/* interperson.ai — the Desk on paper: warm paper, iron-gall ink, one oxblood accent, hairline rules, serif.
   The sky plate is the observatory room: always dark, bone stars, oxblood kept for the user's own sun.
   System serifs only (New York via ui-serif on Apple devices): the CSP allows no third-party fonts. */
:root {
  --paper: #F6F2EA;
  --paper-deep: #EFE9DD;
  --ink: #1B1A2E;          /* indigo-black ink */
  --ink-soft: #4A463F;     /* 8.4:1 on paper */
  --oxblood: #8E2B1F;      /* 7.6:1 on paper */
  --rule: rgba(27, 26, 46, 0.32);
  --night: #0D1324;
  --bone: #E9E2D0;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 34rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  /* The logbook's diagonal grain, faint enough to feel rather than see. */
  background-image: repeating-linear-gradient(135deg, rgba(27, 26, 46, 0.018) 0 1px, transparent 1px 7px);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.page {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 16vh 16px 3rem;
}

.kicker, .smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}
.kicker { margin: 0 0 1rem; font-size: 1.05rem; }

h1, h2, h3 { font-weight: 400; overflow-wrap: anywhere; text-wrap: balance; }
h1 {
  margin: 0 0 1.25rem;
  font-size: 1.95rem;
  line-height: 1.18;
  letter-spacing: -0.005em;
}
h1 em, h2 em { font-style: italic; }

p { margin: 0 0 1rem; overflow-wrap: anywhere; }
.lede { font-size: 1.18rem; }
.lede:empty { display: none; }
.quiet { color: var(--ink-soft); font-size: 1rem; font-style: italic; }
.beta { font-style: italic; color: var(--ink-soft); }

.rule {
  border: 0;
  border-top: 0.5px solid var(--rule);
  margin: 2rem 0;
}

.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.cta p { margin: 0; }

a { color: inherit; text-decoration-thickness: 0.5px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 1px; }
.cta .quiet a, .folio a { display: inline-flex; align-items: center; min-height: 44px; }

/* One primary action: the only filled oxblood on the page. */
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 0.65rem 1.6rem;
  border: 0;
  border-radius: 2px;
  background: var(--oxblood);
  color: var(--paper);
  font: inherit;
  font-size: 1.15rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
}
.action:hover { background: #7A2419; }

/* The heads-up answers carry equal weight: hairline, never a nudge toward one. */
.choices { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }
.choice {
  min-height: 48px;
  padding: 0.6rem 1.3rem;
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.choice:hover { background: var(--paper-deep); }
.choice[aria-pressed="true"] { border-color: var(--oxblood); color: var(--oxblood); }
button:disabled { opacity: 0.55; cursor: progress; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--paper);
  border: 0.5px solid var(--ink);
  z-index: 2;
}
.skip:focus { top: 0.75rem; }

.folio {
  /* Rules span the text column, not the gutter. */
  width: calc(100% - 32px);
  max-width: calc(var(--measure) - 32px);
  margin: 0 auto;
  padding: 0.75rem 0 1.75rem;
  border-top: 0.5px solid var(--rule);
  font-size: 0.95rem;
  text-align: center;
}
.folio a { text-decoration: none; }
.folio-sep { margin: 0 0.6em; color: var(--ink-soft); }

/* ---- Home -------------------------------------------------------------------------------------------- */

body[data-page="home"] { --measure: 70rem; }

.masthead {
  width: calc(100% - 32px);
  max-width: calc(var(--measure) - 32px);
  margin: 0 auto;
  padding: 1.1rem 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  border-bottom: 0.5px solid var(--rule);
}
.wordmark { color: var(--ink); font-size: 1.2rem; letter-spacing: 0.14em; }
.masthead-note { font-size: 0.98rem; }

.home {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 8vh, 6rem) 0 clamp(3rem, 8vh, 5.5rem);
}
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}
.hero h1 em { display: block; color: var(--ink); }
.hero .lede { max-width: 31rem; margin-bottom: 2rem; color: var(--ink); }

