/* ============================================================
   nanopolar , polar aurora design system
   Palette: deep polar night + aurora spectrum (green→cyan→violet)
   with a single solar-amber warm counterpoint.
   ============================================================ */

:root {
  /* surfaces */
  --void:        #05070d;
  --void-2:      #070b15;
  --surface:     #0a1020;
  --surface-2:   #0e1626;
  --surface-3:   #14203a;

  /* lines */
  --line:        rgba(150,168,196,.12);
  --line-2:      rgba(150,168,196,.22);

  /* text */
  --text:        #e9eef8;
  --text-dim:    #9aa8c0;
  --text-mut:    #5e6c86;

  /* aurora spectrum */
  --green:  #34e5a0;
  --cyan:   #38bdf8;
  --violet: #a78bfa;
  --teal:   #2dd4bf;
  --amber:  #f5b14c;
  --peri:   #8b93f8;

  /* accent , overridden per project via inline style */
  --accent: #38bdf8;
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-ink: var(--accent); /* readable accent text; darkened in light mode */

  --aurora: linear-gradient(105deg, var(--green) 0%, var(--cyan) 42%, var(--violet) 100%);

  /* type */
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --radius: 16px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--void);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img,svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); color: #fff; }

/* ---------- ambient background ---------- */
.field-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 80% at 82% -10%, color-mix(in oklab, var(--violet) 20%, transparent), transparent 55%),
    radial-gradient(90% 70% at 8% 0%, color-mix(in oklab, var(--cyan) 16%, transparent), transparent 50%),
    var(--void);
}
.field-bg::before {  /* fine polar grid */
  content: ""; position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: .5;
}
/* Ambient aurora: one lightweight layer. No blur and no per-frame blend.
   Soft edges come from the gradient falloff; the additive glow comes from
   background-blend-mode (paid once at paint time); and the only animated
   property is transform, so the drift stays on the compositor and is cheap
   even on older GPUs. The layer is oversized (inset: -12%) and travels at most
   ~4%, so its edges never enter the viewport. */
.field-bg .aurora {
  position: absolute; inset: -12%;
  background:
    radial-gradient(54vw 54vh at 84% 20%, var(--green),  transparent 66%),
    radial-gradient(56vw 56vh at 16% 16%, var(--violet), transparent 66%),
    radial-gradient(56vw 56vh at 16% 80%, var(--cyan),   transparent 66%),
    radial-gradient(54vw 54vh at 84% 76%, var(--violet), transparent 66%);
  background-blend-mode: screen;
  opacity: .55;
  will-change: transform;
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0); }
  to   { transform: translate3d(4%,  3%, 0); }
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
section { position: relative; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-mut); display: inline-flex; align-items: center; gap: .6em;
}
.eyebrow .tick { color: var(--accent-ink); }
.aurora-text {
  background: var(--aurora); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.chip {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .02em;
  padding: .34em .7em; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-dim);
  display: inline-flex; align-items: center; gap: .5em; white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.demo { color: var(--green); border-color: color-mix(in oklab, var(--green) 40%, transparent); }
.chip.repo { color: var(--cyan); border-color: color-mix(in oklab, var(--cyan) 40%, transparent); }

.btn {
  --bg: transparent;
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .02em;
  padding: .82em 1.25em; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg);
  color: var(--text); transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 30px -14px var(--accent); }
