/* ChatBro documentation, variant 5: "The sentence is the layout".
   Golos Text, two weights (it has the Cyrillic the Russian page needs). Cool grey ground, near-black ink, one cobalt accent. */

:root {
  --bg: #eef0f3;
  --surface: #e2e5ea;
  --paper: #ffffff;
  --ink: #0b0c0e;
  --muted: #5d6470;
  --accent: #1f2de6;
  --accent-ink: #ffffff;

  --font: "Golos Text", system-ui, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.375rem, 1rem + 1.2vw, 2.25rem);
  --step-head: clamp(2.5rem, 1.3rem + 3.4vw, 4.5rem);
  --step-display: clamp(3.25rem, 7.4vw, 8.5rem);

  --m: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 1.7vw, 1.5rem);
  --section: clamp(6rem, 10.5vw, 10rem);
  --step-phrase: clamp(3.25rem, 9vw, 9.5rem);
  --radius: 4px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
h1, h2, h3, p, ul, ol, figure, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p, li { text-wrap: pretty; }
img, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
b { font-weight: 500; }
code { font-family: inherit; font-weight: 500; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.head { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.045em; }

.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color 180ms ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
}

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 180ms ease;
}
.button:hover { background: #1320c4; }
.button:active { transform: scale(0.97); }
.button-small { min-height: 2.75rem; padding: 0 1.1rem; font-size: 0.9375rem; }

.narrow-only { display: none; }

/* ---------------- hero: the sentence split by the reel ---------------- */

.hero { position: relative; }
.stage {
  position: relative;
  min-height: 100svh;
  padding: 0 var(--m);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 5.5rem;
  font-size: 0.9375rem;
}
.mark { font-size: var(--step-body); font-weight: 500; letter-spacing: -0.03em; text-decoration: none; }
.bar-links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.75rem); }
.bar-links > a.link { text-decoration-color: transparent; text-decoration-line: underline; }
.lang { display: inline-flex; gap: 0.6rem; }
.lang a { text-decoration: none; color: var(--muted); padding: 0.4rem 0; }
.lang a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; }

.sentence {
  align-self: center;
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--gutter);
  font-size: var(--step-display);
  line-height: 0.9;
  letter-spacing: -0.05em;
  white-space: nowrap;
}
.half { display: block; padding-bottom: 0.06em; }
.slot { justify-self: center; display: block; width: var(--fw); height: 0; }
.hero { --fw: clamp(15rem, 34vw, 36rem); --fh: calc(var(--fw) * 0.78); }

.hero-foot { padding-bottom: 2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gutter); position: relative; z-index: 2; }
.hero-lead { max-width: 30rem; font-size: var(--step-body); line-height: 1.45; }

/* The reel: without script it is a plain list under the sentence. */
.reel { margin: 1.5rem auto 0; width: min(100%, 34rem); }
.reel-track { display: grid; gap: 1rem; }
.js .reel {
  position: absolute; z-index: 1;
  top: var(--reel-top, 5.5rem); left: var(--reel-left, 50%);
  width: var(--reel-w, var(--fw)); height: var(--reel-h, calc(100% - 11rem));
  margin: 0; overflow: hidden;
}
.js .reel-track { display: flex; flex-direction: column; gap: var(--reel-gap, 2rem); transform: translateY(var(--reel-y, 0px)); transition: transform 760ms var(--ease-in-out); }
.js .reel-item { height: var(--fh); flex: none; transition: opacity 400ms ease; opacity: 0.45; }
.js .reel-item.is-on { opacity: 1; }
.js .hero { height: calc(100svh + 3 * 45svh); }
.js .stage { position: sticky; top: 0; height: 100svh; min-height: 0; }

