/* ============================================================
   Carrierfile Castle demo · ink style
   Palette and type follow the castle ink sheet: cream paper,
   black ink, one accent (cobalt). System and local fonts only.
   ============================================================ */

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

:root {
  --paper: #fcfcfa;
  --paper-soft: #f2f3f1;
  --paper-clear: #ffffff;
  --ink: #191919;
  --ink-soft: #555650;
  --ink-faint: #777970;
  --hair: rgba(25, 25, 25, 0.18);
  --hair-strong: rgba(25, 25, 25, 0.42);
  --accent: #2b3fa8;
  --accent-wash: rgba(43, 63, 168, 0.08);
  --rule: rgba(43, 63, 168, 0.045);
  --wash-soft: #eef0f8;
  --radius: 8px;
  --radius-card: 14px;

  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-read: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-hand: Noteworthy, 'Bradley Hand', 'Segoe Print', 'Chalkboard SE', cursive;

  --wrap: 1280px;
  --pad: clamp(20px, 4vw, 48px);
  --bar: 56px;
  --sec-pad: clamp(28px, 5.2vh, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px),
    var(--paper);
  line-height: 1.5;
  font-size: 16px;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0 0 .75em; }

.mono { font-family: var(--font-display); letter-spacing: .02em; }
.small { font-size: 13px; }
.muted { color: var(--ink-faint); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50;
}
.skip:focus { left: 8px; }

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

/* ---------- buttons, chips ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .03em;
  padding: 12px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-clear);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), background .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--paper-soft); }
.btn.small { padding: 8px 14px; font-size: 12px; }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.chip, .pill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 3px 9px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  background: var(--paper-clear);
  white-space: nowrap;
}
.chip-on, .pill-on { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.pill-warn { border-style: dashed; border-color: var(--ink); }

.paper {
  background: var(--paper-clear);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--bar);
  padding: 0 var(--pad);
  background: rgba(252, 252, 250, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hair);
}
.wordmark { font-family: var(--font-display); font-weight: 600; text-decoration: none; letter-spacing: .01em; }
.topnav { display: flex; gap: 22px; font-family: var(--font-display); font-size: 13px; }
.topnav a { text-decoration: none; color: var(--ink-soft); }
.topnav a:hover { color: var(--accent); }

/* ---------- sections as slides ----------
   Each section is two slides, each one screen tall under the top bar:
   a header slide that introduces the idea, then the demo slide, where the
   title docks small above the demo. */

html { scroll-snap-type: y proximity; }

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--sec-pad) var(--pad);
  min-height: calc(100vh - var(--bar));
  scroll-snap-align: start;
}
.section { position: relative; }
.slide {
  min-height: calc(100vh - var(--bar));
  padding: var(--sec-pad) max(var(--pad), calc((100% - var(--wrap)) / 2 + var(--pad)));
  scroll-snap-align: start;
}

/* header slide: open paper, no ruled lines, one soft wash of colour */
.slide-head {
  position: relative;
  display: flex; align-items: center;
  overflow: hidden;
  background:
    radial-gradient(34% 42% at 79% 40%, rgba(43, 63, 168, .12), transparent 72%),
    radial-gradient(24% 30% at 68% 62%, rgba(43, 63, 168, .07), transparent 70%),
    radial-gradient(20% 24% at 89% 72%, rgba(214, 178, 92, .12), transparent 70%),
    var(--paper);
}
.slide-head .section-head { position: relative; max-width: 1000px; transform-origin: 0 50%; }
.slide-head .eyebrow { display: flex; align-items: center; gap: 14px; font-size: 13px; margin-bottom: clamp(18px, 3vh, 28px); }
/* the one line on the slide: a short ink stroke before the eyebrow */
.slide-head .eyebrow::before { content: ""; width: 44px; height: 1.5px; background: var(--accent); }
.slide-head h2 {
  font-size: clamp(44px, 5.4vw, 80px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 19ch;
  text-wrap: balance;
  margin: 0 0 clamp(20px, 3.6vh, 34px);
}
.lede { font-family: var(--font-read); font-size: 19px; line-height: 1.48; color: var(--ink-soft); text-wrap: pretty; }
.slide-head .lede { font-size: clamp(19px, 1.55vw, 23px); line-height: 1.45; max-width: 50ch; margin-bottom: .6em; }
.slide-head .lede:last-child { margin-bottom: 0; }

/* demo slide: the title docks small, the demo gets the room. Top-anchored
   (not centred) so switching rooms or build steps never shifts the slide. */
.slide-demo { padding-top: clamp(26px, 6.4vh, 64px); }
.dock { display: flex; align-items: baseline; gap: 18px; margin: 0 0 clamp(18px, 3.4vh, 32px); transform-origin: 0 50%; }
.dock .eyebrow { margin: 0; flex: none; }
.dock-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 1.6vw, 23px); letter-spacing: -0.01em; line-height: 1.2; }

/* ---------- motion for the slides ----------
   Only active once the script adds .reveal-on to <html> (never under reduced
   motion), so nothing is hidden when JS is off or fails. */

