:root {
  --bg: #fff6fb;
  --ink: #1b0a2e;            /* deep aubergine — used for all titles, always legible */
  --muted: #6e5180;
  --line: rgba(180, 40, 130, 0.18);
  --card: rgba(255, 255, 255, 0.74);
  --pink: #ff1f8f;
  --cyan: #00b3cc;
  --purple: #8a2bff;
  --gold: #f59e0b;
  --orange: #ff6a2c;
  --accent: var(--pink);
  --pixel: "Press Start 2P", monospace;
  --display: "Anton", "Inter", sans-serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1050px 600px at 50% -10%, rgba(255, 31, 143, 0.22) 0%, transparent 58%),
    radial-gradient(820px 520px at 90% 8%, rgba(0, 179, 204, 0.20) 0%, transparent 58%),
    radial-gradient(700px 460px at 8% 18%, rgba(138, 43, 255, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, #fff8fc 0%, #ffeef6 48%, #ffe7d8 100%);
  overflow-x: hidden;
}

/* sunny synthwave grid horizon */
body::before {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 40vh; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgba(255, 31, 143, 0.16) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(to bottom, rgba(138, 43, 255, 0.14) 0 1px, transparent 1px 58px);
  transform: perspective(440px) rotateX(64deg); transform-origin: bottom;
  mask-image: linear-gradient(transparent, #000 75%);
}

#stars { position: fixed; inset: 0; z-index: 1; display: block; opacity: .5; }
.hidden { display: none !important; }

/* ── BOOT ───────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background:
    radial-gradient(900px 520px at 50% 20%, rgba(255, 31, 143, 0.22), transparent 62%),
    linear-gradient(180deg, #fff8fc, #ffe9f2);
}
.boot-inner { text-align: center; padding: 20px; }
.boot-logo {
  font-family: var(--display); font-weight: 400; font-style: italic; text-transform: uppercase;
  font-size: clamp(42px, 11vw, 110px); line-height: .9; letter-spacing: 1px;
  background: linear-gradient(180deg, var(--pink) 0%, var(--purple) 55%, var(--orange) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(27, 10, 46, 0.14)) drop-shadow(0 0 22px rgba(255, 31, 143, 0.35));
  margin-bottom: 8px;
}
.boot-logo small { display: block; font-size: .26em; letter-spacing: 6px; -webkit-text-fill-color: var(--ink); font-style: normal; opacity: .8; margin-top: 6px; }
.boot-line { font-family: var(--pixel); font-size: 11px; color: var(--purple); margin: 22px 0 28px; min-height: 14px; }
.boot-bar { width: 280px; max-width: 76vw; height: 16px; margin: 0 auto 30px; border: 1.5px solid var(--pink); border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.7); }
.boot-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--pink), var(--orange)); transition: width .12s linear; }
.btn-press {
  font-family: var(--pixel); font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple)); border: 0; padding: 18px 30px; cursor: pointer;
  border-radius: 8px; box-shadow: 0 6px 0 #b3157a, 0 12px 30px -8px rgba(255, 31, 143, 0.6);
  transition: transform .08s, box-shadow .08s; animation: pulse 1.4s infinite;
}
.btn-press:active { transform: translateY(5px); box-shadow: 0 1px 0 #b3157a; }
.btn-press[disabled] { animation: none; opacity: .55; cursor: default; }
.boot-hint { margin-top: 30px; color: var(--muted); font-size: 12px; }
@keyframes pulse { 0%,100%{ box-shadow:0 6px 0 #b3157a,0 12px 30px -8px rgba(255,31,143,.5);} 50%{ box-shadow:0 6px 0 #b3157a,0 14px 44px -6px rgba(255,31,143,.85);} }

/* ── APP / HUD ──────────────────────────────────────── */
.app { position: relative; z-index: 5; max-width: 1180px; margin: 0 auto; padding: 22px 20px 70px; }
.hud {
  display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap;
  padding: 16px 22px; border: 1px solid var(--line); border-radius: 18px;
  background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(14px);
  box-shadow: 0 10px 36px -18px rgba(138, 43, 255, 0.4);
}
.hud-player { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.avatar {
  width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 18px -4px rgba(255, 31, 143, 0.6);
}
.hud-name { font-weight: 800; font-size: 18px; color: var(--ink); }
.hud-tagline { color: var(--muted); font-size: 13px; }
.hud-stats { display: flex; align-items: center; gap: 24px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-family: var(--pixel); font-size: 8px; color: var(--purple); letter-spacing: 1px; }
.stat-val { font-family: var(--pixel); font-size: 17px; color: var(--pink); margin-top: 6px; }
.hud-actions { display: flex; align-items: center; gap: 16px; }
.hud-links { display: flex; align-items: center; gap: 14px; }
.hud-links a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.hud-links a:hover { color: var(--pink); border-color: var(--pink); }
.mute-btn { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; font-size: 17px; cursor: pointer; flex: none; }
.mute-btn:hover { background: rgba(255, 31, 143, 0.12); border-color: var(--pink); }
.progress-wrap { flex-basis: 100%; height: 8px; border-radius: 999px; background: rgba(138, 43, 255, 0.12); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--pink), var(--orange)); transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ── SELECT ─────────────────────────────────────────── */
.select { margin-top: 54px; text-align: center; }
.select-title {
  font-family: var(--display); font-weight: 400; font-style: italic; text-transform: uppercase;
  font-size: clamp(42px, 8vw, 88px); line-height: .9; letter-spacing: 1px; margin: 0 0 14px;
  background: linear-gradient(120deg, var(--pink) 0%, var(--purple) 52%, var(--orange) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(27, 10, 46, 0.12));
}
.select-sub { color: var(--muted); margin: 0 auto 44px; max-width: 580px; font-size: 15px; }

.grid { display: grid; gap: 22px; text-align: left; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  position: relative; cursor: pointer; overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--ca) 40%, var(--line));
  border-radius: 18px; padding: 24px; background: var(--card); backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--ca) 70%, transparent);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s;
  outline: none;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 220px at var(--mx,50%) var(--my,0%), color-mix(in srgb, var(--ca) 16%, transparent), transparent 60%);
  opacity: .5; transition: opacity .2s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-8px); border-color: var(--ca);
  box-shadow: 0 0 0 1.5px var(--ca), 0 24px 50px -22px color-mix(in srgb, var(--ca) 85%, transparent);
}
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.card.is-active { transform: translateY(-8px); border-color: var(--ca); box-shadow: 0 0 0 2px var(--ca), 0 18px 40px -20px var(--ca); }
.card:active { transform: translateY(-3px) scale(.985); }

