/* =========================================================
   Modern Writing Lab: landing page
   Design tokens live in :root. Later pages reuse them.
   ========================================================= */
:root {
  --paper: #F3EFE6;
  --paper-2: #E8E1D2;
  --card: #FBF9F4;
  --ink: #141414;
  --ink-2: #514E48;
  --line: #141414;
  --hair: rgba(20, 20, 20, .14);

  --blue: #2340FF;      /* signal: the lab's primary color */
  --lime: #D7F64A;      /* highlight / active */
  --tang: #FF5A2C;      /* small nod to school red, used sparingly */
  --sky: #A9DBFF;
  --pink: #FFC2D1;
  --peach: #FFD3B4;
  --mint: #B8F0D6;
  --night: #111211;
  --night-2: #1C1E1C;

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-s: 10px;
  --r-m: 18px;
  --r-l: 28px;
  --gutter: 16px;
  --max: 1240px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-soft: 0 18px 40px -18px rgba(20, 20, 20, .35);
}
@media (min-width: 900px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; overflow-x: clip; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
em { font-style: normal; font-weight: inherit; }
/* the serif is a rare accent: only the wordmark and the hero's key word use it */
.hero-title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 1.1em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible { outline-color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

/* tactile press for every button that should feel physical */
.press { transition: transform .18s var(--ease-spring), box-shadow .18s var(--ease-out), background-color .2s; }
.press:active { transform: translate(2px, 2px) scale(.97); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--hair); }
.wordmark { display: inline-flex; align-items: baseline; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.03em; line-height: 1; min-height: 44px; align-items: center; }
.wm-w { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 1.12em; margin: 0 .08em 0 .12em; letter-spacing: 0; }
.wm-l { background: var(--lime); padding: .08em .2em .12em; border-radius: 6px; margin-left: .1em; }
.wm-caret { width: 3px; height: 1.05em; background: var(--blue); margin-left: 4px; align-self: center; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.topnav { display: flex; gap: 8px; }
.notes-btn, .rooms-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card);
  font-size: 14px; font-weight: 600;
  transition: transform .2s var(--ease-spring), background .2s;
}
.notes-btn:hover, .rooms-btn:hover { background: var(--lime); }
.notes-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tang); }
.notes-count { font-family: var(--f-mono); font-size: 13px; }
.notes-btn.bump { animation: bump .5s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.12) rotate(-3deg); background: var(--lime); } }
.rooms-btn { background: var(--ink); color: var(--paper); }
.rooms-btn:hover { background: var(--blue); }
.rooms-icon { display: grid; grid-template-columns: 6px 6px; gap: 2px; }
.rooms-icon i { width: 6px; height: 6px; background: currentColor; border-radius: 1.5px; }
.rooms-icon i:nth-child(2) { border-radius: 50%; }
@media (max-width: 520px) {
  .notes-label { display: none; }
  .wordmark { font-size: 18px; }
}

/* ---------- shared type ---------- */
.kicker, .placard, .pl-label, .xs-label, .fine, .meter-l, .st-gl, .pc-label, .report-l, .map-h, .room-no {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .02em;
}
.ex-title, .hero-title, .learn-title, .rooms-title {
  font-weight: 800; letter-spacing: -.035em; line-height: .98; margin: 0;
}
.ex-title em { color: var(--blue); }
.ex-title { font-size: clamp(36px, 8.6vw, 76px); max-width: 15ch; }
.ex-lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--ink-2); max-width: 46ch; margin: 18px 0 0; }
.fine { color: var(--ink-2); margin: 18px 0 0; max-width: 70ch; }
.dark .fine, .dark .ex-lede { color: #B9B6AE; }
.arrow-link { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--blue); padding-bottom: 1px; }
.arrow-link::after { content: " ↓"; }
a.arrow-link[href$=".html"]::after { content: " →"; }

/* ---------- discoverable terms ---------- */
.term {
  display: inline; padding: 0 .1em; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; font-weight: 700; letter-spacing: inherit;
  background-image: radial-gradient(circle, currentColor 1.2px, transparent 1.6px);
  background-size: 6px 4px; background-repeat: repeat-x; background-position: 0 100%;
  padding-bottom: 3px; cursor: help;
  transition: background-color .2s, color .2s;
  border-radius: 4px;
}
.term:hover, .term[aria-expanded="true"] { background-color: var(--lime); color: var(--ink); }
.term.found { background-image: none; box-shadow: inset 0 -.4em 0 color-mix(in srgb, var(--lime) 75%, transparent); }
.dark .term.found { box-shadow: inset 0 -.4em 0 color-mix(in srgb, var(--lime) 40%, transparent); }

