/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #060913;
  --bg-2: #0b1020;
  --ink: #e8eefc;
  --muted: #8b97b4;
  --dim: #5a6684;
  --line: rgba(140, 160, 210, .14);
  --line-strong: rgba(140, 160, 210, .28);
  --surface: rgba(16, 22, 40, .66);
  --surface-2: rgba(22, 30, 54, .8);
  --cyan: #5eead4;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --green: #4ade80;
  --red: #f87171;
  --grad: linear-gradient(100deg, var(--cyan) 0%, var(--blue) 45%, var(--violet) 100%);
  --sans: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 6px; }
::selection { background: rgba(94, 234, 212, .3); }

/* ---------- backdrop ---------- */
.bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 85% -10%, rgba(96, 165, 250, .18), transparent 60%),
    radial-gradient(50vw 50vw at -10% 30%, rgba(167, 139, 250, .14), transparent 60%),
    radial-gradient(40vw 40vw at 60% 110%, rgba(94, 234, 212, .10), transparent 60%);
}
.gridlines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(rgba(140, 160, 210, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 160, 210, .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* ---------- intro / boot ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .7s var(--ease), visibility .7s;
}
.intro.out { opacity: 0; visibility: hidden; }
.intro-term {
  width: min(560px, 92vw);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(94, 234, 212, .06) inset;
  overflow: hidden;
  animation: intro-pop .6s var(--ease) both;
}
@keyframes intro-pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a4463; }
.term-bar span:nth-child(1) { background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { margin-left: 8px; font: 12px var(--mono); font-style: normal; color: var(--dim); letter-spacing: .02em; }
.intro-log {
  margin: 0; min-height: 190px; padding: 18px 20px;
  font: 13.5px/1.75 var(--mono);
  color: #b9c6e6; white-space: pre-wrap;
}
.intro-log .ok { color: var(--green); }
.intro-log .key { color: var(--cyan); }
.intro-log .dim { color: var(--dim); }
.intro-log .cursor::after { content: "\258D"; color: var(--cyan); animation: blink 1s steps(1) infinite; }
.intro-skip {
  display: block; width: 100%;
  padding: 11px 16px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--dim);
  font: 12px var(--mono); letter-spacing: .08em; text-align: right; cursor: pointer;
}
.intro-skip:hover { color: var(--cyan); }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px clamp(18px, 4vw, 48px);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(6, 9, 19, .55);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 14px var(--mono); letter-spacing: .14em; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.brand-sub { color: var(--dim); font-weight: 400; letter-spacing: .06em; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.top nav a { position: relative; font-size: 13.5px; color: var(--muted); padding: 4px 0; transition: color .2s; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--grad); transition: right .3s var(--ease); }
.top nav a:hover { color: var(--ink); }
.top nav a:hover::after { right: 0; }
.nav-gh { color: var(--ink) !important; }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px); }
section { scroll-margin-top: 80px; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin: 0 0 28px; }
.section-head h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.02em; }
.section-head .num { font: 600 13px var(--mono); color: var(--cyan); letter-spacing: .14em; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  min-height: calc(100vh - 70px); padding: 56px 0 72px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  font: 600 12px var(--mono); letter-spacing: .2em; color: var(--muted);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
h1 { margin: 0 0 18px; font-size: clamp(44px, 7.2vw, 96px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
h1 .line { display: block; }
h1 .line:first-child { font-size: .42em; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 8px; }
.grad {
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }
.typer { margin: 0 0 20px; min-height: 1.8em; font: 500 clamp(17px, 2vw, 22px) var(--mono); color: var(--cyan); }
.caret { display: inline-block; width: .55em; height: 1.15em; margin-left: 3px; vertical-align: -.2em; background: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 0 0 30px; max-width: 560px; font-size: 16.5px; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(94, 234, 212, .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.btn.primary { border: 0; color: #06111c; background: var(--grad); background-size: 200% 100%; }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 10px 30px rgba(96, 165, 250, .3); }
.btn.link { border: 0; background: transparent; color: var(--muted); }
.btn.link:hover { color: var(--ink); box-shadow: none; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }

.hero-term {
  position: relative;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--surface-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  overflow: hidden;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.term-body { display: grid; gap: 8px; margin: 0; padding: 18px 20px 10px; font: 13px var(--mono); }
.term-body div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.term-body dt { color: var(--dim); }
.term-body dd { margin: 0; color: #cfdaf5; text-align: right; overflow-wrap: anywhere; }
.state[data-state="ok"] { color: var(--green); }
.state[data-state="error"] { color: var(--red); }
.state[data-state="loading"] { color: var(--amber); }
.term-log { margin: 0; padding: 10px 20px 18px; font: 12.5px/1.7 var(--mono); color: var(--dim); white-space: pre-wrap; min-height: 86px; }
.term-log .ok { color: var(--green); }
.term-log .warn { color: var(--amber); }

/* ---------- marquee ---------- */
.marquee {
  position: relative; z-index: 1; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 28, .5);
  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; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { padding: 14px 26px; font: 500 13px var(--mono); letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.marquee-track span::before { content: "\25C6"; margin-right: 22px; color: var(--cyan); font-size: 8px; vertical-align: 2px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- modules (bento) ---------- */
.modules { padding: 88px 0 40px; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(190px, auto); gap: 16px; }
.tile {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(94, 234, 212, .16), transparent 45%);
  transition: opacity .35s;
}
.tile::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; opacity: 0;
  background: radial-gradient(300px circle at var(--mx) var(--my), rgba(94, 234, 212, .8), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .35s;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.tile:hover::before, .tile:hover::after { opacity: 1; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tile-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.tile-icon svg { width: 22px; height: 22px; stroke: var(--cyan); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-tag { font: 600 11px var(--mono); letter-spacing: .14em; color: var(--dim); padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; }
.tile-tag.live { color: var(--green); border-color: rgba(74, 222, 128, .35); }
.tile-tag.soon { color: var(--amber); border-color: rgba(251, 191, 36, .35); }
.tile-tag.ext { color: var(--violet); border-color: rgba(167, 139, 250, .35); }
.tile h3 { margin: 18px 0 6px; font-size: 20px; letter-spacing: -.01em; }
.tile p { margin: 0; font-size: 14px; color: var(--muted); }
.tile-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; font: 600 13px var(--mono); color: var(--cyan); letter-spacing: .04em; }
.tile-foot .arrow { display: inline-block; transition: transform .3s var(--ease); }
.tile:hover .tile-foot .arrow { transform: translateX(6px); }
.tile-lg { grid-column: span 4; grid-row: span 2; }
.tile-md { grid-column: span 2; }
.tile-sm { grid-column: span 2; }
.tile-wide { grid-column: span 3; }
.tile-full { grid-column: span 6; }
.tile-lg h3 { font-size: 28px; }
.tile-lg p { font-size: 15px; max-width: 460px; }
.tile-lg .tile-stats { display: flex; gap: 28px; margin-top: 22px; }
.tile-stats b { display: block; font: 700 26px var(--mono); color: var(--ink); letter-spacing: -.02em; }
.tile-stats small { font-size: 12px; color: var(--dim); letter-spacing: .06em; }
.lab-tile .tile-icon svg { stroke: var(--violet); }
.lab-progress { margin-top: 16px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.lab-progress i { display: block; width: 18%; height: 100%; border-radius: inherit; background: var(--grad); animation: progress-sheen 2.4s ease-in-out infinite; }
@keyframes progress-sheen { 50% { width: 26%; } }

/* ---------- about strip ---------- */
.about { padding: 60px 0 40px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; }
.about p { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; }
.about strong { color: var(--ink); font-weight: 600; }
.timeline { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line-strong); }
.timeline li { position: relative; padding-left: 22px; font-size: 14px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
.timeline b { display: block; color: var(--ink); font-weight: 600; }
.timeline time { font: 12px var(--mono); color: var(--dim); letter-spacing: .06em; }

/* ---------- footer ---------- */
footer {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 60px auto 0; padding: 26px clamp(18px, 4vw, 48px) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line);
  font: 12px var(--mono); color: var(--dim); letter-spacing: .06em;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--cyan); }

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

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 40px; }
  .hero-term { animation: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-lg { grid-column: span 2; grid-row: auto; }
  .tile-md, .tile-sm, .tile-wide { grid-column: span 1; }
  .tile-full { grid-column: span 2; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .top nav { gap: 4px 16px; }
  .bento { grid-template-columns: 1fr; }
  .tile-lg, .tile-md, .tile-sm, .tile-wide, .tile-full { grid-column: span 1; }
  .tile-lg .tile-stats { gap: 18px; flex-wrap: wrap; }
  h1 { font-size: clamp(40px, 13vw, 64px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .bg { display: none; }
}
@media (max-width: 640px) {
  .typer { min-height: 3.6em; }
}
