/* ============================================================
   lab.bycracus — style.css  ·  "studio" refresh (v0.2)
   Evolves the bycracus DNA: dark base + gold chrome + grain.
   New: an electric iris secondary for live/active/lab energy,
   an asymmetric bento gallery, a living-reel hero, and a
   capture-booth runner. All sim canvases stay untouched.
   ============================================================ */

:root {
  /* --- bycracus DNA (anchor) --- */
  --bg:           #0a0a0a;
  --bg-elevated:  #111111;
  --bg-subtle:    #161616;
  --bg-raised:    #1a1a1b;
  --text:         #f0ede8;
  --text-muted:   #8a8a8a;   /* WCAG AA on --bg */
  --text-dim:     #5e5e5e;
  --accent:       #c9a96e;   /* gold — primary chrome / CTAs / focus */
  --accent-hover: #dbb97e;
  --accent-deep:  #a98a52;
  --border:       #1f1f1f;
  --border-bright:#2b2b2b;
  --hairline:     rgba(240, 237, 232, 0.07);

  /* --- new: electric iris (the "lab" energy) --- */
  --iris:         #8b7bff;   /* live / active / selected / data */
  --iris-bright:  #a89bff;
  --iris-dim:     rgba(139, 123, 255, 0.14);
  --iris-glow:    rgba(139, 123, 255, 0.45);

  /* --- functional --- */
  --rec:          #ff3b5c;   /* record red (recognizable) */
  --rec-deep:     #d31f43;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --container: 1380px;
  --gutter:    clamp(20px, 5vw, 84px);

  --shadow-soft: 0 1px 0 var(--hairline), 0 18px 50px rgba(0,0,0,0.45);
  --shadow-pop:  0 30px 90px rgba(0,0,0,0.6);
}

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

/* --- Motion reveal gate ---
   Active only when JS adds `.motion` to <html> (skipped for reduced-motion).
   Elements start hidden and animate in via js/ui-motion.js. */
.motion .hero-eyebrow,
.motion .hero-title,
.motion .hero-sub,
.motion .hero-spec,
.motion .hero-cta-row,
.motion .section-eyebrow,
.motion .section-title,
.motion .section-lede,
.motion .filter-bar,
.motion .sim-card { opacity: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
::selection { background: var(--iris); color: #fff; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; border-radius: 4px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* shared eyebrow motif */
.eyebrow, .hero-eyebrow, .section-eyebrow, .config-eyebrow, .legal-body .section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* --- Grain --- */
.grain {
  position: fixed; inset: -100%;
  width: 300%; height: 300%;
  pointer-events: none; z-index: 90;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* --- Nav --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  z-index: 100;
  background: linear-gradient(180deg, rgba(10,10,10,0.92), rgba(10,10,10,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: 0.01em;
  font-size: 18px;
  display: inline-flex; align-items: baseline;
}
.nav-logo .lab { color: var(--accent); }
.nav-logo .sep { color: var(--iris); margin: 0 5px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--text-muted); transition: color .2s var(--ease-out); }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-cta {
  border: 1px solid var(--border-bright);
  color: var(--text) !important;
  padding: 9px 18px; border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.08em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out), color .25s var(--ease-out);
}
.nav-cta::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--iris); box-shadow: 0 0 10px var(--iris-glow);
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px var(--gutter) 64px;
  overflow: hidden;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 920px;
}
.hero-eyebrow {
  color: var(--accent);
  margin-bottom: 26px;
  display: inline-flex; align-items: center; gap: 10px;
}
.hero-eyebrow em { font-style: normal; color: var(--iris); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(46px, 8.4vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin-bottom: 30px;
  text-wrap: balance;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-title .glyph {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 400;
  color: var(--iris);
  font-size: 0.62em;
  vertical-align: 0.12em;
}
.hero-sub {
  max-width: 560px;
  color: var(--text-muted);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.65;
  margin-bottom: 34px;
}
.hero-sub strong { color: var(--text); font-weight: 400; }
.hero-cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.06em;
  padding: 14px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .25s var(--ease-out), background .25s var(--ease-out), border-color .25s var(--ease-out), color .25s var(--ease-out);
}
.hero-btn-primary {
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent);
}
.hero-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-2px); }
.hero-btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-bright);
}
.hero-btn-ghost:hover { border-color: var(--iris); color: var(--iris-bright); }
.hero-spec {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
}
.hero-spec b { color: var(--text-muted); font-weight: 500; }
.hero-spec .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-bright); }

