/* ==========================================================================
   我的编程学习分享 — Design System
   Dark, cinematic, WebGL-first. No framework, no CDN.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #05060b;
  --bg-soft: #080a12;
  --ink: #eef1f7;
  --ink-dim: #b9c1d1;
  --muted: #98a2b8;
  --muted-2: #6d778c;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --glass: rgba(255, 255, 255, .035);
  --blue: #5b8cff;
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --grad: linear-gradient(100deg, #6ea0ff 0%, #a78bfa 48%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(91, 140, 255, .16), rgba(167, 139, 250, .1));

  --font-display: 'Space Grotesk', 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;

  --container: 1240px;
  --pad: 32px;
  --radius: 20px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
ul, ol { list-style: none; }

::selection { background: rgba(110, 160, 255, .35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Page ambience ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 78% 8%, rgba(91, 140, 255, .13), transparent 65%),
    radial-gradient(700px 520px at 8% 22%, rgba(167, 139, 250, .09), transparent 62%),
    radial-gradient(800px 600px at 50% 100%, rgba(34, 211, 238, .05), transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 78%);
}

main, .site-nav, .site-footer, .marquee { position: relative; z-index: 1; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 10px;
  background: #fff;
  color: #05060b;
  font-size: .85rem;
  font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(110, 160, 255, .7);
  will-change: transform;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: padding .35s var(--ease-out), background .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  padding: 12px 0;
  background: rgba(5, 6, 11, .72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom-color: rgba(255, 255, 255, .07);
}

.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(110, 160, 255, .45)); }
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
}
.brand-text em {
  font-family: var(--font-display);
  font-style: normal;
  font-size: .56rem;
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  position: relative;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 450;
  color: rgba(238, 241, 247, .66);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-links a.is-active { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-links a.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 14px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--grad);
}

.nav-right { display: flex; align-items: center; gap: 12px; position: relative; z-index: 101; }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(3, 4, 8, .62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s, visibility .35s;
}
.nav-scrim.is-open { opacity: 1; visibility: visible; }
@media (min-width: 861px) { .nav-scrim { display: none; } }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .84rem;
  color: rgba(238, 241, 247, .86);
  transition: border-color .3s, background .3s, color .3s, box-shadow .3s;
}
.nav-cta .ic { width: 15px; height: 15px; transition: transform .3s var(--ease-out); }
.nav-cta:hover {
  border-color: rgba(110, 160, 255, .55);
  background: rgba(91, 140, 255, .1);
  color: #fff;
  box-shadow: 0 0 24px -6px rgba(110, 160, 255, .5);
}
.nav-cta:hover .ic { transform: translate(2px, -2px); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 17px; height: 1.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s var(--ease-out), opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: .94rem;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: transform .35s var(--ease-out), box-shadow .35s, background .35s, border-color .35s, color .35s;
  will-change: transform;
}
.btn .ic { width: 18px; height: 18px; transition: transform .35s var(--ease-out); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #5b8cff 0%, #8b5cf6 100%);
  box-shadow: 0 12px 32px -12px rgba(91, 140, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #7aa2ff 0%, #a78bfa 100%);
  opacity: 0;
  transition: opacity .35s;
  z-index: -1;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(110, 160, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover .ic { transform: translateX(4px); }

.btn-ghost {
  color: rgba(238, 241, 247, .9);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#hero-canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease .1s;
}
#hero-canvas.is-ready { opacity: 1; }

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 6, 11, .92) 0%, rgba(5, 6, 11, .62) 42%, rgba(5, 6, 11, 0) 72%),
    linear-gradient(180deg, rgba(5, 6, 11, .55) 0%, transparent 22%, transparent 72%, rgba(5, 6, 11, .95) 100%);
}

.hero-inner { position: relative; z-index: 2; }
.hero-copy { max-width: 760px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(238, 241, 247, .55);
}
.eyebrow .sep { opacity: .35; }
.pulse-dot {
  position: relative;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.4vw, 3.95rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.03em;
  color: #fff;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: block; }
.hero-title em {
  font-style: normal;
  font-size: .94em;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(110, 160, 255, .28));
}

.hero-lede {
  margin-top: 30px;
  max-width: 560px;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--muted);
}
.hero-lede strong { color: var(--ink-dim); font-weight: 500; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.hero-stats {
  display: flex;
  gap: 46px;
  margin-top: 54px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  max-width: 560px;
}
.hero-stats dt { display: flex; flex-direction: column; gap: 6px; }
.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  color: #fff;
}
.hero-stats span { font-size: .8rem; color: var(--muted-2); letter-spacing: .06em; }

.hero-foot {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: .64rem;
  letter-spacing: .3em;
  color: rgba(238, 241, 247, .38);
  transition: color .3s;
}
.scroll-cue:hover { color: rgba(238, 241, 247, .8); }
.scroll-line {
  position: relative;
  display: block;
  width: 1px; height: 42px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 40%;
  background: linear-gradient(180deg, transparent, #6ea0ff, transparent);
  animation: scrollLine 2.4s var(--ease-out) infinite;
}
@keyframes scrollLine {
  0% { transform: translateY(-110%); }
  60%, 100% { transform: translateY(260%); }
}

.hero-social { display: flex; align-items: center; gap: 22px; }
.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: rgba(238, 241, 247, .45);
  transition: color .3s;
}
.hero-social .ic { width: 16px; height: 16px; }
.hero-social a:hover { color: #fff; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .012);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 30px;
  width: max-content;
  animation: marquee 46s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: .74rem;
  letter-spacing: .24em;
  color: rgba(238, 241, 247, .38);
  white-space: nowrap;
}
.marquee-track i {
  font-style: normal;
  font-size: .62rem;
  color: rgba(110, 160, 255, .55);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(90px, 11vw, 148px) 0; }
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .014) 18%, rgba(255, 255, 255, .014) 82%, transparent);
  border-top: 1px solid rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.section-head { max-width: 780px; margin-bottom: clamp(44px, 6vw, 68px); }
.section-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.section-kicker span { color: #8fb2ff; }
.section-kicker i {
  display: block;
  width: 36px; height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .32), transparent);
}
.section-head h2 {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.7vw, 3.05rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.02em;
  color: #fff;
}
.section-sub {
  margin-top: 18px;
  max-width: 620px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

/* ---------- 3D Lab ---------- */
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, .9fr);
  gap: 22px;
  align-items: stretch;
}
.lab-stage {
  position: relative;
  min-height: 500px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(24, 34, 86, .85), rgba(6, 8, 18, .98) 72%);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 60px -40px rgba(0, 0, 0, .9);
}
.lab-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 90px 20px rgba(5, 6, 11, .55);
}
#lab-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}
#lab-canvas:active { cursor: grabbing; }

