/* ============================================================
   COMPOUND — 365 days in one scroll
   Ink / Bone / Brass · Fraunces + Instrument Sans + Plex Mono
   z: field 0 · content 1 · hud 90 · nav 100 · boot 999 · cursor 1000
   ============================================================ */

:root {
  --ink: #100e0b;          /* matches the GL clear color exactly */
  --ink-2: #1a1712;
  --ink-line: #2e2719;
  --paper: #f3efe6;
  --bone: #faf7f0;
  --paper-line: #d8d0bc;

  --brass: #c2914c;
  --brass-2: #dcab60;
  --gold: #ffd9a0;

  --t-on-ink: #ece6d8;
  --t-on-ink-mute: #a89d87;
  --t-on-paper: #2e2920;
  --t-on-paper-mute: #6f6755;

  --wa-bg: #efe9dc;
  --wa-in: #ffffff;
  --wa-out: #ddf2c9;
  --wa-tick: #4fae9b;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;

  --fs-h1: clamp(2.2rem, 8.4vw, 7.4rem);
  --fs-h2: clamp(2.05rem, 5.6vw, 4.3rem);
  --fs-lede: clamp(1.08rem, 1.3vw + 0.8rem, 1.3rem);
  --fs-body: clamp(1rem, 0.4vw + 0.9rem, 1.1rem);
  --fs-small: 0.92rem;
  --fs-label: 0.78rem;

  --pad-x: clamp(1.4rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* overflow-x: clip (not hidden) — hidden creates a scroll container on
   body and breaks position:sticky pins on iOS Safari */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--t-on-ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-booting { overflow: hidden; }

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.5 0 0 0 0 0.47 0 0 0 0 0.42 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
em { font-style: italic; }
sup { line-height: 0; }

::selection { background: var(--brass); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(194, 145, 76, 0.45); border-radius: 99px; }

.mono { font-family: var(--mono); }

/* ---------- the field ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

main { position: relative; z-index: 1; }

/* ---------- boot ---------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__mark {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 520;
}
.boot__mark sup { font-family: var(--mono); font-size: 0.55em; color: var(--brass-2); }
.boot__line {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  color: var(--brass-2);
  font-variant-numeric: tabular-nums;
}
.boot__line sup { font-size: 0.55em; }
.boot__sub {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--t-on-ink-mute);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem var(--pad-x);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease), padding 0.5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(16, 14, 11, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 rgba(194, 145, 76, 0.2);
  padding-block: 0.65rem;
}
.nav__mark {
  font-family: var(--serif);
  font-weight: 520;
  font-size: 1.32rem;
}
.nav__mark sup { font-family: var(--mono); font-size: 0.58em; color: var(--brass-2); margin-left: 0.08em; }
.nav__skip {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--t-on-ink-mute);
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  padding: 0.55em 1.1em;
  white-space: nowrap;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav__skip:hover { color: var(--ink); background: var(--brass); border-color: var(--brass); }

/* ---------- hud ---------- */

.hud { pointer-events: none; }
.hud__day, .hud__chapter, .hud__rail { transition: opacity 0.4s var(--ease); }
/* yield while the demo phone has the stage; vanish over tape/colophon */
body.hud--yield .hud__day, body.hud--yield .hud__chapter,
body.hud--end .hud__day, body.hud--end .hud__chapter, body.hud--end .hud__rail {
  opacity: 0;
}
.hud__day {
  position: fixed;
  left: clamp(1.1rem, 3.5vw, 2.6rem);
  bottom: clamp(0.9rem, 3vw, 2rem);
  z-index: 90;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.hud__dayLabel { font-size: 0.66rem; letter-spacing: 0.3em; color: var(--t-on-ink-mute); }
.hud__dayNum {
  font-size: clamp(2rem, 5.6vw, 4rem);
  color: var(--brass-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  will-change: transform;
  transition: color 0.4s var(--ease);
}
.hud__dayNum.is-one { color: var(--gold); }
.hud__dayOf { font-size: 0.72rem; color: var(--t-on-ink-mute); letter-spacing: 0.12em; }

.hud__chapter {
  position: fixed;
  right: clamp(1.1rem, 3.5vw, 2.6rem);
  bottom: clamp(1rem, 3vw, 2.1rem);
  z-index: 90;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--t-on-ink-mute);
}

.hud__rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 36vh;
  background: rgba(194, 145, 76, 0.16);
  z-index: 90;
  overflow: hidden;
}
.hud__rail span {
  position: absolute;
  inset: 0;
  background: var(--brass);
  transform-origin: top;
  transform: scaleY(0);
}

@media (max-width: 600px) {
  .hud__chapter { display: none; }
  .hud__dayNum { font-size: 1.7rem; }
  .hud__dayLabel { font-size: 0.56rem; }
}

/* phones: no pinning — sticky stages feel sluggish on touch and clip
   copy on short screens. Chapters flow naturally; the field, day counter
   and chapter behaviors still ride the scroll. Hero + finale keep their
   full-screen presence. */
@media (max-width: 760px) {
  /* backdrop blur is a compositor tax on phones — solid ink instead */
  .nav.is-scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(16, 14, 11, 0.93);
  }
  /* the ticker tape reads as a broken control on touch — desktop only */
  .tape { display: none; }
  /* heavier scrim: on phones every text block sits in the field's path.
     Horizontal inset MUST stay inside the container padding (~1.4rem) —
     wider scrims poke past the viewport and let the page pan sideways */
  .ch .ch__inner::before {
    inset: -2.5rem -1.2rem;
    background: radial-gradient(ellipse closest-side, rgba(16, 14, 11, 0.94) 65%, rgba(16, 14, 11, 0) 100%);
  }
  .demo__result::before { inset: -2rem -1.2rem; }
  /* belt + braces: phones have no sticky pins, so hidden is safe here,
     and it covers browsers that don't support overflow: clip */
  body { overflow-x: hidden; }
  /* an 8000px smooth anchor cruise feels possessed on touch — jump */
  html { scroll-behavior: auto; }
  /* duplicate of the coarse-pointer scroll-trap fix: narrow viewports
     are overwhelmingly touch, and this one must never miss.
     (.phone prefix: this block sits before the base rule in the file) */
  .phone .phone__scroll {
    overscroll-behavior-y: auto;
    height: min(48vh, 420px);
    min-height: 320px;
  }
}

/* touch devices regardless of width */
@media (pointer: coarse) {
  /* no double-tap-zoom delay on taps; pan + pinch stay native */
  body { touch-action: manipulation; }
  /* THE scroll trap: the chat fills most of a phone screen, and
     `contain` refused to hand an at-boundary swipe back to the page —
     thumbs died mid-page. Chain to the page, and shrink the capture
     zone while we're at it. */
  .phone .phone__scroll {
    overscroll-behavior-y: auto;
    height: min(48vh, 420px);
    min-height: 320px;
  }
  /* tap targets */
  .viz .viz__chip { padding: 0.6em 1em; }
  .colophon__nav a { padding: 0.4em 0; }
  .ch.ch--zero, .ch.ch--leak, .ch.ch--attract, .ch.ch--book, .ch.ch--compound, .ch.ch--begin {
    min-height: auto;
  }
  .ch .ch__pin {
    position: static;
    min-height: auto;
    padding: clamp(3.5rem, 9vh, 5rem) var(--pad-x) 6.5rem;
  }
  .ch--zero .ch__pin, .ch--begin .ch__pin {
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: 6.5rem;
  }
}

/* ---------- cursor ---------- */

#cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(220, 171, 96, 0.85);
  border-radius: 50%;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease),
              background 0.3s var(--ease), opacity 0.3s var(--ease);
  will-change: transform;
}
#cursor::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass-2);
  transition: opacity 0.25s;
}
#cursor.grow {
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  background: rgba(16, 14, 11, 0.55);
}
#cursor.grow::before { opacity: 0; }
#cursorTag {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s;
}
#cursor.grow #cursorTag { opacity: 1; }
#cursor.is-out { opacity: 0; }
body.has-cursor #cursor { display: flex; }
body.has-cursor a, body.has-cursor button { cursor: none; }
body.has-cursor { cursor: none; }