/* Living reel montage (right side, behind text on small screens) */
.hero-reels {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: clamp(420px, 52vw, 920px);
  z-index: 1;
  display: flex; align-items: center; justify-content: flex-end;
  gap: clamp(14px, 2vw, 30px);
  padding-right: var(--gutter);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 42%, #000 100%);
}
.hero-reel {
  position: relative;
  width: clamp(150px, 15vw, 244px);
  aspect-ratio: 9 / 16;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--hairline);
  opacity: 0.62;
  flex: 0 0 auto;
}
.hero-reel:nth-child(1) { transform: translateY(46px); }
.hero-reel:nth-child(2) { transform: translateY(-30px); }
.hero-reel:nth-child(3) { transform: translateY(64px); opacity: 0.42; }
.hero-reel canvas { width: 100%; height: 100%; }
.hero-reel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(139,123,255,0.06), rgba(10,10,10,0.34));
  pointer-events: none;
}
@media (max-width: 980px) {
  .hero-reels {
    width: 100%;
    opacity: 0.22;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
            mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
    justify-content: center;
  }
  .hero-inner { max-width: none; }
}

/* --- Section header --- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
  margin-bottom: 38px;
}
.section-eyebrow {
  color: var(--iris);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.0;
}
.section-lede {
  max-width: 420px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* --- Gallery --- */
.gallery { padding: clamp(72px, 11vw, 150px) 0 110px; position: relative; }

/* "In development" section: a quieter, divided block below the main catalogue. */
.gallery-dev { padding-top: clamp(40px, 6vw, 80px); }
.gallery-dev .container { border-top: 1px solid var(--hairline); padding-top: clamp(48px, 7vw, 90px); }
.gallery-dev .section-eyebrow { color: #e8a33d; }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 34px;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.filter-chip .n { color: var(--text-dim); font-size: 11px; }
.filter-chip:hover { color: var(--text); border-color: var(--border-bright); }
.filter-chip.is-active {
  color: var(--bg); background: var(--text); border-color: var(--text);
}
.filter-chip.is-active .n { color: rgba(10,10,10,0.5); }

/* Bento grid */
/* Uniform grid — 3 tiles per row, all the same size, for a clean catalogue. */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.4vw, 20px);
}
/* Drop to 2 across on small phones so the tall 9:16 tiles aren't cramped. */
@media (max-width: 560px) { .sim-grid { grid-template-columns: repeat(2, 1fr); } }

.sim-card {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  transition: transform .45s var(--ease-out), border-color .3s var(--ease-out), box-shadow .4s var(--ease-out);
}
.sim-card:hover {
  transform: translateY(-6px);
  border-color: var(--iris);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), 0 0 0 1px var(--iris-dim);
}
.sim-card canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  transition: transform .6s var(--ease-out);
}
.sim-card:hover canvas { transform: scale(1.03); }

/* hover "live" badge */
.sim-card-live {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text);
  background: rgba(10,10,10,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 10px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.sim-card-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--iris); box-shadow: 0 0 8px var(--iris-glow);
  animation: live-pulse 1.4s var(--ease-in-out) infinite;
}
.sim-card.is-playing .sim-card-live { opacity: 1; transform: none; }
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.sim-card-index {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em;
  color: rgba(240,237,232,0.55);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.sim-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 26px 16px 16px;
  background: linear-gradient(180deg, transparent, rgba(8,8,8,0.62) 38%, rgba(6,6,6,0.92));
}
.sim-card-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.sim-card-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.sim-card-cat .tag { color: var(--iris); }
.sim-card-open {
  position: absolute; right: 14px; bottom: 16px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg);
  font-size: 15px;
  opacity: 0; transform: translateY(8px) scale(0.85);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.sim-card:hover .sim-card-open { opacity: 1; transform: none; }

