/* ==========================================================================
   story.css — the home page in chapters (home only)

   Mobile first. On a phone the device is pinned under the top bar and the
   lines scroll up beneath it; from 901px the lines take the left column and
   the device holds the right, centred in the viewport.

   Type: Nohemi ≥16px, Montserrat ≤14px on the site; inside the Steady
   phone, Steady's own pair (Inter Tight >20px, Inter ≤20px).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-VF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/InterTight-VF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- a chapter ---------------------------------------------------- */

.ch {
  position: relative;
}
/* every chapter is a rounded card on the ground, with the ground between */
.ch, .contact-end {
  margin: var(--card-gap) var(--card-gap) 0;
  border-radius: var(--card-radius);
}
.ch.surface, .contact-end.surface { background: var(--paper); }
/* a chapter that is its own .shell: the card spans, its content keeps the measure */
.ch.shell {
  width: auto;
  max-width: none;
  padding-inline: max(var(--gutter), (100% - var(--page-max)) / 2 + var(--gutter));
}
/* the light card after the hero: the pixel seam is its top edge */
section:has(> [data-pixel-seam]) + section,
section:has(> [data-pixel-seam]) + script + section { margin-top: 0; border-start-start-radius: 0; border-start-end-radius: 0; }

.ch__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.ch__stage {
  order: -1;
  position: sticky;
  top: calc(var(--bar-y) + var(--stick-gap));
  z-index: 2;
  display: grid;
  place-items: center;
  height: min(60svh, 540px);   /* room for the whole ledger card on a phone */
  padding-block: 14px;
  background: var(--paper);
  /* the lines pass under the device; a short fade keeps the edge soft */
  box-shadow: 0 18px 18px -6px var(--paper);
}

.ch__story { padding-bottom: 18svh; }

.ch__num {
  margin-top: clamp(28px, 5vw, 56px);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 560;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.ch__steps { list-style: none; margin: 0; padding: 0; }

.ch__step {
  min-height: 46svh;
  padding-top: clamp(20px, 5svh, 48px);
  transition: opacity var(--phrase) var(--tempo);
}

.ch__kick {
  margin-bottom: 0.9rem;
  font-family: var(--font-small);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.ch__line {
  max-width: 15ch;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6.2vw, 4rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}
.ch__line em { font-style: normal; color: var(--accent); }
/* the second half of a beat: on its own line, a size down, in the soft ink */
.ch__sub {
  display: block;
  max-width: 24ch;
  margin-top: 0.45em;
  font-size: 0.5em;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}
.ch__line--xl { font-size: clamp(2.6rem, 9vw, 7rem); max-width: none; }

.ch__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 1.4rem;
  font-size: 1rem;
  font-weight: 560;
  color: var(--accent);
  text-decoration: none;
}
.ch__go .icon { width: 18px; height: 18px; transition: transform var(--beat) var(--tempo); }
.ch__go:hover .icon { transform: translateX(3px); }

.ch__cap {
  margin-top: 0.6rem;
  font-family: var(--font-small);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* armed only: one line lit, the rest dimmed — never hidden */
.ch.is-armed .ch__step { opacity: 0.16; }
.ch.is-armed .ch__step.is-active { opacity: 1; }

/* ---------- 01 · the ledger card ---------------------------------------- */

.ledcard {
  /* no card of its own: rows and words on the chapter's ground */
  width: min(100%, 38rem);
  max-height: 100%;
  overflow: hidden;
  padding: 0;
}
.ledcard__rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ledger-line); }
.ledcard { --ledger-line: var(--ink); }   /* the lines: the text's own dark */
.ledcard__row {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr) auto;
  column-gap: clamp(16px, 2.4vw, 32px);
  align-items: center;
  width: 100%;
  padding: 11px 0;   /* 15px from 901px, where the stage is a full screen tall */
  border: 0;
  border-bottom: 1px solid var(--ledger-line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: opacity var(--phrase) var(--tempo);
}
button.ledcard__row { cursor: pointer; }
.ledcard__yr {
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.ledcard__what { position: relative; display: grid; gap: 2px; min-width: 0; }
.ledcard__what b {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ledcard__what i {
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--ink-soft);
}
/* NDA / Public / Archive: badges, neutral until the story names them */
.ledcard__tag {
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 9%, transparent);
  font-family: var(--font-small);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--ink);
  transition: background-color var(--phrase) var(--tempo), color var(--phrase) var(--tempo);
}