.btn:hover .arrow { transform: translate(3px,-3px); }
.btn.primary {
  border-color: transparent; color: #04121a; font-weight: 600;
  background: var(--aurora); box-shadow: 0 12px 34px -16px var(--cyan);
}
.btn.primary:hover { box-shadow: 0 16px 40px -14px var(--cyan); }
.btn.accent { border-color: color-mix(in oklab, var(--accent) 55%, transparent); color: var(--accent-ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--void) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .7em; font-family: var(--f-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.brand b { font-weight: 700; }
.brand .lo { color: var(--text-dim); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-family: var(--f-mono); font-size: .8rem; letter-spacing: .04em; color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.signal { display: inline-flex; align-items: center; gap: .55em; font-family: var(--f-mono); font-size: .72rem; color: var(--text-mut); letter-spacing: .06em; }
.signal .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 70%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--green) 55%,transparent);} 70%{box-shadow:0 0 0 9px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(48px,7vw,90px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px,5vw,72px); align-items: center; }
.hero h1 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2.6rem, 6.2vw, 4.7rem); line-height: .98; letter-spacing: -.03em;
  margin: 22px 0 20px;
}
.hero h1 em { font-style: normal; }
.hero .lede { font-size: clamp(1.02rem,1.7vw,1.22rem); color: var(--text-dim); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .stat b { font-family: var(--f-display); font-weight: 600; font-size: 1.7rem; display: block; letter-spacing: -.02em; }
.hero-stats .stat span { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mut); }
.hero-stats .stat b.grad { background: var(--aurora); -webkit-background-clip:text; background-clip:text; color:transparent; }

/* ---------- polar radar (signature) ---------- */
.radar { position: relative; width: 100%; aspect-ratio: 1; max-width: 480px; margin-inline: auto; }
.radar svg { width: 100%; height: 100%; overflow: visible; }
.radar .ring, .radar .spoke { fill: none; stroke: var(--line-2); }
.radar .ring.faint, .radar .spoke.faint { stroke: var(--line); }
.radar .ticks line { stroke: var(--line-2); }
.radar .core { fill: var(--text); }
.radar .core-halo { fill: none; stroke: var(--cyan); opacity: .5; }
.radar .sweep { transform-origin: 260px 260px; animation: sweep 7s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar .label-ring text { font-family: var(--f-mono); font-size: 12px; fill: var(--text-mut); letter-spacing: .1em; }

/* nodes */
.node { cursor: pointer; }
.node .halo { fill: var(--n); opacity: 0; transform-box: fill-box; transform-origin: center; transition: opacity .3s; }
.node .glow { fill: var(--n); filter: drop-shadow(0 0 7px var(--n)); }
.node .ring2 { fill: none; stroke: var(--n); opacity: .55; }
.node .cap {
  font-family: var(--f-mono); font-size: 12.5px; fill: var(--text);
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s;
  paint-order: stroke; stroke: var(--void); stroke-width: 4px; stroke-linejoin: round;
}
.node .cap-sub { font-family: var(--f-mono); font-size: 9.5px; fill: var(--text-mut); opacity: 0; transition: opacity .25s; }
.node:hover .halo, .node:focus-visible .halo { opacity: .22; }
.node:hover .cap, .node:focus-visible .cap { opacity: 1; transform: translateY(0); }
.node:hover .cap-sub, .node:focus-visible .cap-sub { opacity: 1; }
.node:hover .ring2, .node:focus-visible .ring2 { opacity: 1; }
.node:focus-visible { outline: none; }
.node:focus-visible .glow { stroke: #fff; stroke-width: 2px; }

/* ---------- section header ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.8rem,3.6vw,2.7rem); letter-spacing: -.025em; line-height: 1.02; margin-top: 14px; }
.sec-head p { color: var(--text-dim); max-width: 40ch; }

/* ---------- work grid ---------- */
.work { padding: clamp(40px,6vw,86px) 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  --accent: var(--cyan);
  --accent-ink: var(--accent);
  position: relative; display: flex; flex-direction: column;
  padding: 26px 24px 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); overflow: hidden; min-height: 258px;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card::before { /* accent wash */
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(120% 90% at 90% 0%, var(--accent-soft), transparent 60%);
}
.card::after { /* top accent line */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .4s;
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); box-shadow: 0 26px 50px -30px var(--accent); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card:focus-within { border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); }
.card .idx { display: flex; align-items: center; justify-content: space-between; }
.card .idx .n { font-family: var(--f-mono); font-size: .74rem; color: var(--accent-ink); letter-spacing: .1em; }
.card .idx .coord { font-family: var(--f-mono); font-size: .68rem; color: var(--text-mut); letter-spacing: .08em; }
.card h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; margin: 20px 0 10px; }
.card .desc { color: var(--text-dim); font-size: .95rem; flex: 1; }
.card .tags { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.card .go { position: relative; z-index: 1; margin-top: 18px; display: inline-flex; align-items: center; gap: .5em; font-family: var(--f-mono); font-size: .78rem; color: var(--accent-ink); }
.card .go .arrow { transition: transform .3s var(--ease); }
.card:hover .go .arrow { transform: translateX(4px); }
.card a.stretched { position: absolute; inset: 0; z-index: 2; }

/* ---------- capabilities band ---------- */
.caps { padding: clamp(40px,6vw,80px) 0; border-block: 1px solid var(--line); background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--surface) 60%, transparent)); }
.caps .row { display: grid; grid-template-columns: repeat(6,1fr); gap: 18px; }
.caps .cap {
  padding: 22px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s;
}
.caps .cap:hover { transform: translateY(-4px); border-color: var(--line-2); }
.caps .cap .k { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; }
.caps .cap .k.grad { background: var(--aurora); -webkit-background-clip:text; background-clip:text; color:transparent; }
.caps .cap .v { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mut); margin-top: 8px; }