/* ---------- chapters ---------- */

.ch { position: relative; }
.ch--zero    { min-height: 175vh; }
.ch--leak    { min-height: 205vh; }
.ch--attract { min-height: 190vh; }
.ch--book    { min-height: 190vh; }
.ch--compound{ min-height: 220vh; }
.ch--begin   { min-height: 175vh; }

.ch__pin {
  position: sticky;
  top: 0;
  min-height: 100vh; /* fallback for browsers without svh */
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(4.5rem, 10vh, 7rem) var(--pad-x);
}
.ch__flow {
  padding: clamp(7rem, 16vh, 11rem) var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vh, 5rem);
}

.ch__inner {
  position: relative;
  max-width: 580px;
  width: 100%;
  margin-right: auto;
}
.ch__inner--wide { max-width: 860px; }
.ch__inner--center {
  margin-inline: auto;
  text-align: center;
  max-width: 760px;
}
/* text scrim so copy stays readable over the field */
.ch__inner::before {
  content: "";
  position: absolute;
  inset: -3.5rem -4rem;
  background: radial-gradient(ellipse closest-side, rgba(16, 14, 11, 0.88) 40%, rgba(16, 14, 11, 0) 100%);
  z-index: -1;
  pointer-events: none;
}

@media (min-width: 1100px) {
  .ch__pin .ch__inner:not(.ch__inner--center) { margin-left: clamp(0rem, 4vw, 4rem); }
}

