/* =========================================================
   joshuabeverly.com — Interactive view
   Same palette as the Overview and Technical views. Serif
   headings (Newsreader), Archivo body, Plex Mono for game UI.
   Sections unlock one at a time; without JS everything shows.
   ========================================================= */

:root {
  --bg: #F6F3EE;
  --bg-alt: #EEEAE2;
  --surface: #FFFFFF;
  --ink: #1A1916;
  --ink-2: #3D3A34;
  --muted: #6B665D;
  --line: #E1DCD2;
  --line-strong: #CFC8BB;
  --accent: #B4471C;
  --accent-bright: #E4531B;
  --accent-soft: #F6E5DB;
  --on-accent: #FFFFFF;
  --olive: #5A6336;
  --olive-soft: #E7E9D9;
  --dot: rgba(26, 25, 22, .11);
  --shadow-sm: 0 1px 2px rgba(26, 25, 22, .05);
  --shadow: 0 1px 2px rgba(26, 25, 22, .04), 0 12px 32px -12px rgba(26, 25, 22, .16);
  --shadow-lg: 0 2px 4px rgba(26, 25, 22, .04), 0 30px 60px -24px rgba(26, 25, 22, .28);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1080px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --r: 14px;
  --hud-h: 0px;
  color-scheme: light;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210; --bg-alt: #181715; --surface: #1D1B18;
    --ink: #EDE9E0; --ink-2: #CBC5B9; --muted: #9A9387;
    --line: #2C2A25; --line-strong: #3B3832;
    --accent: #F07A45; --accent-bright: #FF6A2B; --accent-soft: #33221A; --on-accent: #1A0D05;
    --olive: #A9B472; --olive-soft: #262A1C;
    --dot: rgba(237, 233, 224, .09);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 60px -24px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210; --bg-alt: #181715; --surface: #1D1B18;
  --ink: #EDE9E0; --ink-2: #CBC5B9; --muted: #9A9387;
  --line: #2C2A25; --line-strong: #3B3832;
  --accent: #F07A45; --accent-bright: #FF6A2B; --accent-soft: #33221A; --on-accent: #1A0D05;
  --olive: #A9B472; --olive-soft: #262A1C;
  --dot: rgba(237, 233, 224, .09);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 60px -24px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; transition: background-color .35s ease, color .35s ease;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.skip:focus { top: 12px; }
.noscript { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin: 24px auto 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.noscript a, .link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.kicker::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.mini-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: .005em; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .3s var(--ease), transform .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--solid { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 18px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--solid:hover { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn--outline { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn--outline:hover { border-color: var(--ink); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 9px; gap: 8px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn[data-next]:hover svg { transform: translateY(2px); }

.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; transition: border-color .2s; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: block; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .35s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 17px; letter-spacing: -.02em;
  transition: background-color .25s, color .25s, transform .4s var(--ease);
}
.brand:hover .brand__mark { background: var(--accent); color: var(--on-accent); transform: rotate(-5deg); }
.brand__name { font-weight: 650; font-size: 15.5px; letter-spacing: -.005em; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) { .brand__name { display: none; } }
@media (max-width: 600px) { .nav__resume { display: none; } .nav__actions { gap: 8px; } }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 68px; z-index: 45;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: none;
}
.is-touring .hud { display: block; animation: hud-in .5s var(--ease) both; }
@keyframes hud-in { from { opacity: 0; transform: translateY(-8px); } }
.hud__inner { display: flex; align-items: center; gap: 18px; height: 52px; }
.hud__pips { display: flex; align-items: center; gap: 6px; }
.pip {
  position: relative; width: 22px; height: 6px; border-radius: 99px; background: var(--line-strong);
  transition: background-color .3s, width .4s var(--ease);
}
.pip button { position: absolute; inset: -9px -2px; border-radius: 6px; cursor: pointer; }
.pip button:disabled { cursor: default; }
.pip.is-open { background: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.pip.is-done { background: var(--olive); }
.pip.is-here { width: 38px; background: var(--accent); }
.hud__label { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__label span:first-child { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.hud__actions { margin-left: auto; display: flex; gap: 8px; }
.hud__btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  font-size: 13.5px; font-weight: 600; transition: border-color .2s, transform .3s var(--spring);
}
.hud__btn:hover { border-color: var(--ink); }
.hud__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.hud__btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.hud__btn--ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.hud__count { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 11.5px; }
.hud__btn.is-bump { animation: bump .5s var(--spring); }
.hud__btn.is-bump .hud__count { background: var(--accent); color: var(--on-accent); }
@keyframes bump { 40% { transform: scale(1.12); } }
.floater {
  position: fixed; z-index: 70; pointer-events: none; padding: 3px 9px; border-radius: 99px;
  background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: 12px; font-weight: 600;
  animation: float-up 1.3s var(--ease) forwards;
}
@keyframes float-up { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
@media (max-width: 720px) { .hud__label { display: none; } .hud__btn-text { display: none; } }
@media (max-width: 440px) { .pip { width: 14px; } .pip.is-here { width: 26px; } .hud__inner { gap: 10px; } .hud__btn--ghost { padding: 0 8px; } }

.belt {
  position: fixed; inset: auto; top: 128px; right: max(var(--gutter), calc((100vw - var(--maxw)) / 2));
  margin: 0; width: min(380px, calc(100vw - 2 * var(--gutter))); max-height: min(60vh, 520px); overflow: auto;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.belt:popover-open { animation: hud-in .3s var(--ease); }
.belt__head { margin-bottom: 12px; }
.belt__sum { margin-top: 4px; font-size: 14px; color: var(--ink-2); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li, .chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.chips--sm li { height: 25px; font-size: 12.5px; padding: 0 8px; }
.chips li.is-new { animation: chip-in .5s var(--spring) both; border-color: var(--accent); color: var(--ink); }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px) scale(.85); } }

/* ---------- entrance animation (intro) ---------- */
.js .anim { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; animation-delay: calc(var(--a, 0) * 90ms + 80ms); }
.js .anim-up { display: inline-block; transform: translateY(105%); animation: up 1s var(--ease) forwards; animation-delay: calc(var(--a, 0) * 90ms + 40ms); }
.js .anim-card { opacity: 0; transform: translateY(24px) scale(.985); animation: rise 1s var(--ease) .45s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes up { to { transform: none; } }

/* ---------- intro ---------- */
.intro { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 104px); }
.intro__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.intro__name { margin-top: 18px; font-family: var(--serif); font-weight: 500; font-size: clamp(3.6rem, 9vw, 7rem); line-height: .92; letter-spacing: -.035em; }
.intro__name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.intro__name em { font-style: normal; color: var(--accent); }
.intro__lede { margin-top: 26px; max-width: 46ch; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); text-wrap: pretty; }
.intro__lede em { font-family: var(--serif); font-size: 1.12em; color: var(--accent); }
.intro__facts { display: flex; gap: 26px; margin-top: 30px; color: var(--muted); font-size: 14px; }
.intro__facts b { display: block; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1; color: var(--ink); letter-spacing: -.02em; margin-bottom: 4px; }

.setup {
  position: relative; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.setup::before {
  content: ""; position: absolute; inset: 10px; border: 1px dashed var(--line); border-radius: 12px; pointer-events: none;
}
.setup > * { position: relative; }
.setup__step { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.setup__q { margin-top: 10px; font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.1rem); line-height: 1.1; letter-spacing: -.02em; }
.setup__hint { margin-top: 8px; color: var(--muted); font-size: 15px; }
.focus { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.focus__chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--bg); font-size: 14px; font-weight: 550;
  transition: border-color .2s, background-color .2s, color .2s, transform .3s var(--spring);
}
.focus__chip::before {
  content: ""; width: 14px; height: 14px; border-radius: 99px; border: 1.5px solid var(--line-strong);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.focus__chip:hover { border-color: var(--ink); }
.focus__chip:active { transform: scale(.96); }
.focus__chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.focus__chip[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2.5px var(--accent-soft); }
.setup__go { width: 100%; margin-top: 24px; }
.setup__go:hover svg { transform: translateX(3px); }
.setup__alt { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }
@media (max-width: 880px) { .intro__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- stages ---------- */
.stage { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.stage:nth-of-type(even) { background: var(--bg-alt); }
.js .stage:not(.is-open) { display: none; }
.stage.is-entering { animation: stage-in .8s var(--ease) both; }
@keyframes stage-in { from { opacity: 0; transform: translateY(28px); } }
.stage__head { max-width: 680px; margin-bottom: clamp(26px, 4vw, 40px); }
.stage__meta { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.stage__num { display: grid; place-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 11.5px; }
.stage.is-done .stage__num { background: var(--olive); }
.stage__head h2 { margin-top: 16px; font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.stage__head h2 em { font-style: italic; color: var(--accent); }
.stage__brief { margin-top: 14px; font-size: 17.5px; color: var(--ink-2); text-wrap: pretty; }
.stage__match {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 12px 6px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--ink); font-size: 13.5px; font-weight: 550;
}
.stage__match::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); }
.stage__match[hidden] { display: none; }

/* game frame */
.game { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); padding: clamp(16px, 2.6vw, 26px); }
.game__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.game__status { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; color: var(--ink); }
.game__status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 99px; background: var(--accent); vertical-align: 1px; animation: blink 1.6s ease-in-out infinite; }
.stage.is-done .game__status::before { background: var(--olive); animation: none; }
@keyframes blink { 50% { opacity: .3; } }
.game__hint { font-size: 13.5px; color: var(--muted); }
.board-dots { background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 18px 18px; }

/* debrief */
.debrief { display: none; margin-top: 22px; }
.debrief.is-open, html:not(.js) .debrief { display: grid; gap: 18px; justify-items: start; animation: stage-in .7s var(--ease) both; }
.debrief__note { max-width: 640px; font-size: 17px; color: var(--ink-2); }
.debrief__note p + p { margin-top: 6px; }
.debrief__lead { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.55rem); line-height: 1.3; color: var(--ink); letter-spacing: -.01em; }
.debrief__lead strong { font-weight: 600; color: var(--accent); }
.role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; }
@media (max-width: 820px) { .role-cards { grid-template-columns: minmax(0, 1fr); } }
.role-card { position: relative; width: 100%; padding: 22px 24px 22px 26px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.role-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--olive); }
.role-card--now::before { background: var(--accent); }
.role-card__meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.role-card h3 { margin-top: 8px; font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.015em; }
.role-card__org { margin-top: 2px; font-weight: 650; color: var(--accent); }
.role-card__points { margin-top: 12px; display: grid; gap: 8px; }
.role-card__points li { position: relative; padding-left: 20px; font-size: 15.5px; color: var(--ink-2); }
.role-card__points li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 1.5px; background: var(--accent); }
.debrief__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; color: var(--muted); }