/* the chat fragment inside each frame of the reel */
[data-ui].tg {
  height: 100%; display: flex; flex-direction: column;
  background: #d5dbe3; border-radius: 4px; overflow: hidden;
  font-size: 0.9375rem; line-height: 1.38; letter-spacing: 0;
}
[data-ui] .tg-step { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.9rem; background: #c7ced8; font-weight: 500; }
[data-ui] .tg-count { color: #3f4652; white-space: nowrap; font-weight: 400; }
[data-ui] .tg-feed { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.5rem; padding: 0.9rem; }
[data-ui] .tg-msg, [data-ui] .tg-note { flex: none; background: #fff; border-radius: 12px 12px 12px 4px; padding: 0.55rem 0.8rem 0.45rem; max-width: 92%; }
[data-ui] .tg-who { font-weight: 500; color: #1f2de6; font-size: 0.875rem; }
[data-ui] .tg-bot .tg-who { color: #0e7a43; }
[data-ui] .tg-quote { margin: 0.25rem 0 0.35rem; padding: 0.15rem 0 0.15rem 0.55rem; border-left: 3px solid #1f2de6; font-size: 0.875rem; color: #3f4652; }
[data-ui] .tg-quote b { display: block; color: #1f2de6; }
[data-ui] .tg-time { text-align: right; font-size: 0.8125rem; color: #6b7280; margin-top: 0.1rem; }
[data-ui] .tg-text mark { background: #1f2de6; color: #fff; border-radius: 3px; padding: 0 0.15em; }
[data-ui] .tg-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
[data-ui] .tg-tags span { background: #0b0c0e; color: #fff; border-radius: 3px; padding: 0.35rem 0.6rem; font-size: 0.8125rem; }
[data-ui] .tg-note { border-radius: 4px; background: #e4e7fd; max-width: 100%; padding: 0.8rem 0.9rem; }
[data-ui] .tg-note .tg-text { font-size: 1.0625rem; }

/* ---------------- the router: a headline you can type ---------------- */

.ask { padding: var(--section) var(--m) 0; }
.ask-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
.ask-head h2 { grid-column: 1 / span 7; }
.ask-intro { grid-column: 8 / span 5; max-width: 36ch; }

[data-ui].router { margin-top: clamp(2.5rem, 5vw, 4.5rem); }
[data-ui] .router-line { position: relative; overflow: hidden; background: var(--paper); border-radius: 4px; padding: 0.12em 0.22em 0.16em; font-size: clamp(2.5rem, 6.4vw, 7.5rem); transition: background-color 180ms ease; }
[data-ui] .router-line:focus-within { background: #fff; outline: 3px solid var(--accent); outline-offset: 0; }
[data-ui] .router-input {
  display: block; width: 100%; border: 0; background: transparent; padding: 0;
  font-size: 1em; font-weight: 500; letter-spacing: -0.045em; line-height: 1.1;
  color: var(--ink); caret-color: var(--accent); outline: none;
}
[data-ui] .router-mirror { position: absolute; left: 0.22em; top: 0; visibility: hidden; white-space: pre; font-weight: 500; letter-spacing: -0.045em; line-height: 1.1; padding-top: 0.12em; }
[data-ui] .router-caret { position: absolute; top: 0.24em; height: 0.92em; width: 0.08em; background: var(--accent); left: var(--caret-x, 0.22em); pointer-events: none; }
[data-ui] .router-line:focus-within .router-caret { visibility: hidden; }

[data-ui] .router-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: 3rem; align-items: start; }
[data-ui] .router-out { grid-column: 1 / span 5; display: grid; gap: 0.9rem; max-width: 35rem; }
[data-ui] .verdict { font-size: var(--step-lead); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; color: var(--accent); }
[data-ui] .verdict[data-tone="sleep"], [data-ui] .verdict[data-tone="quiet"] { color: var(--ink); }
[data-ui] .why { font-size: var(--step-body); }
[data-ui] .trace { font-size: var(--step-small); color: var(--muted); }
[data-ui] .router-out.is-updating .verdict { animation: verdict-in 420ms var(--ease-out); }
@keyframes verdict-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

[data-ui] .router-side { grid-column: 6 / span 7; display: grid; grid-template-columns: 4fr 3fr; gap: var(--gutter); align-items: start; }
[data-ui] .router-switches { border: 0; padding: 0; display: grid; gap: 0.5rem; }
[data-ui] .router-switches legend, [data-ui] .router-examples p { font-weight: 500; margin-bottom: 0.6rem; padding: 0; }
[data-ui] .router-switches label { display: flex; align-items: center; gap: 0.8rem; min-height: 3.25rem; padding: 0.5rem 0.9rem; background: var(--surface); border-radius: 4px; cursor: pointer; transition: background-color 180ms ease; }
[data-ui] .router-switches label:hover { background: #d6dae1; }
[data-ui] .router-switches input { appearance: none; flex: none; width: 1.3rem; height: 1.3rem; margin: 0; border-radius: 3px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); display: grid; place-items: center; transition: background-color 160ms ease, box-shadow 160ms ease; cursor: pointer; }
[data-ui] .router-switches input::after { content: ""; width: 0.65rem; height: 0.35rem; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px) scale(0.6); opacity: 0; transition: transform 160ms var(--ease-out), opacity 120ms ease; }
[data-ui] .router-switches input:checked { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
[data-ui] .router-switches input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); opacity: 1; }
[data-ui] .router-examples { display: grid; justify-items: start; }
[data-ui] .router-examples button { padding: 0.35rem 0; text-decoration: underline; text-decoration-color: rgba(11, 12, 14, 0.25); text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color 180ms ease, color 180ms ease; }
[data-ui] .router-examples button:hover { text-decoration-color: currentColor; color: var(--accent); }
[data-ui] .router-examples button:active { transform: translateY(1px); }
[data-ui] .router-examples button span { color: var(--muted); }

/* ---------------- a day on Minsk time: one bar ---------------- */

.day { padding: var(--section) var(--m) 0; }
.day h2 { margin-bottom: 4rem; }
.day-bar { display: flex; gap: 6px; }
.seg { flex: var(--grow) 1 0; min-width: 16%; display: grid; grid-template-rows: max(22vh, 11rem) auto; }
.seg-fill { grid-row: 1; grid-column: 1; position: relative; overflow: hidden; border-radius: 4px; }
.seg-fill img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transform: scale(1.06); }
.seg-time { position: relative; padding: 1.25rem; font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.seg-clause { grid-row: 2; padding-top: 1rem; max-width: 22ch; padding-right: 0.75rem; }
.seg-morning .seg-fill { background: #d3d8df; }
.seg-digest .seg-fill { background: var(--accent); }
.seg-digest .seg-time { color: #fff; }
.seg-day .seg-fill { background: var(--paper); }
.seg-night .seg-fill { background: #07080b; }
.seg-night .seg-time { color: #fff; }

/* ---------------- what it reads: statement left, the context on the right ---------------- */

.reads { padding: var(--section) var(--m) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.reads-text { grid-column: 1 / span 6; }
.notes { margin-top: 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem var(--gutter); }
.notes button { position: relative; display: block; max-width: 30ch; padding: 0.2rem 0; line-height: 1.45; }
.notes b { transition: color 180ms ease; }
.notes button:hover b, .notes button[aria-pressed="true"] b { color: var(--accent); }
.notes b { display: block; }
[data-ui].context { grid-column: 8 / span 5; background: var(--paper); border-radius: 4px; padding: 1.4rem; font-size: 0.9375rem; line-height: 1.45; position: sticky; top: 2rem; }
[data-ui] .context-title { font-weight: 500; font-size: 1.0625rem; margin-bottom: 0.9rem; }
[data-ui] .part { padding: 0.7rem 0.8rem; border-radius: 4px; transition: background-color 200ms ease; }
[data-ui] .part + .part { margin-top: 0.2rem; }
[data-ui] .part.is-active { background: #e4e8ff; }
[data-ui] .part-name { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.15rem; }
[data-ui] .part .t { color: var(--muted); }

/* ---------------- statements on colour fields ---------------- */

.fields { margin-top: var(--section); }
.field {
  min-height: 58svh;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr auto;
  column-gap: var(--gutter);
  /* A field of colour insets its text more than the page margin, so nothing sits on its edge. */
  padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1.5rem, 4vw, 4rem);
}
.field-ink { background: var(--ink); color: #fff; }
.field-pale { background: var(--surface); color: var(--ink); }
.field-text { grid-row: 1; grid-column: 8 / span 4; max-width: 31ch; font-size: var(--step-body); line-height: 1.45; }
.field-text code { white-space: nowrap; }
.phrase { grid-row: 3; grid-column: 1 / -1; font-size: var(--step-phrase); line-height: 0.9; letter-spacing: -0.05em; padding-bottom: 0.04em; }
.field-mirror .field-text { grid-column: 2 / span 4; }
.field-mirror .phrase { text-align: right; }
.inline-slot { display: inline-block; vertical-align: baseline; height: 0.75em; width: 2.2em; overflow: hidden; border-radius: 4px; margin: 0 0.06em; background: #22252b; }
.inline-slot img, .inline-slot video { width: 100%; height: 100%; object-fit: cover; }
.inline-slot img { object-position: 52% 62%; transform: scale(1.35); transform-origin: 52% 62%; }

/* ---------------- the morning digest: a pinned story ---------------- */

.digest { padding: var(--section) var(--m) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.digest-pin { grid-column: 1 / span 5; align-self: start; position: sticky; top: 14vh; }
.digest-lead { margin-top: 2rem; max-width: 36ch; }
.digest-states { grid-column: 7 / span 6; }
.state { min-height: 55svh; display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; }
.state:first-child { justify-content: flex-start; padding-top: 2vh; }
.js .state { opacity: 0.45; transition: opacity 300ms ease; }
.js .state.is-on { opacity: 1; }
.state-word { font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.03em; }
[data-ui].post { background: var(--paper); border-radius: 4px; padding: 1.3rem 1.4rem; font-size: 1rem; line-height: 1.5; max-width: 38rem; }
[data-ui] .post-meta { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.4rem; }
[data-ui] .post-meta b { color: #0e7a43; font-weight: 500; }
[data-ui] .post-title { font-weight: 500; font-size: 1.125rem; margin-bottom: 0.6rem; }
[data-ui] .post-items { display: grid; gap: 0.7rem; }
[data-ui] .post-items li { padding-left: 1rem; position: relative; }
[data-ui] .post-items li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
[data-ui] .src { color: var(--muted); }
[data-ui] .post-quote { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 0.7rem; margin-bottom: 0.8rem; color: #3f4652; font-size: 0.9375rem; }
[data-ui] .post-hint { margin-top: 0.9rem; font-size: 0.875rem; color: var(--muted); }
[data-ui] .post-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
[data-ui] .post-tags span { background: var(--surface); border-radius: 3px; padding: 0.35rem 0.6rem; font-size: 0.8125rem; }

/* ---------------- common questions: large questions, answers beside ---------------- */

.faq { padding: var(--section) var(--m) 0; }
.faq-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: baseline; }
.faq-row + .faq-row { margin-top: clamp(3rem, 4.5vw, 4rem); }
.faq-row h3, .faq-heading { grid-column: 1 / span 6; font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.03em; max-width: 22ch; }
.faq-heading { color: var(--muted); }
.faq-row p { grid-column: 8 / span 5; max-width: 42ch; line-height: 1.55; }

/* ---------------- footer: the contact is the headline ---------------- */

.foot {
  margin-top: var(--section);
  min-height: 60svh;
  background: var(--accent); color: var(--accent-ink);
  padding: 2.5rem var(--m) 1.75rem;
  display: grid; grid-template-rows: auto 1fr auto auto;
}
.foot-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; font-size: 0.9375rem; }
.foot-notes { grid-column: 1 / span 6; display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--gutter); }
.foot-notes p { max-width: 36ch; }
.foot-back { grid-column: 9 / span 4; justify-self: end; }
.foot-handle {
  grid-row: 3; align-self: end;
  display: block; width: max-content; max-width: 100%;
  font-size: 11.6vw; font-weight: 500; line-height: 0.9; letter-spacing: -0.055em;
  text-decoration: none; padding-bottom: 0.05em; margin-left: -0.04em;
  transition: opacity 180ms ease;
}
.foot-handle:hover { opacity: 0.85; }
.foot-meta { grid-row: 4; margin-top: 2rem; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); font-size: var(--step-small); align-items: start; }
.foot-meta nav { grid-column: 1 / span 3; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.foot-meta .credits { grid-column: 4 / span 6; max-width: 70ch; }
.foot-meta .credits a { text-underline-offset: 0.18em; }
.foot-year { grid-column: 10 / span 3; justify-self: end; text-align: right; }

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

@media (prefers-reduced-motion: no-preference) {
  .js .half-a, .js .half-b { animation: half-in 900ms var(--ease-expo) both; }
  .js .half-a { --from: -0.35em; animation-delay: 80ms; }
  .js .half-b { --from: 0.35em; animation-delay: 160ms; }
  .js .reel { animation: reel-open 1100ms var(--ease-in-out) 120ms both; }
  .js .hero-foot { animation: lead-in 700ms var(--ease-out) 380ms both; }

  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .seg { opacity: 0; transform: translateY(22px); transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .day-bar.is-in .seg { opacity: 1; transform: none; }
  .js .seg-night img { transition: transform 1600ms var(--ease-soft); transform: scale(1.18); }
  .js .day-bar.is-in .seg-night img { transform: scale(1.06); }
  .js .router-caret { animation: blink 1.06s steps(1) infinite; }
}
@keyframes half-in { from { opacity: 0; transform: translateX(var(--from)); } to { opacity: 1; transform: none; } }
@keyframes reel-open { from { clip-path: inset(50% 0 50% 0); } to { clip-path: inset(0); } }
@keyframes lead-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .js .reel-track, .js .reel-item, .js .state { transition: none; }
}

/* ---------------- tablet and phone ---------------- */

@media (max-width: 1000px) {
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .button.narrow-only { display: inline-flex; }
  .bar { min-height: 4rem; }

  .hero { --fh: clamp(13.5rem, calc(100svh - 30.5rem), 22rem); --sliver: 1.75rem; }
  .sentence { grid-template-columns: 1fr; row-gap: 0; font-size: clamp(2.75rem, 14.6vw, 7rem); align-self: start; padding-top: 0.75rem; }
  .half-b { justify-self: end; }
  .slot { width: 100%; height: 1.5rem; }
  .js .slot { height: calc(var(--fh) + 2 * var(--sliver) + 1.25rem); }
  .hero-foot { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1.5rem; padding: 1.25rem 0 1.25rem; }
  .hero-lead { max-width: 34rem; }
  .foot { min-height: 56svh; }
  .hero-foot .button { align-self: flex-start; }
  .stage { grid-template-rows: auto auto 1fr; }
  .js .reel { top: var(--reel-top, 10rem); }

  .ask-head h2, .ask-intro { grid-column: 1 / -1; }
  .ask-intro { margin-top: 1.5rem; }
  [data-ui] .router-out, [data-ui] .router-side { grid-column: 1 / -1; }
  [data-ui] .router-side { margin-top: 2.5rem; }

  .reads-text, [data-ui].context { grid-column: 1 / -1; }
  [data-ui].context { position: static; margin-top: 3rem; }

  .digest-pin { grid-column: 1 / -1; position: static; }
  .digest-states { grid-column: 1 / -1; margin-top: 2.5rem; display: grid; gap: 3rem; }
  .state { min-height: 0; }
  .js .state { opacity: 1; }

  .field-text { grid-column: 1 / span 9; }
  .phrase { font-size: 13vw; }
  .field { min-height: 46svh; }
  [data-ui] .router-side { grid-template-columns: 1fr 1fr; }
  .field-mirror .field-text { grid-column: 4 / span 9; }

  .faq-row h3, .faq-heading { grid-column: 1 / span 5; }
  .faq-row p { grid-column: 7 / span 6; }

  .foot-notes { grid-column: 1 / span 9; grid-template-columns: 1fr; gap: 0.8rem; }
  .foot-back { grid-column: 10 / span 3; }
  .foot-meta nav { grid-column: 1 / -1; }
  .foot-meta .credits { grid-column: 1 / span 8; margin-top: 1rem; }
  .foot-year { grid-column: 9 / span 4; margin-top: 1rem; }
}

@media (max-width: 640px) {
  :root { --section: 4.5rem; }
  .js .hero { height: calc(100svh + 3 * 34svh); }
  .bar-links { gap: 1rem; }

  .head { font-size: clamp(2.4rem, 11vw, 3.25rem); }
  [data-ui] .router-line { font-size: 11vw; }
  [data-ui] .router-body { margin-top: 1.75rem; }
  [data-ui] .router-side { grid-template-columns: 1fr; gap: 2rem; }
  [data-ui] .router-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  [data-ui] .router-examples p { width: 100%; margin-bottom: 0.1rem; }
  [data-ui] .router-examples button { min-height: 2.75rem; padding: 0.5rem 0.8rem; background: var(--surface); border-radius: 4px; text-decoration: none; }

  .day h2 { margin-bottom: 2rem; }
  .day-bar { flex-direction: column; min-height: 70svh; }
  .seg { flex: calc(var(--grow) + 1.5) 1 auto; min-width: 0; min-height: 4.5rem; display: block; position: relative; border-radius: 4px; overflow: hidden; }
  .seg-fill { position: static; overflow: visible; border-radius: 0; background: none !important; }
  .seg-fill img { z-index: 0; opacity: 0.55; object-position: 70% 50%; }
  .seg-time { padding: 0.9rem 1rem 0.2rem; z-index: 1; }
  .seg-clause { position: relative; z-index: 1; padding: 0 1rem 0.9rem; max-width: 34ch; }
  .seg-morning { background: #d3d8df; }
  .seg-digest { background: var(--accent); }
  .seg-day { background: var(--paper); }
  .seg-night { background: #07080b; }
  .seg-digest .seg-clause, .seg-night .seg-clause { color: #fff; }

  .notes { grid-template-columns: 1fr; gap: 1.1rem; margin-top: 2rem; }

  .field { min-height: 46svh; grid-template-columns: 1fr; padding: 1.5rem 1.5rem 1.75rem; }
  .field-text, .field-mirror .field-text { grid-column: 1; width: 86%; }
  .field-mirror .field-text { justify-self: end; text-align: right; }
  .phrase { font-size: clamp(2.5rem, 12.4vw, 7rem); }
  .field-mirror .phrase { text-align: left; }

  .faq-row { display: block; }
  .faq-row + .faq-row { margin-top: 2.75rem; }
  .faq-row p { margin-top: 0.75rem; }

  .foot { min-height: 64svh; padding-top: 1.5rem; }
  .foot-top { display: block; }
  .foot-notes { display: grid; gap: 0.8rem; }
  .foot-back { display: inline-block; margin-top: 1rem; }
  .foot-meta { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
  .foot-meta .credits, .foot-year { grid-column: 1; margin-top: 0; justify-self: start; text-align: left; }
}
