/* ============================================================
   OCTAV8 ACADEMY — SHARED DESIGN SYSTEM
   Canonical source: room page (quality bar)
   ============================================================ */

/* === 1. THEME TOKENS — Studio Dark/Light === */

[data-theme="studio"][data-mode="dark"],
[data-theme="studio"]:not([data-mode]) {
  --bg-0: #110e0a;
  --bg-1: #181309;
  --bg-2: #1f1a10;
  --line: rgba(236, 229, 214, 0.09);
  --line-accent: rgba(232, 163, 59, 0.4);
  --text-hi: #ece5d6;
  --text-mid: #a89e8c;
  --text-dim: #7d7468;
  --chrome: #e8a33b;
  --chrome-hi: #f2b654;
  --chrome-soft: rgba(232, 163, 59, 0.07);
  --chrome-rgb: 232,163,59;
  --chrome-hi-rgb: 242,182,84;
  --text-hi-rgb: 236,229,214;
  --ok: #7fd44b;
  --ok-rgb: 127,212,75;
  --sat-1: #2ec4b6;
  --sat-1-rgb: 46,196,182;
  --sat-2: #7fd44b;
  --sat-3: #f4d03f;
  --sat-4: #e84393;
  --sat-4-rgb: 232,67,147;
  --sat-5: #3b9ae1;
  --sat-5-rgb: 59,154,225;
  --err: #e85d5d;
  --warn: #f4d03f;
  --grain-opacity: 0.05;
  --strong: #f6f0e3;
  --transport-bg: rgba(13, 11, 8, 0.93);
  --playhead-glow-1: rgba(232, 163, 59, 0.6);
  --playhead-glow-2: rgba(232, 163, 59, 0.28);
  --playhead-glow-bright-1: rgba(232, 163, 59, 0.75);
  --playhead-glow-bright-2: rgba(242, 182, 84, 0.35);
  --clip-1: #6bdc4a;
  --clip-2: #e3d44e;
  --clip-3: #4fc8c4;
  --clip-4: #c45fc9;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 0deg;
  --wf-sat-adjust: 1;
  --alive-type: studio;
}

[data-theme="studio"][data-mode="light"] {
  --bg-0: #f5f0e6;
  --bg-1: #ebe4d4;
  --bg-2: #e0d8c6;
  --line: rgba(17, 14, 10, 0.1);
  --line-accent: rgba(180, 120, 30, 0.35);
  --text-hi: #1a1610;
  --text-mid: #5a5346;
  --text-dim: #7d7468;
  --chrome: #c48520;
  --chrome-hi: #d99a2e;
  --chrome-soft: rgba(196, 133, 32, 0.08);
  --chrome-rgb: 196,133,32;
  --chrome-hi-rgb: 217,154,46;
  --text-hi-rgb: 26,22,16;
  --ok: #4a9c2a;
  --ok-rgb: 74,156,42;
  --sat-1: #1a8a7e;
  --sat-1-rgb: 26,138,126;
  --sat-2: #4a9c2a;
  --sat-3: #c4a520;
  --sat-4: #b82e72;
  --sat-4-rgb: 184,46,114;
  --sat-5: #2a76b8;
  --sat-5-rgb: 42,118,184;
  --err: #c83838;
  --warn: #c4a520;
  --grain-opacity: 0.015;
  --strong: #0f0d08;
  --transport-bg: rgba(240, 232, 218, 0.93);
  --playhead-glow-1: rgba(196, 133, 32, 0.4);
  --playhead-glow-2: rgba(196, 133, 32, 0.15);
  --playhead-glow-bright-1: rgba(196, 133, 32, 0.55);
  --playhead-glow-bright-2: rgba(217, 154, 46, 0.25);
  --clip-1: #4a9c2a;
  --clip-2: #b8a820;
  --clip-3: #2a8a84;
  --clip-4: #9a3a9e;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 0deg;
  --wf-sat-adjust: 0.7;
  --alive-type: studio-light;
}

/* === THEME TOKENS — Synthwave Dark/Light === */