/* --- "In development" sims: live showcase tiles, not openable --- */
.sim-card.is-dev { cursor: default; }
/* Gentler lift on hover so it doesn't read as a clickable, openable card. */
.sim-card.is-dev:hover {
  transform: translateY(-3px);
  border-color: var(--hairline);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.sim-card.is-dev .sim-card-open { display: none; }
.sim-card-dev {
  position: absolute; right: 12px; bottom: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text);
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 10px;
}
.sim-card-dev::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #e8a33d; box-shadow: 0 0 8px rgba(232,163,61,0.6);
}

/* --- Sim Runner (capture booth) --- */
.runner {
  position: fixed; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(139,123,255,0.05), rgba(5,5,5,0.96) 55%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  overflow-y: auto;
}
.runner.is-open { display: flex; }
.runner-booth {
  display: flex; align-items: stretch; gap: clamp(20px, 3vw, 44px);
  padding: 40px;
  max-width: 100%;
}
.runner-stage {
  position: relative;
  height: min(880px, calc(100dvh - 96px));
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: 92vw;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--border-bright), 0 0 0 7px rgba(20,20,22,0.6);
  flex: 0 0 auto;
}
.runner-stage::before {
  content: ''; position: absolute; inset: 0; z-index: 4;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  pointer-events: none;
}
.runner-stage canvas { width: 100%; height: 100%; }

/* preview of the baked overlay (matches recorder.js) */
.runner-overlay {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 30px 30px 28px;
}
.runner-overlay::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 230px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
  opacity: var(--scrim, 1);
}
.runner-overlay::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 150px;
  background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent);
  opacity: var(--scrim, 1);
}
.runner-overlay-top { position: relative; display: flex; flex-direction: column; gap: 8px; }
.runner-cat {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.24em;
  color: var(--ov-muted, rgba(255,255,255,0.62));
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px;
}
.runner-cat::before {
  content: ''; width: 16px; height: 1.5px; background: currentColor; opacity: 0.7;
}
.runner-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ov-fg, #fff);
  line-height: 1.05;
}
.runner-overlay-bottom {
  position: relative;
  display: flex; justify-content: space-between; align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ov-muted, rgba(255,255,255,0.62));
  letter-spacing: 0.12em;
}
.runner-overlay-bottom .wm {
  text-transform: lowercase;
  color: var(--ov-fg, #fff);
  display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: 0.02em;
}
.runner-overlay-bottom .wm::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent);
}

/* --- Control desk (NOT recorded) --- */
.runner-controls {
  width: 244px;
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  align-self: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.desk-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 4px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.desk-head .rec-state {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-muted);
}
.desk-head .rec-state::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
}
.runner-controls.is-armed .desk-head .rec-state { color: var(--rec); }
.runner-controls.is-armed .desk-head .rec-state::before {
  background: var(--rec); box-shadow: 0 0 10px rgba(255,59,92,0.7);
  animation: live-pulse 1s var(--ease-in-out) infinite;
}

.ctrl-stack { display: flex; flex-direction: column; gap: 9px; }
.runner-controls .ctrl {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 15px;
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
  text-align: left;
  display: flex; align-items: center; gap: 10px;
}
.runner-controls .ctrl .ic { font-size: 13px; width: 16px; text-align: center; color: var(--text-muted); transition: color .2s; }
.runner-controls .ctrl:hover { border-color: var(--iris); color: var(--iris-bright); }
.runner-controls .ctrl:hover .ic { color: var(--iris); }
.runner-controls .ctrl:disabled,
.swatch:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.runner-controls .ctrl.is-record {
  background: linear-gradient(180deg, rgba(255,59,92,0.16), rgba(255,59,92,0.06));
  border-color: rgba(255,59,92,0.5);
  color: #ffd0d8;
  font-weight: 500;
  padding: 15px;
  justify-content: center;
  margin-bottom: 4px;
}
.runner-controls .ctrl.is-record .ic { color: var(--rec); }
.runner-controls .ctrl.is-record:hover {
  border-color: var(--rec); color: #fff;
  background: linear-gradient(180deg, rgba(255,59,92,0.28), rgba(255,59,92,0.12));
}
.runner-controls .ctrl.is-record.is-recording {
  background: var(--rec); color: #fff; border-color: var(--rec);
  animation: pulse 1.1s var(--ease-in-out) infinite;
}
.runner-controls .ctrl.is-record.is-recording .ic { color: #fff; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.desk-divider { height: 1px; background: var(--border); margin: 16px 2px; }
.desk-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px; padding: 0 2px;
}
.palette-swatches {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.swatch {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s var(--ease-out), border-color .18s, box-shadow .18s;
}
.swatch:hover { transform: translateY(-2px); border-color: var(--border-bright); }
.swatch.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 16px rgba(0,0,0,0.5); }
.swatch.is-active::after {
  content: ''; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 2px rgba(10,10,10,0.55);
  border-radius: var(--r-sm);
}