.plate { margin: 0; padding: 6px; }
.sky-wrap {
  position: relative;
  border-radius: 2px;
  outline: 0.5px solid var(--rule);
  outline-offset: 6px;
}
.sky { display: block; width: 100%; height: auto; border-radius: 2px; }
/* The live sky (assets/sky.js) draws the drifting stars over the SVG's rings and sun; the SVG's own stars are
   the still picture for no-JS. touch-action keeps vertical page scrolling on phones. */
.sky-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: crosshair;
  display: none;
}
.plate.live .sky-live { display: block; }
.plate.live .sky .dust,
.plate.live .sky .figure,
.plate.live .sky .star,
.plate.live .sky .leader,
.plate.live .sky .label:not(.label-you) { display: none; }
.plate figcaption { margin-top: 1rem; font-size: 0.98rem; color: var(--ink-soft); text-align: center; }
.plate figcaption .smallcaps { margin-right: 0.25em; }

.sky-ground { fill: var(--night); }
.orbit { fill: none; stroke: var(--bone); stroke-opacity: 0.12; stroke-width: 0.6; }
.orbit-outer { stroke-opacity: 0.32; }
.tick { stroke: var(--bone); stroke-opacity: 0.3; stroke-width: 0.6; fill: none; }
.dust circle { fill: var(--bone); fill-opacity: 0.42; }
.figure { fill: none; stroke: var(--bone); stroke-opacity: 0.34; stroke-width: 0.6; }
.star { fill: var(--bone); }
.halo { fill: #B03A2A; fill-opacity: 0.16; }
.sun { fill: #B03A2A; }
.leader { fill: none; stroke: var(--bone); stroke-opacity: 0.55; stroke-width: 0.6; }
.label {
  fill: var(--bone);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.02em;
}
.label-you { font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.14em; fill-opacity: 0.8; }

@media (prefers-reduced-motion: no-preference) {
  .tw { animation: twinkle 5.5s ease-in-out infinite; }
  .tw2 { animation-delay: -1.8s; animation-duration: 6.5s; }
  .tw3 { animation-delay: -3.6s; animation-duration: 7.5s; }
  @keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
  .action, .choice { transition: background-color 140ms ease, opacity 140ms ease; }
}

.section-head { margin-bottom: 2rem; }
.section-head .kicker { margin-bottom: 0.4rem; }
h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { margin: 0 0 0.6rem; font-size: 1.3rem; line-height: 1.25; }

.entries, .rooms, .closing {
  border-top: 0.5px solid var(--rule);
  padding: clamp(3rem, 7vh, 4.5rem) 0;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.75rem clamp(2rem, 5vw, 4.5rem);
}
.entry { border-top: 0.5px solid var(--rule); padding-top: 1.1rem; }
.entry p { margin: 0; max-width: 32rem; }
.numeral {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.room-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); }
.room h3 { font-size: 1.15rem; color: var(--ink); letter-spacing: 0.12em; }
.room p { margin: 0; max-width: 32rem; }

.closing { text-align: center; padding-bottom: clamp(3.5rem, 9vh, 6rem); }
.closing h2 { margin-bottom: 1rem; }
.closing h2::before {
  content: "✦";
  display: block;
  margin-bottom: 0.9rem;
  font-size: 1rem;
  color: var(--ink-soft);
}
.closing p { max-width: 33rem; margin: 0 auto; }

body[data-page="home"] .folio { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 3.5rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .plate { max-width: 30rem; width: 100%; margin: 0 auto; }
  .entry-list, .room-pair { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
  .page { padding-top: 10vh; }
  h1 { font-size: 1.65rem; }
  .action { width: 100%; }
  .hero h1 { font-size: 2.3rem; }
  .masthead-note, .hero .kicker { font-size: 0.86rem; letter-spacing: 0.06em; }
  body[data-page="home"] .folio { flex-direction: column; gap: 0; }
  body[data-page="home"] .folio-sep { display: none; }
}