[data-theme="synthwave"][data-mode="dark"] {
  --bg-0: #0d0b1a;
  --bg-1: #14122a;
  --bg-2: #1c1838;
  --line: rgba(42, 36, 80, 0.7);
  --line-accent: rgba(255, 77, 157, 0.4);
  --text-hi: #e6e1ff;
  --text-mid: #9b93c4;
  --text-dim: #7a72a0;
  --chrome: #ff4d9d;
  --chrome-hi: #ff7ab5;
  --chrome-soft: rgba(255, 77, 157, 0.07);
  --chrome-rgb: 255,77,157;
  --chrome-hi-rgb: 255,122,181;
  --text-hi-rgb: 230,225,255;
  --ok: #36e27a;
  --ok-rgb: 54,226,122;
  --sat-1: #2de2e6;
  --sat-1-rgb: 45,226,230;
  --sat-2: #a259ff;
  --sat-3: #ff4d9d;
  --sat-4: #ffb347;
  --sat-4-rgb: 255,179,71;
  --sat-5: #36e27a;
  --sat-5-rgb: 54,226,122;
  --err: #ff4d6a;
  --warn: #ffb347;
  --grain-opacity: 0.03;
  --strong: #f0ecff;
  --transport-bg: rgba(13, 11, 26, 0.93);
  --playhead-glow-1: rgba(255, 77, 157, 0.6);
  --playhead-glow-2: rgba(255, 77, 157, 0.28);
  --playhead-glow-bright-1: rgba(255, 77, 157, 0.75);
  --playhead-glow-bright-2: rgba(255, 122, 181, 0.35);
  --clip-1: #2de2e6;
  --clip-2: #a259ff;
  --clip-3: #ff4d9d;
  --clip-4: #ffb347;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 160deg;
  --wf-sat-adjust: 1.2;
  --alive-type: synthwave;
}

[data-theme="synthwave"][data-mode="light"] {
  --bg-0: #f0ecff;
  --bg-1: #e4e0f4;
  --bg-2: #d8d3ea;
  --line: rgba(42, 36, 80, 0.15);
  --line-accent: rgba(200, 40, 120, 0.35);
  --text-hi: #1a1630;
  --text-mid: #5a5480;
  --text-dim: #7a72a0;
  --chrome: #d03080;
  --chrome-hi: #e04090;
  --chrome-soft: rgba(208, 48, 128, 0.08);
  --chrome-rgb: 208,48,128;
  --chrome-hi-rgb: 224,64,144;
  --text-hi-rgb: 26,22,48;
  --ok: #28a854;
  --ok-rgb: 40,168,84;
  --sat-1: #1a9ca0;
  --sat-1-rgb: 26,156,160;
  --sat-2: #7a3acc;
  --sat-3: #d03080;
  --sat-4: #cc8830;
  --sat-4-rgb: 204,136,48;
  --sat-5: #28a854;
  --sat-5-rgb: 40,168,84;
  --err: #cc3050;
  --warn: #cc8830;
  --grain-opacity: 0.015;
  --strong: #0e0a20;
  --transport-bg: rgba(235, 230, 250, 0.93);
  --playhead-glow-1: rgba(208, 48, 128, 0.4);
  --playhead-glow-2: rgba(208, 48, 128, 0.15);
  --playhead-glow-bright-1: rgba(208, 48, 128, 0.55);
  --playhead-glow-bright-2: rgba(224, 64, 144, 0.25);
  --clip-1: #1a9ca0;
  --clip-2: #7a3acc;
  --clip-3: #d03080;
  --clip-4: #cc8830;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 160deg;
  --wf-sat-adjust: 0.8;
  --alive-type: synthwave-light;
}

/* === THEME TOKENS — Aura Dark/Light === */