/* ---------- about / cta ---------- */
.about { padding: clamp(56px,8vw,110px) 0; }
.about .panel {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 24px; padding: clamp(34px,6vw,68px);
  background: radial-gradient(120% 130% at 100% 0%, color-mix(in oklab, var(--violet) 16%, transparent), transparent 55%), var(--surface);
}
.about h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.9rem,4vw,3rem); letter-spacing: -.03em; line-height: 1.03; max-width: 20ch; }
.about p { color: var(--text-dim); max-width: 54ch; margin-top: 20px; font-size: 1.05rem; }
.about .about-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px 0; }
.foot .wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot .brand { order: 0; }
.foot .credit { order: 1; margin-inline: auto; }   /* centered on wide screens */
.foot .email { order: 2; }
.foot .theme-toggle { order: 3; }                   /* email + toggle grouped on the right */
@media (max-width: 620px) {
  .foot .wrap { row-gap: 12px; }
  .foot .brand { margin-right: auto; }              /* row 1: brand left, toggle right */
  .foot .theme-toggle { order: 1; }
  .foot .credit { order: 2; margin-inline: 0; flex-basis: 100%; }  /* own line */
  .foot .email  { order: 3; flex-basis: 100%; }                    /* own line */
}
.foot .muted { font-family: var(--f-mono); font-size: .74rem; color: var(--text-mut); letter-spacing: .04em; }

/* ============================================================
   DETAIL PAGES
   ============================================================ */
.detail { padding-bottom: 60px; --accent-ink: var(--accent); }
.back { display: inline-flex; align-items: center; gap: .5em; font-family: var(--f-mono); font-size: .78rem; color: var(--text-dim); margin: 34px 0 4px; transition: color .2s, gap .2s; }
.back:hover { color: var(--accent-ink); gap: .8em; }

.dhero { padding: 30px 0 46px; border-bottom: 1px solid var(--line); }
.dhero .meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: .5em; color: var(--accent-ink); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dhero h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.6rem,6vw,4.4rem); letter-spacing: -.03em; line-height: 1; margin: 22px 0 16px; }
.dhero .tagline { font-size: clamp(1.1rem,2vw,1.4rem); color: var(--text-dim); max-width: 40ch; }
.dhero .links { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.dhero .none { font-family: var(--f-mono); font-size: .78rem; color: var(--text-mut); }

.facts { display: flex; gap: 40px; margin-top: 38px; flex-wrap: wrap; }
.facts .fact span { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mut); display: block; }
.facts .fact b { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; margin-top: 6px; display: block; }

.block { padding: clamp(44px,6vw,72px) 0; border-bottom: 1px solid var(--line); }
.block .lab { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); }
.block h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem,3vw,2.2rem); letter-spacing: -.02em; margin: 12px 0 26px; }
.block .prose p { color: var(--text-dim); font-size: 1.08rem; max-width: 62ch; }
.block .prose p + p { margin-top: 16px; }