/* the redaction: a bar drawn across the words, left to right */
.ledcard__what::after {
  content: "";
  position: absolute;
  inset: 2px 0;
  border-radius: 3px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--breath) var(--tempo);
}
.ch:is([data-at="3"], [data-at="4"]) .is-nda .ledcard__what::after { transform: scaleX(1); }
.ch:is([data-at="3"], [data-at="4"]) .is-nda .ledcard__tag { background: color-mix(in oklab, var(--alert) 9%, transparent); color: var(--alert); }
/* stepped back by colour, not opacity: opacity takes small type under 4.5:1 */
.ch:is([data-at="3"], [data-at="4"]) .is-archive .ledcard__what b,
.ch:is([data-at="3"], [data-at="4"]) .is-archive .ledcard__what i,
.ch:is([data-at="3"], [data-at="4"]) .is-archive .ledcard__yr,
.ch:is([data-at="3"], [data-at="4"]) .is-archive .ledcard__tag { color: var(--ink-faint); }

.ch[data-at="4"] .is-public .ledcard__what b { color: var(--accent); }
.ch[data-at="4"] .is-public .ledcard__tag { background: var(--accent-soft); color: var(--on-accent-soft); }

.ledcard__reply {
  min-height: 1.6em;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--accent);
}
.ledcard__reply.is-on { animation: reply-in var(--phrase) var(--tempo) both; }
@keyframes reply-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ledcard__more { margin-top: 12px; }   /* a secondary button: .btn--outlined */
.ledcard__more .icon { width: 18px; height: 18px; fill: currentColor; }

/* ---------- 02 · a browser window --------------------------------------- */

.browser { width: min(100%, 44rem); margin: 0; }
.browser__bar,
.win__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--paper-high, var(--paper-deep));
  font-family: var(--font-small);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.browser__bar i,
.win__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-strong); }
.browser__bar span { margin-inline: auto; padding-right: 39px; }
.browser__view {
  border: 1px solid var(--rule);
  border-radius: 0 0 12px 12px;
}

/* ---------- 02 · MedBrief: the real site, in a window ------------------- */
.mbwin { --mb-navy: #0b0b2b; }
.mbwin .browser__bar { position: relative; }
.mbwin__view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1600 / 802;
  background: var(--mb-navy);
}
.mbwin__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity var(--phrase, 420ms) var(--tempo, ease);
}
/* the window follows the story; without JavaScript the first page shows */
.mbwin__shot--1,
.ch[data-at="1"] .mbwin__shot--1 { opacity: 1; }
.ch[data-at="2"] .mbwin__shot--1,
.ch[data-at="3"] .mbwin__shot--1 { opacity: 0; }
.ch[data-at="2"] .mbwin__shot--2,
.ch[data-at="3"] .mbwin__shot--3 { opacity: 1; }
/* the brand page: the mark on MedBrief's own gradient (its palette, not ours) */
.mbwin__brand {
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 80% at 85% 20%, rgb(18 160 140 / 0.55), transparent 70%),
    radial-gradient(70% 90% at 10% 100%, rgb(60 40 170 / 0.6), transparent 70%),
    var(--mb-navy);
}
.mbwin__brand img { width: 46%; height: auto; }