.runner-close {
  position: absolute; top: 22px; right: 22px; z-index: 210;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  color: var(--text);
  cursor: pointer;
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, transform .2s;
}
.runner-close:hover { border-color: var(--iris); color: var(--iris); transform: rotate(90deg); }

/* --- Countdown --- */
.countdown {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(120px, 30vw, 240px);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 60px rgba(0,0,0,0.85);
  pointer-events: none;
  opacity: 0;
}

/* --- Configurator --- */
.configurator {
  position: fixed; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(139,123,255,0.05), rgba(5,5,5,0.96) 55%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 250;
  display: none;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.configurator.is-open { display: flex; }
.config-panel {
  position: relative;
  width: min(1000px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 52px);
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.config-header {
  margin-bottom: 8px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.config-eyebrow {
  color: var(--iris);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.config-eyebrow .step { color: var(--text-dim); }
.config-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 50px);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  line-height: 1.0;
}
.config-desc {
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.65;
  font-size: 15px;
}

.config-opt {
  padding-top: 30px; margin-top: 2px;
}
.config-opt-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.config-opt-label > span:first-child {
  display: inline-flex; align-items: baseline; gap: 12px;
}
.config-opt-counter { color: var(--iris); letter-spacing: 0.08em; }
.config-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 16px;
  display: flex; align-items: center; gap: 8px;
}
.config-hint::before { content: '//'; color: var(--text-dim); }

.config-chip-grid,
.config-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.config-chip, .config-radio {
  position: relative;
  text-align: left;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .25s var(--ease-out);
}
.config-chip:hover, .config-radio:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  background: var(--bg-raised);
}
.config-chip.is-active, .config-radio.is-active {
  border-color: var(--iris);
  background: var(--iris-dim);
  box-shadow: 0 0 0 1px var(--iris-dim);
}
.config-chip-name, .config-radio-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.config-chip-desc, .config-radio-desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
/* multi-select rank badge */
.config-chip-rank {
  position: absolute;
  top: 12px; right: 12px;
  min-width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.config-chip.is-active .config-chip-rank {
  color: var(--bg); background: var(--iris); border-color: var(--iris);
  transform: scale(1.05);
  box-shadow: 0 0 14px var(--iris-glow);
}
.config-chip.is-active .config-chip-rank:empty { display: none; }

.config-chip.has-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 16px 18px;
}
.config-chip-portrait {
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, rgba(139,123,255,0.16), rgba(0,0,0,0) 70%), var(--bg);
  box-shadow: inset 0 0 0 1px var(--border-bright);
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out);
}
.config-chip.has-portrait:hover .config-chip-portrait { transform: scale(1.04); }
.config-chip.has-portrait.is-active .config-chip-portrait {
  box-shadow: inset 0 0 0 1px var(--iris), 0 0 24px var(--iris-glow);
}
.config-chip.has-portrait .config-chip-rank { top: 14px; right: 14px; }

/* range slider */
.config-range {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 2px;
}
.config-range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  background: linear-gradient(90deg, var(--iris) 0%, var(--iris) var(--fill, 0%), var(--border-bright) var(--fill, 0%));
  border-radius: 999px;
  outline: none;
}
.config-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  background: var(--text);
  border: 4px solid var(--iris);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.config-range input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.14); box-shadow: 0 0 0 6px var(--iris-dim);
}
.config-range input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--text);
  border: 4px solid var(--iris);
  border-radius: 50%;
  cursor: pointer;
}
.config-range-value {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--iris-bright);
  font-weight: 600;
  min-width: 64px;
  text-align: right;
}