[data-theme="aura"][data-mode="dark"] {
  --bg-0: #0f0d15;
  --bg-1: #16121f;
  --bg-2: #1d1829;
  --line: rgba(60, 52, 78, 0.6);
  --line-accent: rgba(180, 136, 240, 0.4);
  --text-hi: #ece8f0;
  --text-mid: #9a93a8;
  --text-dim: #766f88;
  --chrome: #b488f0;
  --chrome-hi: #c9a6ff;
  --chrome-soft: rgba(180, 136, 240, 0.08);
  --chrome-rgb: 180,136,240;
  --chrome-hi-rgb: 201,166,255;
  --text-hi-rgb: 236,232,240;
  --ok: #52d726;
  --ok-rgb: 82,215,38;
  --sat-1: #33b3ef;
  --sat-1-rgb: 51,179,239;
  --sat-2: #52d726;
  --sat-3: #ffd23d;
  --sat-4: #b488f0;
  --sat-4-rgb: 180,136,240;
  --sat-5: #ff4d57;
  --sat-5-rgb: 255,77,87;
  --err: #ff4d57;
  --warn: #ffd23d;
  --grain-opacity: 0.04;
  --strong: #f4f0f8;
  --transport-bg: rgba(15, 13, 21, 0.93);
  --playhead-glow-1: rgba(180, 136, 240, 0.6);
  --playhead-glow-2: rgba(51, 179, 239, 0.26);
  --playhead-glow-bright-1: rgba(201, 166, 255, 0.78);
  --playhead-glow-bright-2: rgba(79, 107, 255, 0.36);
  --aura-red: #ff4d57;
  --aura-orange: #ff9636;
  --aura-yellow: #ffd23d;
  --aura-green: #4bd85e;
  --aura-blue: #33b3ef;
  --aura-indigo: #4f6bff;
  --aura-violet: #b488f0;
  --clip-1: #ff4d57;
  --clip-2: #ffb020;
  --clip-3: #30c8d8;
  --clip-4: #b488f0;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 0deg;
  --wf-sat-adjust: 1.15;
  --alive-type: aura;
}

[data-theme="aura"][data-mode="light"] {
  --bg-0: #f4f1fb;
  --bg-1: #eae5f4;
  --bg-2: #ded8ec;
  --line: rgba(46, 40, 56, 0.12);
  --line-accent: rgba(91, 52, 176, 0.35);
  --text-hi: #1a1620;
  --text-mid: #5a5468;
  --text-dim: #766f88;
  --chrome: #5b34b0;
  --chrome-hi: #6a40c4;
  --chrome-soft: rgba(91, 52, 176, 0.08);
  --chrome-rgb: 91,52,176;
  --chrome-hi-rgb: 106,64,196;
  --text-hi-rgb: 26,22,32;
  --ok: #38a018;
  --ok-rgb: 56,160,24;
  --sat-1: #1580bc;
  --sat-1-rgb: 21,128,188;
  --sat-2: #38a018;
  --sat-3: #a07e08;
  --sat-4: #5b34b0;
  --sat-4-rgb: 91,52,176;
  --sat-5: #d8303c;
  --sat-5-rgb: 216,48,60;
  --err: #d8303c;
  --warn: #a07e08;
  --grain-opacity: 0.015;
  --strong: #0e0a18;
  --transport-bg: rgba(244, 241, 251, 0.93);
  --playhead-glow-1: rgba(91, 52, 176, 0.4);
  --playhead-glow-2: rgba(21, 128, 188, 0.16);
  --playhead-glow-bright-1: rgba(91, 52, 176, 0.52);
  --playhead-glow-bright-2: rgba(56, 72, 204, 0.24);
  --aura-red: #d8303c;
  --aura-orange: #c86a12;
  --aura-yellow: #a07e08;
  --aura-green: #2f9e3f;
  --aura-blue: #1580bc;
  --aura-indigo: #3848cc;
  --aura-violet: #5b34b0;
  --clip-1: #d8303c;
  --clip-2: #b5800c;
  --clip-3: #12879a;
  --clip-4: #5b34b0;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wf-hue-shift: 0deg;
  --wf-sat-adjust: 0.7;
  --alive-type: aura-light;
}


/* === 2. SPACE & LAYOUT TOKENS === */

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6.5rem;
  --space-9: 8rem;
  --content-width: 66ch;
  --content-narrow: 42rem;
  --content-wide: 1100px;
  --content-padding: 1.5rem;
  --content-padding-m: 1.1rem;
}


/* === 3. BASE RESET === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }


/* === 4. BODY === */

body {
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 3.2rem;
}


/* === 5. TYPOGRAPHY === */

h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.018em;
  font-weight: 750;
  margin-bottom: 1.8rem;
}
h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  background: var(--chrome);
  margin-bottom: 1.2rem;
}

p { margin: 0 0 1.3rem; }
p:last-child { margin-bottom: 0; }

