/* verso.page — one living reader travels the page: off the phone's back,
   into the story. Ink on paper throughout.
   Palette + type are the product's own tokens (verso-design-tokens/tokens.json). */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/HankenGrotesk-Variable.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic-Variable.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper:    #F3EAD9;
  --ink:      #2A2520;
  --ember:    #C0552C;
  --muted:    #8A7858;
  --hairline: #E3D6BD;

  --ghost: rgba(138, 120, 88, .42);

  --voice:   "Instrument Serif", Georgia, serif;
  --caption: "Newsreader", Georgia, serif;
  --ui:      "Hanken Grotesk", -apple-system, sans-serif;
  --mono:    "Space Mono", ui-monospace, monospace;

  --gutter: clamp(1.5rem, 6vw, 5.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 380;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ================= the traveling twin ================= */

.travel {
  position: fixed;
  left: 0; top: 0;
  z-index: 5;
  pointer-events: none;
  will-change: transform, width;
  /* hidden until the script places it — prevents a giant unstyled flash
     at the top-left on first paint, and hides it entirely without JS */
  visibility: hidden;
}
.travel.placed { visibility: visible; }

/* without JS there is no twin; retire the annotations that point at it */
html.no-js .x3-notes,
html.no-js .device-caption { display: none; }
.travel svg { display: block; width: 100%; height: auto; }

/* the live e-ink, placed in the chassis aperture
   (padded box 394.2×597.6; aperture x35.7+6 y36+6 w310.8 h466.2) */
.panel {
  position: absolute;
  left: 10.58%; top: 7.03%;
  width: 78.84%;
  aspect-ratio: 528 / 792;
  container-type: inline-size;
  background: var(--paper);
  overflow: hidden;
}
/* screen change: a brief blank-paper beat, then the new page — no inversion */
.panel.refresh .screen { opacity: 0; }

.screen {
  position: absolute; inset: 0;
  padding: 8% 8% 6%;
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity .3s steps(3, end);
}
.screen.is-active { opacity: 1; }

/* invisible slots the twin flies between */
.anchor { pointer-events: none; visibility: hidden; }

/* ================= line language ================= */

.ln-ghost rect, .ln-ghost circle, .ln-ghost line {
  stroke: var(--ghost); stroke-width: 1.6;
}
.ln-ink rect, .ln-ink line {
  stroke: var(--ink); stroke-width: 1.9;
}
.ln-ink rect { fill: var(--paper); }
.ln-ink rect + rect { fill: none; }
.ln-ink .key { fill: var(--paper); }
.ln-note line { stroke: var(--ink); stroke-width: 1.1; }
.ln-note .dot { fill: var(--ink); }
.dim, .ln-ghost .dim { stroke-width: 1.1; }
.dim-ink { stroke: var(--ink); stroke-width: 1.1; }

.dim-label {
  font-family: var(--mono); font-size: 15px; letter-spacing: .12em;
  fill: var(--muted);
}
.dim-label-ink { fill: var(--ink); }
.note-label {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em;
  fill: var(--ink);
}

/* the reader's annotations fade as it departs (JS drives --depart 0→1) */
.x3-notes { opacity: calc(1 - var(--depart, 0)); }

/* ================= the plate ================= */

.plate {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 5.5rem var(--gutter) 2.5rem;
}

.masthead {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem var(--gutter) 0;
  z-index: 6;
}
.wordmark { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.wordmark-text { font-family: var(--voice); font-size: 1.7rem; color: var(--ink); }
.mark { width: 1.5rem; height: auto; display: block; }
.buy-pill {
  font-family: var(--ui); font-weight: 500; font-size: .84rem;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: .5rem 1.05rem;
  transition: background .2s, color .2s;
}
.buy-pill:hover { background: var(--ink); color: var(--paper); }

.plate-voice { max-width: 36rem; }
.plate-eyebrow {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.plate-voice h1 {
  font-family: var(--voice);
  font-weight: 400;
  font-size: clamp(2.6rem, 4.6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
}
.plate-voice h1 em { font-style: italic; color: var(--ember); }
.plate-sub {
  font-family: var(--caption); font-style: italic; font-weight: 370;
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 28rem;
  margin-top: 1.4rem;
}

.cta-row { display: flex; align-items: center; gap: 1.6rem; margin-top: 2rem; flex-wrap: wrap; }
.cta-row-center { justify-content: center; }
.cta {
  font-family: var(--ui); font-weight: 560; font-size: .95rem;
  letter-spacing: .01em;
  background: var(--ink); color: var(--paper);
  text-decoration: none;
  padding: .85rem 1.5rem; border-radius: 2px;
}
.cta:hover { background: #3a332c; }
.cta-quiet {
  font-family: var(--ui); font-weight: 470; font-size: .93rem;
  color: var(--ember); text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: .1rem;
}
.cta-quiet:hover { border-bottom-color: var(--ember); }
.cta-micro {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  color: var(--muted); margin-top: 1.2rem;
}

.drawing {
  position: relative;
  width: min(100%, 52vh, 34rem);
  justify-self: center;
  margin: 0;
}
.drawing svg { display: block; width: 100%; height: auto; }

/* the reader's resting place on the phone: padded chassis box in svg coords
   (x 178.6–572.8, y 332–929.6 of 720×1000) */
#heroAnchor {
  position: absolute;
  left: 24.81%; top: 33.2%;
  width: 54.75%; height: 59.76%;
}

.device-caption {
  position: absolute;
  left: 50%; bottom: -2.4rem;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: .6rem; letter-spacing: .18em;
  color: var(--muted);
  transition: opacity .3s;
}

/* ================= the story ================= */

.story {
  padding: clamp(2rem, 5vh, 4rem) var(--gutter);
  max-width: 72rem;
  margin-inline: auto;
}
.eyebrow {
  font-family: var(--ui); font-weight: 560;
  font-size: .7rem; letter-spacing: .18em; color: var(--muted);
  margin-bottom: 1.2rem;
}

/* each row is a stop: text left, dock right; the twin hops dock to dock */
.story-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  min-height: 86svh;
  padding: 2rem 0;
}
.row-text { max-width: 28rem; }
.story-row h2 {
  font-family: var(--voice); font-weight: 400;
  font-size: clamp(1.7rem, 2.9vw, 2.2rem);
  line-height: 1.12;
}
.story-row p {
  color: var(--muted);
  max-width: 26rem;
  margin-top: .6rem;
  font-size: 1rem;
}
.story-row p em { font-family: var(--caption); font-style: italic; color: var(--ink); }
.row-micro {
  display: block;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em;
  color: var(--muted);
  margin-top: .9rem;
}

.row-anchor {
  width: min(100%, 40svh, 21rem);
  aspect-ratio: 394.2 / 597.6;
  justify-self: center;
}

/* ---- screen compositions ---- */

.scr-masthead {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4%;
}
.scr-greeting { font-family: var(--voice); font-size: 8.2cqw; color: var(--ink); }
.scr-batt { font-family: var(--ui); font-size: 3.6cqw; color: var(--muted); }

.scr-continue { display: flex; flex-direction: column; gap: 2.4cqw; padding: 6.5cqw 0; border-bottom: 1px solid var(--hairline); }
.scr-eyebrow { font-family: var(--ui); font-weight: 560; font-size: 3cqw; letter-spacing: .16em; color: var(--muted); }
.scr-title { font-family: var(--voice); font-size: 6.4cqw; line-height: 1.14; color: var(--ink); }
.scr-meta { font-family: var(--ui); font-size: 3.4cqw; color: var(--muted); }

.scr-rows { list-style: none; margin-top: 1cqw; }
.scr-rows li {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ui); font-size: 4.4cqw; font-weight: 430;
  color: var(--ink);
  padding: 4.4cqw 0;
  border-bottom: 1px solid var(--hairline);
}
.scr-rows li:last-child { border-bottom: 0; }
.scr-count { font-size: 3.4cqw; color: var(--muted); }

.st-sleep { justify-content: center; align-items: center; text-align: center; gap: 4cqw; }
.sleep-title { font-family: var(--voice); font-size: 7.6cqw; line-height: 1.15; margin-top: 2cqw; color: var(--ink); }
.sleep-rule { width: 14cqw; height: 1px; background: var(--ink); margin: 2cqw 0; }
.sleep-quote {
  font-family: var(--caption); font-style: italic;
  font-size: 4.4cqw; line-height: 1.55; color: var(--ink);
  max-width: 34ch;
}
.sleep-foot { font-family: var(--ui); font-size: 3cqw; letter-spacing: .14em; color: var(--muted); margin-top: 3cqw; }

.shelf-rows { list-style: none; margin-top: 2cqw; }
.shelf-rows li {
  display: flex; flex-direction: column; gap: 1.6cqw;
  padding: 5.4cqw 0;
  border-bottom: 1px solid var(--hairline);
}
.shelf-rows li:last-child { border-bottom: 0; }
.sh-t { font-family: var(--voice); font-size: 5.6cqw; color: var(--ink); line-height: 1.1; }
.sh-m { font-family: var(--ui); font-size: 2.9cqw; letter-spacing: .1em; color: var(--muted); }

.life-hero { display: flex; flex-direction: column; gap: 1cqw; padding: 7cqw 0 6cqw; border-bottom: 1px solid var(--hairline); }
.life-big { font-family: var(--voice); font-size: 13cqw; color: var(--ink); line-height: 1; }
.life-cap { font-family: var(--ui); font-size: 3.4cqw; color: var(--muted); }
.life-stats { display: flex; gap: 7cqw; padding: 6cqw 0; border-bottom: 1px solid var(--hairline); }
.life-stats div { display: flex; flex-direction: column; gap: 1.4cqw; }
.life-k { font-family: var(--ui); font-weight: 560; font-size: 2.7cqw; letter-spacing: .14em; color: var(--muted); }
.life-v { font-family: var(--ui); font-size: 4.4cqw; color: var(--ink); }
.life-note { font-family: var(--caption); font-style: italic; font-size: 3.8cqw; color: var(--muted); margin-top: 5cqw; }

.st-starter { justify-content: center; gap: 7cqw; }
.starter-book { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 5cqw; align-items: center; }
.starter-book .cover {
  grid-row: 1 / 3;
  width: 15cqw; height: 22.5cqw;
  border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.starter-book .cover i {
  display: block; width: 8cqw; height: 1px; background: var(--ink);
  box-shadow: 0 -2.4cqw 0 var(--ink), 0 2.4cqw 0 var(--ink);
  transform: scaleX(.6);
}
.starter-t { font-family: var(--voice); font-size: 5.2cqw; color: var(--ink); line-height: 1.12; align-self: end; }
.starter-m { font-family: var(--ui); font-size: 2.8cqw; letter-spacing: .1em; color: var(--muted); align-self: start; margin-top: 1.6cqw; }

/* ================= closing + footer ================= */

.get {
  text-align: center;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter);
}
.get-line {
  font-family: var(--voice); font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.12;
}
.get .cta-row { margin-top: 2rem; }
.get .cta-micro { margin-top: 1.2rem; }

.foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--ink);
  margin: 0 var(--gutter);
  padding: 1.4rem 0 2.2rem;
}
.foot-voice { font-family: var(--caption); font-style: italic; color: var(--muted); font-size: .95rem; }
.foot-links { display: flex; gap: 1.6rem; }
.foot-links a, .foot-fine {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  color: var(--muted); text-decoration: none;
}
.foot-links a:hover { color: var(--ink); }