@media (prefers-reduced-motion: no-preference) {
  /* header slide: eyebrow, then the headline word by word, then the lede */
  .reveal-on .slide-head:not(.is-in) .section-head > :not(h2) { opacity: 0; }
  .reveal-on .slide-head .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
  .reveal-on .slide-head .wi { display: inline-block; }
  .reveal-on .slide-head:not(.is-in) .wi { transform: translateY(108%); }
  .reveal-on .slide-head.is-in .eyebrow { animation: rv-rise .6s var(--ease) backwards; }
  .reveal-on .slide-head.is-in .wi { animation: word-up .7s var(--ease) backwards; animation-delay: calc(.14s + var(--i, 0) * .045s); }
  .reveal-on .slide-head.is-in .lede { animation: rv-rise .7s var(--ease) .62s backwards; }
  .reveal-on .slide-head.is-in .lede + .lede { animation-delay: .74s; }

  /* demo slide: the title docks in (arriving larger, settling small), then the demo rises */
  .reveal-on .slide-demo:not(.is-in) :is(.dock, .rv-body) { opacity: 0; }
  .reveal-on .slide-demo.is-in .dock { animation: dock-in .75s var(--ease) backwards; }
  .reveal-on .slide-demo.is-in .rv-body { animation: rv-body .9s var(--ease) .28s backwards; }

  /* hero: headline first, then the drawing */
  .reveal-on .hero:not(.is-in) :is(.rv-head > *, .rv-body) { opacity: 0; }
  .reveal-on .hero.is-in .rv-head > * { animation: rv-rise .8s var(--ease) backwards; }
  .reveal-on .hero.is-in .rv-head > :nth-child(2) { animation-delay: .08s; }
  .reveal-on .hero.is-in .rv-head > :nth-child(3) { animation-delay: .3s; }
  .reveal-on .hero.is-in .rv-head > :nth-child(n+4) { animation-delay: .38s; }
  .reveal-on .hero.is-in .rv-body { animation: rv-body 1s var(--ease) .45s backwards; }
}

/* as you scroll on, the big header shrinks and fades toward the demo
   (scroll-linked where the browser supports it; otherwise it simply scrolls) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .slide-head .section-head {
      animation: head-exit linear both;
      animation-timeline: view();
      animation-range: exit 5% exit 85%;
    }
  }
}

@keyframes rv-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rv-body { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes word-up { from { transform: translateY(108%); } to { transform: none; } }
@keyframes dock-in { from { opacity: 0; transform: translateY(-18px) scale(1.5); } to { opacity: 1; transform: none; } }
@keyframes head-exit { to { opacity: .1; transform: translateY(-4vh) scale(.78); } }

/* ---------- 1 hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  align-content: center;
}
.hero h1 { font-size: clamp(40px, 5.4vw, 68px); letter-spacing: -0.03em; margin-bottom: 20px; }
.hero-line { font-family: var(--font-read); font-size: clamp(22px, 2.2vw, 27px); line-height: 1.35; margin-bottom: 18px; }
.hero-sub { color: var(--ink-soft); max-width: 44ch; margin-bottom: 28px; }

.hero-art { margin: 0; }
.hero-frame {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}
.hero-frame img { width: 100%; height: auto; }
.hero-art figcaption { margin-top: 16px; font-size: 14px; color: var(--ink-soft); }

/* ---------- 2 map ---------- */