/* the hero galaxy deserves to be seen — lighter scrim on day zero */
.ch--zero .ch__inner--center::before {
  background: radial-gradient(ellipse closest-side, rgba(16, 14, 11, 0.62) 28%, rgba(16, 14, 11, 0) 100%);
}

.eyebrow, .kicker {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: clamp(1.4rem, 3vh, 2.2rem);
}

.ch__copy {
  display: grid;
  gap: 1.1em;
  color: var(--t-on-ink-mute);
  max-width: 54ch;
  margin-top: clamp(1.8rem, 4vh, 2.8rem);
}
.ch__inner--center .ch__copy { margin-inline: auto; }
.ch__copy em, .ch__aside em { color: var(--brass-2); }
.ch__aside { font-size: var(--fs-small); color: var(--t-on-ink-mute); max-width: 54ch; }
p.ch__aside.reveal { margin-top: 1.4rem; }

.lede {
  font-size: var(--fs-lede);
  line-height: 1.62;
  color: var(--t-on-ink-mute);
  max-width: 58ch;
  margin-top: clamp(1.6rem, 3.5vh, 2.4rem);
}
.ch__inner--center .lede { margin-inline: auto; }

/* ---------- kinetic titles ---------- */

.kin {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: var(--fs-h2);
  line-height: 1.05;
  letter-spacing: -0.018em;
}
.kin--hero { font-size: var(--fs-h1); line-height: 1.02; }
.kin--final { font-size: clamp(1.9rem, 5.2vw, 3.9rem); }
.kin__line { display: block; }
.kin__line--accent .kw i { color: var(--brass-2); font-style: italic; font-weight: 460; }
.kw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* insets cover italic overhang + descenders; negative margins
     give the space back so words still sit flush */
  padding: 0 0.2em 0.14em;
  margin: 0 -0.2em -0.14em;
}
.kw i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(118%);
  transition: transform 0.95s var(--ease);
  transition-delay: calc(var(--i, 0) * 65ms);
}
.kin.is-in .kw i { transform: translateY(0); }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- hero equation ---------- */

.heroEq {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(1.7rem, 5.2vw, 2.9rem);
  font-variant-numeric: tabular-nums;
  color: var(--t-on-ink);
  margin-top: clamp(1.6rem, 3.5vh, 2.4rem);
  cursor: pointer;
  user-select: none;
  transition: transform 0.4s var(--ease);
}
.heroEq:hover { transform: scale(1.03); }
.heroEq sup { font-family: var(--mono); font-size: 0.46em; color: var(--brass-2); letter-spacing: 0.02em; }
.heroEq__eq { color: var(--t-on-ink-mute); margin-inline: 0.18em; }
.heroEq__res { color: var(--brass-2); font-weight: 480; }
.heroEq__x { font-size: 0.6em; color: var(--brass-2); }

@media (max-width: 480px) {
  .eyebrow__tail { display: none; }
}