.term-pop {
  position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px));
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-m); padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
  transform-origin: var(--tp-ox, 50%) var(--tp-oy, 0%);
  animation: unfold .35s var(--ease-spring);
}
.term-pop[hidden] { display: none; }
@keyframes unfold { from { opacity: 0; transform: scale(.85) translateY(-6px); clip-path: inset(0 0 100% 0 round 18px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 18px); } }
.tp-close { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: none; color: var(--paper); font-size: 24px; border-radius: 50%; }
.tp-split { margin: 0 0 6px; font-family: var(--f-mono); font-size: 13px; display: flex; gap: 4px; flex-wrap: wrap; }
.tp-split span { background: var(--lime); color: var(--ink); padding: 1px 6px; border-radius: 5px; animation: popin .4s var(--ease-spring) backwards; }
.tp-title { margin: 0 34px 6px 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.1; }
.tp-def { margin: 0; font-size: 16px; line-height: 1.45; }
.tp-ex { margin: 10px 0 0; font-size: 14px; color: #C9C5BC; border-left: 2px solid var(--lime); padding-left: 10px; }
.tp-ex:empty { display: none; }
.tp-new { margin: 10px 0 0; font-family: var(--f-mono); font-size: 12px; color: var(--lime); display: none; }
.tp-new.show { display: block; animation: popin .5s var(--ease-spring); }
@media (max-width: 899px) {
  .term-pop { left: 12px !important; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); top: auto !important; width: auto; transform-origin: 50% 100%; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: 28px var(--gutter) 40px;
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-direction: column;
}
@media (min-width: 900px) { .hero { min-height: calc(100svh - 64px); } }
.kicker { margin: 0 0 14px; color: var(--ink-2); }
.hero-title { font-size: clamp(42px, 10.5vw, 84px); max-width: 13ch; }
@media (min-width: 900px) { .hero-title { font-size: clamp(56px, 6vw, 84px); max-width: 20ch; } }
.hero-title em { color: var(--blue); }

.stage { position: relative; margin-top: 26px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 900px) { .stage { flex: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0;
  border: 1.5px solid var(--ink); border-radius: 16px;
  background: var(--card);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .25s var(--ease-spring), background .2s, box-shadow .2s;
  will-change: transform;
}
.chip img { width: 30px; height: 30px; display: block; pointer-events: none; }
.chip:hover { background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.chip.dragging { box-shadow: 6px 8px 0 var(--ink); z-index: 20; cursor: grabbing; transition: none; background: #fff; }
.chip.hit { animation: wiggle .5s var(--ease-spring); }
@keyframes wiggle { 25% { transform: rotate(-8deg) scale(1.1); } 60% { transform: rotate(6deg); } }
@media (min-width: 900px) { .chip { width: 64px; height: 64px; border-radius: 18px; } .chip img { width: 34px; height: 34px; } }

.promptbox {
  position: relative; z-index: 5;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--r-l);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 18px 18px 12px;
  transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out);
}
.promptbox:focus-within { box-shadow: 8px 8px 0 var(--blue); }
.promptbox.catch-ready { box-shadow: 12px 12px 0 var(--lime); transform: scale(1.015); }
.promptbox.catch { animation: catch .6s var(--ease-spring); }
@keyframes catch { 30% { transform: scale(1.03) rotate(-.6deg); box-shadow: 12px 12px 0 var(--lime); } }
.pb-field { position: relative; min-height: 3.2em; }
.pb-field textarea, .pb-ghost {
  display: block; width: 100%; margin: 0; padding: 0; border: 0;
  font-size: clamp(22px, 5.4vw, 40px); font-weight: 500; letter-spacing: -.02em; line-height: 1.2;
  background: transparent; resize: none; outline: none;
  min-height: 2.5em;
}
.pb-ghost { position: absolute; inset: 0; color: var(--ink-2); pointer-events: none; white-space: pre-wrap; }
.pb-ghost::after { content: ""; display: inline-block; width: .07em; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--blue); animation: blink 1s steps(1) infinite; }
.pb-ghost.typing::after { animation: none; }
.pb-field textarea:not(:placeholder-shown) + .pb-ghost, .promptbox.has-text .pb-ghost, .promptbox:focus-within .pb-ghost { opacity: 0; }
.promptbox:focus-within .pb-ghost { opacity: 0; }
.pb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--hair); }
.pb-hint { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.pb-hint b { color: var(--blue); font-weight: 500; }
.pb-send {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--lime);
  display: grid; place-items: center;
}
.pb-send svg { width: 24px; height: 24px; }
.pb-send:hover { background: var(--blue); color: #fff; }
.bot-card { min-height: 1.5em; margin: 16px 0 0; font-size: 16px; color: var(--ink-2); }
.bot-card strong { color: var(--ink); }

/* desktop: chips float freely around the box */
.stage.floating { min-height: 460px; }
.stage.floating .chips { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.stage.floating .chip { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: grab; }
.stage.floating .promptbox { width: min(760px, 70%); margin: 0 auto; }
.stage.floating .bot-card { text-align: center; position: relative; z-index: 5; }

/* x-ray of your prompt */
.xray { margin-top: 26px; border-top: 2px solid var(--ink); padding-top: 18px; }
.xray-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.xs { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.xs.in { opacity: 1; transform: none; }
.xs-label { display: block; color: var(--ink-2); margin-bottom: 6px; }
.xs-label strong { color: var(--ink); font-weight: 500; }
.xs-body { margin: 0; }
.xs-text { font-size: 20px; font-weight: 500; }
.xs-tokens, .xs-ids { display: flex; flex-wrap: wrap; gap: 4px; }
.xs-ids span { font-family: var(--f-mono); font-size: 14px; padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--paper); animation: popin .4s var(--ease-spring) backwards; }
.xray-next { margin: 18px 0 0; font-size: 17px; max-width: 60ch; }
@media (min-width: 900px) {
  .xray-steps { grid-template-columns: 1fr 1.3fr 1.3fr; gap: 28px; }
}
.scroll-cue { margin: 26px 0 0; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.scroll-cue::before { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); animation: nudge 1.6s var(--ease-out) infinite; }
@keyframes nudge { 50% { transform: translateY(4px) rotate(45deg); } }

/* =========================================================
   EXHIBITS: shared shell
   ========================================================= */
.exhibit { position: relative; padding: 80px var(--gutter); max-width: var(--max); margin: 0 auto; }
.exhibit.dark { max-width: none; background: var(--night); color: var(--paper); border-radius: var(--r-l); margin: 0 8px; padding-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); padding-right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.placard { display: inline-flex; align-items: stretch; margin-bottom: 22px; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.placard span { padding: 5px 10px; }
.placard-no { background: var(--ink); color: var(--paper); }
.placard-dark { border-color: var(--paper); }
.placard-dark .placard-no { background: var(--lime); color: var(--ink); }
@media (min-width: 900px) { .exhibit { padding: 130px var(--gutter); } }

/* reveal on scroll (only when JS + motion allowed) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* token chips: used across the page */
.tk {
  display: inline-flex; align-items: center;
  font-family: var(--f-mono); font-size: 16px; line-height: 1;
  padding: 7px 8px; border-radius: 8px;
  background: var(--c, var(--lime)); color: var(--ink);
  border: 1.5px solid transparent; white-space: pre;
}
.tk .sp { color: rgba(20, 20, 20, .45); }
.tk-0 { --c: var(--lime); } .tk-1 { --c: var(--sky); } .tk-2 { --c: var(--pink); } .tk-3 { --c: var(--peach); } .tk-4 { --c: var(--mint); }
@keyframes popin { from { opacity: 0; transform: scale(.4) translateY(8px); } }

/* =========================================================
   EXHIBIT 01: tokens
   ========================================================= */
.tok-lab { margin-top: 40px; }
.tok-input {
  width: 100%; border: 0; border-bottom: 3px solid var(--ink); background: transparent;
  font-size: clamp(24px, 5.6vw, 54px); font-weight: 700; letter-spacing: -.03em; padding: 6px 0 10px; outline: none; border-radius: 0;
}
.tok-input:focus { border-bottom-color: var(--blue); }
.tok-split { height: 0; }
.tok-stage {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: calc(var(--split, 1) * 10px) calc(var(--split, 1) * 8px);
  margin-top: 24px; min-height: 64px;
}
.tok-stage .tk {
  font-size: clamp(17px, 2.6vw, 26px); padding: 10px 10px; border-radius: 10px;
  min-height: 44px;
  border: 2px solid var(--ink);
  transform: rotate(calc(var(--rot, 0deg) * var(--split, 1)));
  transition: transform .35s var(--ease-spring), box-shadow .2s, background .2s;
  cursor: pointer;
}
.tok-stage .tk:hover { transform: translateY(-4px) rotate(0deg); box-shadow: 0 4px 0 var(--ink); }
.tok-stage .tk[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tok-stage .tk[aria-pressed="true"] .sp { color: rgba(243, 239, 230, .5); }
.tok-stage .tk.new { animation: popin .45s var(--ease-spring) backwards; }
.tok-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; }
.meter { border: 1.5px solid var(--ink); border-radius: var(--r-m); padding: 12px 14px; background: var(--card); }
.meter-n { display: block; font-size: clamp(32px, 7vw, 56px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-l { color: var(--ink-2); }
.meter-hot { background: var(--blue); color: #fff; border-color: var(--blue); }
.meter-hot .meter-l { color: rgba(255, 255, 255, .8); }
.meter-n.tick { animation: tick .35s var(--ease-spring); }
@keyframes tick { 40% { transform: translateY(-5px) scale(1.06); } }
.tok-inspect { margin-top: 16px; min-height: 3.2em; padding: 14px 16px; border-radius: var(--r-m); background: var(--paper-2); font-size: 16px; }
.tok-inspect code { font-family: var(--f-mono); background: var(--card); padding: 1px 6px; border-radius: 5px; }
.tok-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.tok-try-l { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.try { min-height: 44px; padding: 0 14px; border: 1.5px dashed var(--ink); border-radius: 10px; background: transparent; font-size: 15px; }
.try:hover { background: var(--card); border-style: solid; }
.try[data-shuffle] { border-style: solid; background: var(--ink); color: var(--paper); }
@media (min-width: 900px) {
  .ex-tokens .tok-lab { display: grid; grid-template-columns: 1fr 300px; gap: 0 48px; align-items: start; }
  .tok-input, .tok-stage, .tok-split, .tok-try, .ex-tokens .fine { grid-column: 1; }
  .tok-meters { grid-column: 2; grid-row: 1 / span 3; grid-template-columns: 1fr; margin-top: 0; }
  .tok-inspect { grid-column: 2; grid-row: 4 / span 2; align-self: start; }
}

/* =========================================================
   EXHIBIT 02: machine
   ========================================================= */
.pipeline { margin-top: 44px; display: grid; gap: 18px; }
.pl-label { display: block; color: var(--ink-2); margin-bottom: 10px; }
.cards { display: grid; gap: 10px; }
.pcard {
  text-align: left; min-height: 56px; padding: 14px 16px;
  border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card);
  font-size: 17px; font-weight: 600; line-height: 1.25;
  touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .25s var(--ease-spring), box-shadow .2s, background .2s;
}
.pcard:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.pcard.active { background: var(--lime); }
.pcard[data-card="yours"] { border-style: dashed; box-shadow: none; }
.pcard.dragging { position: fixed; z-index: 70; pointer-events: none; transform: rotate(-4deg) scale(1.04); box-shadow: 8px 10px 0 var(--ink); transition: none; width: var(--w); }
.pcard-ghost { visibility: hidden; }

.pl-model { position: relative; display: grid; place-items: center; padding: 10px 0; }
.model {
  position: relative; width: 100%; max-width: 360px; aspect-ratio: 1.25;
  background: var(--blue); color: #fff;
  border: 2px solid var(--ink); border-radius: 36px 36px 36px 8px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden; display: grid; place-items: center;
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.model.over { transform: scale(1.04) rotate(-1deg); box-shadow: 12px 12px 0 var(--lime); }
.model.running { animation: hum .18s linear infinite alternate; }
@keyframes hum { to { transform: translate(1px, -1px); } }
.model-slot { position: absolute; top: 14px; left: 14px; right: 14px; height: 46px; border: 2px dashed rgba(255, 255, 255, .6); border-radius: 12px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; color: rgba(255, 255, 255, .85); }
.model-layers { display: flex; gap: 10px; align-items: center; height: 46%; margin-top: 30px; }
.model-layers i { width: 14px; height: 100%; border-radius: 7px; background: rgba(255, 255, 255, .22); position: relative; overflow: hidden; }
.model-layers i::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; top: 100%; background: var(--lime); border-radius: 7px; }
.model.running .model-layers i::after { animation: rise .6s var(--ease-out) infinite; }
.model-layers i:nth-child(2)::after { animation-delay: .08s !important; } .model-layers i:nth-child(3)::after { animation-delay: .16s !important; }
.model-layers i:nth-child(4)::after { animation-delay: .24s !important; } .model-layers i:nth-child(5)::after { animation-delay: .32s !important; } .model-layers i:nth-child(6)::after { animation-delay: .4s !important; }
@keyframes rise { to { top: -30%; } }
.model-name { position: absolute; bottom: 12px; left: 16px; font-family: var(--f-mono); font-size: 12px; opacity: .85; }
.model-state { position: absolute; bottom: 12px; right: 16px; font-family: var(--f-mono); font-size: 12px; background: rgba(0, 0, 0, .25); padding: 2px 8px; border-radius: 6px; }
.belt { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 0; }
.fly { position: fixed; z-index: 65; pointer-events: none; transition: transform .7s var(--ease-out), opacity .7s; }

.out {
  min-height: 170px; padding: 18px; border: 2px solid var(--ink); border-radius: var(--r-m);
  background: var(--card); font-size: 18px; line-height: 1.45; white-space: pre-line;
}
.out-empty { color: var(--ink-2); font-family: var(--f-mono); font-size: 14px; }
.out .cursor { display: inline-block; width: 2px; height: 1em; background: var(--blue); vertical-align: -.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.out-note { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); margin: 10px 0 0; min-height: 1.4em; }
@media (min-width: 900px) {
  .pipeline { grid-template-columns: 1fr 1.05fr 1fr; gap: 36px; align-items: center; }
  .pl-model::before, .pl-model::after { content: ""; position: absolute; top: 50%; height: 2px; width: 36px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 11px); }
  .pl-model::before { right: 100%; } .pl-model::after { left: 100%; }
}

/* =========================================================
   EXHIBIT 03: network
   ========================================================= */
.ex-network { padding-top: 90px; padding-bottom: 90px; }
.ex-network .ex-title em { color: var(--lime); }
.net-wrap { margin-top: 40px; display: grid; gap: 18px; }
.net-words { display: flex; flex-wrap: wrap; gap: 8px; }
.nw {
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  border: 1.5px solid rgba(243, 239, 230, .45); background: transparent; color: var(--paper);
  font-family: var(--f-mono); font-size: 16px;
}
.nw:hover { border-color: var(--paper); }
.nw[aria-pressed="true"] { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.net-canvas-wrap { position: relative; }
.net-canvas { display: block; width: 100%; height: 320px; touch-action: pan-y; }
.net-sentence { margin: 8px 0 0; font-family: var(--f-mono); font-size: 14px; color: #B9B6AE; text-align: center; min-height: 1.4em; }
.net-out { display: grid; gap: 10px; }
.mood { display: grid; grid-template-columns: 64px 1fr 48px; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 14px; }
.mood-bar { height: 14px; border-radius: 7px; background: var(--night-2); overflow: hidden; }
.mood-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--c); border-radius: 7px; transition: width .6s var(--ease-out); }
.mood[data-mood="0"] { --c: var(--lime); } .mood[data-mood="1"] { --c: var(--sky); } .mood[data-mood="2"] { --c: var(--tang); }
.mood-pct { text-align: right; font-variant-numeric: tabular-nums; }
.mood.top .mood-name { color: var(--c); font-weight: 500; }
.net-train { margin-top: 32px; display: grid; gap: 14px; align-items: center; }
.switch { display: inline-flex; border: 1.5px solid rgba(243, 239, 230, .5); border-radius: 999px; padding: 3px; width: max-content; }
.sw-opt { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--paper); font-size: 15px; font-weight: 600; transition: background .2s; }
.sw-opt[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.net-train-note { margin: 0; color: #B9B6AE; max-width: 60ch; }
@media (min-width: 900px) {
  .net-wrap { grid-template-columns: 160px 1fr 240px; gap: 28px; align-items: center; }
  .net-words { flex-direction: column; }
  .net-canvas { height: 420px; }
  .net-train { grid-template-columns: auto 1fr; gap: 24px; }
}

/* =========================================================
   EXHIBIT 04: prediction
   ========================================================= */
.pred { margin-top: 36px; }
.pred-start { display: flex; flex-wrap: wrap; gap: 8px; }
.ps { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: transparent; font-size: 15px; font-weight: 600; }
.ps[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pred-sentence {
  margin: 28px 0 0; min-height: 2.3em;
  font-size: clamp(30px, 6.4vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12;
}
.pred-sentence .w-new { background: var(--lime); border-radius: 8px; padding: 0 .12em; animation: popin .4s var(--ease-spring); display: inline-block; }
.pred-sentence .blank { display: inline-block; width: 2.6em; border-bottom: .09em solid var(--blue); height: .9em; vertical-align: baseline; animation: blink 1.1s steps(1) infinite; }
.pred-sentence .done-stamp { display: inline-block; margin-left: .3em; font-family: var(--f-mono); font-size: .28em; letter-spacing: 0; vertical-align: middle; padding: 6px 10px; border: 2px solid var(--blue); color: var(--blue); border-radius: 8px; transform: rotate(-6deg); animation: stamp .5s var(--ease-spring); }
@keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }
.pred-board { margin-top: 26px; display: grid; gap: 24px; }
.pred-opts { display: grid; gap: 8px; align-content: start; }
.opt {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center;
  min-height: 56px; padding: 0 16px; text-align: left; overflow: hidden;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--card);
  font-size: 19px; font-weight: 600;
  animation: popin .4s var(--ease-spring) backwards;
}
.opt::before { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--sky); transition: width .5s var(--ease-out); z-index: 0; }
.opt:nth-child(1)::before { background: var(--lime); }
.opt > * { position: relative; z-index: 1; }
.opt-p { font-family: var(--f-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.opt:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.guessing .opt::before { width: 0 !important; }
.guessing .opt-p { visibility: hidden; }
.opt.pick { outline: 3px solid var(--blue); outline-offset: 2px; }
.pred-side { display: grid; gap: 18px; align-content: start; }
.temp { display: grid; gap: 6px; }
.temp-l { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.temp-l .term { font-family: var(--f-display); font-size: 15px; }
.temp-scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sky), var(--peach), var(--tang)); border: 1.5px solid var(--ink); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sky), var(--peach), var(--tang)); border: 1.5px solid var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); margin-top: -12px; box-shadow: 2px 2px 0 var(--ink); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.pred-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 12px; background: var(--blue); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.btn:hover { background: var(--ink); }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn-ghost:hover { background: var(--lime); }
.btn-ghost[aria-pressed="true"] { background: var(--lime); }
.pred-score { margin: 0; font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
@media (min-width: 900px) {
  .pred-board { grid-template-columns: 1.4fr 1fr; gap: 48px; }
}

/* =========================================================
   EXHIBIT 05: prompting
   ========================================================= */
.steer { margin-top: 40px; display: grid; gap: 28px; }
.prompt-card { padding: 18px 20px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow-hard); }
.pc-label { color: var(--ink-2); }
.pc-text { margin: 6px 0 0; font-size: clamp(22px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.pc-text mark { background: var(--c); color: var(--ink); padding: 0 .15em; border-radius: 6px; animation: popin .4s var(--ease-spring); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.stickers { margin-top: 18px; display: grid; gap: 12px; }
.st-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-gl { width: 100%; color: var(--ink-2); }
.sticker {
  min-height: 44px; padding: 0 14px; font-size: 15px; font-weight: 600;
  border: 2px solid var(--ink); border-radius: 6px 14px 6px 14px; background: var(--c);
  transform: rotate(var(--tilt, -1.5deg));
}
.sticker:nth-of-type(2n) { --tilt: 1.5deg; }
.sticker:hover { transform: rotate(0) translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.sticker[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); background: var(--ink); color: var(--c); }
.s-a { --c: var(--sky); } .s-b { --c: var(--peach); } .s-c { --c: var(--pink); }
.answer {
  position: relative; min-height: 220px; padding: 22px 22px 22px 22px;
  border-radius: var(--r-m); background: var(--ink); color: var(--paper);
  font-size: 18px; line-height: 1.55;
}
.answer::before { content: "Response"; display: block; font-family: var(--f-mono); font-size: 12px; color: var(--lime); margin-bottom: 10px; }
.answer ul { margin: 0; padding-left: 1.2em; }
.answer li + li { margin-top: 6px; }
.answer p { margin: 0; }
.answer.swap { animation: swap .45s var(--ease-out); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.answer-meta { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
@media (min-width: 900px) {
  .steer { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
  .steer-right { position: sticky; top: 100px; }
}

/* =========================================================
   EXHIBIT 06: editor
   ========================================================= */
.doc-wrap { margin-top: 40px; display: grid; gap: 20px; }
.doc {
  background: var(--card); border: 2px solid var(--ink); border-radius: 6px var(--r-l) var(--r-l) var(--r-l);
  padding: 22px 20px; box-shadow: var(--shadow-soft);
}
.doc-q { margin: 0 0 14px; font-weight: 700; font-size: 17px; }
.doc-q span { font-family: var(--f-mono); font-size: 12px; font-weight: 400; background: var(--ink); color: var(--paper); padding: 2px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 2px; }
.doc-a { margin: 0; font-size: clamp(18px, 2.1vw, 21px); line-height: 1.6; }
.sus {
  display: inline; border: 0; outline-offset: 1px; padding: 2px 2px; margin: 0; background: none; text-align: left;
  font: inherit; color: inherit; border-radius: 4px; cursor: pointer;
  transition: background .2s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sus:hover { background: var(--paper-2); }
.sus.flagged { text-decoration: line-through; text-decoration-color: var(--tang); text-decoration-thickness: 2px; background: color-mix(in srgb, var(--tang) 14%, transparent); }
.sus.cleared { background: color-mix(in srgb, var(--mint) 60%, transparent); }
.sus.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.margin { display: grid; gap: 10px; align-content: start; }
.margin-empty { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); margin: 0; }
.note {
  padding: 12px 14px; border-radius: 4px 14px 14px 14px; font-size: 15px; line-height: 1.4;
  background: var(--c, var(--peach)); border: 1.5px solid var(--ink);
  animation: noteIn .45s var(--ease-spring);
  transform: rotate(var(--r, -.8deg));
}
.note:nth-child(even) { --r: .8deg; }
.note strong { display: block; font-family: var(--f-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.note.n-ok { --c: var(--mint); }
@keyframes noteIn { from { opacity: 0; transform: translateX(20px) rotate(4deg); } }
.editor-score { margin: 18px 0 0; font-size: 20px; font-weight: 700; min-height: 1.5em; }
@media (min-width: 900px) {
  .doc-wrap { grid-template-columns: 1.6fr 1fr; gap: 36px; }
}

/* =========================================================
   LEARN
   ========================================================= */
.learn { padding: 90px var(--gutter); max-width: var(--max); margin: 0 auto; border-top: 2px solid var(--ink); }
.report { border: 1.5px dashed var(--ink); border-radius: var(--r-m); padding: 14px 16px; margin-bottom: 40px; max-width: 520px; }
.report-l { color: var(--ink-2); }
.report-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 16px; display: grid; gap: 4px; }
.report-list li::before { content: "✓ "; color: var(--blue); font-weight: 800; }
.report-list li.todo { color: var(--ink-2); }
.report-list li.todo::before { content: "○ "; color: var(--ink-2); }
.report-reset { margin-top: 10px; padding: 0; min-height: 32px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.report-reset:hover { color: var(--ink); }
.report-reset[hidden] { display: none; }
.learn-title { font-size: clamp(36px, 8vw, 80px); max-width: 16ch; }
.learn-title em { color: var(--blue); }
.goals { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: g; }
.goal {
  display: grid; grid-template-columns: 48px 1fr; gap: 4px 14px; align-items: baseline;
  padding: 22px 0; border-top: 1.5px solid var(--ink);
  transition: background .3s, padding .3s var(--ease-out);
  outline-offset: -3px;
}
.goal:last-child { border-bottom: 1.5px solid var(--ink); }
.goal-n { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); }
.goal p { margin: 0; font-size: clamp(20px, 2.8vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.goal-tag { grid-column: 2; font-family: var(--f-mono); font-size: 12px; justify-self: start; padding: 3px 8px; border-radius: 6px; background: var(--lime); opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s var(--ease-spring); }
.goal:hover, .goal:focus-visible, .goal.open { background: var(--card); padding-left: 12px; padding-right: 12px; }
.goal:hover .goal-tag, .goal:focus-visible .goal-tag, .goal.open .goal-tag { opacity: 1; transform: none; }
@media (hover: none) { .goal-tag { opacity: 1; transform: none; } }
.learn-kicker { margin: 40px 0 0; font-size: clamp(26px, 4.4vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.learn-kicker em { color: var(--tang); }
@media (min-width: 900px) {
  .goal { grid-template-columns: 90px 1fr 140px; }
  .goal-tag { grid-column: 3; justify-self: end; }
}

/* =========================================================
   ROOMS
   ========================================================= */
.rooms { padding: 40px var(--gutter) 100px; max-width: var(--max); margin: 0 auto; }
.rooms-title { font-size: clamp(44px, 10vw, 110px); }
.rooms-lede { margin: 10px 0 0; color: var(--ink-2); font-size: 18px; }
.plan { margin-top: 36px; display: grid; gap: 12px; }
.room {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-content: start;
  min-height: 140px; padding: 20px; text-decoration: none;
  border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--c);
  overflow: hidden;
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.room:hover, .room:focus-visible { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.room:active { transform: translate(1px, 1px); box-shadow: none; }
.room-no { grid-row: 1 / span 2; padding-top: 6px; }
.room-name { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.room-name::after { content: "→"; display: inline-block; margin-left: .25em; transition: transform .3s var(--ease-spring); }
.room:hover .room-name::after { transform: translateX(6px); }
.room-desc { font-size: 16px; max-width: 34ch; color: var(--ink); opacity: .82; }
.r-terms { --c: var(--lime); } .r-lab { --c: var(--sky); } .r-games { --c: var(--pink); }
.room-toy { position: absolute; right: 16px; bottom: 14px; pointer-events: none; }
.rt-terms { display: flex; gap: 0; font-family: var(--f-mono); font-size: 20px; }
.rt-terms b { font-weight: 500; background: var(--card); border: 1.5px solid var(--ink); padding: 4px 6px; border-radius: 6px; transition: transform .4s var(--ease-spring); }
.room:hover .rt-terms b:first-child { transform: translateX(-6px) rotate(-8deg); }
.room:hover .rt-terms b:last-child { transform: translateX(6px) rotate(8deg); }
.rt-lab { font-family: var(--f-serif); font-style: italic; font-size: 30px; opacity: .5; transition: opacity .3s, letter-spacing .4s var(--ease-out); }
.room:hover .rt-lab { opacity: 1; letter-spacing: .08em; }
.rt-games { display: grid; grid-template-columns: repeat(3, 12px); gap: 3px; }
.rt-games i { width: 12px; height: 12px; border-radius: 3px; background: var(--card); border: 1.5px solid var(--ink); transition: background .2s; }
.room:hover .rt-games i:nth-child(3n+1) { background: var(--lime); }
.room:hover .rt-games i:nth-child(5) { background: var(--blue); }
@media (min-width: 900px) {
  .plan { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 170px; gap: 14px; }
  .r-terms { grid-column: 1 / span 4; grid-row: span 2; }
  .r-terms .room-name { font-size: 64px; }
  .r-lab { grid-column: 5 / span 2; grid-row: span 2; }
  .r-games { grid-column: 1 / span 6; }
  .rt-terms { font-size: 40px; right: 26px; bottom: 24px; }
  .rt-lab { font-size: 40px; }
}

/* =========================================================
   GUIDE + FOOTER
   ========================================================= */

.foot { background: var(--ink); color: var(--paper); padding: 50px var(--gutter) max(30px, env(safe-area-inset-bottom)); border-radius: var(--r-l) var(--r-l) 0 0; }
.tokcount {
  display: block; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0; text-align: left;
  border: 0; background: none; color: inherit;
}
.tc-l { display: block; font-size: clamp(20px, 3vw, 30px); font-weight: 500; color: #CFCBC2; }
.tc-n { display: block; font-size: clamp(56px, 15vw, 180px); font-weight: 800; letter-spacing: -.05em; line-height: .95; color: var(--lime); font-variant-numeric: tabular-nums; }
.tc-n.pending { font-size: clamp(36px, 8vw, 90px); }
.tc-hint { display: inline-block; margin-top: 14px; font-family: var(--f-mono); font-size: 13px; border-bottom: 1.5px solid var(--lime); }
.tokcount:hover .tc-n { color: var(--paper); }
.foot-row { max-width: var(--max); margin: 50px auto 0; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 14px; color: #B9B6AE; border-top: 1px solid rgba(243, 239, 230, .2); padding-top: 18px; }
.foot-mark { font-weight: 800; color: var(--paper); }

/* ---------- dialogs ---------- */
.sheet {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88svh;
  background: var(--paper); color: var(--ink); border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: var(--shadow-soft);
}
.sheet[open] { animation: sheetUp .4s var(--ease-out); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet::backdrop { background: rgba(17, 18, 17, .5); backdrop-filter: blur(2px); }
.sheet-in { position: relative; padding: 26px var(--gutter) max(30px, env(safe-area-inset-bottom)); }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); font-size: 22px; line-height: 1; }
.sheet-title { margin: 0 50px 8px 0; font-size: 34px; letter-spacing: -.03em; line-height: 1; }
.sheet-lede { margin: 0 0 18px; color: var(--ink-2); }
@media (min-width: 900px) {
  .sheet { margin: auto; width: min(720px, 92vw); border-radius: var(--r-l); border: 2px solid var(--ink); }
  .sheet-in { padding: 34px 40px 36px; }
}
.notes-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.notes-list li { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--ink); }
.notes-list li.locked { border-style: dashed; background: transparent; color: var(--ink-2); }
.notes-list b { display: block; }
.notes-list span { font-size: 15px; }
.map-grid { display: grid; gap: 22px; margin-top: 16px; }
.map-col { display: grid; gap: 4px; }
.map-h { color: var(--ink-2); margin-bottom: 4px; }
.map-col a { display: flex; align-items: center; min-height: 46px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 18px; border: 1.5px solid transparent; }
.map-col a:hover { border-color: var(--ink); background: var(--card); }
.map-room { background: var(--lime); border-color: var(--ink) !important; margin-bottom: 4px; }
.map-room:nth-of-type(2) { background: var(--sky); } .map-room:nth-of-type(3) { background: var(--peach); } .map-room:nth-of-type(4) { background: var(--pink); } .map-room:nth-of-type(5) { background: var(--mint); }
@media (min-width: 640px) { .map-grid { grid-template-columns: 1fr 1fr; } }
.ledger-body { font-size: 17px; }
.ledger-body p { margin: 0 0 14px; }
.ledger-body table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 6px 0 16px; }
.ledger-body th, .ledger-body td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.ledger-body th { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.ledger-body .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-demo { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; }

.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 140%); opacity: 0;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
  transition: transform .45s var(--ease-spring), opacity .3s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast b { color: var(--lime); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wm-caret, .pb-ghost::after { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* small phones: keep the top bar on one line */
@media (max-width: 400px) {
  .topbar { gap: 8px; }
  .topnav { gap: 6px; }
  .notes-btn, .rooms-btn { padding: 0 11px; gap: 6px; }
  .wordmark { font-size: 16.5px; white-space: nowrap; }
}
@media (max-width: 340px) { .rooms-btn span:last-child { display: none; } }

/* =========================================================
   EXHIBIT 01: what is AI
   ========================================================= */
.sub-title { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }

.sort { margin-top: 36px; max-width: 560px; }
.sort-bins { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.bin { transition: color .2s, transform .2s var(--ease-spring); }
.sort.lean-no .bin-no, .sort.lean-yes .bin-yes { color: var(--ink); transform: scale(1.15); font-weight: 500; }
.deck { position: relative; height: 230px; }
.scard {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 22px 24px; border: 2px solid var(--ink); border-radius: var(--r-l);
  background: var(--card); box-shadow: 6px 6px 0 var(--ink);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
  transition: transform .4s var(--ease-spring), opacity .3s, background .2s;
}
.scard.under { transform: translate(6px, 8px) rotate(2deg); box-shadow: none; z-index: 0; }
.scard.top { z-index: 1; }
.scard.dragging { transition: none; cursor: grabbing; }
.scard.lean-yes { background: color-mix(in srgb, var(--lime) 55%, var(--card)); }
.scard.lean-no { background: color-mix(in srgb, var(--sky) 55%, var(--card)); }
.scard-emoji { font-size: 34px; line-height: 1; }
.scard-name { font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.scard-sub { font-size: 16px; color: var(--ink-2); }
.scard.verdict { cursor: default; }
.scard .v-tag { align-self: flex-start; font-family: var(--f-mono); font-size: 13px; padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--paper); }
.scard .v-tag.wrong { background: var(--tang); color: var(--ink); }
.scard .v-why { font-size: 17px; line-height: 1.4; }
.sort-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 22px; }
.sort-actions .btn { min-height: 52px; }
.sort-count { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sort-hint { margin: 10px 0 0; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.sort-result { margin-top: 18px; padding: 18px 20px; border-radius: var(--r-m); background: var(--ink); color: var(--paper); }
.sort-result .term { color: var(--lime); }
.sort-score { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.sort-rule { margin: 0 0 14px; font-size: 17px; line-height: 1.45; }

.loop { margin-top: 70px; }
.loop-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; }
.loop-step {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--card); font-size: 16px; font-weight: 700;
  transition: background .2s, transform .25s var(--ease-spring);
}
.loop-step:hover { transform: translateY(-2px); }
.loop-step[aria-selected="true"] { background: var(--blue); color: #fff; }
.ls-n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; font-family: var(--f-mono); font-size: 13px; }
.loop-panel { margin-top: 12px; min-height: 170px; padding: 20px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); }
.loop-panel p { margin: 0; font-size: 18px; line-height: 1.45; max-width: 60ch; }
.loop-panel .lp-viz { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; min-height: 36px; align-items: center; }
.lp-msg { font-family: var(--f-mono); font-size: 14px; padding: 6px 10px; border-radius: 10px 10px 10px 2px; background: var(--paper-2); animation: popin .4s var(--ease-spring) backwards; }
.lp-bar { display: grid; grid-template-columns: 70px 1fr 44px; gap: 10px; align-items: center; font-family: var(--f-mono); font-size: 14px; width: 100%; max-width: 420px; }
.lp-bar i { display: block; height: 12px; border-radius: 6px; background: var(--lime); border: 1.5px solid var(--ink); width: 0; transition: width .7s var(--ease-out); }
.lp-phone { display: inline-flex; flex-direction: column; gap: 8px; padding: 12px; border: 2px solid var(--ink); border-radius: 18px; background: var(--paper); }
.lp-typed { font-size: 18px; font-weight: 600; }
.lp-typed .cursor { display: inline-block; width: 2px; height: 1em; background: var(--blue); vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
.lp-sugg { display: flex; gap: 6px; }
.lp-sugg button { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); font-weight: 600; }
.lp-sugg button:first-child { background: var(--lime); }
.lp-next { margin-top: 14px; }
@media (max-width: 520px) { .loop-step { font-size: 14px; padding: 0 10px; gap: 6px; } .ls-n { display: none; } }

.versus { margin-top: 70px; }
.versus-lede { margin: 0; color: var(--ink-2); font-size: 18px; }
.vs-qs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.vs-grid { display: grid; gap: 14px; margin-top: 18px; }
.vs-col { min-width: 0; }
.vs-label { display: block; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.vs-label small { display: block; font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--ink-2); }
.vs-out { min-height: 190px; padding: 16px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); font-size: 17px; line-height: 1.45; white-space: pre-line; }
.vs-ai .vs-out { background: var(--ink); color: var(--paper); }
.vs-ai .out-empty { color: #B9B6AE; }
.vs-ai .cursor { display: inline-block; width: 2px; height: 1em; background: var(--lime); vertical-align: -.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.vs-result { display: block; padding: 10px 0; border-bottom: 1px solid var(--hair); white-space: normal; animation: popin .35s var(--ease-spring) backwards; }
.vs-result:last-child { border-bottom: 0; }
.vs-result b { display: block; color: var(--blue); font-size: 16px; }
.vs-result span { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.vs-none { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); }
.vs-note { margin: 14px 0 0; font-size: 18px; font-weight: 600; min-height: 1.5em; max-width: 60ch; }
@media (min-width: 900px) {
  .ex-whatis { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; align-items: start; }
  .ex-whatis > .placard, .ex-whatis > .ex-title, .ex-whatis > .ex-lede { grid-column: 1 / -1; }
  .ex-whatis > .placard { justify-self: start; }
  .sort { grid-column: 1; }
  .loop { grid-column: 2; margin-top: 36px; }
  .versus { grid-column: 1 / -1; }
  .vs-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.ledger-scroll { overflow-x: auto; }
