/* ============================================================================
   Cosmo marketing site — design system + pages.
   Light, warm, premium. Brand tokens mirror the desktop app's renderer
   (eye #1e1e2e, accent #4a9eff, blush #ff6b8a). One accent does the work;
   pink is the rare heartbeat. Soft glows for lighting, never decoration.
   ========================================================================== */
:root {
  /* ink + text */
  --ink: #1e1e2e;                 /* eye color = primary text */
  --ink-2: #2d2d3e;
  --text: #2a2a3a;
  --muted: #6a6a7e;               /* body-secondary */
  --faint: #9090a4;               /* captions, eyebrows */

  /* accents */
  --blue: #4a9eff;
  --blue-deep: #2b7fe0;
  --blue-ink: #2b6fd0;            /* AA text on light */
  --pink: #ff6b8a;
  --pink-deep: #e54f70;
  --wave: #9bb0d6;
  --green: #1b9a63;

  /* surfaces — warm off-white, never pure white/black */
  --bg: #fbfbfd;
  --bg-2: #f3f4fa;                /* alternating band */
  --surface: #ffffff;
  --surface-2: #f6f7fc;           /* code / nested */
  --glass: rgba(251, 251, 253, 0.72);
  --line: #e7e8f1;
  --line-2: #d9dae8;

  /* shadows — soft, multi-layer, low opacity */
  --shadow-s: 0 1px 2px rgba(30,30,46,.05), 0 1px 1px rgba(30,30,46,.04);
  --shadow-m: 0 6px 18px rgba(30,30,46,.07), 0 2px 5px rgba(30,30,46,.05);
  --shadow-l: 0 18px 48px rgba(30,30,60,.12), 0 5px 12px rgba(30,30,46,.06);
  --shadow-blue: 0 8px 24px rgba(74,158,255,.30);

  --r-lg: 20px; --r-md: 14px; --r-sm: 10px; --r-pill: 999px;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1120px;
  --prose: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 82% -8%, #e9eeff 0%, transparent 58%),
    radial-gradient(820px 460px at -8% 6%, #ffeaf1 0%, transparent 52%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .brand-name { font-family: var(--display); font-weight: 600; line-height: 1.12; color: var(--ink); letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); margin: 0 0 .35em; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0 0 .5em; }
h3 { font-size: 1.3rem; margin: 0 0 .4em; letter-spacing: -0.015em; }
p  { margin: 0 0 1em; }
a  { color: var(--blue-ink); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue); }
strong { color: var(--ink); font-weight: 600; }
.lead { font-size: clamp(1.06rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); }
section { padding: clamp(72px, 10vw, 132px) 0; }
.wrap { width: min(var(--maxw), 92vw); margin: 0 auto; }
.prose { max-width: var(--prose); }
.center { text-align: center; }
.center .lead, .lead.center { margin-left: auto; margin-right: auto; }
/* keep left-aligned content inside centered sections actually left-aligned */
.center .card, .center .feat, .center .steps, .center .arch-content { text-align: left; }

/* mono eyebrow label */
.eyebrow {
  display: inline-block; font-family: var(--mono); font-weight: 500;
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 .9em;
}
.eyebrow--blue { color: var(--blue-ink); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display); font-weight: 600; font-size: .98rem; letter-spacing: -0.01em;
  border: 0; border-radius: var(--r-sm); padding: .74em 1.35em;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s ease, background .2s, border-color .2s;
  display: inline-flex; align-items: center; gap: .5em; text-decoration: none;
}
.btn--primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-s); }
.btn--primary:hover { background: #3d92f7; transform: translateY(-1px); box-shadow: var(--shadow-blue); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-1px); }
.btn--block { width: 100%; justify-content: center; }
.btn--sm { padding: .5em .95em; font-size: .88rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 5vw, 44px);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand-name { font-size: 1.26rem; letter-spacing: -0.02em; }
.nav__links { display: flex; gap: 2px; margin-left: 10px; }
.nav__links a {
  color: var(--text); font-weight: 500; font-size: .94rem;
  padding: 7px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.nav__links a:hover { background: rgba(30,30,46,.05); color: var(--ink); }
.nav__links a.is-active { background: rgba(74,158,255,.12); color: var(--blue-ink); }
.nav__github {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: .94rem; cursor: pointer;
  background: var(--ink); color: #fff; border: 0;
  padding: 9px 16px; border-radius: var(--r-pill); transition: transform .15s, background .2s, box-shadow .2s;
}
.nav__github:hover { transform: translateY(-1px); background: #000; box-shadow: var(--shadow-m); }
/* hamburger — hidden on desktop, revealed ≤860px; bars morph to an ✕ when open */
.nav__burger {
  display: none; margin-left: 6px; width: 40px; height: 34px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background .15s;
}
.nav__burger:hover { background: rgba(30,30,46,.05); }
.nav__burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav.is-open .nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- mini eyes logo (pure CSS blink) — matches the cute classic eye:
   dark eye, glossy white shine up-left, tiny catch-light top-right. ---------- */
.brand-eyes { display: inline-flex; gap: 5px; }
.brand-eyes i {
  width: 16px; height: 16px; border-radius: 50%; background: var(--ink);
  position: relative; overflow: hidden; animation: brandblink 5s infinite;
  filter: drop-shadow(0 1.5px 2.5px rgba(0,0,0,.3));
}
.brand-eyes i::after {        /* big white shine, offset up-left — follows cursor via --ex/--ey */
  content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; top: 2.5px; left: 2.5px;
  transform: translate(var(--ex, 0px), var(--ey, 0px)); transition: transform .12s ease;
}
.brand-eyes i::before {       /* tiny catch-light, top-right */
  content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,.85); top: 2px; left: 9.5px; z-index: 2;
}
.brand-eyes--sm i { width: 13px; height: 13px; }
.brand-eyes--sm i::after { width: 6.5px; height: 6.5px; top: 2px; left: 2px; }
.brand-eyes--sm i::before { width: 2.4px; height: 2.4px; top: 2px; left: 8px; }
@keyframes brandblink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 5vw, 48px); text-align: center; }
.hero__eyes {
  position: relative; width: 340px; max-width: 86vw; height: 210px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
}
/* signature ambient glow behind the character — lighting, not decoration */
.hero__eyes::before {
  content: ""; position: absolute; inset: -10% -6%; z-index: -1; border-radius: 50%;
  background:
    radial-gradient(46% 52% at 50% 42%, rgba(74,158,255,.30) 0%, transparent 70%),
    radial-gradient(40% 44% at 64% 64%, rgba(255,107,138,.24) 0%, transparent 72%);
  filter: blur(34px);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .82; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.hero__cta { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero__hint { font-size: .85rem; color: var(--faint); margin-top: 16px; }

/* ---------- "works with" provider strip ---------- */
.providers {
  display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; align-items: center;
  margin-top: 30px;
}
.providers__label { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); width: 100%; margin-bottom: 2px; }
.providers span.pill { font-family: var(--mono); }

/* generic pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-weight: 500; font-size: .76rem; letter-spacing: .02em;
  color: var(--blue-ink); background: rgba(74,158,255,.10);
  border: 1px solid rgba(74,158,255,.20); border-radius: var(--r-pill); padding: 4px 12px;
}
.pill--pink { color: var(--pink-deep); background: rgba(255,107,138,.10); border-color: rgba(255,107,138,.24); }
.pill--plain { color: var(--muted); background: var(--surface); border-color: var(--line); }

/* ---------- grid + cards ---------- */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px; box-shadow: var(--shadow-s);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--line-2); }
.card h3 { margin: 14px 0 6px; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }
.card__ico {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: linear-gradient(135deg, #eaf2ff, #f4ecff); border: 1px solid var(--line);
}

/* alternating soft band — never solid black */
.band { background: var(--bg-2); }
.band--tint {
  background:
    radial-gradient(700px 400px at 12% 0%, rgba(74,158,255,.08), transparent 60%),
    radial-gradient(700px 400px at 88% 100%, rgba(255,107,138,.07), transparent 60%),
    var(--bg-2);
}
/* "ink" band kept as a soft deep-indigo gradient (legible, not flat black) */
.band--ink {
  background: linear-gradient(160deg, #20202e 0%, #181826 100%);
  color: #ececf5; position: relative; overflow: hidden;
}
.band--ink::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(620px 360px at 78% 0%, rgba(74,158,255,.16), transparent 62%),
              radial-gradient(560px 340px at 10% 100%, rgba(255,107,138,.12), transparent 60%);
  pointer-events: none;
}
.band--ink > * { position: relative; }
.band--ink h2, .band--ink h3 { color: #fff; }
.band--ink .lead, .band--ink p { color: rgba(255,255,255,.74); }
.band--ink .card { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); box-shadow: none; }
.band--ink .card:hover { border-color: rgba(255,255,255,.22); }

/* ---------- feature list ---------- */
.feat { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.feat:last-child { border-bottom: 0; }
.feat__ico { font-size: 1.6rem; line-height: 1.2; }
.feat h3 { margin: 0 0 4px; font-size: 1.08rem; }
.feat p { margin: 0; color: var(--muted); font-size: .96rem; }
.tag { display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .03em;
  color: var(--blue-ink); background: rgba(74,158,255,.12); padding: 2px 9px; border-radius: var(--r-pill); margin-left: 8px; vertical-align: middle; }
.tag--green { color: var(--green); background: rgba(27,154,99,.12); }

/* ---------- code blocks ---------- */
.code {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: .86rem; line-height: 1.7; margin: 0;
  white-space: pre;
}
.code span { color: #8a8aa0; }       /* comments */
.code code { color: var(--blue-ink); background: none; padding: 0; }
code { font-family: var(--mono); font-size: .9em; background: rgba(30,30,46,.06); padding: 1px 6px; border-radius: 6px; color: var(--ink-2); }

/* ======================================================================
   DEMOS — a faithful, in-browser recreation of the real Cosmo widget.
   Every element mirrors src/renderer/index.html: the 150px face column,
   the 48px control rail that slides open on HOVER, the 220px chat column,
   and the tasks/sources panel + setup overlays. Values (mic geometry, rail
   gradient, dark chat, pastel overlays, the dark status pill) are lifted
   straight from the app so the layout is the app's layout, just zoomed.
   ====================================================================== */

/* ── A MacBook; Cosmo floats on its screen and is draggable. The laptop scales
   with the viewport (responsive), so Cosmo always reads "properly" — a small
   buddy on a real Mac — on a big monitor or a 13" MacBook alike. ── */
.mb { width: min(94vw, 760px); margin: 0 auto; }
.mb-screen {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border: 12px solid #1b1b22; border-bottom-width: 13px; border-radius: 20px 20px 9px 9px;
  overflow: hidden; box-shadow: 0 18px 40px rgba(20,24,40,.30), inset 0 0 0 1.5px #2c2c36;
  touch-action: none;   /* let JS own drag gestures on the screen */
}
.mb-wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 28% 8%, rgba(255,255,255,.40), transparent 42%),
    radial-gradient(90% 90% at 84% 96%, rgba(196,90,168,.55), transparent 60%),
    linear-gradient(158deg, #7e8cf0 0%, #8f7ce8 52%, #b387d8 100%);
}
.mb-menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 22px; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; padding: 0 10px;
  background: rgba(22,22,32,.26); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 10.5px; color: rgba(255,255,255,.92); font-weight: 500; pointer-events: none;
}
.mb-mb-left { display: inline-flex; align-items: center; gap: 7px; }
.mb-mb-logo { width: 9px; height: 9px; border-radius: 2.5px; background: rgba(255,255,255,.85); }
.mb-mb-dim { color: rgba(255,255,255,.62); font-weight: 400; }
.mb-mb-right { display: inline-flex; align-items: center; gap: 6px; }
.mb-batt { width: 16px; height: 8px; border: 1px solid rgba(255,255,255,.6); border-radius: 2px; position: relative; }
.mb-batt::before { content: ''; position: absolute; inset: 1px; right: 3px; background: rgba(255,255,255,.85); border-radius: 1px; }
.mb-batt::after { content: ''; position: absolute; right: -2.5px; top: 2px; width: 1.5px; height: 4px; background: rgba(255,255,255,.6); border-radius: 0 1px 1px 0; }
.mb-hint {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: 10.5px; color: rgba(255,255,255,.82); background: rgba(20,20,30,.28);
  padding: 3px 11px; border-radius: var(--r-pill); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none; white-space: nowrap;
}
/* base / keyboard deck + lid-open notch */
.mb-deck {
  position: relative; width: 113%; height: 14px; margin: 0 auto -1px; left: 0;
  background: linear-gradient(#dde1ea 0%, #c2c8d4 55%, #aab1c0 100%);
  border-radius: 2px 2px 13px 13px; box-shadow: 0 10px 16px rgba(20,24,40,.18);
}
.mb-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 84px; height: 6px; background: #a7adbd; border-radius: 0 0 9px 9px;
}

/* ── The widget shell (= #app). Absolutely placed on the screen; JS positions &
   drags it and grows it to the app's real overlay dimensions on open. ── */
.cw {
  position: absolute; left: 40%; top: 26%;
  display: flex; flex-direction: row; align-items: stretch;
  width: 150px; height: 160px;             /* face state (= real BASE 150 × ~160) */
  background: rgba(255,255,255,0.97);
  border-radius: 18px; overflow: hidden; cursor: grab; z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), 0 8px 26px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.12);
  -webkit-font-smoothing: antialiased;
  transition: width .22s ease, height .22s ease;
}
.cw.dragging { cursor: grabbing; transition: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), 0 16px 40px rgba(0,0,0,0.30); }
/* width grows to match what's visible — rail on hover, chat beside, overlays cover */
.cw:hover, .cw.rail-open { width: 198px; }                 /* + rail (48) */
.cw.s-chat { width: 418px; height: 160px; }                /* + rail + chat (220) */
.cw.s-panel { width: min(320px, 94%); height: min(410px, 86%); }   /* tasks panel */
.cw.s-setup { width: min(360px, 94%); height: min(440px, 90%); }   /* setup — real 360 wide */