/* ================= small screens ================= */

@media (max-width: 880px) {
  .plate {
    grid-template-columns: 1fr;
    padding-top: 6rem;
    gap: 3.5rem;
  }
  .drawing { width: min(88vw, 24rem); }
  .plate-voice { order: 1; }
  .drawing { order: 0; }

  .story-row {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 1.6rem;
    padding: 3rem 0;
  }
  .row-anchor { width: min(56vw, 34svh); }
}

/* ================= subpages (support, later privacy/install) ================= */

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 clamp(1.4rem, 5vw, 4rem);
}
.page .masthead { position: static; }
.page-body {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) 0 clamp(4rem, 12vh, 8rem);
}
.page-eyebrow {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .3em;
  color: var(--muted); margin-bottom: 1.1rem;
}
.page-title {
  font-family: var(--voice); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.05;
  letter-spacing: -0.01em; margin-bottom: 1.4rem;
}
.page-lede {
  font-family: var(--caption); font-style: italic;
  font-size: 1.22rem; line-height: 1.6; color: var(--ink);
  margin-bottom: 3rem;
}
.page-mail {
  color: var(--ember); text-decoration-thickness: 1px; text-underline-offset: 3px;
  white-space: nowrap;
}
.page-section { margin-bottom: 2.6rem; }
.page-section h2 {
  font-family: var(--voice); font-weight: 400; font-size: 1.5rem;
  margin-bottom: .7rem;
}
.page-section p { margin-bottom: .8rem; max-width: 34rem; }
.page-section ul { padding-left: 1.1rem; }
.page-section li { margin-bottom: .45rem; }
.page-section strong { font-weight: 600; }
