/* Layout: one long editorial scroll; hero split (text | live point-cloud head), then a full-width live training lab. */
:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #121620;
  --surface-2: #181d29;
  --line: rgba(168, 186, 226, .13);
  --fg: #e9edf5;
  --muted: #8d96ab;
  --accent: #ff8a3d;   /* shiba fur */
  --signal: #5ee6ff;   /* compute / neural signal */
  --good: #8af0a6;

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
img, canvas { max-width: 100%; }
::selection { background: var(--accent); color: #140a03; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* faint compute grid behind everything */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 75% 18%, rgba(255, 138, 61, .10), transparent 70%),
    radial-gradient(ellipse 50% 45% at 15% 70%, rgba(94, 230, 255, .07), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .15));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .15));
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(11, 13, 18, .72);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.logo__mark { width: 28px; height: 28px; }
.logo b { color: var(--accent); font-weight: 700; }
.nav__links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav__links a { text-decoration: none; color: var(--muted); transition: color .25s; }
.nav__links a:hover { color: var(--fg); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .03em;
  cursor: pointer;
  transition: transform .35s var(--ease), border-color .3s, background .3s, box-shadow .35s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(168, 186, 226, .35); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0c02;
  box-shadow: 0 10px 30px -10px rgba(255, 138, 61, .7);
}
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(255, 138, 61, .85); background: #ff9a55; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn.is-ok { border-color: var(--good); color: var(--good); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(40px, 6vw, 80px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); animation: pulse 2s ease-in-out infinite; }
.hero h1 {
  margin: 18px 0 20px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: .98;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; animation: rise 1s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .24s; }
.lede { max-width: 33em; margin: 0 0 30px; font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); animation: fade 1.2s .35s var(--ease) both; }
.lede strong { color: var(--fg); font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; animation: fade 1.2s .5s var(--ease) both; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 34px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); animation: fade 1.2s .65s var(--ease) both; }
.hero__meta span b { color: var(--fg); font-weight: 500; }

.stage { position: relative; aspect-ratio: 1 / 1; max-width: 100%; overflow: hidden; animation: fade 1.6s .2s var(--ease) both; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__ring {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 1px dashed rgba(94, 230, 255, .22);
  animation: spin 60s linear infinite;
}
.stage__ring--2 { inset: 14%; border-style: solid; border-color: rgba(255, 138, 61, .12); animation-duration: 90s; animation-direction: reverse; }
.stage__tag {
  position: absolute;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 32, .78);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  animation: float 6s ease-in-out infinite;
}
.stage__tag b { color: var(--signal); font-weight: 500; }
.stage__tag--a { top: 12%; left: 0; }
.stage__tag--b { bottom: 16%; right: 0; animation-delay: -3s; }
.stage__tag--c { bottom: 4%; left: 12%; animation-delay: -1.5s; }

/* ---------- ticker strip ---------- */
.strip { border-block: 1px solid var(--line); overflow: hidden; background: rgba(18, 22, 32, .5); }
.strip__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.strip__track span { padding: 14px 28px; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.strip__track span::before { content: "◆"; margin-right: 28px; color: var(--accent); font-size: 9px; vertical-align: 2px; }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: clamp(32px, 4vw, 52px); }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h2 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.section__head p { margin: 0; color: var(--muted); max-width: 34em; }

/* ---------- lab (live sim) ---------- */
.lab { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.lab__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lab__title { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.lab__title b { color: var(--fg); font-weight: 500; }
.lab__live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--good); }
.lab__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 1.4s ease-in-out infinite; }
.lab__actions { display: flex; gap: 8px; margin-left: auto; }
.lab__body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.lab__canvas { position: relative; min-width: 0; aspect-ratio: 16 / 9; border-right: 1px solid var(--line); }
.lab__canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lab__stats { display: flex; flex-direction: column; gap: 18px; padding: 20px; min-width: 0; }
.stat__k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat__v { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__v small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.meter { height: 6px; margin-top: 8px; border-radius: 6px; background: rgba(168, 186, 226, .12); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--signal)); transition: width .6s var(--ease); }
.spark { width: 100%; height: 64px; display: block; }
.lab__note { margin: auto 0 0; font-size: 13px; color: var(--muted); }