ol, ul { margin: 0 0 1.4rem 1.3rem; }
li { margin-bottom: .95rem; }
li::marker { color: var(--chrome); }

strong { font-weight: 700; color: var(--strong); }

a { color: var(--chrome); text-decoration: underline; }
a:hover { color: var(--chrome-hi); }

blockquote {
  margin: 1.8rem 0;
  padding: .15rem 0 .15rem 1.3rem;
  border-left: 2px solid var(--chrome);
  font-style: italic;
  color: var(--text-hi);
}
blockquote cite {
  display: block;
  margin-top: .6rem;
  font-style: normal;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-mid);
}
blockquote.pull {
  border-left: none;
  padding: 0 0 0 2.6rem;
  margin: 3rem 0;
  position: relative;
  font-style: normal;
  font-weight: 650;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.3;
  letter-spacing: -.012em;
}
blockquote.pull::before {
  content: "\201C";
  position: absolute;
  left: -.2rem;
  top: -.9rem;
  font-size: 4.2rem;
  line-height: 1;
  color: var(--chrome);
  opacity: .55;
  font-weight: 800;
}
blockquote.pull cite { margin-top: .9rem; font-weight: 400; }


/* === 6. LAYOUT UTILITIES === */

.wrap      { max-width: 66ch; margin: 0 auto; }
.wrap-wide { max-width: 1100px; margin: 0 auto; }
.wrap-narrow { max-width: 42rem; margin: 0 auto; }

.section {
  padding: 6.5rem 1.5rem;
  border-top: 1px solid var(--line);
  position: relative;
}
.section.no-rule { border-top: none; }
.alt-bg { background: var(--bg-1); }


/* === 7. SHARED COMPONENTS === */

/* --- Brand lockup --- */
.brand-lockup { text-align: center; }
.brand-mark {
  width: 72px; height: 72px;
  margin: 0 auto .8rem;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--chrome);
  box-shadow: 0 0 12px rgba(var(--chrome-rgb), .3);
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand {
  font-family: var(--mono);
  font-size: .92rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--text-mid);
}

/* --- Lede paragraph --- */
.lede {
  font-size: clamp(1.12rem, 2.4vw, 1.35rem);
  line-height: 1.55;
  color: var(--text-hi);
  max-width: 58ch;
  margin: 0 auto 1.6rem;
}

/* --- Label --- */
.label {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--chrome);
  text-transform: uppercase;
  letter-spacing: .16em;
}

/* --- Button --- */
.btn {
  display: inline-block;
  margin-top: 2.2rem;
  background: var(--chrome);
  color: var(--bg-0);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .01em;
  padding: 1rem 2.6rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 120ms ease, transform 80ms ease;
}
.btn:hover { background: var(--chrome-hi); color: var(--bg-0); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--text-hi); outline-offset: 3px; }

/* --- Wavesep divider --- */
.wavesep {
  display: block;
  margin: 0 auto 4.5rem;
  width: 220px; height: 16px;
  color: var(--chrome);
  opacity: .55;
}

/* --- Grain overlay --- */
.grain {
  position: fixed; inset: 0;
  z-index: 40; pointer-events: none;
  opacity: var(--grain-opacity, .05);
  width: 100%; height: 100%;
}

/* --- Bio (shared between guide and course pages) --- */
.bio { display: flex; gap: 2rem; align-items: flex-start; }
.bio-photo { width: 160px; flex-shrink: 0; border-radius: 10px; overflow: hidden; }
.bio-photo img { display: block; width: 100%; height: auto; border-radius: 10px; }
.bio-text { flex: 1; }
.bio-text p { color: var(--text-mid); font-size: .95rem; line-height: 1.6; }

/* --- Hero trust signal (site-wide) --- */
.hero-trust {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-top: 1.4rem;
  text-align: center;
}

/* --- Featured-in strip (site-wide) --- */
.featured-strip {
  text-align: center;
  padding: 1.5rem 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.featured-strip-label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .5rem;
}
.featured-strip-link {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.featured-strip-link:hover { color: var(--chrome); border-color: rgba(var(--chrome-rgb), .4); }
.featured-strip-link:focus-visible { outline: 1px solid var(--chrome); outline-offset: 3px; }

/* --- Scroll affordance (hub + long-form pages) --- */
.scroll-hint {
  margin-top: 2rem;
  text-align: center;
  opacity: .3;
  transition: opacity 200ms ease;
}
.scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, var(--text-dim), transparent);
  margin: 0 auto;
}