.lab-hud {
  position: absolute;
  top: 18px; left: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .22em;
  color: rgba(255, 255, 255, .45);
  pointer-events: none;
}
.hud-live { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .55); }
.hud-live i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: blink 2s infinite;
}
@keyframes blink { 50% { opacity: .25; } }
.hud-mode { color: #9fc0ff; }

.lab-hint {
  position: absolute;
  left: 18px; bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(5, 6, 11, .55);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  font-size: .72rem;
  color: rgba(255, 255, 255, .45);
  pointer-events: none;
}
.lab-hint .ic { width: 14px; height: 14px; }

.lab-zoom {
  position: absolute;
  right: 16px; bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lab-zoom button {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(5, 6, 11, .55);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  font-size: 1rem;
  color: rgba(255, 255, 255, .7);
  transition: background .25s, border-color .25s, color .25s;
}
.lab-zoom button:hover { background: rgba(91, 140, 255, .22); border-color: rgba(110, 160, 255, .5); color: #fff; }

.lab-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lab-panel h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.lab-desc { font-size: .88rem; line-height: 1.8; color: var(--muted); }

.lab-group { display: flex; flex-direction: column; gap: 10px; }
.lab-label {
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .32);
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .07);
}
.seg button {
  padding: 9px 6px;
  border-radius: 9px;
  font-size: .82rem;
  color: var(--muted);
  transition: background .25s, color .25s, box-shadow .25s;
  white-space: nowrap;
}
.seg button:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.seg button.is-active {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 10px -2px rgba(0, 0, 0, .6);
}

.swatches { display: flex; gap: 9px; }
.swatch {
  width: 46px; height: 30px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.swatch span {
  display: block;
  width: 100%; height: 100%;
  border-radius: 6px;
  background: linear-gradient(120deg, var(--a), var(--b) 55%, var(--c));
  opacity: .8;
  transition: opacity .25s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch:hover span { opacity: 1; }
.swatch.is-active {
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .06), 0 6px 18px -6px var(--a, #5b8cff);
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .84rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative;
  width: 40px; height: 22px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  transition: background .3s;
}
.switch .thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .3s var(--ease-out);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.switch input:checked + .track { background: linear-gradient(135deg, #5b8cff, #8b5cf6); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 3px; }

.lab-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 8px;
}
.lab-specs span {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
}

/* ---------- Demo collection ---------- */
.demo-strip { margin-top: 34px; }
.demo-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.demo-strip-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.demo-strip-title em {
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .28em;
  color: rgba(255, 255, 255, .2);
}
.demo-strip-note { font-size: .72rem; color: rgba(255, 255, 255, .28); letter-spacing: .04em; }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.demo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .08);
  transition: transform .35s var(--ease-out), border-color .35s, background .35s, box-shadow .35s;
}
.demo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 160, 255, .4);
  background: linear-gradient(140deg, rgba(91, 140, 255, .12), rgba(255, 255, 255, .02));
  box-shadow: 0 26px 50px -34px rgba(91, 140, 255, .9);
}
.demo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-card h3 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #fff;
}
.demo-card p { font-size: .84rem; line-height: 1.75; color: var(--muted); }