/* ---------- 00 route ---------- */
.route__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 28px; }
.route__date { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
.route__year { font-family: var(--serif); font-weight: 500; font-size: clamp(4rem, 11vw, 7rem); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.route__month { font-family: var(--mono); font-size: 14px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; order: 2; }
.route__stats { display: flex; gap: clamp(16px, 3vw, 32px); }
.route__stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.route__stats dd { font-family: var(--serif); font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.route__track { position: relative; margin-top: 22px; padding-top: 30px; }
.route__bands { position: absolute; left: 0; right: 0; top: 0; height: 22px; }
.band {
  position: absolute; top: 0; height: 22px; border-radius: 4px; overflow: hidden;
  font-size: 11px; font-weight: 600; line-height: 22px; padding: 0 6px; white-space: nowrap; text-overflow: ellipsis;
  background: var(--line); color: var(--ink-2); transition: background-color .3s, color .3s, transform .3s var(--ease);
  border-right: 2px solid var(--surface);
}
.band--mil { background: var(--olive-soft); }
.band--con { background: repeating-linear-gradient(135deg, var(--line) 0 4px, var(--bg) 4px 8px); }
.band--full { background: var(--accent-soft); }
.band.is-on { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); }
.band--mil.is-on { background: var(--olive); color: var(--bg); }
.route__range {
  --p: 0%;
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 34px; margin: 0; background: transparent; cursor: grab;
}
.route__range:active { cursor: grabbing; }
.route__range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--line-strong) var(--p)); }
.route__range::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--line-strong) var(--p)); }
.route__range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow);
  transition: transform .2s var(--spring);
}
.route__range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 99px; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); }
.route__range:active::-webkit-slider-thumb { transform: scale(1.15); }
.route__range:focus-visible { outline: none; }
.route__range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 3px; }
.route__ticks { position: relative; height: 18px; margin-top: 2px; }
.route__ticks span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.route__ticks span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 4px; background: var(--line-strong); }
.route__body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-top: 22px; }
.route__card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); min-height: 190px; }
.route__card.is-swap > * { animation: swap .45s var(--ease) both; }
.route__card.is-swap > :nth-child(2) { animation-delay: 30ms; }
.route__card.is-swap > :nth-child(3) { animation-delay: 60ms; }
.route__card.is-swap > :nth-child(4) { animation-delay: 90ms; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } }
.route__kind { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.route__title { margin-top: 6px; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.015em; }
.route__org { margin-top: 3px; font-weight: 650; }
.route__sum { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; }
.route__tools { padding: 4px 0; }
.route__tools .chips { margin-top: 10px; }
.route__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
#rPlay svg { fill: currentColor; stroke: none; }
#rPlay .i-pause { display: none; fill: none; stroke: currentColor; stroke-width: 2.4; }
#rPlay.is-playing .i-play { display: none; }
#rPlay.is-playing .i-pause { display: block; }
.route__legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg--mil { background: var(--olive-soft); border: 1px solid var(--olive); }
.lg--con { background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, var(--bg) 2px 4px); border: 1px solid var(--line-strong); }
.lg--full { background: var(--accent-soft); border: 1px solid var(--accent); }
@media (max-width: 760px) { .route__body { grid-template-columns: minmax(0, 1fr); } .band { font-size: 0; } }