.card-emoji { font-size: 38px; }
.card-badge {
  position: absolute; top: 18px; right: 18px;
  font-family: var(--pixel); font-size: 7px; letter-spacing: 1px; padding: 7px 9px; border-radius: 7px;
  background: var(--ca); color: #fff; border: 0; box-shadow: 0 4px 12px -3px var(--ca);
}
.card-title { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: .4px; margin: 16px 0 4px; text-transform: uppercase; color: var(--ink); }
.card-sub { color: #5a4070; font-size: 14px; min-height: 38px; }
.card-stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 16px; }
.chip { font-size: 11px; color: #4a3360; border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.55); }
.card-cta { display: flex; align-items: center; justify-content: space-between; }
.card-cta .go { font-family: var(--pixel); font-size: 9px; color: var(--ca); }
.card.locked { opacity: .9; }
.card.locked .card-cta .go { color: var(--muted); }
.lock { font-size: 12px; }

/* cleared ribbon */
.card.cleared { border-color: color-mix(in srgb, var(--cyan) 55%, var(--line)); }
.card .cleared-ribbon {
  position: absolute; top: 16px; left: -36px; transform: rotate(-45deg);
  background: var(--cyan); color: #fff; font-family: var(--pixel); font-size: 7px; letter-spacing: 1px;
  padding: 6px 40px; display: none; box-shadow: 0 3px 10px -2px var(--cyan);
}
.card.cleared .cleared-ribbon { display: block; }

/* ── MODAL ──────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(40, 10, 50, 0.42); backdrop-filter: blur(6px); padding: 20px; animation: fade .2s; }
.modal-card {
  position: relative; width: min(720px, 100%); max-height: 88vh; overflow: auto;
  border: 1.5px solid var(--ca, var(--pink)); border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fff4fa);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ca) 30%, transparent), 0 40px 100px -28px rgba(27, 10, 46, 0.4);
  animation: rise .25s cubic-bezier(.2,.8,.2,1);
}
.modal-close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; font-family: var(--pixel); font-size: 9px; color: var(--ink); background: rgba(27, 10, 46, 0.06); border: 1px solid var(--line); padding: 9px 11px; border-radius: 9px; cursor: pointer; z-index: 2; }
.modal-close:hover { background: rgba(255, 31, 143, 0.12); border-color: var(--pink); }
.modal-body { padding: 28px 32px 36px; }
.m-emoji { font-size: 50px; }
.m-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 40px; letter-spacing: .5px; margin: 10px 0 4px; color: var(--ink); }
.m-sub { color: var(--muted); margin: 0 0 22px; }
.m-section { margin: 20px 0; }
.m-h { font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; color: var(--ca); margin-bottom: 8px; }
.m-section p { margin: 0; line-height: 1.6; color: #3a2750; }
.m-impact { list-style: none; padding: 0; margin: 0; }
.m-impact li { padding: 9px 0 9px 24px; position: relative; line-height: 1.5; border-bottom: 1px solid var(--line); color: #3a2750; }
.m-impact li::before { content: "▸"; position: absolute; left: 0; color: var(--ca); }
.m-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.m-btn { font-family: var(--pixel); font-size: 10px; text-decoration: none; padding: 15px 19px; border-radius: 11px; cursor: pointer; border: 1px solid var(--line); }
.m-btn.primary { background: var(--ca); color: #fff; border: 0; box-shadow: 0 8px 20px -6px var(--ca); }
.m-btn.ghost { color: var(--ink); background: rgba(27, 10, 46, 0.05); }
.m-btn.ghost:hover { border-color: var(--ca); }
.m-btn.disabled { opacity: .45; pointer-events: none; }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 60px; }
.foot a { color: var(--pink); text-decoration: none; font-weight: 600; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); z-index: 40; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 14px; padding: 14px 22px; box-shadow: 0 18px 50px -16px rgba(27, 10, 46, 0.4); opacity: 0; transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .t-emoji { font-size: 26px; }
.toast .t-title { font-family: var(--pixel); font-size: 9px; color: #c47a00; letter-spacing: 1px; }
.toast .t-body { font-size: 13px; color: var(--ink); margin-top: 4px; }
#confetti { position: fixed; inset: 0; z-index: 45; pointer-events: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }

/* tap feedback */
.card, .btn-press, .m-btn, .mute-btn, .modal-close { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn-press:active, .m-btn:active, .mute-btn:active, .modal-close:active { transform: translateY(2px); }

@media (max-width: 760px) {
  .hud { justify-content: center; text-align: center; }
  .hud-player { margin-right: 0; width: 100%; justify-content: center; }
  .hud-stats { width: 100%; justify-content: center; gap: 26px; }
  .hud-actions { width: 100%; justify-content: center; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-card { max-height: 100vh; height: 100vh; border-radius: 0; width: 100%; }
  .modal-body { padding: 22px 20px 40px; }
  .modal-close { width: 56px; height: 44px; display: grid; place-items: center; }
  .esc-hint { display: none; }
  .m-actions { flex-direction: column; }
  .m-btn { text-align: center; }
}
@media (hover: none) and (pointer: coarse) { .esc-hint { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════
   MODE TOGGLE  (floating, both themes)
   ═══════════════════════════════════════════════════════════════════════ */
.mode-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.82); color: #1b0a2e; border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.4); backdrop-filter: blur(10px);
  transition: transform .12s, background .2s;
}
.mode-toggle:hover { transform: translateY(-1px); }
.mode-toggle:active { transform: translateY(1px); }
body.mode-editorial .mode-toggle { background: rgba(20,20,22,.7); color: #f4f1ea; border-color: rgba(255,255,255,.18); }

/* in editorial mode, swap the global backdrop to charcoal & kill arcade FX */
body.mode-editorial { background: #0e0e10; }
body.mode-editorial::before { display: none; }
body.mode-editorial #stars { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   EDITORIAL THEME  — premium / athlete-showcase inspired (original build)
   ═══════════════════════════════════════════════════════════════════════ */
.editorial {
  --ed-bg: #0e0e10;
  --ed-panel: #161618;
  --ed-ink: #f4f1ea;
  --ed-muted: #9a968d;
  --ed-accent: #c8ff3d;       /* our own acid-lime accent */
  --ed-serif: "Fraunces", Georgia, serif;
  position: relative; z-index: 5;
  background: var(--ed-bg); color: var(--ed-ink);
  font-family: var(--sans); min-height: 100vh;
}

/* nav */
.ed-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  background: linear-gradient(180deg, rgba(14,14,16,.92), rgba(14,14,16,0));
  backdrop-filter: blur(8px);
}
.ed-logo { font-family: var(--ed-serif); font-weight: 600; font-size: 18px; letter-spacing: .3px; }
.ed-nav-links { display: flex; gap: 28px; }
.ed-nav-links a { color: var(--ed-muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.ed-nav-links a:hover { color: var(--ed-accent); }

/* hero */
.ed-hero {
  min-height: 86vh; display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(20px, 5vw, 64px);
  background:
    radial-gradient(900px 600px at 82% 20%, rgba(200, 255, 61, 0.10), transparent 60%),
    linear-gradient(180deg, #0e0e10, #131315);
}
.ed-eyebrow { font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--ed-accent); margin: 0 0 18px; font-weight: 700; }
.ed-hero-title {
  font-family: var(--ed-serif); font-weight: 600; font-size: clamp(58px, 13vw, 168px);
  line-height: .92; letter-spacing: -1px; margin: 0;
}
.ed-hero-title em { font-style: italic; color: var(--ed-accent); }
.ed-hero-sub { max-width: 540px; margin: 26px 0 0; font-size: clamp(16px, 2vw, 20px); color: var(--ed-muted); line-height: 1.6; }
.ed-scroll-hint { margin-top: 52px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--ed-muted); }
.ed-scroll-hint span { display: inline-block; margin-left: 8px; color: var(--ed-accent); animation: nudge 1.6s infinite; }
@keyframes nudge { 0%,100%{ transform: translateX(0);} 50%{ transform: translateX(8px);} }

/* work / horizontal rail */
.ed-work { padding: clamp(60px, 9vw, 120px) 0 clamp(60px, 9vw, 110px); }
.ed-work-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 clamp(20px, 5vw, 64px); margin-bottom: 36px; gap: 20px; flex-wrap: wrap; }
.ed-section-title { font-family: var(--ed-serif); font-weight: 600; font-size: clamp(30px, 5vw, 52px); margin: 0; }
.ed-rail-ctrl { display: flex; align-items: center; gap: 14px; }
.ed-counter { font-variant-numeric: tabular-nums; color: var(--ed-muted); font-size: 14px; letter-spacing: 1px; }
.ed-arrow { width: 46px; height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--ed-ink); font-size: 18px; cursor: pointer; transition: background .2s, border-color .2s, transform .1s; }
.ed-arrow:hover { background: var(--ed-accent); color: #0e0e10; border-color: var(--ed-accent); }
.ed-arrow:active { transform: scale(.94); }
.ed-arrow:disabled { opacity: .3; cursor: default; }

.ed-rail {
  display: flex; gap: 26px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px clamp(20px, 5vw, 64px) 28px; scroll-padding-left: clamp(20px, 5vw, 64px);
  scrollbar-width: none;
}
.ed-rail::-webkit-scrollbar { display: none; }
.ed-slide {
  scroll-snap-align: start; flex: 0 0 min(560px, 84vw); min-height: 460px;
  border-radius: 22px; padding: 34px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(155deg, color-mix(in srgb, var(--ca) 34%, #161618), #131315);
  border: 1px solid color-mix(in srgb, var(--ca) 40%, rgba(255,255,255,.08));
  cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.ed-slide:hover { transform: translateY(-6px); box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--ca) 80%, transparent); }
.ed-slide-top { display: flex; align-items: flex-start; justify-content: space-between; }
.ed-slide-num { font-family: var(--ed-serif); font-size: 20px; color: color-mix(in srgb, var(--ca) 75%, #fff); opacity: .9; }
.ed-slide-emoji { font-size: 52px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.ed-slide-mid { margin: auto 0; }
.ed-slide-cat { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: color-mix(in srgb, var(--ca) 80%, #fff); margin: 0 0 12px; font-weight: 700; }
.ed-slide-title { font-family: var(--ed-serif); font-weight: 600; font-size: clamp(32px, 4.4vw, 48px); line-height: 1; margin: 0 0 14px; }
.ed-slide-sub { color: #d7d4cc; font-size: 16px; line-height: 1.55; margin: 0; max-width: 42ch; }
.ed-slide-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.ed-slide-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tag { font-size: 11px; color: #e8e6df; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 10px; }
.ed-slide-go { font-size: 13px; font-weight: 700; color: var(--ca); white-space: nowrap; }
.ed-slide.locked .ed-slide-go { color: var(--ed-muted); }

/* about */
.ed-about { padding: clamp(60px, 9vw, 120px) clamp(20px, 5vw, 64px); max-width: 1100px; }
.ed-about-text { font-family: var(--ed-serif); font-weight: 400; font-size: clamp(22px, 3.4vw, 40px); line-height: 1.4; margin: 18px 0 0; }
.ed-about-text em { font-style: italic; color: var(--ed-accent); }

/* contact */
.ed-contact { padding: clamp(60px, 9vw, 120px) clamp(20px, 5vw, 64px) 80px; border-top: 1px solid rgba(255,255,255,.08); }
.ed-contact-mail { display: inline-block; font-family: var(--ed-serif); font-weight: 600; font-size: clamp(30px, 6vw, 72px); color: var(--ed-ink); text-decoration: none; margin: 14px 0 30px; transition: color .2s; }
.ed-contact-mail:hover { color: var(--ed-accent); }
.ed-contact-links { display: flex; gap: 26px; flex-wrap: wrap; }
.ed-contact-links a { color: var(--ed-muted); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.ed-contact-links a:hover { color: var(--ed-accent); border-color: var(--ed-accent); }
.ed-copy { margin-top: 44px; color: var(--ed-muted); font-size: 13px; }

@media (max-width: 640px) {
  .ed-nav-links { display: none; }
  .ed-slide { flex-basis: 84vw; min-height: 420px; padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