.demo-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  flex: none;
  border-radius: 14px;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
}
.demo-icon .ic { width: 22px; height: 22px; color: #9fc0ff; }
.demo-icon--glass {
  background: linear-gradient(140deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -10px rgba(110, 160, 255, .8);
}

.demo-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-tags span {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .68rem;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.demo-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  font-size: .84rem;
  color: #9fc0ff;
  white-space: nowrap;
}
.demo-go .ic { width: 15px; height: 15px; transition: transform .3s var(--ease-out); }
.demo-card:hover .demo-go .ic { transform: translate(2px, -2px); }

/* ---------- Posts ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  perspective: 1200px;
}
.post {
  --mx: 50%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  padding: 26px 24px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .042), rgba(255, 255, 255, .016));
  border: 1px solid rgba(255, 255, 255, .07);
  transition: transform .45s var(--ease-out), border-color .45s, background .45s;
  will-change: transform;
}
.post::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(110, 160, 255, .16), transparent 70%);
  opacity: 0;
  transition: opacity .45s;
}
.post:hover {
  transform: translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  border-color: rgba(255, 255, 255, .16);
}
.post:hover::before { opacity: 1; }

.post-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-index {
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .26);
}
.post-cat {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .68rem;
  letter-spacing: .04em;
  color: #9fc0ff;
  background: rgba(91, 140, 255, .1);
  border: 1px solid rgba(91, 140, 255, .2);
}
.post h3 {
  margin: 22px 0 12px;
  font-family: var(--font-display);
  font-size: 1.19rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: #fff;
}
.post p { font-size: .87rem; line-height: 1.8; color: var(--muted); }
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: .72rem;
  color: rgba(255, 255, 255, .36);
}
.post-time { font-family: var(--font-display); letter-spacing: .08em; }
.post-tags { display: flex; gap: 6px; }
.post-tags span { color: rgba(255, 255, 255, .34); }
.post-tags span span::before { content: '· '; opacity: .5; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.7vw, 1.45rem);
  font-weight: 500;
  line-height: 1.6;
  color: #e4e9f4;
  margin-bottom: 24px;
}
.about-copy p:not(.about-lead) {
  font-size: .94rem;
  line-height: 1.95;
  color: var(--muted);
  margin-bottom: 18px;
}
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.stack span {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .78rem;
  color: rgba(238, 241, 247, .72);
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: border-color .3s, color .3s, background .3s;
}
.stack span:hover {
  border-color: rgba(110, 160, 255, .45);
  color: #fff;
  background: rgba(91, 140, 255, .08);
}

.about-panel {
  padding: 30px;
  border-radius: 24px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(91, 140, 255, .14), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 24px; }
.stat-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 20%, #b9c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-cell span { display: block; margin-top: 8px; font-size: .78rem; color: var(--muted-2); }
.about-sign {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .82rem;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .02em;
}

/* ---------- Contact ---------- */
.section-contact {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, .05);
}
.section-contact::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  width: 620px; height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(91, 140, 255, .14), transparent 65%);
  pointer-events: none;
}