/* --- Screen reader only --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.sr-only:focus {
  position: fixed; top: 0; left: 0;
  width: auto; height: auto;
  padding: 1rem 1.5rem; margin: 0;
  overflow: visible; clip: auto; white-space: normal;
  background: var(--bg-0); color: var(--chrome);
  z-index: 50; font-size: 1rem;
  outline: 2px solid var(--chrome);
}

/* --- Text utilities --- */
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 1.5rem 3.2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .06em;
}
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--chrome); }


/* === 8. TRANSPORT BAR === */

.transport {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 45; display: flex; align-items: center; gap: 1rem;
  background: var(--transport-bg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 2px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(var(--text-hi-rgb), .06);
  padding: .55rem 1.25rem;
  padding-bottom: calc(.55rem + env(safe-area-inset-bottom, 0px));
}

.t-locs { display: flex; gap: .15rem; flex-shrink: 0; }

.t-loc {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--text-dim); text-decoration: none;
  padding: .38rem .65rem; border-radius: 3px;
  transition: color 120ms ease, background 120ms ease;
}
.t-loc:hover { color: var(--text-hi); background: rgba(var(--text-hi-rgb), .06); }
.t-loc:focus-visible { outline: 1px solid var(--chrome); outline-offset: 1px; }
.t-loc.on { color: var(--chrome); }

.t-rail {
  position: relative; flex: 1; min-width: 48px;
  height: 20px; display: flex; gap: 4px;
}
.t-seg {
  flex: 1;
  background: rgba(var(--text-hi-rgb), .13);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255, .06);
}
.t-seg.lit { background: rgba(var(--chrome-rgb), .6); }

.t-head {
  position: absolute; top: -4px; bottom: -4px; left: 0;
  width: 2px; background: var(--chrome);
  box-shadow: 0 0 9px rgba(var(--chrome-rgb), .7);
}

/* Transport flag (guide/room pages) */
.t-flag {
  position: relative; flex-shrink: 0;
  width: 16px; height: 18px; opacity: .45;
}
.t-flag::before {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0;
  width: 2px; background: var(--chrome);
}
.t-flag::after {
  content: ""; position: absolute; right: 2px; top: 0;
  width: 8px; height: 6px; background: var(--chrome);
}
.t-flag.reached {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(var(--chrome-rgb), .8));
}

/* Transport apply link (room page) */
.t-loc.t-apply {
  color: var(--chrome);
  border: 1px solid var(--line-accent);
  margin-left: .25rem;
}
.t-loc.t-apply:hover { color: var(--chrome-hi); background: var(--chrome-soft); }
.t-loc.t-apply.on { background: var(--chrome-soft); }

.t-count {
  flex-shrink: 0; font-family: var(--mono);
  font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  color: var(--text-mid); min-width: 2.6em; text-align: right;
  background: rgba(var(--text-hi-rgb), .04);
  padding: .2rem .45rem; border-radius: 3px;
  border: 1px solid rgba(var(--text-hi-rgb), .08);
}
.t-count.full { color: var(--chrome); }

/* Armed CTA indicator (guide/room) */
html.armed .btn::before {
  content: "";
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 6px rgba(var(--ok-rgb), .45);
  margin-right: .65rem; vertical-align: .08em;
}


/* === 9. THEME CONTROLS (in transport bar) === */

.ctl-group {
  display: flex; align-items: center; gap: .35rem;
  flex-shrink: 0; margin-left: auto; border-radius: 8px;
}

.theme-ctl {
  display: flex; gap: 2px; flex-shrink: 0; align-items: center;
  background: rgba(var(--text-hi-rgb), .04);
  border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 3px;
}