/* ---------- scrollcue ---------- */

.scrollcue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-top: clamp(2.2rem, 5vh, 3.6rem);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--t-on-ink-mute);
}
.scrollcue__bar {
  width: 1px;
  height: 52px;
  background: var(--ink-line);
  position: relative;
  overflow: hidden;
}
.scrollcue__bar::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 1px;
  height: 40%;
  background: var(--brass);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip { to { top: 140%; } }

/* ---------- live equation ---------- */

.liveEq {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(2rem, 7vw, 4.2rem);
  margin-top: clamp(2rem, 5vh, 3.2rem);
  font-variant-numeric: tabular-nums;
  color: var(--t-on-ink);
}
.liveEq sup { font-family: var(--mono); font-size: 0.46em; color: var(--brass-2); letter-spacing: 0.02em; }
.liveEq__eq { color: var(--t-on-ink-mute); margin-inline: 0.2em; }
.liveEq__res { color: var(--brass-2); font-weight: 480; }
.liveEq__x { font-size: 0.6em; color: var(--brass-2); }
.liveEq__note {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t-on-ink-mute);
  margin-top: 0.8rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
              color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn__arrow { display: inline-block; transition: transform 0.35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:active { transform: scale(0.97); }
.btn--brass { background: var(--brass); color: var(--ink); }
.btn--brass:hover { background: var(--brass-2); box-shadow: 0 0 44px -8px rgba(220, 171, 96, 0.55); }
.btn--ghost { border-color: var(--ink-line); background: rgba(16, 14, 11, 0.4); color: var(--t-on-ink); }
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-2); }
.btn--big { font-size: 1.08rem; padding: 1em 1.9em; }
.wa { width: 1.25em; height: 1.25em; flex: none; }

.begin__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(2rem, 4.5vh, 3rem);
}
.begin__where {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--t-on-ink-mute);
  margin-top: 2.2rem;
}

/* ---------- demo / phone ---------- */

.demo__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2.4rem, 5vw, 3.6rem);
  position: relative;
  z-index: 1;
}

.phone {
  width: min(400px, 100%);
  border-radius: 26px;
  overflow: hidden;
  background: var(--wa-bg);
  border: 1px solid var(--ink-line);
  box-shadow: 0 40px 90px -36px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(26, 23, 18, 0.75);
  display: flex;
  flex-direction: column;
}

.phone__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--ink-2);
  color: var(--t-on-ink);
  padding: 0.85rem 1rem;
}
.phone__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brass);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  flex: none;
}
.phone__id { flex: 1; min-width: 0; }
.phone__name { font-weight: 600; font-size: 0.98rem; line-height: 1.2; }
.phone__status { font-size: 0.74rem; color: var(--t-on-ink-mute); line-height: 1.3; }
.phone__status.is-typing { color: var(--brass-2); }
.phone__timer { font-size: 0.86rem; color: var(--brass-2); letter-spacing: 0.05em; }

.phone__scroll {
  height: min(58vh, 520px);
  min-height: 380px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.phone__scroll::-webkit-scrollbar { width: 5px; }
.phone__scroll::-webkit-scrollbar-thumb { background: rgba(46, 41, 32, 0.25); }

.phone__chat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 0.85rem 1.2rem;
  min-height: 100%;
}

.msg {
  max-width: 82%;
  padding: 0.6em 0.85em 0.45em;
  border-radius: 13px;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--t-on-paper);
  box-shadow: 0 1px 1px rgba(22, 19, 16, 0.08);
  animation: msgin 0.45s var(--ease);
}
@keyframes msgin {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
}
.msg--in { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 4px; }
.msg--out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 4px; }
.msg--wide { max-width: 92%; width: 92%; }

.msg__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3em;
  font-size: 0.66rem;
  color: rgba(46, 41, 32, 0.7); /* 4.5:1+ on white and --wa-out */
  margin-top: 0.15em;
  user-select: none;
}
.msg__ticks { color: var(--wa-tick); letter-spacing: -0.18em; }

.msg--note {
  align-self: center;
  max-width: 88%;
  background: rgba(222, 213, 192, 0.85);
  color: #5d5443;
  font-size: 0.74rem;
  font-family: var(--mono);
  line-height: 1.5;
  text-align: center;
  border-radius: 8px;
  box-shadow: none;
  padding: 0.55em 0.9em;
}