.config-footer {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.config-footer-note {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--text-dim);
}
.ctrl {
  font-family: var(--font-mono);
  cursor: pointer;
}
.ctrl-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 15px 30px;
  border-radius: 999px;
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600;
  transition: background .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .25s var(--ease-out);
}
.ctrl-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(201,169,110,0.24);
}
.ctrl-primary.is-disabled, .ctrl-primary:disabled {
  background: var(--bg-subtle);
  color: var(--text-dim);
  border-color: var(--border);
  cursor: not-allowed;
  transform: none; box-shadow: none;
}

/* --- Image upload panel --- */
.upload-panel {
  margin-top: 16px;
  padding: 20px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-subtle);
  display: none;
}
.upload-panel.is-open { display: block; animation: upl-in .35s var(--ease-out); }
@keyframes upl-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.upload-notice {
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--iris);
}
.upload-notice strong { color: var(--text); }
.upload-notice a { color: var(--iris-bright); text-decoration: underline; text-underline-offset: 2px; }
.upload-consent {
  display: flex; gap: 11px; align-items: flex-start;
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.5;
  color: var(--text);
  opacity: 0.92;
  margin-bottom: 16px;
  cursor: pointer; user-select: none;
}
.upload-consent input[type="checkbox"] {
  margin-top: 3px; accent-color: var(--iris);
  cursor: pointer; width: 16px; height: 16px; flex: 0 0 auto;
}
.upload-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-btn {
  background: transparent;
  border: 1px solid var(--iris);
  color: var(--iris-bright);
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  padding: 9px 16px; border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.upload-btn:hover:not(:disabled) { background: var(--iris); color: #fff; }
.upload-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.upload-status {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em;
}
.upload-preview {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.upload-preview[hidden] { display: none; }
.upload-thumb {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--border-bright);
}
.upload-clear {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em;
  padding: 7px 13px; border-radius: var(--r-sm); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.upload-clear:hover { border-color: var(--text-muted); color: var(--text); }
.config-radio.is-uploadable .config-radio-name::after {
  content: ' ↑'; color: var(--iris);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px var(--gutter);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  align-items: center;
}
.footer a { color: var(--text-muted); transition: color .2s; }
.footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

/* --- Legal pages --- */
.legal-body { background: var(--bg); color: var(--text); }
.legal-main { padding: 120px 0 80px; min-height: calc(100vh - 200px); }
.legal-main .container { max-width: 760px; }
.legal-body .section-eyebrow { color: var(--iris); margin-bottom: 14px; }
.legal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 12px 0 16px;
}
.legal-meta {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.08em; margin-bottom: 48px; text-transform: uppercase;
}
.legal-section { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.legal-section:last-child { border-bottom: 0; }
.legal-section h2 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 22px;
  color: var(--accent);
  margin-bottom: 16px; letter-spacing: -0.01em;
}
.legal-section p {
  font-family: var(--font-body);
  font-weight: 400; font-size: 16px; line-height: 1.65;
  color: var(--text); margin-bottom: 14px; opacity: 0.92;
}
.legal-section ul { list-style: none; margin: 12px 0 18px; padding: 0; }
.legal-section li {
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.6;
  color: var(--text); opacity: 0.92;
  padding: 8px 0 8px 22px; position: relative;
}
.legal-section li::before {
  content: ''; position: absolute; left: 2px; top: 14px;
  width: 8px; height: 1.5px; background: var(--iris);
}
.legal-section a {
  color: var(--accent);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.legal-section a:hover { color: var(--accent-hover); }
.legal-section strong { color: var(--text); font-weight: 600; }
.legal-section code {
  font-family: var(--font-mono);
  font-size: 14px; background: var(--bg-subtle);
  padding: 2px 6px; border-radius: 4px; color: var(--iris-bright);
}

/* --- Responsive --- */
@media (max-width: 920px) {
  .runner-booth { flex-direction: column; align-items: center; padding: 80px 16px 40px; gap: 18px; }
  .runner-controls { width: min(92vw, 460px); }
  .ctrl-stack { flex-direction: row; flex-wrap: wrap; }
  .ctrl-stack .ctrl { flex: 1 1 calc(50% - 5px); }
  .ctrl-stack .ctrl.is-record { flex-basis: 100%; }
  .runner { align-items: flex-start; }
}
@media (max-width: 600px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .config-footer { flex-direction: column; align-items: stretch; }
  .config-footer .ctrl-primary { justify-content: center; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero-reel { opacity: 0.4; }
}