.t-theme {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mid); background: 0 0;
  border: 1px solid transparent; border-radius: 3px;
  padding: .3rem .5rem; cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  line-height: 1;
}
.t-theme::before {
  content: ""; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  margin-right: .34rem; flex-shrink: 0;
}
.t-theme[data-set-theme="studio"]::before { background: #e8a33b; }
.t-theme[data-set-theme="synthwave"]::before { background: #ff4d9d; }
.t-theme[data-set-theme="aura"]::before {
  background: linear-gradient(135deg, #ff4d57 0, #ffd23d 33%, #4bd85e 55%, #33b3ef 75%, #b488f0 100%);
}
.t-theme:hover { color: var(--text-hi); }
.t-theme[aria-pressed="true"] {
  color: var(--chrome); background: var(--chrome-soft);
  border-color: var(--line-accent);
}

.t-mode {
  font-size: .64rem; background: 0 0;
  border: 1px solid var(--line); border-radius: 3px;
  padding: .22rem .38rem; cursor: pointer;
  color: var(--text-mid); margin-left: 3px; line-height: 1;
  transition: color 120ms ease, border-color 120ms ease;
}
.t-mode:hover { color: var(--text-hi); border-color: rgba(var(--chrome-rgb), .3); }

.t-focus {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mid); background: 0 0;
  border: 1px solid var(--line); border-radius: 3px;
  padding: .3rem .6rem; cursor: pointer; line-height: 1;
  flex-shrink: 0;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.t-focus:hover { color: var(--text-hi); border-color: rgba(var(--chrome-rgb), .3); }
.t-focus[aria-pressed="true"] {
  color: var(--chrome); background: var(--chrome-soft);
  border-color: var(--line-accent);
}
.t-focus[aria-pressed="true"]::before { content: "\2713\00a0"; }

.t-focus:focus-visible,
.t-mode:focus-visible,
.t-theme:focus-visible { outline: 1px solid var(--chrome); outline-offset: 1px; }


/* === 10. FOCUS MODE OVERRIDES === */

[data-focus="on"] .t-theme { display: none; }
[data-focus="on"] .theme-ctl { background: 0 0; border-color: transparent; padding: 0; }
[data-focus="on"] .t-mode { margin-left: 0; }
[data-focus="on"] .t-head { box-shadow: none; }


/* === 11. LIGHT MODE OVERRIDES === */

[data-mode="light"] .transport { border-top-color: rgba(var(--text-hi-rgb), .12); }
[data-mode="light"] .grain { opacity: var(--grain-opacity); }
[data-mode="light"] .wavesep { opacity: .35; }


/* === 12. KEYFRAMES === */

@keyframes controls-arrive {
  0%   { box-shadow: 0 0 0 0 rgba(var(--chrome-rgb), 0); }
  35%  { box-shadow: 0 0 0 4px rgba(var(--chrome-rgb), .22); }
  100% { box-shadow: 0 0 0 11px rgba(var(--chrome-rgb), 0); }
}
@keyframes shell-lift {
  0%   { background: rgba(var(--text-hi-rgb), 0); border-color: transparent; }
  100% { background: rgba(var(--text-hi-rgb), .04); border-color: var(--line); }
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-focus="on"]) .ctl-group.controls-cue {
    animation: controls-arrive 1.4s ease-out 1;
  }
  html:not([data-focus="on"]) .ctl-group.controls-cue .theme-ctl {
    animation: shell-lift 1.4s ease-out 1;
  }
}


/* === 13. RESPONSIVE — Transport Bar (mobile) === */

@media (max-height: 540px) {
  .transport { display: none; }
  body { padding-bottom: 0; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .bio { flex-direction: column; }
  .bio-photo { width: 120px; margin: 0 auto; }

  .transport { gap: .5rem; padding-left: .6rem; padding-right: .6rem; }
  .t-locs { gap: 0; }
  .t-loc { padding: .3rem .35rem; font-size: .5rem; letter-spacing: .06em; }
  .t-count { font-size: .5rem; min-width: 2.3em; }

  .ctl-group { gap: .3rem; }
  .theme-ctl { gap: 2px; padding: 2px; }
  .t-theme {
    font-size: 0; padding: 0;
    min-width: 32px; min-height: 32px;
    justify-content: center;
  }
  .t-theme::before { width: 14px; height: 14px; margin-right: 0; }
  .t-mode {
    font-size: .64rem; min-width: 32px; min-height: 32px;
    padding: 0; margin-left: 2px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .t-focus {
    min-height: 32px; padding: 0 .55rem;
    display: inline-flex; align-items: center;
  }
}