.mail-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(120deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  transition: border-color .35s, transform .35s var(--ease-out), background .35s, box-shadow .35s;
}
.mail-cta:hover {
  transform: translateY(-3px);
  border-color: rgba(110, 160, 255, .45);
  background: linear-gradient(120deg, rgba(91, 140, 255, .13), rgba(255, 255, 255, .02));
  box-shadow: 0 24px 50px -30px rgba(91, 140, 255, .8);
}
.mail-label {
  font-family: var(--font-display);
  font-size: .66rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex: none;
}
.mail-address {
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -.01em;
  color: #fff;
}
.mail-cta .ic { width: 22px; height: 22px; color: #9fc0ff; transition: transform .3s var(--ease-out); }
.mail-cta:hover .ic { transform: translate(3px, -3px); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.contact-card {
  display: block;
  padding: 26px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .07);
  transition: transform .35s var(--ease-out), border-color .35s, background .35s;
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 160, 255, .35);
  background: rgba(91, 140, 255, .06);
}
.contact-card .ic { width: 22px; height: 22px; color: #9fc0ff; }
.contact-card h3 { margin: 18px 0 7px; font-size: .98rem; font-weight: 600; }
.contact-card p { font-family: var(--font-display); font-size: .86rem; color: rgba(255, 255, 255, .55); word-break: break-all; }
.contact-note { display: block; margin-top: 14px; font-size: .74rem; color: rgba(255, 255, 255, .32); }

.socials { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 40px; }
.socials-label { font-size: .74rem; letter-spacing: .16em; color: rgba(255, 255, 255, .3); margin-right: 8px; }
.socials a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .09);
  font-size: .84rem;
  color: rgba(238, 241, 247, .72);
  transition: border-color .3s, background .3s, color .3s;
}
.socials a:hover { border-color: rgba(110, 160, 255, .45); background: rgba(91, 140, 255, .08); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 60px 0 44px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .25);
}
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.footer-name em {
  font-style: normal;
  margin-left: 8px;
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.footer-brand p { margin-top: 10px; font-size: .86rem; color: rgba(255, 255, 255, .38); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { font-size: .85rem; color: rgba(255, 255, 255, .5); transition: color .25s; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: .76rem;
  color: rgba(255, 255, 255, .32);
}
.footer-meta { display: flex; align-items: center; gap: 10px; }
.footer-meta a { color: rgba(255, 255, 255, .42); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .2); }
.footer-meta a:hover { color: #fff; }
.footer-meta .dot { opacity: .4; }

/* ---------- Reveal / load animations ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out) var(--d, 0ms), transform .9s var(--ease-out) var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

.js .hero-eyebrow,
.js .hero-lede,
.js .hero-actions,
.js .hero-stats,
.js .hero-foot {
  opacity: 0;
  animation: fadeUp .9s var(--ease-out) forwards;
}
.js .hero-eyebrow { animation-delay: .15s; }
.js .hero-lede { animation-delay: .55s; }
.js .hero-actions { animation-delay: .68s; }
.js .hero-stats { animation-delay: .8s; }
.js .hero-foot { animation-delay: 1s; }

.js .hero-title .line > span {
  transform: translateY(112%);
  animation: lineUp 1.05s var(--ease-out) forwards;
}
.js .hero-title .line:nth-child(1) > span { animation-delay: .2s; }
.js .hero-title .line:nth-child(2) > span { animation-delay: .34s; }

@keyframes lineUp { to { transform: translateY(0); } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- WebGL fallback ---------- */
.no-webgl .hero-canvas-wrap::after {
  content: '';
  position: absolute;
  top: 50%; right: 6%;
  width: min(46vw, 560px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(110, 160, 255, .55), transparent 55%),
    radial-gradient(circle at 65% 70%, rgba(167, 139, 250, .45), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, .18), transparent 70%);
  filter: blur(10px);
}
.no-webgl .lab-stage { background: radial-gradient(circle at 50% 45%, rgba(91, 140, 255, .35), #06080f 70%); }

/* ---------- Cursor (1:1 tracking, no easing) ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 300;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .22s;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #fff;
  box-shadow:
    0 0 10px rgba(120, 168, 255, .95),
    0 0 22px rgba(167, 139, 250, .55);
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid rgba(178, 199, 255, .55);
  background: radial-gradient(circle, rgba(110, 160, 255, .12), transparent 68%);
  box-shadow:
    0 0 20px -6px rgba(110, 160, 255, .7),
    inset 0 0 12px rgba(110, 160, 255, .12);
  transition:
    width .22s var(--ease-out),
    height .22s var(--ease-out),
    border-color .22s,
    background .22s,
    box-shadow .22s,
    opacity .22s;
}
.cursor-ring.is-hover {
  width: 54px; height: 54px;
  border-color: rgba(196, 214, 255, .9);
  background: radial-gradient(circle, rgba(110, 160, 255, .2), transparent 70%);
  box-shadow:
    0 0 26px -6px rgba(110, 160, 255, .9),
    inset 0 0 14px rgba(110, 160, 255, .18);
}
.cursor-ring.is-down {
  width: 22px; height: 22px;
  border-color: rgba(255, 255, 255, .95);
}
.has-cursor .cursor-dot, .has-cursor .cursor-ring { opacity: 1; }
.has-cursor,
.has-cursor body,
.has-cursor a,
.has-cursor button,
.has-cursor .post,
.has-cursor .contact-card { cursor: none; }

body.menu-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .lab { grid-template-columns: 1fr; }
  .lab-stage { min-height: 440px; }
  .lab-panel { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 20px 28px; }
  .lab-panel h3, .lab-desc { flex-basis: 100%; }
  .lab-group { flex: 1 1 200px; min-width: 180px; }
  .lab-specs { flex-basis: 100%; margin-top: 0; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy { max-width: 620px; }
}

@media (max-width: 860px) {
  :root { --pad: 24px; --nav-h: 68px; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: min(78vw, 320px);
    height: 100svh;
    padding: 96px 22px 32px;
    background: rgba(8, 10, 18, .96);
    backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255, 255, 255, .08);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .45s var(--ease-out), visibility .45s;
  }
  .nav-links.is-open { transform: none; visibility: visible; }
  .nav-links a { padding: 14px 16px; font-size: 1rem; border-radius: 12px; }
  .nav-links a.is-active::after { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }

  .hero { padding-top: calc(var(--nav-h) + 60px); padding-bottom: 150px; }
  #hero-canvas.is-ready { opacity: .68; }
  .hero-lede { text-shadow: 0 1px 20px rgba(5, 6, 11, .85); }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(5, 6, 11, .82) 0%, rgba(5, 6, 11, .58) 40%, rgba(5, 6, 11, .96) 100%);
  }
  .hero-foot { bottom: 26px; }
  .hero-social span { display: none; }
  .hero-social { gap: 18px; }
  .hero-social .ic { width: 18px; height: 18px; }
  .hero-stats { gap: 34px; }

  .demo-strip-note { display: none; }
  .demo-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: 22px; }
}

@media (max-width: 640px) {
  .hero-title { font-size: clamp(2.15rem, 9.2vw, 2.8rem); letter-spacing: -.02em; }
  .hero-lede { font-size: .95rem; margin-top: 22px; }
  .hero-actions { margin-top: 30px; gap: 10px; }
  .btn { height: 48px; padding: 0 20px; font-size: .88rem; }
  .hero-stats { gap: 24px; margin-top: 38px; padding-top: 24px; }
  .hero-stats strong { font-size: 1.45rem; }
  .hero-stats span { font-size: .72rem; }
  .hero-copy { max-width: 100%; }
  .eyebrow { font-size: .62rem; letter-spacing: .12em; flex-wrap: wrap; gap: 8px; }

  .post-grid { grid-template-columns: 1fr; }
  .post { padding: 22px 20px 18px; }
  .lab-stage { min-height: 360px; border-radius: 18px; }
  .lab-panel { padding: 22px; border-radius: 18px; }
  .lab-hint { font-size: .66rem; padding: 6px 10px; }
  .demo-card { padding: 18px; }
  .demo-strip-head { margin-bottom: 12px; }
  .mail-cta { flex-wrap: wrap; gap: 10px; padding: 20px; }
  .mail-label { flex-basis: 100%; }
  .mail-cta .ic { margin-left: auto; }
  .section-head h2 { font-size: clamp(1.65rem, 7vw, 2rem); }
  .about-panel { padding: 24px; }
  .stat-grid { gap: 24px 18px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .scroll-cue { gap: 9px; }
  .scroll-line { height: 30px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .js .hero-title .line > span { transform: none; }
  .marquee-track { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; }
  .site-nav, .hero-canvas-wrap, .marquee, .scroll-progress, .cursor-dot, .cursor-ring, .lab-stage { display: none; }
}