/* Locky: the padlock from the campaign, in the window's bar */
.mbwin__locky {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  margin-block: auto;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #3fb6e8;
  cursor: pointer;
}
.mbwin__locky:hover { background: color-mix(in oklab, var(--ink) 10%, transparent); }
.mbwin__locky:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.mbwin__locky svg { width: 20px; height: 20px; overflow: visible; }
.mbwin__shackle { transform-origin: 16px 11px; transition: transform 380ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.mbwin.is-unlocked .mbwin__shackle { transform: translateY(-3px) rotate(28deg); }
.mbwin__locky.is-jiggle svg { animation: locky-jiggle 360ms ease; }
@keyframes locky-jiggle { 25% { transform: rotate(-12deg); } 60% { transform: rotate(9deg); } }

.mbwin__unlocked {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #05051a;
  opacity: 0;
  clip-path: circle(0% at calc(100% - 20px) 0);
  transition: opacity 200ms ease, clip-path 700ms cubic-bezier(0.2, 0, 0, 1);
}
.mbwin__unlocked img { height: 100%; width: auto; }
.mbwin.is-unlocked .mbwin__unlocked { opacity: 1; clip-path: circle(150% at calc(100% - 20px) 0); }
.mbwin__tag {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-end: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-family: var(--font-small);
  font-size: 0.6875rem;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .mbwin__shot, .mbwin__unlocked, .mbwin__shackle { transition: none; }
  .mbwin__locky.is-jiggle svg { animation: none; }
}

/* ---------- 03 · the Steady phone --------------------------------------- */

.phone {
  container-type: inline-size;
  position: relative;
  height: 100%;
  max-height: 600px;
  aspect-ratio: 9 / 18.5;
  overflow: hidden;
  border: 6px solid #0d0e10;
  border-radius: 36px;
  box-shadow: 0 0 0 1px var(--rule-strong), 0 30px 60px -20px rgb(0 0 0 / 0.6);
}
.phone__bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 4px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
}
.phone__tag {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: "Inter", var(--font-small), system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Stipje on the home page (Nov 2026): the prototype's home in miniature, in
   its own look (solid grey cards, white tiles, palette squares, Inter). The
   chapter's lines drive it: 1 the home, 2 a suggestion arrives, 3 why, 4 yes. */
.stm {
  color-scheme: light;
  color: #101112;
  background: #dcdddb;
  font-family: "Inter", system-ui, sans-serif;
  display: flex; flex-direction: column;   /* the body takes what the bar leaves, and scrolls */
}
.stm .phone__tag { background: rgba(255, 255, 255, 0.78); color: rgba(16, 17, 18, 0.72); }
.stm__body {
  position: relative; display: grid; gap: 8px; align-content: start;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none;
  padding: 10px 10px 16px;
}
.stm__body::-webkit-scrollbar { display: none; }
.stm__hello { padding: 2px 4px 0; font-size: clamp(13px, 6cqw, 17px); font-weight: 600; letter-spacing: -0.01em; }
.stm__card { padding: 12px; border-radius: 16px; background: #f1f1f1; display: grid; gap: 6px; }
.stm__label { font-size: 11px; font-weight: 500; }
.stm__big { font-family: "Inter Tight", "Inter", sans-serif; font-size: clamp(20px, 10cqw, 28px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.stm__accs { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; }
.stm__accs li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #ffffff; font-size: 11px; }
.stm__accs i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-style: normal; font-size: 7px; font-weight: 700; flex: none; }
.stm__accs i.is-aqua { background: #44cfcb; } .stm__accs i.is-lime { background: #abf970; } .stm__accs i.is-coral { background: #ff8573; }
.stm__accs span { flex: 1; min-width: 0; }
.stm__accs b { font-weight: 650; font-variant-numeric: tabular-nums; }
.stm__goaltop { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.stm__goalicon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #e8ff80; }
.stm__goalicon svg { width: 15px; height: 15px; fill: #101112; }
.stm__bar { height: 34px; border-radius: 10px; background: #dcdddb; overflow: hidden; }
.stm__bar > span {
  display: flex; align-items: center; height: 100%; width: var(--pct, 48%); border-radius: 10px; background: #e8ff80;
  transition: width 900ms cubic-bezier(0.2, 0, 0, 1);
}
.stm__bar b { padding-left: 8px; font-family: "Inter Tight", "Inter", sans-serif; font-size: 18px; font-weight: 500; letter-spacing: -0.03em; }
.stm__small { font-size: 10px; color: rgba(16, 17, 18, 0.72); }
.stm__small b { color: #101112; font-weight: 650; }
.stm__small b.is-new { background: color-mix(in srgb, #6c5bcd 16%, transparent); border-radius: 4px; padding: 0 2px; }

/* the suggestion */
.stm__nbahead { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.stm__mark .st-mark { width: 18px; height: 18px; display: block; color: #101112; }
.stm__mark .st-mark__dot { fill: #ffffff; }
.stm__mark .st-mark__dot--ai { fill: color-mix(in srgb, #6c5bcd 62%, #ffffff); }
.stm__q { font-size: 13px; font-weight: 600; line-height: 1.3; }
.stm__why { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #ffffff; font-size: 11px; line-height: 1.4; }
.stm__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stm__btn {
  min-height: 32px; padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: #dcdddb; color: #101112; font: 600 11px/1 "Inter", system-ui, sans-serif;
}
.stm__btn--go { background: #101112; color: #ffffff; }
.stm__btn:focus-visible { outline: 2px solid #6c5bcd; outline-offset: 2px; }
.stm__done { font-size: 12px; font-weight: 600; line-height: 1.35; }

/* the lines drive it (JS adds .is-cue when the chapter reaches step 3 or 4) */
.stm__txns { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; }
.stm__txns li { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.stm__txns i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #dcdddb; font-style: normal; font-size: 10px; font-weight: 600; flex: none; }
.stm__txns span { flex: 1; min-width: 0; font-weight: 500; }
.stm__txns small { display: block; font-size: 10px; font-weight: 400; color: rgba(16, 17, 18, 0.72); }
.stm__txns b { font-weight: 650; font-variant-numeric: tabular-nums; }
.stm__txns b.is-in { color: color-mix(in srgb, #0c8346 90%, #000000); }
.stm__txns b.is-out { color: color-mix(in srgb, #eb5160 74%, #000000); }
/* before the second line the card is still thinking; then the suggestion arrives */
.stm__thinking { font-size: 12px; color: rgba(16, 17, 18, 0.72); }
html.js .stm__nba:not(.is-kept) [data-stm-open] { display: none; }
.stm__nba.is-kept .stm__thinking, html:not(.js) .stm__thinking { display: none; }
.stm__nba.is-kept [data-stm-open] { animation: reply-in var(--phrase) var(--tempo) both; }
.stm__nba:not(.is-kept) .stm__mark .st-mark__dot { animation: stm-breathe 1.4s ease-in-out 3; }
.stm__done:focus { outline: none; }
.stm__body:focus-visible { outline: 2px solid #6c5bcd; outline-offset: -2px; border-radius: 30px; }
html.js #ch-04[data-at="2"] .stm__mark .st-mark__dot,
html.js .stm.is-thinking .stm__mark .st-mark__dot { animation: stm-breathe 1.4s ease-in-out 1; }
.stm__mark .st-mark__dot:nth-of-type(3) { animation-delay: 140ms; }
.stm__mark .st-mark__dot:nth-of-type(4) { animation-delay: 280ms; }
@keyframes stm-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.stm__btn.is-cue { animation: stm-cue 1.2s var(--tempo) 1; }
@keyframes stm-cue { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, #6c5bcd 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.stm__why:not([hidden]), .stm__done:not([hidden]) { animation: reply-in var(--phrase) var(--tempo) both; }

/* ---------- 03 · the TweetSpot phone ------------------------------------ */
/* Today's My spot in miniature, in the app's own palette and type (Google
   Sans Flex, #f2f2f2, white cards, moss #35614d, lime #c2db80) */
@font-face { font-family: "Google Sans Flex"; src: url("../fonts/GoogleSansFlex-latin.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
.twm {
  color-scheme: light;
  color: #23261c;
  background: #f2f2f2;
  font-family: "Google Sans Flex", system-ui, sans-serif;
}
.twm .phone__tag { background: #c2db80; color: #254537; }
.twm__body { display: grid; gap: 8px; padding: 12px 12px 14px; }
.twm__hello { display: flex; align-items: center; gap: 8px; font-size: clamp(15px, 6.4cqw, 19px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.twm__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.twm__avatar--me { width: 32px; height: 32px; background: #35614d; color: #c2db80; }
.twm__stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.twm__stats li { display: grid; gap: 2px; padding: 8px 6px 7px; border-radius: 12px; background: #fff; text-align: center; }
.twm__stats b { font-size: 18px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: #254537; font-variant-numeric: tabular-nums; }
.twm__stats b.is-up { animation: twm-up 520ms cubic-bezier(0.2, 0, 0, 1); }
@keyframes twm-up { 0% { transform: translateY(6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.twm__stats span { font-size: 10px; font-weight: 600; color: #5f6256; }
.twm__hero { position: relative; isolation: isolate; height: 84px; overflow: hidden; border-radius: 14px; background: #101310; }
.twm__hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 65% 35%; }
.twm__hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(0 0 0 / 0.85), rgb(0 0 0 / 0.45) 55%, transparent); }
.twm__hero p { display: grid; gap: 2px; height: 100%; align-content: end; padding: 10px 12px; }
.twm__hero span { font-size: 10px; font-weight: 600; color: #c2db80; }
.twm__hero b { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.twm__label { margin-top: 2px; font-size: 12px; font-weight: 600; color: #23261c; }
.twm__feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.twm__post {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 46px;
  grid-template-areas: "av who img" "av btn img";
  align-items: center;
  gap: 4px 8px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
}
.twm__post .twm__avatar { grid-area: av; align-self: start; }
.twm__who { grid-area: who; font-size: 11px; line-height: 1.3; }
.twm__who b { font-weight: 600; }
.twm__who span { display: block; font-size: 10px; color: #5f6256; }
.twm__post img { grid-area: img; width: 46px; height: 46px; border-radius: 10px; object-fit: cover; object-position: 50% 40%; }
.twm__seen {
  grid-area: btn;
  justify-self: start;
  min-height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: #c2db80;
  color: #1b1e16;
  font: 600 11px/1 "Google Sans Flex", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color var(--beat) var(--tempo), color var(--beat);
}
.twm__seen:hover { background: #b2cf68; }
.twm__seen[aria-pressed="true"] { background: #141314; color: #fff; cursor: default; }
.twm__seen:focus-visible { outline: 2px solid #35614d; outline-offset: 2px; }
/* "Seen one? Tick it off." (step 3): the buttons still to tick breathe a
   soft moss ring, staggered, three times, then rest — an invitation, not a
   loop. Off with Moving type Off or reduced motion. */
/* three clear beats (her call): each a ring and a small lift, then a rest */
@keyframes twm-pulse {
  0%, 60%, 100% { box-shadow: 0 0 0 0 rgba(53, 97, 77, 0); transform: none; }
  25%           { box-shadow: 0 0 0 6px rgba(53, 97, 77, 0.32); transform: scale(1.07); }
}
#ch-03[data-at="3"] .twm__seen:not([aria-pressed="true"]) { animation: twm-pulse 1.2s cubic-bezier(0.2, 0, 0, 1) 3; }
#ch-03[data-at="3"] .twm__post:nth-child(2) .twm__seen { animation-delay: 0.25s; }
#ch-03[data-at="3"] .twm__post:nth-child(3) .twm__seen { animation-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) { .twm__seen, .twm__stats b { animation: none !important; } }
html[data-type-motion="off"] .twm__seen, html[data-type-motion="off"] .twm__stats b { animation: none !important; }
.twm__life { margin-top: 2px; font-size: 11px; line-height: 1.4; color: #5f6256; }
.twm__credit { font-size: 9px; line-height: 1.4; color: #5f6256; }

/* a small phone (the story on a phone): the greeting, this month's bird and
   two birders — the counts, the third post and the credit step aside; the
   logged line stays for screen readers */
@container (max-width: 260px) {
  .twm__body { gap: 6px; padding: 10px 9px 10px; }
  .twm__stats, .twm__credit, .twm__post:nth-child(n+3) { display: none; }
  .twm__hero { height: 64px; }
  .twm__hero p { padding: 7px 9px; }
  .twm__hero b { font-size: 13px; }
  .twm__post { grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "av who" "av btn"; padding: 7px; }
  .twm__post img { display: none; }
  .twm__post .twm__avatar { width: 24px; height: 24px; font-size: 9px; }
  .twm__life { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* the splash (her call): as the chapter opens the phone shows the app's
   splash — the leaves and the wordmark — and hands over to My spot when the
   story reaches "What's about this month". Without the story script (no
   is-armed) the app shows straight away. */
@font-face { font-family: "Taste Bread"; src: url("../fonts/TasteBread.otf") format("opentype"); font-weight: 400; font-display: swap; }
.twm { position: relative; }
.twm__splash {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgb(58 112 71);
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms cubic-bezier(0.2, 0, 0, 1), visibility 0s linear 600ms;
}
.twm__splash img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.twm__mark {
  position: relative;
  font-family: "Taste Bread", var(--font-display);
  font-size: 15cqw;
  line-height: 1;
  color: #c2db80;
  text-shadow: 0 3px 0 #35614d;
  transition: transform 600ms cubic-bezier(0.2, 0, 0, 1);
}
#ch-03.is-armed[data-at="1"] .twm__splash { opacity: 1; visibility: visible; transition: opacity 400ms ease, visibility 0s; }
#ch-03.is-armed:not([data-at="1"]) .twm__mark { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .twm__splash, .twm__mark { transition: none; } }
html[data-type-motion="off"] .twm__splash, html[data-type-motion="off"] .twm__mark { transition: none; }

/* the chapter numbers at the case pages' size (her call) */
.ch__num { font-size: clamp(1.25rem, 2vw, 1.75rem); }

/* ---------- 05 · the Thursdays window ----------------------------------- */
/* Thursdays keeps its own paper, night ink and lamp, as on its own page */
.thm { --thm-paper: oklch(0.977 0.012 84); --thm-ink: oklch(0.235 0.02 60); --thm-ink-2: oklch(0.43 0.015 60);
       --thm-line: oklch(0.885 0.012 78); --thm-lamp: oklch(0.735 0.155 68); --thm-night: oklch(0.235 0.035 277); }
.thm__view {
  container-type: inline-size;
  display: grid;
  gap: 14px;
  padding: clamp(16px, 4cqw, 28px);
  background: var(--thm-paper);
  color: var(--thm-ink);
  color-scheme: light;
}
.thm__brand { display: flex; align-items: center; gap: 10px; }
.thm__mark { width: 34px; height: 23px; flex: none; }
.thm__mark circle { fill: none; stroke: currentColor; stroke-width: 2; transition: fill var(--phrase) var(--tempo), stroke var(--phrase) var(--tempo); }
.thm.is-booked .thm__mark circle:first-child { fill: var(--thm-lamp); stroke: var(--thm-lamp); }
.thm__word { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.035em; }
.thm__tag { margin-left: auto; background: var(--thm-night); color: #fff; }
.thm__card {
  display: grid;
  gap: 6px;
  padding: clamp(14px, 3.4cqw, 22px);
  border: 1px solid var(--thm-line);
  border-radius: 10px;
  background: #fff;
}
.thm__cat { font-family: var(--font-small); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--thm-ink-2); }
.thm__title { font-family: var(--font-display); font-size: clamp(1.25rem, 5cqw, 1.75rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.thm__meta { font-family: var(--font-small); font-size: 0.75rem; color: var(--thm-ink-2); }
.thm__weeks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  margin: 6px 0 0;
  padding: 10px 0 0 1.4em;
  border-top: 1px solid var(--thm-line);
  font-family: var(--font-small);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--thm-ink);
}
.thm.is-booked .thm__weeks li:first-child { font-weight: 700; }
/* a phone pins the device in ~60svh: the dots already say six weeks */
.thm__weeks { display: none; }
@container (min-width: 420px) { .thm__weeks { display: grid; } }
.thm__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.thm__price { font-family: var(--font-small); font-size: 0.8125rem; font-weight: 600; }
.thm__book {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--thm-night);
  color: #fff;
  font: 600 0.8125rem/1 var(--font-small);
  cursor: pointer;
  transition: transform var(--beat) var(--tempo);
}
.thm__book:hover { transform: translateY(-1px); }
.thm__book:disabled { background: var(--thm-lamp); color: var(--thm-night); cursor: default; transform: none; }
.thm__book:focus-visible { outline: 2px solid var(--thm-night); outline-offset: 3px; }
.thm__done { min-height: 1.4em; font-family: var(--font-small); font-size: 0.75rem; color: var(--thm-ink-2); }
.thm.is-booked .thm__done { animation: reply-in var(--phrase) var(--tempo) both; }

/* ---------- 05 · everything else ---------------------------------------- */

.ch--list { padding-block: clamp(48px, 7vw, 112px); }   /* its own padding: the number's margin used to collapse out and open a gap above the card */
.ch--list .ch__num { margin-top: 0; }
.ch--list .ch__line { margin-top: 0.8rem; max-width: 18ch; }
.worklist {
  list-style: none;
  margin: clamp(24px, 4vw, 48px) 0 1rem;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}
.worklist a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "n y" "k k";
  gap: 2px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
  transition: padding var(--beat) var(--tempo), color var(--beat);
}
.worklist a:hover { padding-left: 8px; color: var(--accent); }
/* rows without a page (NDA, archive): the same grid, nothing to click */
.worklist__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "n y" "k k";
  gap: 2px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.worklist__n {
  grid-area: n;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2.4vw, 1.75rem);
  font-weight: 480;
  letter-spacing: -0.02em;
}
.worklist__k,
.worklist__y {
  font-family: var(--font-small);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.worklist__k { grid-area: k; }
.worklist__k.is-nda { color: var(--alert); }
.worklist__y { grid-area: y; align-self: center; font-variant-numeric: tabular-nums; }

/* ---------- 06 · your turn ---------------------------------------------- */

.ch--turn { padding-block: clamp(40px, 6vw, 88px) clamp(24px, 4vw, 48px); }
/* "So, <name>." on the ground above the card, centred, with air around it */
.turn__intro {
  padding-block: clamp(72px, 11vw, 160px) clamp(56px, 8vw, 120px);
  text-align: center;
}
.turn__intro .ch__line { margin: 0 auto; }
.turn__intro .turn__sum { margin-inline: auto; }
/* the question, now an invitation: a quiet link down to the contact card.
   No underline and no arrow (her call); the accent colour says link, and
   hover/focus brings the underline back as feedback */
.turn__ask {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: clamp(16px, 2vw, 24px);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.turn__ask:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.turn__sum {
  max-width: 30ch;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 440;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.turn__grid {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  margin-top: clamp(32px, 5vw, 64px);
}
.ch--turn > .badges:first-child,
.ch--turn > .card-corners + .badges { margin-top: 0; }

.receipt-box { margin-top: 1rem; }
.receipt-box summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}
.receipt-box[open] .receipt { margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .ch.is-armed .ch__step { transition: none; }
  .ledcard__what::after { transition: none; }
  .stm__nba [data-stm-open], .stm__why, .stm__done, .stm__btn.is-cue, .stm__mark .st-mark__dot { animation: none !important; }
  .stm__bar > span { transition: none; }
  .ledcard__reply.is-on { animation: none; }
}

/* ---------- room to spread ---------------------------------------------- */

@media (min-width: 561px) {
  .worklist a,
  .worklist__row {
    grid-template-columns: minmax(0, 1fr) 8rem 5rem;
    grid-template-areas: "n k y";
    align-items: center;
  }
  .worklist__y { text-align: right; }
}

@media (min-width: 901px) {
  .ch__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 4vw, 72px);
  }
  .ch__stage {
    order: 0;
    height: calc(100svh - var(--topbar-h) - var(--stick-gap));
    padding-block: 32px;
    background: none;
    box-shadow: none;
  }
  .ch__story .ch__num {
    position: sticky;
    top: calc(var(--bar-y) + var(--stick-gap) + 28px);
    z-index: 1;
  }
  .ch__story { padding-block: 0 30svh; }
  .ch__step {
    min-height: 72svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
  }
  .ch__steps { margin-top: 12svh; }
  .phone { max-height: 640px; }
  .ledcard__row { padding-block: 15px; }
  .ledcard__more { margin-top: 18px; }
}

/* ---------- type before pixels (ascii.js) ------------------------------
   The veil hides a device only while a canvas wireframe is drawn over it,
   and only once JS has armed it; ascii.js lifts it on a timer as well. */

.ascii-veil {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transition: opacity 520ms var(--tempo);   /* = HAND in ascii.js */
}
.ascii-veil.is-leaving { opacity: 0; }
/* veiled from the first frame, so the real mockup never shows before its
   wireframe; ascii-on is set inline and withdrawn if ascii.js never runs */
html.ascii-on .ch__stage > *:not(.is-shown):not(.ascii-veil) { opacity: 0; }
.ch__stage > *:not(.ascii-veil) { transition: opacity 520ms var(--tempo); }
@media (prefers-reduced-motion: reduce) {
  html.ascii-on .ch__stage > *:not(.ascii-veil) { opacity: 1; }
}

/* redaction in characters: the black bar retires when ascii.js is running */
.has-ascii-redact .ledcard__what::after { display: none; }
.redact {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  font-size: 1.5rem;     /* tall blocks by size, not by scaling: the row lines stay whole */
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  pointer-events: none;
}
.redact:empty { display: none; }
.is-redacted { color: transparent; }
.is-redacted b, .is-redacted i { color: transparent; }
.is-redacted .redact { inset: 1px 0; }

/* ---------- badges (visit.js) ------------------------------------------- */

.badges { margin-top: clamp(28px, 4vw, 48px); }
.badges__count {
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.badges__grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
/* one card per badge: medal left, words right; no rule around it and the
   same ground whatever its state. Only a new one gets the theme's outline
   (the transparent border keeps it from shifting when it does). */
.badge {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--paper-deep);
  transition: border-color var(--beat) var(--tempo);
}
.badge.is-new { border-color: var(--accent); }
.badge__medal {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
}
.badge__medal canvas { display: block; }
/* locked: a grey circle set in characters, a question mark in the middle */
.badge__ascii {
  display: grid;
  grid-template-columns: repeat(11, 9.5px);   /* 11 x 7 cells = 104 x 104, the earned circle's size */
  grid-auto-rows: 15px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 15px;
  color: var(--ink-faint);
}
.badge__ascii i { font-style: normal; text-align: center; }
/* earned art: the same cells, sized per artCell() inline, in the theme colour */
.badge__ascii--art { color: var(--accent); }
.badge__ascii--art .is-noise { color: var(--ink-faint); }
.badge__ascii .is-q { font-size: 21px; color: var(--ink-soft); }
/* earned: a round well of the card ground (--surface), ringed in the primary blue */
.badge.is-earned .badge__medal {
  border: 1px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
}
.on-light .badge.is-earned .badge__medal { background: var(--paper); }
.badge__text { display: grid; gap: 4px; min-width: 0; }
.badge__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 520;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.badge.is-locked .badge__name { color: var(--ink-soft); }
.badge__new {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-small);
  font-size: 0.625rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.badge__line {
  font-family: var(--font-small);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-wrap: pretty;
}

@media (min-width: 761px) {
  .badges__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1101px) {
  .badges__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- sticky top corners (cards.js) --------------------------------
   While a [data-sticky-corners] card scrolls under the bar, a strip of
   ground (--stick-gap) and two corner pieces hold its rounded top edge just
   beneath the bar. They sit under the bar (z-index 80), over the content. */
.card-corners {
  position: fixed;
  top: var(--bar-y);
  height: calc(var(--stick-gap) + var(--card-radius));
  z-index: 70;
  pointer-events: none;
  display: none;
}
.card-corners.is-on { display: block; }
.card-corners::before {   /* the ground between the bar and the card's edge */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--stick-gap);
  background: var(--dark);
}
.card-corners > span {
  position: absolute;
  top: var(--stick-gap);
  width: var(--card-radius);
  height: var(--card-radius);
}
.card-corners__l {
  left: 0;
  background: radial-gradient(circle at 100% 100%, transparent calc(var(--card-radius) - 0.5px), var(--dark) var(--card-radius));
}
.card-corners__r {
  right: 0;
  background: radial-gradient(circle at 0 100%, transparent calc(var(--card-radius) - 0.5px), var(--dark) var(--card-radius));
}
html[data-gate="ask"] .card-corners { display: none; }

/* "Now you tell me:" on its own line, the question beneath it (her call) */
.turn__tell {
  margin-top: clamp(20px, 2.6vw, 32px);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}
.turn__tell + .turn__ask { margin-top: 0; }
/* the receipt opens from a secondary button with a caret, so it reads as clickable */
.receipt-box summary.btn {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  height: auto;
  padding: 0 14px 0 20px;
  list-style: none;
  font-family: var(--font-small);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.receipt-box summary.btn::-webkit-details-marker { display: none; }
.receipt-box__caret { width: 20px; height: 20px; fill: currentColor; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1); }
.receipt-box[open] .receipt-box__caret { transform: rotate(180deg); }
.receipt-box[open] summary.btn { margin-bottom: 1rem; }
@media (prefers-reduced-motion: reduce) { .receipt-box__caret { transition: none; } }