.map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.floorplan {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(124px, 18.5vh, 176px);
  gap: 1.5px;
  border: 3px solid var(--ink);
  background: var(--ink);
}
.room {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 12px;
  border: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(25,25,25,.035) 23px 24px),
    var(--paper-clear);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .04em;
  transition: background .2s;
}
.room svg { width: 48px; height: 48px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.room:hover svg { transform: translateY(-3px); }
/* the plan's lines are the ink showing through the grid gaps, so every room
   fill must be opaque: a translucent wash would read as near-black */
.room:hover { background: repeating-linear-gradient(90deg, transparent 0 23px, rgba(25,25,25,.035) 23px 24px), #f6f7fb; }
.room[aria-selected="true"] { background: var(--wash-soft); }
.room:focus-visible { outline: 2px solid var(--accent); outline-offset: -5px; }
.room[aria-selected="true"] svg { stroke: var(--accent); }
.room[aria-selected="true"] span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.r-hearth .flame { fill: var(--paper-soft); }
.room[aria-selected="true"] .flame { fill: rgba(43,63,168,.15); }

/* little gaps in the walls, like doorways on a plan */
.door { display: none; }
.door-a { left: calc(33.333% - 2px); top: 22%; width: 4px; height: 36px; }
.door-b { left: calc(66.666% - 2px); top: 45%; width: 4px; height: 36px; }
.door-c { left: calc(33.333% - 2px); bottom: 12%; width: 4px; height: 36px; }

.room-panel {
  align-self: stretch;
  padding: 26px 28px;
  background: var(--paper-clear);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}
.room-panel [data-f="kicker"] { font-family: var(--font-display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.room-panel [data-f="name"] { font-size: 24px; margin-bottom: 10px; }
.room-panel [data-f="what"] { font-family: var(--font-read); font-size: 17px; line-height: 1.45; color: var(--ink-soft); margin-bottom: 0; }
.room-panel [data-f="artifact"] { margin: 16px 0; }
/* inside the panel nothing gets a frame of its own: soft fills, one hairline */
.split { margin: 0; padding-top: 14px; border-top: 1px solid var(--hair); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split dt { font-family: var(--font-display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.split > div + div dt { color: var(--accent); }
.split dd { margin: 0; font-size: 14px; line-height: 1.45; }
.room-panel.swap { animation: rise .35s var(--ease); }

.art-fire, .art-audio { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--paper-soft); }
.art-fire p, .art-audio p { margin: 0 0 4px; }
.dot-live { flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); display: inline-block; }
.art-note { padding: 18px 20px; background: var(--paper); border: 1px solid var(--hair-strong); transform: rotate(-1deg); box-shadow: 2px 3px 0 var(--hair); font-family: var(--font-read); font-size: 17px; }
.art-note .sig { text-align: right; margin: 0; }
.hand { font-family: var(--font-hand); }
.art-log, .file-view {
  margin: 0; padding: 16px; font-family: var(--font-display); font-size: 12.5px; line-height: 1.6;
  background: var(--paper-soft); border: 0; border-radius: var(--radius);
  white-space: pre-wrap; overflow-x: auto;
}
.play-dot { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper-clear); font-size: 11px; }
.wave { display: flex; gap: 3px; align-items: center; height: 24px; margin-top: 8px; }
.wave i { width: 3px; background: var(--ink); border-radius: 2px; height: 40%; }
.wave i:nth-child(3n) { height: 85%; } .wave i:nth-child(4n) { height: 60%; } .wave i:nth-child(5n) { height: 25%; }
.play-dot[data-audio] { cursor: pointer; }
.play-dot[data-audio]:hover { background: var(--accent-wash); }
.art-audio.playing .wave i { animation: wavebar 1s ease-in-out infinite alternate; transform-origin: center; }
.art-audio.playing .wave i:nth-child(2n) { animation-delay: -.3s; } .art-audio.playing .wave i:nth-child(3n) { animation-delay: -.6s; }
@keyframes wavebar { from { transform: scaleY(.45); } to { transform: scaleY(1.15); } }
@media (prefers-reduced-motion: reduce) { .art-audio.playing .wave i { animation: none; } }
.art-lesson { padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--paper-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.art-lesson p { margin-bottom: 6px; }
/* a small hearth flame: two ink tongues that flicker */
.flicker { flex: none; position: relative; width: 22px; height: 28px; margin-top: 1px; }
.flicker::before, .flicker i {
  content: ""; position: absolute; left: 50%; bottom: 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  transform-origin: 50% 100%;
}
.flicker::before { width: 18px; height: 26px; margin-left: -9px; background: rgba(43,63,168,.16); border: 1.5px solid var(--accent); animation: flick 1.6s ease-in-out infinite; }
.flicker i { width: 8px; height: 13px; margin-left: -4px; bottom: 2px; background: var(--accent); animation: flick 1.1s ease-in-out infinite reverse; }
@keyframes flick { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 30% { transform: scale(.94, 1.08) rotate(2deg); } 60% { transform: scale(1.04, .93) rotate(-1deg); } }

.art-draft, .art-edition, .art-room, .art-private { padding: 14px 18px; background: var(--paper-soft); border-radius: var(--radius); }
.art-draft .draft-line { font-family: var(--font-read); font-size: 18px; margin-bottom: 10px; }
.art-draft del { color: var(--ink-faint); text-decoration-thickness: 1.5px; }
.art-draft ins { text-decoration: none; color: var(--accent); background: var(--accent-wash); padding: 0 3px; border-radius: 3px; }
.art-draft .draft-note { margin: 0; padding-top: 10px; border-top: 1px dashed rgba(25,25,25,.22); font-size: 14px; color: var(--ink-soft); }
.art-draft .draft-note .mono { color: var(--accent); margin-right: 6px; }
.ed-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(25,25,25,.09); font-size: 14.5px; }
.ed-row .mono { color: var(--ink-faint); }
.art-edition .ed-row { justify-content: flex-start; }
.art-room .ed-row:first-of-type, .art-edition .ed-row:first-of-type { border-top: 0; }
.ed-loud { font-weight: 600; }
.ed-loud .mono { color: var(--accent); }
.art-edition .ed-row > .mono { min-width: 84px; }
.art-room .ed-row > .mono:first-child { min-width: 84px; }
.art-room .ed-row:has(> .mono:first-child) { justify-content: flex-start; }
.art-private { display: flex; gap: 12px; align-items: center; }
.art-private svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-soft); stroke-width: 1.6; flex: none; }
.art-private p { margin: 0; color: var(--ink-soft); }

/* ---------- 3 team ---------- */

.team-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2.2vh, 20px) 20px;
}
.agent {
  display: flex; flex-direction: column;
  padding: clamp(18px, 2.6vh, 24px) 24px;
  background: var(--paper-clear);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.agent:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.agent-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.agent h3 { font-size: 19px; margin-bottom: 2px; }
.agent > p { font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
.agent .small { color: var(--ink-soft); margin: 0; }
.mono-badge {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  background: var(--paper);
}
.agent:first-child .mono-badge { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.agent blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 2px solid var(--accent); font-family: var(--font-read); font-style: italic; font-size: 16.5px; line-height: 1.4; color: var(--ink-soft); }
.where { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.where-label { font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-right: 2px; }
.where button, .where span:not(.where-label) {
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: .02em;
  padding: 4px 10px; border: 1px solid var(--hair-strong); border-radius: 999px; background: var(--paper);
}
.where button { cursor: pointer; border-style: dashed; border-color: var(--ink); }
.where button::after { content: " ↗"; color: var(--ink-faint); }
.where button:hover { background: var(--accent-wash); border-color: var(--accent); }

/* ---------- 4 build ---------- */


.build { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
/* one continuous line threads the step numbers */
.steps::before { content: ""; position: absolute; left: 27px; top: 22px; bottom: 22px; border-left: 1.5px solid var(--hair); }
.steps li { position: relative; }
.steps button {
  position: relative;
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left;
  padding: 8px 12px 8px 12px; margin-bottom: 4px;
  border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: 14.5px; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.steps button:hover { background: var(--paper-soft); color: var(--ink); }
.steps button .mono {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--hair-strong); background: var(--paper-clear);
  font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.steps button.done { color: var(--ink); }
.steps button.done .mono { border-color: var(--ink); color: var(--ink); }
.steps button.done .mono::after { content: "✓"; position: absolute; left: 34px; top: 6px; font-size: 10px; color: var(--accent); }
.steps button[aria-selected="true"] { background: var(--accent-wash); color: var(--ink); font-weight: 500; }
.steps button[aria-selected="true"] .mono { border-color: var(--accent); background: var(--accent); color: var(--paper); }

.stage { min-width: 0; }
.progress { height: 3px; background: var(--hair); border-radius: 2px; margin: 0 0 18px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 16.66%; background: var(--accent); transition: width .5s var(--ease); }

.screen { min-height: 404px; }
.screen:not([hidden]) { animation: rise .45s var(--ease); }
.caption { font-family: var(--font-read); font-size: 18px; line-height: 1.45; color: var(--ink-soft); margin-bottom: 16px; }
.caption strong { color: var(--ink); font-weight: 600; }

/* player controls live under the step list: play on top, back and next below */
.build-nav { min-width: 0; }
.stage-controls { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "play play" "prev next"; gap: 8px; margin-top: 22px; }
.stage-controls .btn { justify-content: center; padding: 10px 14px; }
.stage-controls #play { grid-area: play; }
.stage-controls #prev { grid-area: prev; }
.stage-controls #next { grid-area: next; }

/* 01 sketch */
.sketch {
  position: relative;
  display: grid; grid-template-columns: 1.2fr .8fr 1.2fr; gap: 28px;
  padding: 30px 32px 60px;
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper-clear);
}
.sk-box { padding: 16px; border: 1.8px dashed var(--ink); border-radius: 14px 6px 12px 8px; min-height: 170px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sk-1 { transform: rotate(-1.2deg); }
.sk-2 { transform: rotate(1deg); margin-top: 28px; }
.sk-3 { transform: rotate(-.6deg); }
.sk-box .hand { font-size: 20px; margin: 0 0 4px; }
.sk-box .hand.small { font-size: 15px; color: var(--ink-soft); }
.sk-chip { font-family: var(--font-hand); font-size: 15px; padding: 2px 10px; border: 1.5px solid var(--ink); border-radius: 10px 14px 8px 12px; }
.sk-note { position: absolute; left: 32px; bottom: 18px; margin: 0; font-size: 16px; color: var(--accent); }

/* 02 doc */
.doc { padding: 24px 32px; max-width: 760px; }
.doc h4 { font-size: 21px; margin: 4px 0 12px; }
.doc p { font-family: var(--font-read); font-size: 16.5px; line-height: 1.45; margin-bottom: .5em; }
.doc-dw { margin-top: 14px; color: var(--accent); }
.doc .checklist li { padding: 5px 0 5px 30px; }
.doc .checklist li::before { top: 7px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 7px 0 7px 30px; border-bottom: 1px solid var(--hair); font-size: 15px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 9px; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; }
.checklist.checked li::after { content: "✓"; position: absolute; left: 3px; top: 5px; font-size: 14px; color: var(--accent); font-weight: 700; }
.checklist li.fail { text-decoration: line-through; text-decoration-color: var(--ink); }
.checklist.checked li.fail::after { content: "✕"; color: var(--ink); }

/* 03 queue */
.queue { padding: 8px 0; max-width: 760px; }
.q-head, .q-row { display: grid; grid-template-columns: 1fr 90px 110px; gap: 12px; padding: 12px 24px; align-items: center; }
.q-head { color: var(--ink-faint); border-bottom: 1.5px solid var(--ink); }
.q-row { border-bottom: 1px solid var(--hair); font-size: 15px; }
.q-row:last-child { border-bottom: 0; }
.q-row .pill { justify-self: start; }
.q-new { background: var(--accent-wash); }
.st-shipped { background: #e3efe2; border-color: #7fa37a; color: #2f5a2a; }
.st-review { background: #fbf0c9; border-color: #c9a83f; color: #6b5414; }
.st-queued, .st-waiting { background: var(--paper-soft); border-color: var(--hair-strong); color: var(--ink-soft); }
.screen:not([hidden]) .q-new { animation: slidein .6s var(--ease) .15s both; }

/* 04 term */
.term { padding: 22px 28px; max-width: 760px; }
.term-lines { list-style: none; margin: 0; padding: 0; font-family: var(--font-display); font-size: 14px; line-height: 1.95; }
.term-lines li .mono { display: inline-block; width: 58px; color: var(--accent); }
.term-lines li b { color: var(--accent); font-weight: 700; }
.term-lines li:last-child { border-top: 1px dashed var(--hair-strong); margin-top: 6px; padding-top: 6px; }
.term.typing .term-lines li { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.term.typing .term-lines li.on { opacity: 1; transform: none; }

/* 05 verdict */
.verdict { position: relative; padding: 24px 32px; max-width: 760px; }
.verdict .checklist { max-width: 360px; margin-bottom: 18px; }
.stamp {
  position: absolute; right: 56px; top: 44px;
  padding: 6px; border: 3px solid var(--accent); border-radius: 10px;
  transform: rotate(-9deg);
  color: var(--accent);
}
.stamp span { display: block; padding: 6px 18px; border: 1.5px solid currentColor; border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 38px; letter-spacing: .12em; }
.screen:not([hidden]) .stamp { animation: stamp .5s var(--ease) .35s both; }
/* reviewer ticks: each item checks off in turn, the stamp lands after the last */
#verdict-list li::after { opacity: 0; transform: scale(.3); transition: opacity .25s var(--ease), transform .3s var(--ease); }
#verdict-list li.on::after { opacity: 1; transform: none; }
#verdict-list li.on { background: linear-gradient(90deg, var(--accent-wash), transparent 70%); transition: background .4s; }
.screen:not([hidden]) #verdict-list ~ .stamp { animation-delay: 3.4s; }
@media (prefers-reduced-motion: reduce) { #verdict-list li::after { opacity: 1; transform: none; transition: none; } .screen:not([hidden]) #verdict-list ~ .stamp { animation-delay: 0s; } }
.stamp.fail { color: var(--ink); border-color: var(--ink); }
.verdict-note { font-family: var(--font-read); font-size: 18px; font-style: italic; }

/* 06 shipped */
.shipped { padding: 24px; }
.devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 12px; }
.device { padding: 16px; border: 0; border-radius: var(--radius); background: var(--paper-soft); display: flex; flex-direction: column; gap: 6px; }
.d-name { display: flex; gap: 8px; align-items: center; font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.d-name svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.d-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; padding: 6px 0; border-top: 1px solid rgba(25,25,25,.09); }
.toggle { width: 30px; height: 17px; border-radius: 999px; border: 1.5px solid var(--ink); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { left: auto; right: 2px; background: var(--paper); }
.copy {
  margin-top: auto; align-self: flex-start;
  font-family: var(--font-display); font-size: 12px; padding: 6px 12px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper-clear); cursor: pointer;
}
.copy.copied { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* ---------- 5 arrival ---------- */

.arrival { display: grid; grid-template-columns: minmax(0, 820px) auto; gap: 32px; align-items: end; }
.arrival-actions { margin: 0; }

.chat { overflow: hidden; }
.chat-bar { display: flex; gap: 10px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--hair); background: var(--paper-soft); }
.chat-bar .dot-live { margin: 0; }
.chat-lines { list-style: none; margin: 0; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.msg { max-width: 86%; }
.msg p { margin: 0; }
.msg .who { display: block; font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.msg.me { align-self: flex-end; text-align: right; }
.msg.me p { display: inline-block; text-align: left; padding: 10px 16px; border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--paper); }
.msg.cal p { padding: 11px 16px; border-radius: 16px 16px 16px 4px; background: var(--wash-soft); font-family: var(--font-read); font-size: 17.5px; line-height: 1.42; }
.msg.sys { align-self: flex-start; font-family: var(--font-display); font-size: 12.5px; color: var(--ink-soft); margin: -3px 0; }
.msg.sys p::before { content: "· "; color: var(--accent); }
.chat.playing .msg { opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.chat.playing .msg.on { opacity: 1; transform: none; }

/* ---------- 6 care ---------- */

.care-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.care-grid { grid-template-rows: auto auto; }
.care-card { grid-row: span 2; display: grid; grid-template-rows: subgrid; row-gap: 0; padding: 22px 24px 24px; background: var(--paper-clear); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.care-main { display: flex; flex-direction: column; padding-bottom: 18px; }
.care-card .eyebrow { margin-bottom: 8px; }
.care-card h3 { font-size: 19px; margin-bottom: 8px; text-wrap: balance; }
.care-main > p:not(.eyebrow):not(.care-note) { font-size: 15px; line-height: 1.45; color: var(--ink-soft); margin-bottom: 0; }

.checkpoint { padding-top: 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
.checkpoint > .cp-status, .checkpoint > .cp-list, .checkpoint > .receipt { grid-column: 1 / -1; }
.cp-status { margin: 0; color: var(--ink-soft); }
.cp-status.ok { color: var(--accent); }
.cp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 13px; line-height: 1.35; }
.cp-list li { position: relative; padding-left: 20px; color: var(--ink-faint); }
.cp-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 11px; height: 11px; border: 1.3px solid var(--hair-strong); border-radius: 50%; }
.cp-list li.pass { color: var(--ink); }
.cp-list li.pass::before { background: var(--accent); border-color: var(--accent); }
.cp-count { font-size: 26px; font-weight: 600; margin: 0; grid-row: 3; grid-column: 1; }
.checkpoint > .btn { grid-row: 3; grid-column: 2; }
.receipt {
  padding: 10px 14px;
  background: var(--paper-soft);
  border: 1.5px dashed var(--ink);
  border-radius: 4px;
  font-size: 14px;
}
.receipt p { margin: 0 0 2px; }
/* the receipt keeps its space while hidden, so the card never jumps */
.receipt { visibility: hidden; opacity: 0; }
.receipt.shown { visibility: visible; opacity: 1; animation: rise .4s var(--ease); }
.checkpoint .btn { justify-self: end; }

.gauge { margin: 14px auto 12px; width: clamp(132px, 17.5vh, 172px); }
.gauge svg { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.gauge .arc { stroke-width: 3; }
.gauge .needle { transform-origin: 100px 100px; transform: rotate(-62deg); transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.gauge .needle circle { fill: var(--ink); }
.gauge .needle path { stroke: var(--accent); stroke-width: 3; }
/* the four sounds sit in one row, like the dial's scale */
.seg { display: flex; gap: 5px; margin-bottom: 12px; }
.seg button {
  flex: 1 1 auto; white-space: nowrap;
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0; padding: 7px 8px;
  border: 1.5px solid var(--hair-strong); border-radius: 999px; background: var(--paper-clear); cursor: pointer;
}
.seg button[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.clank-say { font-family: var(--font-read); font-size: 16.5px; line-height: 1.42; min-height: 4.3em; }
.clank-say p { margin: 0; }
.care-note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-faint); }
/* four sounds, four motions, rising in severity */
.gauge svg, .gauge .arc, .gauge .tick { transition: opacity .8s var(--ease); }
.gauge .needle path { transform-origin: 100px 100px; }
.gauge.m-good .needle { transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.gauge.m-rattle .needle { transition: transform .5s cubic-bezier(.3, 1.2, .5, 1); }
.gauge.m-rattle .needle path { animation: rattle .09s linear .45s 6; }
.gauge.m-clank .needle { transition: transform .32s cubic-bezier(.3, 1.7, .5, 1); }
.gauge.m-clank svg { animation: knock .42s cubic-bezier(.3, .8, .4, 1) .22s; }
.gauge.m-breakdown .needle { transition: transform .26s cubic-bezier(.7, 0, .9, .5); }
.gauge.m-breakdown .needle path { animation: stall 2.2s ease-in-out .3s; }
.gauge.m-breakdown .arc, .gauge.m-breakdown .tick { opacity: .38; }
@keyframes rattle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes knock { 0%, 100% { transform: none; } 18% { transform: translate(-4px, 1px) rotate(-1.6deg); } 40% { transform: translate(3px, 0) rotate(1deg); } 64% { transform: translateX(-1px); } }
@keyframes stall { 0%, 100% { transform: rotate(0); } 12% { transform: rotate(-5deg); } 30% { transform: rotate(1.5deg); } 55% { transform: rotate(-2.5deg); } 80% { transform: rotate(.6deg); } }

.files { display: grid; grid-template-columns: 1fr; gap: 10px; padding-top: 18px; }
.tree { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tree button {
  font-family: var(--font-display); font-size: 12px; padding: 5px 10px;
  border: 1.5px solid var(--hair-strong); border-radius: 999px; background: var(--paper-clear); cursor: pointer;
}
.tree button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.file-view { min-height: 108px; }
.readers { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }

/* "why we have it" strip under each care card */
.why { margin: 0 -24px -24px; padding: 16px 24px 20px; border-top: 1px solid var(--hair); background: var(--wash-soft); border-radius: 0 0 calc(var(--radius) - 1.5px) calc(var(--radius) - 1.5px); }
.why-label { font-family: var(--font-display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.why-label strong { color: var(--accent); font-weight: 600; }
.why p:last-child { margin: 0; font-family: var(--font-read); font-size: 16px; line-height: 1.42; color: var(--ink); }

/* ---------- 7 stack ---------- */

.stack { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
/* a matched pair: same radius, same padding, no border; the wash does the grouping */
.stack-card { padding: clamp(24px, 3.4vh, 34px) 34px; border-radius: var(--radius-card); }
.stack-tools { background: var(--wash-soft); }
.stack-lessons { background: var(--paper-clear); box-shadow: 0 0 0 1px var(--hair) inset; }
.stack-card > .eyebrow { margin-bottom: 18px; }
.stack-list { margin: 0; display: grid; gap: clamp(12px, 2vh, 18px); }
.stack-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; }
.stack-list dt { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--accent); padding-top: 1px; }
.stack-list dd { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.45; }
.lessons { list-style: none; counter-reset: l; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2.4vh, 22px); }
.lessons li { counter-increment: l; position: relative; padding: 0 0 0 46px; }
.lessons li::before {
  content: counter(l); position: absolute; left: 0; top: -3px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  font-family: var(--font-display); font-size: 13px;
}
.lessons h3 { font-size: 17px; margin-bottom: 6px; }
.lessons p { font-family: var(--font-read); font-size: 17px; line-height: 1.42; color: var(--ink-soft); margin: 0; }

/* ---------- 8 footer ---------- */

.footer {
  background: var(--ink); color: var(--paper);
  padding: clamp(56px, 8vw, 96px) var(--pad);
  text-align: center;
}
.foot-line { font-family: var(--font-read); font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 22px; }
/* the closing moment: one matched pair of pills, then quiet text links */
.foot-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 0 0 34px; }
.footer .btn { padding: 13px 24px; }
.btn-paper { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn-paper:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-outline-paper { background: transparent; border-color: var(--paper); color: var(--paper); }
.btn-outline-paper:hover { background: var(--paper); color: var(--ink); }
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin: 0 0 18px; }
.foot-links a {
  font-family: var(--font-display); font-size: 13px; color: #d6d7d1;
  text-decoration: underline; text-decoration-color: rgba(252, 252, 250, .35); text-underline-offset: 4px;
}
.foot-links a:hover { color: var(--paper); text-decoration-color: var(--paper); }
.foot-copy { margin: 0; font-family: var(--font-display); font-size: 12px; letter-spacing: .04em; color: #8e8f89; }

/* (reveal motion lives with the slides, above) */

/* shorter laptop screens (1280x800 and the like): same layout, tighter */
@media (max-height: 860px) and (min-width: 761px) {
  :root { --sec-pad: 32px; }
  .slide-demo { padding-top: clamp(22px, 4vh, 40px); }
  .dock { margin-bottom: 20px; }
  .slide-head h2 { font-size: clamp(42px, 5vw, 68px); }
  .slide-head .lede { font-size: 19px; }
  .hero h1 { font-size: clamp(40px, 4.8vw, 60px); }
  .agent > p { font-size: 14.5px; margin-bottom: 8px; }
  .agent blockquote { font-size: 15.5px; margin-bottom: 10px; }
  .agent-top { margin-bottom: 10px; }
  .room-panel { padding: 22px 24px; }
  .room-panel [data-f="what"] { font-size: 16px; }
  .room-panel [data-f="artifact"] { margin: 12px 0; }
  .split { padding-top: 10px; }
  .split dd { font-size: 13.5px; }
  .caption { font-size: 17px; margin-bottom: 12px; }
  .screen { min-height: 372px; }
  .doc { padding: 18px 28px; }
  .doc p { font-size: 15.5px; }
  .doc h4 { font-size: 19px; margin-bottom: 8px; }
  .doc .checklist li { padding: 3px 0 3px 30px; font-size: 14px; }
  .doc .checklist li::before { top: 5px; }
  .sketch { padding: 24px 28px 54px; }
  .sk-box { min-height: 150px; }
  .chat-lines { padding: 16px 22px 20px; gap: 8px; }
  .msg.cal p { font-size: 16.5px; padding: 9px 14px; }
  .msg.me p { padding: 8px 14px; }
  .care-main > p:not(.eyebrow):not(.care-note) { font-size: 14.5px; }
  .why p:last-child { font-size: 15px; }
  .why { padding: 12px 22px 14px; margin: 0 -22px -20px; }
  .care-card { padding: 18px 22px 20px; }
  .care-main { padding-bottom: 14px; }
  .care-card h3 { font-size: 18px; }
  .care-note { font-size: 12.5px; margin-top: 8px; }
  .seg { margin-bottom: 8px; }
  .clank-say { font-size: 15.5px; }
  .file-view { min-height: 100px; padding: 12px 14px; font-size: 12px; }
  .lessons p { font-size: 16px; }
  .stack-list dd { font-size: 14.5px; }
}

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

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-9deg) scale(1.8); } 70% { opacity: 1; transform: rotate(-9deg) scale(.95); } 100% { opacity: 1; transform: rotate(-9deg) scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px) rotate(-1deg); } 40% { transform: translateX(3px) rotate(1deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .team-grid, .care-grid { grid-template-columns: 1fr 1fr; }
  .devices { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topnav { display: none; }
  .hero, .map-wrap, .arrival, .stack, .build { grid-template-columns: 1fr; }
  .hero, .slide { min-height: 0; }
  .dock { flex-direction: column; gap: 4px; }
  .hero-copy { order: 1; }
  .hero-art { order: 2; }
  .lede { font-size: 18px; }

  .floorplan { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(118px, auto); }
  .room { font-size: 12px; }
  .room svg { width: 40px; height: 40px; }
  .door-c { display: none; }
  .split { grid-template-columns: 1fr; }
  .door-a { left: calc(50% - 2px); top: 10%; height: 28px; }
  .door-b { left: calc(50% - 2px); bottom: 10%; height: 28px; }
  .room-panel { min-height: 0; padding: 22px; }

  .team-grid, .care-grid, .devices { grid-template-columns: 1fr; }

  .steps { position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .steps::before { display: none; }
  .steps button { white-space: nowrap; margin: 0; padding: 10px 12px; font-size: 13px; }
  .screen { min-height: 0; }
  .sketch { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px 64px; }
  .sk-box { min-height: 0; }
  .sk-2 { margin-top: 0; }
  .doc, .term, .verdict { padding: 22px 20px; }
  .q-head, .q-row { grid-template-columns: 1fr 50px 92px; padding: 10px 14px; font-size: 14px; }
  .stamp { position: static; display: inline-block; margin: 6px 0 14px 8px; }
  .stamp span { font-size: 30px; }
  .stage-controls .btn { padding: 10px 14px; font-size: 13px; }

  .chat-lines { min-height: 0; padding: 18px; }
  .msg { max-width: 94%; }
  .stack-list > div { grid-template-columns: 1fr; gap: 4px; }
}

@media print {
  .rv-head > *, .rv-body, .dock, .slide-head .section-head, .slide-head .section-head > *, .wi { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ---------- phone pass (2026-11-05) ----------
   Everything below sits inside max-width queries, so the desktop layout
   (1024px and up) is untouched. Rule of thumb on a phone: the controls stay
   compact so the panel they drive is on screen with them. */

@media (max-width: 760px) {
  /* slides grow with their content; no snapping to trap a tall demo */
  html { scroll-snap-type: none; }
  .hero, .slide { scroll-snap-align: none; }

  /* map: always three across, so nine rooms fill three rows with no filler cell */
  .floorplan { grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(96px, auto); }
  .door-a, .door-b, .door-c { display: none; }

  /* build player: steps, then the screen, then Back · Play · Next */
  .build { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .build-nav { display: contents; }
  .steps { order: 1; }
  .stage { order: 2; width: 100%; }
  .stage-controls { order: 3; }

  /* steps: numbers only, the current step also shows its name */
  .steps { display: flex; gap: 5px; overflow: visible; padding: 0; }
  .steps li { flex: none; }
  .steps li:has(> button[aria-selected="true"]) { flex: 1 1 0; min-width: 0; }
  .steps button { width: auto; min-height: 40px; padding: 4px 3px; gap: 8px; justify-content: center; font-size: 0; white-space: normal; }
  .steps button .mono { width: 30px; height: 30px; font-size: 11.5px; }
  .steps button.done .mono::after { left: 27px; top: 1px; }
  .steps button[aria-selected="true"] { width: 100%; justify-content: flex-start; padding: 4px 12px 4px 4px; font-size: 12.5px; line-height: 1.2; text-align: left; }

  .stage-controls { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "prev play next"; gap: 8px; margin-top: 4px; }
  .stage-controls .btn { min-height: 40px; padding: 8px 16px; font-size: 13px; }
  .stage-controls #play { background: var(--paper-clear); border-color: var(--ink); color: var(--ink); }
  .stage-controls #play:hover { background: var(--paper-soft); }
  .stage-controls #play[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
  .progress { margin-bottom: 12px; }
}

@media (max-width: 600px) {
  :root { --sec-pad: 28px; }

  /* header slides and docked titles */
  .slide-head { padding-top: 56px; padding-bottom: 48px; }
  .slide-head .eyebrow { font-size: 12px; gap: 10px; margin-bottom: 16px; }
  .slide-head .eyebrow::before { width: 28px; }
  .slide-head h2 { font-size: 36px; line-height: 1.08; letter-spacing: -0.03em; max-width: none; margin-bottom: 18px; }
  .slide-head .lede, .lede { font-size: 17px; line-height: 1.45; }
  .slide-demo { padding-top: 22px; padding-bottom: 36px; }
  .dock { gap: 2px; margin-bottom: 14px; }
  .dock .eyebrow { font-size: 11px; }
  .dock-title { font-size: 16px; }

  .hero { gap: 28px; padding-top: 32px; padding-bottom: 40px; }
  .hero h1 { font-size: 38px; margin-bottom: 14px; }
  .hero-line { font-size: 21px; }
  .hero-frame { box-shadow: 4px 4px 0 var(--ink); }

  /* map: small room buttons, about 200px for the whole plan */
  .map-wrap { gap: 14px; }
  .floorplan { grid-auto-rows: 64px; border-width: 2px; }
  .room { gap: 4px; padding: 6px 4px; font-size: 10.5px; letter-spacing: .01em; line-height: 1.15; text-align: center; }
  .room svg { width: 22px; height: 22px; stroke-width: 2.2; }
  .room:hover svg { transform: none; }
  .room[aria-selected="true"] span { text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
  .room-panel { padding: 18px; box-shadow: 3px 3px 0 var(--ink); }
  .room-panel [data-f="name"] { font-size: 20px; margin-bottom: 8px; }
  .room-panel [data-f="what"] { font-size: 16px; }
  .room-panel [data-f="artifact"] { margin: 12px 0; }
  .split { gap: 12px; }
  .play-dot { width: 36px; height: 36px; }

  /* team */
  .agent { padding: 18px; }
  .where button { min-height: 36px; display: inline-flex; align-items: center; }

  /* build screens */
  .caption { font-size: 16px; margin-bottom: 12px; }
  .doc, .term, .verdict, .shipped { padding: 18px 16px; }
  .sketch { padding: 20px 16px 64px; }
  .sk-note { left: 16px; right: 16px; }
  .term { overflow-x: auto; }
  .term-lines { font-size: 13px; line-height: 1.8; }
  .term-lines li .mono { width: 48px; }
  .q-head, .q-row { grid-template-columns: 1fr auto auto; gap: 8px; padding: 10px 12px; font-size: 13.5px; }
  .copy { min-height: 36px; }

  /* arrival */
  .chat-lines { padding: 16px 14px; }
  .msg.cal p { font-size: 16.5px; }
  .msg.sys { font-size: 13px; }

  /* care: compact controls so each card's readout stays in view */
  .care-card { padding: 18px 18px 20px; }
  .why { margin: 0 -18px -20px; padding: 14px 18px 16px; }
  .gauge { width: 128px; margin: 10px auto 10px; }
  .seg { gap: 4px; margin-bottom: 10px; }
  .seg button { min-height: 36px; padding: 6px 6px; font-size: 11.5px; }
  .tree button { min-height: 36px; padding: 6px 12px; }
  .file-view { min-height: 96px; font-size: 12.5px; }
  .checkpoint .btn.small { min-height: 38px; }
  .clank-say { font-size: 16px; min-height: 0; }

  /* stack */
  .stack-card { padding: 22px 18px; }
  .lessons li { padding-left: 40px; }

  /* footer: buttons stack, full width */
  .foot-cta { flex-direction: column; align-items: stretch; max-width: 360px; margin-left: auto; margin-right: auto; }
  .foot-cta .btn { justify-content: center; text-align: center; }
  .foot-links { flex-direction: column; gap: 12px; }
}