/* features */
.features { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.feature { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: transform .3s var(--ease), border-color .3s; }
.feature:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 40%, var(--line-2)); }
.feature .fh { display: flex; align-items: center; gap: 12px; }
.feature .fh .num { font-family: var(--f-mono); font-size: .74rem; color: var(--accent-ink); flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line-2)); border-radius: 8px; }
.feature h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.08rem; letter-spacing: -.01em; }
.feature p { color: var(--text-dim); font-size: .95rem; margin-top: 12px; }

/* roadmap timeline */
.timeline { position: relative; margin-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), transparent); opacity: .4; }
.phase { position: relative; padding: 0 0 30px 52px; }
.phase:last-child { padding-bottom: 0; }
.phase .marker { position: absolute; left: 6px; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--accent); background: var(--void); display: grid; place-items: center; }
.phase .marker::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .35; }
.phase.done .marker::after { opacity: 1; box-shadow: 0 0 10px var(--accent); }
.phase.active .marker { animation: pulse-ring 2.2s infinite; }
@keyframes pulse-ring { 0%{box-shadow:0 0 0 0 var(--accent-soft);}70%{box-shadow:0 0 0 8px transparent;}100%{box-shadow:0 0 0 0 transparent;} }
.phase .ph-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phase h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.12rem; letter-spacing: -.01em; }
.phase .st { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: .28em .6em; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-mut); }
.phase.done .st { color: var(--green); border-color: color-mix(in oklab, var(--green) 40%, transparent); }
.phase.active .st { color: var(--accent-ink); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.phase p { color: var(--text-dim); font-size: .98rem; margin-top: 10px; max-width: 58ch; }

/* stack */
.stack-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; }
.stack-group { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stack-group .g { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mut); margin-bottom: 14px; }
.stack-group .items { display: flex; flex-wrap: wrap; gap: 8px; }
.tech { font-family: var(--f-mono); font-size: .8rem; padding: .4em .75em; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-dim); }

/* detail cta */
.dcta { padding: clamp(44px,6vw,72px) 0; }
.dcta .panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  border: 1px solid var(--line-2); border-radius: 20px; padding: 34px 40px;
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%), var(--surface); }
.dcta h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; }
.dcta .links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .radar { grid-row: 1; max-width: 360px; }
  .grid { grid-template-columns: repeat(2,1fr); }
  .caps .row { grid-template-columns: repeat(3,1fr); }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .wrap { padding-inline: 20px; }
  .nav-links a:not(.signal) { display: none; }
  .grid { grid-template-columns: 1fr; }
  .caps .row { grid-template-columns: repeat(2,1fr); }
  .hero-stats { gap: 24px; }
  .dcta .panel { flex-direction: column; align-items: flex-start; }
}

/* ---------- motion / a11y prefs ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .radar .sweep { display: none; }
}

/* ============================================================
   THEME TOGGLE (theme-independent control)
   ============================================================ */