/* ── Face column (= #cosmo-col, hard-pinned 150) ── */
.cw-col {
  position: relative; flex: 0 0 150px; min-width: 150px; max-width: 150px; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cw-avatar { display: flex; align-items: center; justify-content: center; transform: scale(.92); }
.cw-eyes { width: 150px; height: 150px; display: grid; place-items: center; pointer-events: auto; }

/* gear (top-left) + close (top-right) — faint at rest, surface on hover (real behaviour) */
.cw-gear, .cw-close {
  position: absolute; top: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(120,130,150,0.85); color: #fff; border: none;
  font-size: 10px; line-height: 18px; text-align: center; cursor: pointer; z-index: 40;
  opacity: 0.22; transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.cw-gear { left: 6px; }
.cw-close { right: 6px; }
.cw:hover .cw-gear, .cw:hover .cw-close { opacity: 0.9; }
.cw-gear:hover { transform: scale(1.12); }
.cw-close:hover { transform: scale(1.12); background: rgba(232,87,76,0.95); }

/* grab-handle tick on the right edge — hints the rail is there */
.cw-handle {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 30px; border-radius: 3px; background: rgba(120,130,150,0.22);
  transition: background .15s ease; pointer-events: none; z-index: 5;
}
.cw:hover .cw-handle { background: rgba(120,130,150,0.5); }

/* status pill (= chibi .cosmo-status) — dark, bottom-centre, mono */
.cw-status {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 142px; padding: 3px 10px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  font: 700 12px ui-monospace, system-ui; letter-spacing: 0.3px; white-space: nowrap;
  color: #fff; background: rgba(28,28,40,0.9); box-shadow: 0 2px 9px rgba(0,0,0,0.3); z-index: 15;
  /* NB: keep the -50% X in the keyframe — a plain `transform: none` pop would
     clobber the centering and the pill would anchor its left edge to the centre. */
  animation: cwStatusIn .2s ease both;
}
@keyframes cwStatusIn {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.cw-status__stop {
  margin-left: 1px; width: 15px; height: 15px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: #fff; font-size: 9px; line-height: 1; cursor: pointer; padding: 0;
}
.cw-status__stop:hover { background: rgba(255,255,255,0.34); }

/* Menu-bar (tray) icon + its dropdown — the menu Cosmo shows when tucked away.
   The menubar itself is click-through (so it never eats a drag); these opt back in. */
.mb-tray {
  pointer-events: auto; cursor: pointer; border: none; background: transparent; padding: 2px 3px;
  display: inline-flex; align-items: center; border-radius: 5px; transition: background .15s ease;
}
.mb-tray:hover, .mb-tray.is-open { background: rgba(255,255,255,.22); }
.mb-tray-eyes { width: 18px; height: 10px; position: relative; display: inline-block; }
.mb-tray-eyes::before, .mb-tray-eyes::after {
  content: ''; position: absolute; top: 1px; width: 7px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.92);
}
.mb-tray-eyes::before { left: 0; }
.mb-tray-eyes::after { right: 0; }
.mb-traymenu {
  position: absolute; top: 25px; right: 8px; z-index: 30; min-width: 188px;
  background: rgba(245,245,250,.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0,0,0,.10); border-radius: 9px; padding: 5px; pointer-events: auto;
  box-shadow: 0 12px 32px rgba(20,24,40,.28); animation: cwPop .14s ease both;
}
.mb-traymenu[hidden] { display: none; }
.mb-tm-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  font: 500 11.5px var(--sans); color: #1e1e2e; padding: 5px 9px; border-radius: 6px; white-space: nowrap;
}
.mb-tm-item:hover { background: var(--blue); color: #fff; }
.mb-tm-item.is-danger:hover { background: #e2574c; }
.mb-tm-sep { height: 1px; margin: 4px 6px; background: rgba(0,0,0,.10); }

/* ── Control rail (= #dash-rail, 48). Hidden at rest; HOVER slides it open.
   Stays open while chat/panel are in use so the buttons remain reachable. */
.cw-rail {
  flex: 0 0 48px; height: 100%; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, rgba(247,249,252,0.96), rgba(239,242,247,0.96));
  border-left: 1px solid rgba(0,0,0,0.06);
}
.cw:hover .cw-rail, .cw.rail-open .cw-rail { display: flex; animation: cwRailIn .16s ease; }
@keyframes cwRailIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

.cw-dot {
  position: relative; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(120,130,150,0.92); border: 2px solid rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 11px; line-height: 1; color: #fff; padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22); transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.cw-dot:hover { transform: scale(1.12); }

/* mic dot — blue, with the real ::before body + ::after arc; red while recording */
.cw-mic { background: rgba(74,158,255,0.92); box-shadow: 0 2px 8px rgba(74,158,255,0.4); }
.cw-mic:hover { box-shadow: 0 3px 14px rgba(74,158,255,0.55); }
.cw-mic::before {
  content: ''; position: absolute; top: 5px; width: 7px; height: 9px; border-radius: 4px; background: #fff;
}
.cw-mic::after {
  content: ''; position: absolute; bottom: 3px; width: 13px; height: 6px;
  border: 2px solid #fff; border-top: none; border-radius: 0 0 7px 7px;
}
.cw-mic.recording {
  background: rgba(255,65,65,0.92); box-shadow: 0 2px 12px rgba(255,65,65,0.5);
  animation: cwMicPulse .9s ease-in-out infinite;
}
@keyframes cwMicPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.cw-mute.is-muted { background: rgba(255,80,80,0.95); box-shadow: 0 2px 12px rgba(255,80,80,0.5); }
.cw-chat.active, .cw-panel.active { background: rgba(74,158,255,0.95); }

/* ── Chat column (= #chat-area, 220, near-opaque dark). Opens to the right. ── */
.cw-chatcol {
  flex: 0 0 220px; height: 100%; overflow: hidden; display: none; flex-direction: column;
  background: rgba(20,20,30,0.96); border-left: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 22px 22px 0;
}
.cw-chatcol.is-open { display: flex; animation: cwRailIn .18s ease; }
.cw-chat-close {
  position: absolute; top: 4px; right: 6px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.75); border: none;
  font-size: 11px; line-height: 16px; text-align: center; cursor: pointer; z-index: 6;
}
.cw-chat-close:hover { background: rgba(255,255,255,0.28); color: #fff; }
.cw-msgs {
  flex: 1; overflow-y: auto; padding: 22px 10px 4px; font-size: 11px; line-height: 1.4; scrollbar-width: none;
}
.cw-msgs::-webkit-scrollbar { display: none; }
.cw-msg { margin-bottom: 5px; word-wrap: break-word; animation: cwPop .2s ease both; }
.cw-msg.user { color: rgba(255,255,255,0.5); text-align: right; }
.cw-msg.bot { color: rgba(255,255,255,0.9); }
.cw-inputrow { display: flex; align-items: center; padding: 3px 6px 6px; gap: 4px; }
.cw-input {
  flex: 1; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; color: #fff; font: inherit; font-size: 11px; padding: 4px 8px; outline: none;
}
.cw-input::placeholder { color: rgba(255,255,255,0.35); }
.cw-input:focus { border-color: rgba(74,158,255,0.6); }
.cw-send {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(74,158,255,0.8); border: none;
  cursor: pointer; color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* ── Overlays (= #panel-overlay / #setup-overlay): full-widget pastel cards ── */
.cw-overlay {
  position: absolute; inset: 0; border-radius: 18px; z-index: 60; opacity: 1;
  background: linear-gradient(180deg, rgba(252,252,255,0.99), rgba(244,243,254,0.99));
  display: none; flex-direction: column; padding: 14px 14px 12px; overflow: hidden; color: #1e1e2e; font-size: 12px;
}
/* `both` so it holds the final (opaque) frame — without it the pop can read back at opacity:0 */
.cw-overlay.is-open { display: flex; animation: cwPop .24s cubic-bezier(.2,.9,.3,1.25) both; }
.cw-ov-close {
  position: absolute; top: 12px; right: 14px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.06); color: rgba(40,40,55,0.7); border: none;
  font-size: 12px; line-height: 20px; text-align: center; cursor: pointer;
}
.cw-ov-close:hover { background: rgba(0,0,0,0.12); }
.cw-ov-title { font-family: var(--sans); font-weight: 800; font-size: 16px; color: #33334d; letter-spacing: .2px; }
.cw-ov-sub { font-size: 11px; color: rgba(51,51,77,0.55); margin: 2px 0 8px; }
.cw-tabs { display: flex; gap: 4px; margin: 8px 0; }
.cw-tab {
  flex: 1; cursor: pointer; border: none; background: rgba(124,130,210,0.10); color: rgba(51,51,77,0.6);
  border-radius: 12px; padding: 7px 2px; font: 700 10px var(--sans); letter-spacing: -.2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: background .16s ease, transform .16s ease, color .16s ease;
}
.cw-tab:hover { background: rgba(124,130,210,0.18); transform: translateY(-1px); }
.cw-tab.is-on {
  background: linear-gradient(135deg, #6f9bff, #9a86ff); color: #fff; transform: translateY(-1px);
  box-shadow: 0 5px 13px rgba(111,139,255,0.42);
}
.cw-pane { display: none; flex-direction: column; flex: 1; min-height: 0; }
.cw-pane.is-on { display: flex; }
.cw-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; scrollbar-width: none; }
.cw-list::-webkit-scrollbar { width: 0; }
.cw-item {
  display: flex; align-items: flex-start; gap: 8px; background: #fff; border: 1px solid rgba(0,0,0,0.1);
  border-radius: 9px; padding: 7px 9px; animation: cwPop .2s ease both;
}
.cw-item.done { opacity: 0.55; }
.cw-check {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; border-radius: 5px; border: 1.5px solid rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; line-height: 1;
}
.cw-item.done .cw-check { background: #2f9e5e; border-color: #2f9e5e; }
.cw-dotmark { flex: 0 0 auto; }
.cw-itext { flex: 1; line-height: 1.35; word-break: break-word; }
.cw-item.done .cw-itext { text-decoration: line-through; }
.cw-when { display: block; font-size: 10.5px; color: rgba(40,40,55,0.55); margin-top: 2px; }
.cw-empty { font-size: 12px; color: rgba(40,40,55,0.5); text-align: center; padding: 22px 8px; line-height: 1.4; }
.cw-flabel {
  font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .5px; color: rgba(51,51,77,0.55); margin: 10px 0 4px;
}
.cw-fakefield {
  background: #fff; border: 1.5px solid rgba(120,125,200,0.18); border-radius: 12px;
  padding: 8px 9px; font-size: 10.5px; color: #44445e; line-height: 1.4;
}
.cw-fhint { font-size: 10.5px; color: #28b487; font-weight: 600; margin-top: 6px; }

@keyframes cwPop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Director's controls (demo affordances, sit below the desk) ── */
.demo-director { max-width: 620px; margin: 22px auto 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo-voicebar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.demo-voicebar label { font-weight: 600; color: var(--ink); font-size: .92rem; }
.demo-voicebar select {
  font: inherit; font-size: .92rem; padding: .5em .8em; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer;
}
.demo-voicebar__note { font-size: .82rem; color: var(--faint); }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.demo-chip {
  font: inherit; font-size: .85rem; padding: .42em .9em; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer;
  transition: transform .15s, border-color .2s;
}
.demo-chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.demo-chip--scene { border-color: var(--blue); color: var(--blue-ink); font-weight: 600; }
.demo-moods { width: 100%; max-width: 520px; text-align: center; }
.demo-moods summary { cursor: pointer; font-size: .86rem; color: var(--muted); font-weight: 600; }
.demo-moods summary:hover { color: var(--blue-ink); }
.demo-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.demo-controls button { font-size: .82rem; }
.demo-controls .is-on { outline: 2px solid var(--blue); outline-offset: 1px; }

/* honesty note */
.demo-honest { max-width: 64ch; margin: 24px auto 0; text-align: center; font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* ---------- setup steps ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; box-shadow: var(--shadow-s); }
.steps h3 { font-size: 1.12rem; margin: 0 0 8px; }
.steps p { color: var(--muted); margin: 0 0 10px; }
.ticks { margin: 8px 0 0; padding-left: 0; list-style: none; }
.ticks li { padding: 5px 0 5px 26px; position: relative; color: var(--muted); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ---------- support tips ---------- */
.tip-grid { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 8px 0 18px; }
.tip {
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 18px; transition: all .15s; min-width: 90px;
}
.tip:hover { border-color: var(--blue); transform: translateY(-2px); }
.tip.is-sel { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,35,.45); backdrop-filter: blur(4px); }
.modal__card {
  position: relative; width: min(440px, 92vw); background: var(--surface);
  border-radius: var(--r-lg); padding: 30px 28px; box-shadow: var(--shadow-l); border: 1px solid var(--line);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.92) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--faint); cursor: pointer; }
.modal__eyes { width: 120px; height: 74px; margin: 0 auto 8px; display: grid; place-items: center; }
.modal__card h2 { text-align: center; margin: 0 0 4px; font-size: 1.6rem; }
.modal__sub { text-align: center; color: var(--muted); font-size: .95rem; }
.field { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: 1rem; font-family: var(--sans); margin-bottom: 14px; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,158,255,.16); }
.tips__label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.tips__label em { font-style: normal; opacity: .7; }
.tips__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.tips__cur { display: inline-flex; align-items: center; gap: 7px; }
.tips__curlabel { font-size: .82rem; color: var(--muted); }
#cur-select { padding: 6px 9px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: .9rem; background: var(--surface); cursor: pointer; }
.tips__presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 10px; }
.tips__presets .tip { padding: 11px 4px; font-size: 1rem; min-width: 0; text-align: center; }
.tips__custom { position: relative; margin: 0 0 14px; }
.tips__sym { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.tips__custom-input { width: 100%; padding: 12px 14px 12px 32px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: 1rem; font-family: var(--sans); appearance: textfield; -moz-appearance: textfield; }
.tips__custom-input::-webkit-outer-spin-button, .tips__custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tips__custom-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,158,255,.16); }
#paypal-buttons { margin-top: 4px; }
.consent { display: flex; gap: 9px; align-items: flex-start; font-size: .86rem; color: var(--muted); margin-bottom: 16px; }
.consent input { margin-top: 3px; }
.modal__msg { text-align: center; font-size: .9rem; min-height: 1.2em; margin: 12px 0 0; }
.modal__msg.ok { color: var(--green); }
.modal__msg.err { color: var(--pink-deep); }

/* ---------- cookie ---------- */
.cookie {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-l); font-size: .86rem; max-width: 92vw;
}
.cookie[hidden] { display: none; }
.cookie__btns { display: flex; gap: 8px; }

/* ---------- footer ---------- */
.foot { background: linear-gradient(160deg, #20202e, #16161f); color: rgba(255,255,255,.7); text-align: center; padding: 56px 20px 40px; }
.foot__brand { display: flex; gap: 10px; align-items: center; justify-content: center; color: #fff; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.foot__tag { margin: 10px 0 18px; }
.foot__links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.foot__links a { color: rgba(255,255,255,.82); font-weight: 500; }
.foot__links a:hover { color: #fff; }
.foot__fine { font-size: .82rem; color: rgba(255,255,255,.5); margin: 0; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .06s; }
.reveal[data-d="2"] { transition-delay: .12s; }
.reveal[data-d="3"] { transition-delay: .18s; }

/* ============================================================================
   Architecture teaching page
   ========================================================================== */
.arch-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--blue), var(--pink)); transition: width .1s linear; }

.arch-hero { padding: clamp(56px, 8vw, 92px) 0 8px; text-align: center; }

.arch-layout { display: grid; grid-template-columns: 232px 1fr; gap: 48px; align-items: start;
  width: min(1180px, 94vw); margin: 0 auto; padding: 20px 0 80px; }
.arch-toc { position: sticky; top: 88px; align-self: start; font-size: .9rem; }
.arch-toc__title { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.arch-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.arch-toc li a {
  display: block; padding: 7px 0 7px 16px; margin-left: -2px; color: var(--muted);
  border-left: 2px solid transparent; font-weight: 500; line-height: 1.3; transition: color .15s, border-color .15s;
}
.arch-toc li a:hover { color: var(--ink); }
.arch-toc li a.is-active { color: var(--blue-ink); border-left-color: var(--blue); }
.arch-toc__num { font-family: var(--mono); font-size: .76rem; color: var(--faint); margin-right: 7px; }

.arch-content { min-width: 0; }
.chapter { padding: 40px 0 8px; scroll-margin-top: 86px; border-top: 1px solid var(--line); }
.chapter:first-of-type { border-top: 0; padding-top: 12px; }
.chapter__num { font-family: var(--mono); font-size: .76rem; letter-spacing: .12em; color: var(--blue-ink); text-transform: uppercase; }
.chapter h2 { margin: 6px 0 .4em; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.chapter h3 { margin: 28px 0 .4em; font-size: 1.2rem; }
.chapter p, .chapter li { color: var(--text); }
.chapter p { max-width: 68ch; }
.chapter ul { padding-left: 1.1em; }
.chapter li { margin: 4px 0; }
.q-lead { font-size: 1.12rem; color: var(--muted); font-style: italic; max-width: 60ch; }

/* Part II — sets the bonus "payments" track apart from the Cosmo chapters */
.arch-part { border-top: 3px solid var(--blue); margin-top: 26px; }
.arch-part .chapter__num { color: var(--blue); }
.arch-toc__part { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* callouts */
.callout { border-radius: var(--r-sm); padding: 16px 18px 16px 20px; margin: 22px 0; border-left: 4px solid; font-size: .96rem; }
.callout p:last-child { margin-bottom: 0; }
.callout__k { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; display: block; margin-bottom: 5px; }
.callout--why   { background: rgba(74,158,255,.07);  border-color: var(--blue); }
.callout--why   .callout__k { color: var(--blue-ink); }
.callout--rule  { background: rgba(255,107,138,.07); border-color: var(--pink-deep); }
.callout--rule  .callout__k { color: var(--pink-deep); }
.callout--trade { background: rgba(27,154,99,.07);   border-color: var(--green); }
.callout--trade .callout__k { color: var(--green); }

/* contract strip */
.contract { margin: 22px 0; }
.contract__cap { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--faint); margin: 0 0 6px; }

/* chapter prev/next */
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.chapter-nav a { font-family: var(--display); font-weight: 600; font-size: .92rem; }

/* ---------- CSS diagrams ---------- */
.diagram { margin: 24px 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-s); }
.diagram__cap { text-align: center; font-size: .82rem; color: var(--faint); margin: 12px 0 0; font-family: var(--mono); letter-spacing: .03em; }

.diag-box {
  border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--surface);
  text-align: center; min-width: 0;
}
.diag-box b { display: block; font-family: var(--display); font-size: .98rem; color: var(--ink); }
.diag-box small { color: var(--muted); font-size: .8rem; }
.diag-box code { font-size: .76rem; }
.diag-box--blue  { border-color: rgba(74,158,255,.5);  background: rgba(74,158,255,.06); }
.diag-box--pink  { border-color: rgba(255,107,138,.5); background: rgba(255,107,138,.06); }
.diag-box--ink   { background: var(--ink); border-color: var(--ink); }
.diag-box--ink b { color: #fff; } .diag-box--ink small { color: rgba(255,255,255,.7); }
.diag-box--ink code { color: #9bd0ff; background: rgba(255,255,255,.12); }

.diag-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; align-items: stretch; }
.diag-col { display: grid; gap: 14px; }
.diag-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* vertical layer stack with a dashed IPC boundary */
.diag-layers { display: grid; gap: 0; }
.diag-layer { border: 1.5px solid var(--line-2); border-radius: 10px; padding: 12px 16px; background: var(--surface); margin: 6px 0; }
.diag-layer b { font-family: var(--display); }
.diag-layer small { color: var(--muted); display: block; font-size: .82rem; }
.diag-bound { text-align: center; font-family: var(--mono); font-size: .72rem; color: var(--faint); letter-spacing: .06em;
  border-top: 2px dashed var(--line-2); margin: 12px 6px; padding-top: 6px; }

/* connector arrow (down) between stacked boxes */
.diag-arrow { text-align: center; color: var(--faint); font-size: 1.1rem; line-height: 1; margin: 2px 0; }
.diag-flow { display: grid; gap: 0; }
.diag-flow .diag-box { margin: 0 auto; max-width: 460px; width: 100%; }

/* numbered data-flow timeline */
.flow-steps { list-style: none; counter-reset: f; margin: 18px 0; padding: 0; position: relative; }
.flow-steps::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.flow-steps li { counter-increment: f; position: relative; padding: 6px 0 18px 46px; }
.flow-steps li::before { content: counter(f); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: .82rem; font-weight: 600; box-shadow: var(--shadow-s); }
.flow-steps b { font-family: var(--display); color: var(--ink); }
.flow-steps small { color: var(--muted); display: block; font-size: .9rem; }

/* ---------- zoomable system map ---------- */
.arch-map { margin: 26px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; }
.arch-map__bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.arch-map__bar .spacer { flex: 1; }
.arch-map__btn { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--ink); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.arch-map__btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.arch-map__viewport { position: relative; height: clamp(380px, 58vh, 600px); overflow: hidden; cursor: grab;
  background: radial-gradient(circle at 50% 38%, #ffffff, #eef1fb); touch-action: none; }
.arch-map__viewport.is-grab { cursor: grabbing; }
.arch-map__canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.arch-map__canvas svg { display: block; }
.arch-map__hint { position: absolute; bottom: 8px; right: 12px; font-family: var(--mono); font-size: .64rem;
  color: var(--faint); background: rgba(255,255,255,.74); padding: 2px 8px; border-radius: 6px; pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .arch-layout { grid-template-columns: 1fr; gap: 8px; }
  .arch-toc { position: static; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); }
  .arch-toc ol { display: flex; flex-wrap: wrap; gap: 4px 10px; border-left: 0; }
  .arch-toc li a { border-left: 0; padding: 4px 0; }
}
@media (max-width: 860px) {
  .grid--3, .grid--2, .diag-3 { grid-template-columns: 1fr; }
  .diag-row { grid-auto-flow: row; grid-auto-columns: auto; }
  .nav__burger { display: inline-flex; }
  /* links collapse into a dropdown panel under the bar, toggled by the burger */
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    display: none; flex-direction: column; gap: 2px; padding: 8px 16px 14px;
    background: rgba(255, 255, 255, 0.985); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-m);
  }
  .nav.is-open .nav__links { display: flex; animation: navDrop .16s ease; }
  .nav__links a { padding: 11px 12px; font-size: 1rem; }
  section { padding: 56px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero__eyes::before { opacity: .9 !important; }
}