/* ---------- 01 network ---------- */
.net__board { position: relative; aspect-ratio: 1000 / 440; border-radius: 12px; border: 1px solid var(--line); background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 18px 18px; touch-action: none; }
.net__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wire { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 6 7; fill: none; vector-effect: non-scaling-stroke; }
.wire--live { stroke: var(--accent); stroke-width: 3; stroke-dasharray: none; stroke-linecap: round; }
.wire--draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .5s var(--ease) forwards; }
.wire--temp { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 5; opacity: .8; }
.net.is-up .wire--live { stroke: var(--olive); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.net__node {
  z-index: 2;
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px; width: clamp(82px, 13vw, 118px); padding: 10px 6px 9px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: border-color .2s, box-shadow .25s, transform .3s var(--spring);
}
.net__node svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.net__name { font-size: 13px; font-weight: 650; line-height: 1.15; text-align: center; }
.net__sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.net__node:hover { border-color: var(--ink); }
.net__node.is-sel { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); transform: translate(-50%, -50%) scale(1.05); }
.net__node.is-linked { border-color: var(--accent); }
.net.is-up .net__node { border-color: var(--olive); }
.net__node.is-bad { animation: shake .4s; }
.net.is-up .net__node[data-node="phone"] svg { animation: ring .9s ease-in-out 2; color: var(--olive); }
@keyframes shake { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
@keyframes ring { 10%, 30%, 50% { rotate: -14deg; } 20%, 40%, 60% { rotate: 14deg; } 70% { rotate: 0deg; } }
.packet { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 99px; background: var(--olive); box-shadow: 0 0 0 4px color-mix(in srgb, var(--olive) 22%, transparent); pointer-events: none; animation: pkt 1.6s linear infinite; animation-delay: var(--d, 0s); }
@keyframes pkt { from { left: calc(var(--x1) * 1%); top: calc(var(--y1) * 1%); } to { left: calc(var(--x2) * 1%); top: calc(var(--y2) * 1%); } }
@media (max-width: 620px) {
  .net__board { aspect-ratio: 1 / 1; }
  .net__node { width: 78px; padding: 8px 4px; }
  .net__node svg { width: 22px; height: 22px; }
  .net__name { font-size: 11.5px; }
  .net__sub { display: none; }
}

/* ---------- 02 queue ---------- */
.tickets { display: grid; gap: 10px; counter-reset: t; }
.ticket {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 18px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color .3s, background-color .3s;
}
.ticket__head { grid-column: 1; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ticket__pri { padding: 1px 6px; border-radius: 4px; font-weight: 600; color: var(--ink); background: var(--line); }
.ticket__pri--1 { background: var(--accent); color: var(--on-accent); }
.ticket__pri--2 { background: var(--accent-soft); color: var(--accent); }
.ticket__title { grid-column: 1; font-weight: 600; font-size: 16px; line-height: 1.35; }
.hold {
  grid-column: 2; grid-row: 1 / span 2; position: relative; overflow: hidden; height: 42px; min-width: 156px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 9px; background: var(--surface); font-size: 14px; font-weight: 650;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .2s var(--spring);
}
.hold__fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.hold:not(.is-holding) .hold__fill { transition: transform .35s var(--ease); }
.hold__label { position: relative; mix-blend-mode: normal; }
.hold.is-holding { transform: scale(.97); }
.hold.is-holding .hold__label { color: var(--ink); }
.ticket__fix { display: none; grid-column: 1 / -1; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line-strong); font-size: 15px; color: var(--ink-2); }
.ticket__who { font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.ticket__who strong { color: var(--ink); font-weight: 650; }
.ticket.is-done { border-color: color-mix(in srgb, var(--olive) 45%, var(--line)); background: var(--surface); }
.ticket.is-done .hold { display: none; }
.ticket.is-done .ticket__fix { display: block; animation: swap .5s var(--ease) both; }
.ticket.is-done .ticket__title { text-decoration: line-through; text-decoration-color: var(--olive); text-decoration-thickness: 1.5px; color: var(--muted); }
.ticket.is-done .ticket__head::after { content: "Resolved"; margin-left: auto; padding: 1px 7px; border-radius: 4px; background: var(--olive); color: var(--bg); font-weight: 600; }
.ticket.is-done.is-fresh { animation: pop .5s var(--spring); }
@keyframes pop { 40% { transform: scale(1.015); } }
@media (max-width: 600px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .hold { grid-column: 1; grid-row: auto; width: 100%; }
}

/* ---------- 03 fleet ---------- */
.fleet__tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 64px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 18px 18px; }
.fleet__tray:empty::after { content: "All devices enrolled"; align-self: center; font-family: var(--mono); font-size: 12.5px; color: var(--olive); }
.dev {
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 14px 0 12px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; transition: border-color .2s, transform .25s var(--spring), opacity .2s;
}
.dev svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dev:hover { border-color: var(--ink); transform: translateY(-2px); }
.dev.is-sel { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.dev.is-lifted { opacity: .3; }
.dev-ghost { position: fixed; z-index: 90; pointer-events: none; margin: 0; transform: rotate(-3deg) scale(1.05); box-shadow: var(--shadow-lg); border-color: var(--accent); cursor: grabbing; }
.fleet__bins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.bin {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 150px; padding: 16px 18px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .2s, background-color .2s, transform .3s var(--spring);
}
.bin__name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; letter-spacing: -.01em; }
.bin__count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bin__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bin__list span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; background: var(--olive-soft); color: var(--ink); font-size: 12.5px; font-weight: 550; animation: chip-in .45s var(--spring) both; }
.bin__list span::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--olive); }
.fleet.is-picking .bin, .bin.is-over { border-color: var(--accent); border-style: dashed; }
.bin.is-over { background: var(--accent-soft); transform: scale(1.015); }
.bin.is-bad { animation: shake .4s; border-color: var(--accent); }
.fleet__msg { min-height: 1.6em; margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }
.fleet__msg.is-bad { color: var(--accent); }
@media (max-width: 520px) { .fleet__bins { grid-template-columns: minmax(0, 1fr); } .bin { min-height: 110px; } }