.theme-toggle {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: block; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* ============================================================
   LIGHT THEME  (arctic day)
   Surfaces + text flip; the aurora spectrum stays vivid for glows,
   while accent *text* is darkened per project via --accent-ink.
   ============================================================ */
:root[data-theme="light"] {
  --void:      #e9eff8;
  --void-2:    #f2f6fc;
  --surface:   #ffffff;
  --surface-2: #f5f8fe;
  --surface-3: #e8f0fa;
  --line:   rgba(20,42,84,.12);
  --line-2: rgba(20,42,84,.20);
  --text:      #0c1a2e;
  --text-dim:  #40546f;
  --text-mut:  #6a7b95;
  --accent-ink: color-mix(in oklab, var(--accent) 70%, #0a192c);
}
:root[data-theme="light"] .card    { --accent-ink: color-mix(in oklab, var(--accent) 68%, #0a192c); }
:root[data-theme="light"] .detail  { --accent-ink: color-mix(in oklab, var(--accent) 70%, #0a192c); }

/* ambient field: soft daylight tint instead of glowing night */
:root[data-theme="light"] .field-bg {
  background:
    radial-gradient(120% 80% at 82% -10%, color-mix(in oklab, var(--violet) 22%, transparent), transparent 55%),
    radial-gradient(90% 70% at 8% 0%, color-mix(in oklab, var(--cyan) 20%, transparent), transparent 50%),
    var(--void);
}
:root[data-theme="light"] .field-bg::before { opacity: .32; }
:root[data-theme="light"] .field-bg .aurora { background-blend-mode: normal; opacity: .18; }

/* display gradient text needs deeper stops to read on white */
:root[data-theme="light"] .aurora-text,
:root[data-theme="light"] .hero-stats .stat b.grad,
:root[data-theme="light"] .caps .cap .k.grad {
  background: linear-gradient(105deg, #0e9d6d 0%, #0284c7 46%, #6d3ff5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* fixed-color availability chips */
:root[data-theme="light"] .chip.demo { color: #0a7d54; border-color: color-mix(in oklab, #0a7d54 42%, transparent); }
:root[data-theme="light"] .chip.repo { color: #0369a1; border-color: color-mix(in oklab, #0369a1 42%, transparent); }
:root[data-theme="light"] .phase.done .st { color: #0a7d54; border-color: color-mix(in oklab, #0a7d54 40%, transparent); }

/* primary button: keep the vivid aurora but ensure crisp dark label */
:root[data-theme="light"] .btn.primary { color: #06121d; box-shadow: 0 14px 34px -18px var(--cyan); }

/* ============================================================
   SCREENSHOT GALLERY (3D coverflow)
   Active shot is a flat square; the rest are rotated hard on the
   Y axis so they read as thin panels standing on their side,
   stacked and receding left and right. Only transform/opacity
   animate, so it stays cheap.
   ============================================================ */
.carousel { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; }
.stage {
  --shot: min(440px, 70vw);
  position: relative; flex: 1 1 auto; height: var(--shot);
  perspective: 1400px; overflow: hidden;
}
.shot {
  position: absolute; top: 50%; left: 50%;
  width: var(--shot); height: var(--shot);
  padding: 0; border: 0; background: none; cursor: pointer; opacity: 0;
  transform: translate(-50%, -50%); transform-style: preserve-3d;
  transition: transform .55s var(--ease), opacity .55s var(--ease);
  will-change: transform;
}
.shot:first-child { opacity: 1; z-index: 100; }
.shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.7);
  pointer-events: none; user-select: none;
}
.shot.is-active { cursor: zoom-in; }
.shot.is-active img {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2));
  box-shadow: 0 36px 70px -26px var(--accent-soft), 0 30px 60px -30px rgba(0,0,0,.7);
}
.car-nav {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-dim);
  font-size: 1.5rem; line-height: 1; display: grid; place-items: center; z-index: 6;
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.car-nav:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

.thumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.thumb {
  width: 44px; height: 30px; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); opacity: .5;
  transition: opacity .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb:hover { opacity: .85; transform: translateY(-1px); }
.thumb.is-active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

@media (prefers-reduced-motion: reduce) { .shot { transition: opacity .2s linear; } }
@media (max-width: 620px) {
  .stage { --shot: min(300px, 78vw); }
  .car-nav { width: 36px; height: 36px; font-size: 1.3rem; }
  .thumb { width: 38px; height: 26px; }
}

/* ---- lightbox (near-fullscreen image modal) ---- */
html.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: clamp(16px, 4vw, 48px);
  background: color-mix(in oklab, var(--void) 92%, transparent);
  animation: lb-in .22s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 92vw; }
.lb-img {
  max-width: 92vw; max-height: 84vh; width: auto; height: auto; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8);
}
.lb-count { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em; color: var(--text-dim); }
.lb-close {
  position: absolute; top: clamp(14px, 3vw, 26px); right: clamp(14px, 3vw, 26px);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; z-index: 2;
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.lb-close:hover { border-color: var(--accent); transform: rotate(90deg); }
.lb-nav {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-dim);
  font-size: 1.9rem; line-height: 1; display: grid; place-items: center;
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.lb-nav:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
@media (max-width: 620px) {
  .lb-nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lb-img { max-height: 74vh; }
}