/* ---------- pipeline ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.step {
  position: relative;
  padding: 28px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 29, 41, .9), rgba(18, 22, 32, .9));
  transition: transform .5s var(--ease), border-color .4s;
}
.step:hover { transform: translateY(-4px); border-color: rgba(255, 138, 61, .35); }
.step__n { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: .1em; }
.step h3 { margin: 14px 0 8px; font-family: var(--display); font-size: 24px; line-height: 1.15; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; }
.step__viz { height: 92px; margin: 18px 0 4px; border-radius: 10px; background: rgba(11, 13, 18, .6); border: 1px solid var(--line); position: relative; overflow: hidden; }
/* step 1: many worlds */
.viz-worlds { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; padding: 10px; height: 100%; }
.viz-worlds i { border-radius: 2px; background: var(--signal); opacity: .12; animation: blinkcell 2.4s ease-in-out infinite; }
/* step 2: loss curve */
.viz-curve svg { width: 100%; height: 100%; display: block; }
.viz-curve path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw 3.2s var(--ease) infinite; }
/* step 3: transfer */
.viz-transfer { display: flex; align-items: center; justify-content: space-around; height: 100%; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.viz-transfer .chip { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.viz-transfer .chip--real { border-color: rgba(255, 138, 61, .45); color: var(--fg); }
.viz-transfer .beam { position: relative; flex: 1; height: 2px; margin: 0 10px; background: rgba(94, 230, 255, .15); overflow: hidden; }
.viz-transfer .beam::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--signal); box-shadow: 0 0 10px var(--signal); animation: beam 1.6s var(--ease) infinite; }

/* ---------- skill tree ---------- */
.skills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.tree { display: flex; flex-direction: column; gap: 10px; }
.skill {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--fg);
  transition: border-color .3s, background .3s, transform .4s var(--ease);
}
.skill:hover { transform: translateX(4px); }
.skill[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 138, 61, .08); }
.skill__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; color: var(--signal); }
.skill__name { font-family: var(--display); font-weight: 600; font-size: 18px; }
.skill__desc { display: block; font-size: 14px; color: var(--muted); }
.skill__state { font-family: var(--mono); font-size: 11.5px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.skill__state--done { color: var(--good); border-color: rgba(138, 240, 166, .35); }
.skill__state--now { color: var(--accent); border-color: rgba(255, 138, 61, .45); }
.vote { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.vote h3 { margin: 0 0 6px; font-family: var(--display); font-size: 26px; }
.vote p { margin: 0 0 18px; color: var(--muted); }
.vote__bar { display: grid; grid-template-columns: 90px minmax(0, 1fr) 44px; align-items: center; gap: 12px; margin-bottom: 10px; font-family: var(--mono); font-size: 13px; }
.vote__bar .meter { margin: 0; height: 8px; }
.vote__bar span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.vote__hint { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- roadmap ---------- */
.road { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; }
.road::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: linear-gradient(90deg, var(--accent), var(--signal) 40%, var(--line) 60%); }
.phase { position: relative; padding-top: 38px; }
.phase::before { content: ""; position: absolute; top: 4px; left: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.phase--done::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(255, 138, 61, .6); }
.phase--now::before { border-color: var(--signal); animation: pulse 1.8s ease-in-out infinite; }
.phase__k { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.phase h3 { margin: 6px 0 8px; font-family: var(--display); font-size: 22px; }
.phase ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }

/* ---------- join ---------- */
.join { position: relative; padding: clamp(32px, 5vw, 64px); border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(ellipse 70% 90% at 100% 0%, rgba(255, 138, 61, .16), transparent 60%), var(--surface); overflow: hidden; }
.join h2 { max-width: 14em; }
.join__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.ca code { padding: 8px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--fg); word-break: break-all; user-select: all; }

.footer { padding-block: 40px 56px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer p { margin: 0; max-width: 56em; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* scroll reveal: content is visible at rest; only browsers with view timelines animate it in */
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
}

@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } }
@keyframes reveal { from { opacity: .15; transform: translateY(40px) scale(.98); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blinkcell { 50% { opacity: .7; } }
@keyframes draw { 0% { stroke-dashoffset: 320; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes beam { from { transform: translateX(-110%); } to { transform: translateX(360%); } }

@media (max-width: 960px) {
  .hero__grid, .skills, .section__head { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: 520px; width: 100%; margin: 0 auto; }
  .lab__body { grid-template-columns: minmax(0, 1fr); }
  .lab__canvas { border-right: 0; border-bottom: 1px solid var(--line); }
  .lab__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab__stats > :nth-last-child(-n+2) { grid-column: 1 / -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .road { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .road::before { display: none; }
}
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__in .btn { margin-left: auto; }
  .lab__canvas { aspect-ratio: 4 / 3; }
  .lab__actions { margin-left: 0; }
  .road { grid-template-columns: minmax(0, 1fr); }
  .stage__tag { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