/* ---------- 04 audit ---------- */
.audit__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); align-items: start; }
.controls { display: grid; gap: 8px; }
.ctl { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ctl:hover { border-color: var(--line-strong); }
.ctl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ctl__ui { flex: none; position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); transition: background-color .25s; }
.ctl__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .35s var(--spring); }
.ctl input:checked + .ctl__ui { background: var(--olive); }
.ctl input:checked + .ctl__ui::after { transform: translateX(18px); }
.ctl input:focus-visible + .ctl__ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.ctl:has(input:checked) { background: var(--surface); border-color: color-mix(in srgb, var(--olive) 40%, var(--line)); }
.ctl__text { display: grid; line-height: 1.3; }
.ctl__text strong { font-size: 15px; font-weight: 650; }
.ctl__text small { font-size: 13px; color: var(--muted); }
.frameworks { position: relative; display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 18px 18px; }
.fw { display: grid; grid-template-columns: 62px minmax(0, 1fr) 44px; align-items: center; gap: 12px; }
.fw__name { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.fw__bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fw__bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--accent); transition: width .6s var(--ease), background-color .3s; }
.fw__pct { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fw.is-pass .fw__bar i { background: var(--olive); }
.fw.is-pass .fw__pct { color: var(--olive); font-weight: 600; }
.stamp {
  justify-self: center; margin-top: 8px; display: grid; justify-items: center; padding: 10px 22px 8px;
  border: 3px double var(--olive); border-radius: 10px; color: var(--olive); opacity: 0; transform: rotate(-8deg) scale(1.8);
  font-family: var(--sans); font-stretch: 120%; font-weight: 800; font-size: 1.3rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1.1;
}
.stamp small { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; }
.audit.is-pass .stamp { animation: stamp .55s cubic-bezier(.5, 0, .3, 1.4) forwards; }
@keyframes stamp { 60% { opacity: 1; transform: rotate(-8deg) scale(.95); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
@media (max-width: 760px) { .audit__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 05 cloud ---------- */
.cloud__scene { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.zone-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.closet { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: background-color .6s, opacity .6s; }
.rack { display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: #1F1D1A; border: 1px solid #3B3832; } /* hardware stays dark in both themes */
.unit {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 46px; padding: 0 8px 0 12px;
  border-radius: 5px; background: #2E2B27; color: #EDE9E0;
  transition: opacity .4s, background-color .4s;
}
.unit__leds { display: flex; gap: 4px; }
.unit__leds i { width: 6px; height: 6px; border-radius: 99px; background: #8FD06A; animation: led 1.2s steps(2) infinite; }
.unit__leds i + i { background: var(--accent-bright); animation-duration: .7s; }
@keyframes led { 50% { opacity: .25; } }
.unit__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit__go { height: 30px; padding: 0 12px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 650; transition: background-color .2s, transform .2s var(--spring); }
.unit__go:hover { transform: translateY(-1px); background: var(--accent-bright); }
.unit.is-gone { background: #252320; }
.unit.is-gone .unit__name { opacity: .35; text-decoration: line-through; }
.unit.is-gone .unit__go { visibility: hidden; }
.unit.is-gone .unit__leds i { animation: none; background: #8FD06A; opacity: .5; }
.closet.is-off .unit__leds i { background: #3a3833; opacity: 1; animation: none; transition: background-color .2s; transition-delay: var(--off, 0s); }
.closet.is-off .rack { filter: saturate(.4) brightness(.8); }
.closet.is-off .zone-label::after { content: " · powered down"; color: var(--olive); }
.power { margin-top: 12px; width: 100%; }
.power[hidden] { display: none; }
.power:not([hidden]) { animation: chip-in .5s var(--spring) both; }
.sky { position: relative; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 18px 18px; }
.sky__list { display: grid; gap: 6px; }
.sky__list li { display: grid; gap: 1px; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 7px; background: var(--surface); }
.sky__list li.is-pending { visibility: hidden; }
.sky__list b { font-size: 14px; font-weight: 650; }
.sky__list small { font-size: 12.5px; color: var(--muted); }
.sky__empty { font-size: 14px; color: var(--muted); }
.cloud.is-done .sky { border-color: var(--olive); border-style: solid; }
.cloud.is-done .sky__list li { border-left-color: var(--olive); }
.flyer { position: fixed; z-index: 80; pointer-events: none; display: grid; align-items: center; padding: 0 12px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 650; box-shadow: var(--shadow-lg); white-space: nowrap; }
.meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 18px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.meter__bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter__bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .7s var(--ease), background-color .3s; }
.cloud.is-done .meter__bar i { background: var(--olive); }
@media (max-width: 700px) { .cloud__scene { grid-template-columns: minmax(0, 1fr); } }

/* ---------- skills ---------- */
.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 6px; }
.ask__prompt { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.015em; }
.ask__input {
  flex: 1 1 200px; min-width: 0; height: 52px; padding: 0 4px; border: 0; border-bottom: 2px solid var(--line-strong); background: transparent;
  font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--accent); outline: none; transition: border-color .2s;
}
.ask__input:focus { border-bottom-color: var(--accent); }
.ask__input::placeholder { color: var(--line-strong); }
.ask__q { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); margin-left: -8px; }
.ask__answer { min-height: 0; }
.ask__answer:not(:empty) { margin-top: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); animation: swap .4s var(--ease) both; }
.ask__answer .verdict { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.ask__answer .verdict::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: currentColor; }
.ask__answer .verdict--yes { color: var(--olive); }
.ask__answer .verdict--no { color: var(--muted); }
.ask__answer p { margin-top: 6px; color: var(--ink-2); font-size: 16px; }
.ask__answer strong { color: var(--ink); }
.ask__try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ask__try button { height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; font-weight: 550; color: var(--ink-2); transition: border-color .2s, color .2s; }
.ask__try button:hover { border-color: var(--accent); color: var(--accent); }
.inventory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.inv-group h3 { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.inv-group ul { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-group button { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 500; transition: border-color .2s, color .2s, background-color .2s; }
.inv-group button:hover { border-color: var(--ink); color: var(--ink); }
.inv-group button.is-got { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); font-weight: 600; }
.inv-group button.is-asked { outline: 2px solid var(--accent); outline-offset: 1px; }
.inventory__note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.inventory__note b { color: var(--accent); }
@media (max-width: 720px) { .inventory { grid-template-columns: minmax(0, 1fr); } }

/* ---------- credentials ---------- */
.flips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0; border: 0; background: none; box-shadow: none; }
.flip { perspective: 1200px; min-height: 270px; }
.flip__inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--spring); }
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip__back { transform: rotateY(180deg); justify-content: center; gap: 12px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.flip__back .mini-label { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.flip__back code { font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .06em; word-break: break-all; color: var(--accent-bright); }
.flip__seal { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.flip__seal svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.flip--edu .flip__seal { background: var(--olive-soft); color: var(--olive); }
.flip__issuer { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.flip h3 { margin-top: 4px; font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.01em; }
.flip__about { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.flip__btn { margin-top: auto; align-self: flex-start; height: 34px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 8px; font-size: 13.5px; font-weight: 650; transition: background-color .2s, color .2s; }
.flip__btn:hover { background: var(--ink); color: var(--bg); }
.flip__row { display: flex; gap: 8px; }
.flip__btn--back { margin-top: 0; border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.flip__btn--back:hover { background: var(--bg); color: var(--ink); }
.flip__back .copy { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.flips__count { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
@media (max-width: 980px) { .flips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .flips { grid-template-columns: minmax(0, 1fr); } .flip { min-height: 230px; } }

/* ---------- copy / toast ---------- */
.copy { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-2); background: var(--surface); transition: border-color .2s, background-color .2s, color .2s; }
.copy:hover { border-color: var(--ink); color: var(--ink); }
.copy.is-done { background: var(--olive) !important; border-color: var(--olive) !important; color: var(--bg) !important; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translate(-50%, 16px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- finale ---------- */
.finale { background: var(--bg) !important; }
.file { position: relative; max-width: 820px; margin: 0 auto; padding-top: 30px; }
.file__tab { position: absolute; top: 0; left: 24px; height: 31px; padding: 6px 18px 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--olive-soft); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.file__body { position: relative; padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.file__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.file__name { margin-top: 4px; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1; letter-spacing: -.025em; }
.file__role { margin-top: 8px; color: var(--muted); font-size: 15px; }
.file__stamp {
  flex: none; display: grid; justify-items: center; padding: 8px 16px 6px; border: 3px double var(--accent); border-radius: 10px; color: var(--accent);
  font-stretch: 120%; font-weight: 800; font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; line-height: 1.1;
  opacity: 0; transform: rotate(7deg) scale(1.8);
}
.file__stamp small { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .05em; }
.finale.is-in .file__stamp { animation: stamp2 .55s cubic-bezier(.5, 0, .3, 1.4) .6s forwards; }
@keyframes stamp2 { 60% { opacity: 1; transform: rotate(7deg) scale(.95); } 100% { opacity: 1; transform: rotate(7deg) scale(1); } }
.file__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.file__stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.file__stats dd { margin-top: 2px; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.file__fit { padding-top: 20px; }
.file__fit h3 { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.file__fit ul { display: grid; gap: 10px; margin-top: 12px; }
.file__fit li { position: relative; padding-left: 28px; font-size: 16px; color: var(--ink-2); }
.file__fit li::before {
  content: ""; position: absolute; left: 0; top: .25em; width: 18px; height: 18px; border-radius: 5px; background: var(--olive-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6336' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 12.5 3.2 3.2L17 8.8'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.file__fit li b { color: var(--ink); font-weight: 650; }
@media (max-width: 640px) { .file__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .file__head { flex-direction: column-reverse; } }

.contact { text-align: center; display: flex; flex-direction: column; align-items: center; margin-top: clamp(56px, 8vw, 96px); }
.contact h2 { margin-top: 16px; font-family: var(--serif); font-weight: 500; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -.03em; }
.contact h2 em { font-style: italic; color: var(--accent); }
.contact__lede { margin-top: 18px; max-width: 48ch; color: var(--ink-2); font-size: 18px; text-wrap: balance; }
.contact__email { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 28px; padding: 14px 14px 14px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.email-link { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.6rem); letter-spacing: -.01em; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .45s var(--ease); word-break: break-all; }
.email-link:hover { background-size: 100% 1.5px; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.contact__meta { margin-top: 28px; color: var(--muted); font-size: 14.5px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; flex-wrap: wrap; }
.footer__link { transition: color .2s; }
.footer__link:hover { color: var(--ink); }

/* ---------- motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .packet { display: none; }
}
@media print {
  .js .stage:not(.is-open), .debrief { display: block !important; }
  .nav, .hud, .progress, .game, .toast, .footer, [data-next], .belt { display: none !important; }
  .stage { padding: 20px 0; break-inside: avoid; }
}

/* scaled-up stamps start oversized; keep them from widening the page */
.frameworks, .file__body { overflow: clip; overflow-clip-margin: 12px; }