.msg--typing { display: inline-flex; gap: 4px; align-items: center; padding: 0.8em 0.95em; }
.msg--typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a79c86;
  animation: blink 1.2s infinite;
}
.msg--typing i:nth-child(2) { animation-delay: 0.18s; }
.msg--typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.3; } 35% { opacity: 1; transform: translateY(-1px); } }

/* visualizer card */
.viz { display: block; }
.viz__title { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 0.5rem; }
.viz__room { width: 100%; border-radius: 8px; display: block; }
.viz__wall { transition: fill 0.7s var(--ease); }
.viz__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.viz__chip {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.42em 0.85em;
  border-radius: 999px;
  border: 1px solid var(--paper-line);
  background: var(--bone);
  color: var(--t-on-paper);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.viz__chip.is-on { background: #2e2920; color: var(--bone); border-color: #2e2920; }
.viz__caption {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: rgba(46, 41, 32, 0.7);
  margin-top: 0.55rem;
}

/* booking card */
.booking {
  display: block;
  border-left: 3px solid var(--brass);
  background: var(--bone);
  border-radius: 8px;
  padding: 0.8em 1em;
  margin-top: 0.2em;
  box-shadow: 0 1px 3px rgba(22, 19, 16, 0.1);
}
.booking__when {
  display: block;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 560;
  margin-bottom: 0.25rem;
}
.booking__what { display: block; font-size: 0.8rem; color: var(--t-on-paper-mute); margin-bottom: 0.6rem; }
.booking__checks { display: grid; gap: 0.25rem; font-size: 0.78rem; }
.booking__checks span::before { content: "✓ "; color: var(--wa-tick); font-weight: 700; }

/* chips dock */
.phone__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: linear-gradient(rgba(239, 233, 220, 0), var(--wa-bg) 30%);
  border-top: 1px solid rgba(46, 41, 32, 0.08);
  min-height: 3.2rem;
  align-items: center;
}
.chip {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 550;
  padding: 0.55em 1.05em;
  border-radius: 999px;
  border: 1px solid #b6ab92;
  background: var(--bone);
  color: var(--t-on-paper);
  cursor: pointer;
  animation: chipin 0.4s var(--ease) backwards;
  transition: all 0.25s var(--ease);
}
.chip:nth-child(2) { animation-delay: 0.07s; }
.chip:nth-child(3) { animation-delay: 0.14s; }
@keyframes chipin { from { opacity: 0; transform: translateY(8px); } }
.chip:hover { border-color: #2e2920; }
.chip:active { transform: scale(0.96); }

.phone__chips .chips__hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(46, 41, 32, 0.7);
}

.phone__inputbar {
  padding: 0.6rem 0.95rem 0.75rem;
  background: var(--wa-bg);
  border-top: 1px solid rgba(46, 41, 32, 0.07);
}
.phone__inputhint {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: rgba(46, 41, 32, 0.7);
  background: var(--bone);
  border: 1px solid rgba(46, 41, 32, 0.1);
  border-radius: 999px;
  padding: 0.55em 1em;
}

/* result */
.demo__result {
  text-align: center;
  max-width: 560px;
  animation: msgin 0.7s var(--ease);
  position: relative;
}
.demo__result::before {
  content: "";
  position: absolute;
  inset: -2.5rem -3rem;
  background: radial-gradient(ellipse closest-side, rgba(16, 14, 11, 0.85) 45%, rgba(16, 14, 11, 0) 100%);
  z-index: -1;
}
.demo__bigtime {
  font-size: clamp(3.4rem, 10vw, 5.6rem);
  color: var(--brass-2);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.demo__verdict {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 440;
  margin-bottom: 1.1rem;
}
.demo__copy { color: var(--t-on-ink-mute); margin-bottom: 2rem; }
.demo__ctaRow { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ---------- ledger (ink) ---------- */

.ledger { border-top: 1px solid var(--ink-line); margin-top: clamp(1.6rem, 3.5vh, 2.4rem); }
.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 0.5rem 2rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--ink-line);
}
.ledger__name { font-family: var(--serif); font-weight: 480; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.ledger__desc { color: var(--t-on-ink-mute); font-size: var(--fs-small); }
.ledger__status {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #82c08f;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #82c08f;
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(130, 192, 143, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(130, 192, 143, 0); }
}

@media (max-width: 720px) {
  .ledger__row { grid-template-columns: 1fr auto; }
  .ledger__name { grid-row: 1; }
  .ledger__status { grid-row: 1; grid-column: 2; justify-self: end; }
  .ledger__desc { grid-column: 1 / -1; margin-top: -0.3rem; }
}

/* ---------- clauses (ink) ---------- */

.clauses { border-top: 1px solid var(--ink-line); margin-top: clamp(2rem, 4.5vh, 3rem); }
.clause {
  display: grid;
  grid-template-columns: clamp(3rem, 8vw, 5rem) 1fr;
  gap: 1rem 1.5rem;
  padding: clamp(1.6rem, 3.6vw, 2.4rem) 0;
  border-bottom: 1px solid var(--ink-line);
}
.clause__no {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  color: var(--brass-2);
  line-height: 1;
}
.clause__title {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin-bottom: 0.55rem;
}
.clause__text { color: var(--t-on-ink-mute); max-width: 56ch; }

.who {
  margin-top: clamp(2rem, 5vh, 3rem);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
  line-height: 1.85;
  color: var(--t-on-ink-mute);
  max-width: 56ch;
}

/* ---------- tape + colophon ---------- */

.tape {
  position: relative;
  z-index: 1;
  background: var(--brass);
  color: var(--ink);
  overflow: hidden;
  padding-block: 0.6rem;
  border-block: 1px solid rgba(16, 14, 11, 0.25);
}
.tape__track { display: flex; width: max-content; animation: tapeflow 36s linear infinite; }
.tape__run { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; white-space: nowrap; }
@keyframes tapeflow { to { transform: translateX(-50%); } }

.colophon {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-top: 1px solid rgba(194, 145, 76, 0.2);
  padding: clamp(2.8rem, 6vw, 4.2rem) var(--pad-x);
  font-size: var(--fs-small);
  color: var(--t-on-ink-mute);
}
.colophon__grid {
  max-width: 1180px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: start;
}
.colophon__mark { font-family: var(--serif); font-size: 1.5rem; font-weight: 520; color: var(--t-on-ink); }
.colophon__mark sup { font-family: var(--mono); font-size: 0.55em; color: var(--brass-2); }
.colophon__text { max-width: 58ch; display: grid; gap: 0.9rem; }
.colophon__fine { font-size: 0.74rem; letter-spacing: 0.02em; opacity: 0.75; }
.colophon__fine sup { font-size: 0.7em; }
.colophon__nav { display: grid; gap: 0.45rem; text-align: right; }
.colophon__nav a {
  font-size: 0.88rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease), color 0.3s var(--ease);
}
.colophon__nav a:hover { color: var(--t-on-ink); background-size: 100% 1px; }

@media (max-width: 760px) {
  .colophon__grid { grid-template-columns: 1fr; }
  .colophon__nav { text-align: left; display: flex; gap: 1.4rem; flex-wrap: wrap; }
}

/* ---------- noscript ---------- */

.noscript-note {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4.2rem var(--pad-x) 0.6rem;
  font-size: 0.78rem;
  color: var(--brass-2);
}

/* the finale's scrim: a full-bleed horizon band, not a floating egg —
   an ellipse edge reads as an object against the bright corona */
.ch--begin .ch__inner--center::before {
  inset: -1.5rem -60vw;
  background: linear-gradient(
    180deg,
    rgba(16, 14, 11, 0) 0%,
    rgba(16, 14, 11, 0.9) 16%,
    rgba(16, 14, 11, 0.9) 84%,
    rgba(16, 14, 11, 0) 100%
  );
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phone__scroll { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .kw i { transform: none; transition: none; }
  .tape__track { animation: none; }
  .scrollcue__bar::after { animation: none; }
  .dot { animation: none; }
  .msg, .chip, .demo__result { animation: none; }
  .msg--typing i { animation: none; opacity: 0.6; }
  #boot { display: none; }
  .hud__dayNum { transition: none; }
}
