:root {
  --bg: #030304;
  --bg-1: #08080b;
  --bg-2: #0e0e12;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.16);
  --text: #ecebe8;
  --muted: #7d7c83;
  --red: #ff2b2b;
  --red-dim: rgba(255,43,43,.14);
  --red-glow: rgba(255,43,43,.5);
  --display: "Michroma", system-ui, sans-serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.2,.75,.15,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.loading { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--red); color: #000; }

/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 200; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, -2%); } }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.wrap { padding-inline: var(--gutter); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1.6s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: grid; place-items: center; }
.loader-in { width: min(320px, 80vw); display: grid; gap: 14px; }
.loader-in .mono { color: var(--muted); }
.loader-pct { font-family: var(--display); font-size: 64px; line-height: 1; color: var(--text); font-weight: 400; }
.loader-bar { height: 1px; background: var(--line); }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--gutter);
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(3,3,4,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-size: 14px; letter-spacing: .08em; }
.links { display: flex; gap: 34px; }
.links a { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--muted); transition: color .25s; }
.links a:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  --cut: 10px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px; text-decoration: none; cursor: pointer; border: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform .3s var(--ease), background .3s, color .3s;
}
.btn.small { height: 40px; padding: 0 18px; font-size: 11px; --cut: 7px; }
.btn-red { background: var(--red); color: #000; }
.btn-red:hover { background: #fff; }
.btn-ghost { background: var(--line); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn:active { transform: scale(.97); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn:focus-visible, .ca:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; display: grid; align-items: center; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.gl-fallback { display: none; position: absolute; right: 8%; top: 50%; transform: translateY(-50%); height: 70%; width: auto; opacity: .9; }
.no-gl .gl-fallback { display: block; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,3,4,.92) 0%, rgba(3,3,4,.55) 32%, transparent 58%),
    linear-gradient(to top, var(--bg) 0%, transparent 22%);
}
.hero-copy { position: relative; z-index: 2; padding: 90px var(--gutter) 120px; max-width: 760px; min-width: 0; }
.tag { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 28px; }
.tag .sep { color: var(--line-2); }
.h-hero { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(26px, 3.7vw, 58px); line-height: 1.1; letter-spacing: -.01em; }
.h-hero .line { display: block; overflow: hidden; }
.h-hero .line > span { display: inline-block; }
.hero-sub { margin-top: 26px; max-width: 34ch; font-size: clamp(17px, 1.3vw, 19px); color: #b9b8be; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.cta.center { justify-content: center; }
.ca {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 14px; max-width: 100%;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; cursor: pointer; transition: border-color .25s;
}
.ca:hover { border-color: var(--red); }
.ca #caText { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: .04em; }
.ca-copy { color: var(--red); }

.hud { position: absolute; z-index: 2; color: var(--muted); display: grid; gap: 8px; font-size: 11px; }
.hud b { color: var(--text); font-weight: 500; margin-left: 8px; }
.hud-r { right: var(--gutter); top: 50%; transform: translateY(-50%); text-align: right; border-right: 1px solid var(--red); padding-right: 14px; }

.hero-stats {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); background: rgba(3,3,4,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero-stats div { padding: 18px var(--gutter); display: grid; gap: 6px; border-left: 1px solid var(--line); }
.hero-stats div:first-child { border-left: 0; }
.hero-stats span { font-size: 10px; }
.hero-stats b { font-weight: 500; font-size: 14px; letter-spacing: .06em; }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 20px 0; background: var(--bg-1); }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: marquee 38s linear infinite; font-size: 15px; letter-spacing: .2em; }
.marquee-track i { color: var(--red); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- shared section bits ---------- */
section { position: relative; }
.label { display: flex; gap: 14px; align-items: center; color: var(--muted); margin-bottom: 26px; }
.label span { color: var(--red); }
.label::after { content: ""; width: 48px; height: 1px; background: var(--line-2); }
.h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(28px, 3.9vw, 60px); line-height: 1.1; letter-spacing: -.01em; }
.h2 .red { text-shadow: 0 0 34px var(--red-glow); }
.lede { margin-top: 22px; color: #a9a8ae; max-width: 40ch; font-size: clamp(16px, 1.2vw, 18px); }

/* ---------- manifesto ---------- */
.manifesto { padding-block: clamp(110px, 16vw, 220px); }
.manifesto-text { font-family: var(--display); text-transform: uppercase; font-size: clamp(22px, 3.1vw, 48px); line-height: 1.32; max-width: 22ch; max-width: min(100%, 1100px); }
.manifesto-text .w { opacity: .12; transition: none; }
.manifesto-text .w.hot { color: var(--red); }

/* ---------- model ---------- */
.model { padding-bottom: clamp(110px, 14vw, 200px); }
.model-head { margin-bottom: 56px; }
.model-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 14px; }
.panel { background: var(--bg-1); border: 1px solid var(--line); position: relative; min-width: 0; }
.panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px; border-top: 1px solid var(--red); border-left: 1px solid var(--red); }
.panel-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.panel-top .live { display: flex; align-items: center; gap: 8px; }
.panel-foot { display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.chart-panel { grid-row: span 2; display: flex; flex-direction: column; }
#compute { width: 100%; flex: 1; min-height: 420px; }
#net { width: 100%; height: 220px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stat-row div { padding: 14px 18px; display: grid; gap: 4px; border-left: 1px solid var(--line); }
.stat-row div:first-child { border-left: 0; }
.stat-row span { font-size: 10px; }
.stat-row b { font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: 0; text-transform: none; }
.stat-row small { font-size: 10px; letter-spacing: .06em; text-transform: none; line-height: 1.4; }
.source { margin-top: 18px; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: .04em; }
.source a { color: var(--text); }
.term { height: 268px; overflow: hidden; padding: 16px 18px; font-size: 11.5px; line-height: 1.75; color: #9d9ca3; text-transform: none; letter-spacing: .02em; white-space: pre-wrap; }
.term .ok { color: #e8e7e3; }
.term .r { color: var(--red); }

/* ---------- outputs (horizontal) ---------- */
.outputs { padding-block: 40px clamp(110px, 14vw, 200px); }
.outputs-pin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 48px; overflow: hidden; }
.outputs-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; flex-wrap: wrap; }
.track { display: flex; gap: 18px; padding-inline: var(--gutter); width: max-content; will-change: transform; }
.card {
  padding: 0; color: inherit; font: inherit; text-align: left;
  position: relative; flex: none; width: clamp(240px, 24vw, 360px); aspect-ratio: 2 / 3;
  background: var(--bg-2); overflow: hidden; cursor: zoom-in; border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.card .img, .card .gl1, .card .gl2 { position: absolute; inset: 0; background-size: cover; background-position: center; }
.card .img { transition: transform 1s var(--ease), filter .5s; filter: saturate(.8) brightness(.85); }
.card .gl1, .card .gl2 { opacity: 0; mix-blend-mode: screen; }
.card .gl1 { background-color: #f00; background-blend-mode: multiply; }
.card .gl2 { background-color: #0ff; background-blend-mode: multiply; }
.card:hover .img { transform: scale(1.05); filter: saturate(1.1) brightness(1); }
.card:hover .gl1 { animation: glitch1 .5s steps(2) 1; }
.card:hover .gl2 { animation: glitch2 .5s steps(2) 1; }
@keyframes glitch1 { 0% { opacity: .8; transform: translate(-6px, 0); clip-path: inset(10% 0 60% 0); } 50% { transform: translate(5px, 2px); clip-path: inset(55% 0 20% 0); } 100% { opacity: 0; transform: none; clip-path: inset(0); } }
@keyframes glitch2 { 0% { opacity: .8; transform: translate(6px, 0); clip-path: inset(40% 0 35% 0); } 50% { transform: translate(-4px, -2px); clip-path: inset(5% 0 80% 0); } 100% { opacity: 0; transform: none; clip-path: inset(0); } }
.card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,.9)); display: grid; gap: 4px; }
.card .meta b { font-family: var(--display); font-weight: 400; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.card .meta span { font-size: 10px; color: var(--muted); }
.card .idx { position: absolute; top: 14px; left: 14px; color: var(--red); font-size: 10px; }
.track-progress { margin-inline: var(--gutter); height: 1px; background: var(--line); }
.track-progress i { display: block; height: 100%; width: 0; background: var(--red); }

/* ---------- weights ---------- */
.weights { overflow-x: clip; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: center; padding-bottom: clamp(110px, 14vw, 200px); }
.w-list { list-style: none; margin-top: 40px; border-top: 1px solid var(--line); }
.w-list li { display: grid; grid-template-columns: 14px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.w-list i { width: 10px; height: 10px; }
.w-list .mono { font-size: 12px; }
.w-list b { font-family: var(--mono); font-weight: 500; font-size: 20px; }
.donut-wrap { position: relative; width: min(100%, 520px); justify-self: center; aspect-ratio: 1; }
#donut { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
#donut circle { fill: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; }
.donut-center b { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 6vw, 84px); line-height: 1; }

/* ---------- epochs ---------- */
.epochs { padding-bottom: clamp(110px, 14vw, 200px); }
.ep-list { list-style: none; margin-top: 56px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); position: relative; }
.ep-list::before { content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: var(--p, 0%); background: var(--red); box-shadow: 0 0 10px var(--red); }
.ep { padding: 34px 26px 30px 0; display: grid; gap: 12px; align-content: start; position: relative; }
.ep + .ep { padding-left: 26px; border-left: 1px solid var(--line); }
.ep-n { color: var(--muted); }
.ep h3 { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 1.6vw, 24px); text-transform: uppercase; }
.ep p { color: #a3a2a8; font-size: 15px; }
.ep-state { margin-top: 8px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- buy ---------- */
.buy { padding-bottom: clamp(110px, 14vw, 200px); }
.steps { margin-top: 56px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.step { background: var(--bg-1); border: 1px solid var(--line); padding: 26px 24px 30px; display: grid; gap: 14px; align-content: start; transition: border-color .3s, background .3s; }
.step:hover { border-color: rgba(255,43,43,.5); background: var(--bg-2); }
.step-n { color: var(--red); font-size: 13px; }
.step h3 { font-family: var(--display); font-weight: 400; font-size: 17px; text-transform: uppercase; }
.step p { color: #a3a2a8; font-size: 15px; }

/* ---------- end ---------- */
.end { min-height: 110svh; display: grid; align-items: end; overflow: hidden; }
.end img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.end::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--bg) 0%, rgba(3,3,4,.1) 25%, rgba(3,3,4,.45) 55%, rgba(3,3,4,.95) 82%, var(--bg) 100%); }
.end-copy { position: relative; z-index: 1; text-align: center; padding-bottom: clamp(70px, 10vw, 140px); }
.h-end { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(28px, 5vw, 80px); line-height: 1.12; text-shadow: 0 4px 30px rgba(0,0,0,.8); }
.h-end span { display: block; }
.h-end .red { text-shadow: 0 0 50px var(--red-glow); }

.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 30px 40px; border-top: 1px solid var(--line); font-size: 11px; }
.disclaimer { max-width: 70ch; text-transform: none; letter-spacing: .03em; }

/* ---------- lightbox ---------- */
.lightbox { margin: auto; border: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(0,0,0,.88); backdrop-filter: blur(6px); }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; }
.lightbox button { margin: 12px auto 0; display: block; background: none; border: 1px solid var(--line-2); color: var(--text); padding: 10px 18px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .links { display: none; }
  .model-grid { grid-template-columns: 1fr; }
  .chart-panel { grid-row: auto; }
  #compute { min-height: 340px; }
  .weights { grid-template-columns: 1fr; }
  .ep-list { grid-template-columns: 1fr 1fr; }
  .ep:nth-child(3) { padding-left: 0; border-left: 0; }
  .ep:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .hero { align-items: end; }
  .hero-shade { background: linear-gradient(to top, var(--bg) 0%, rgba(3,3,4,.88) 38%, rgba(3,3,4,.2) 70%, rgba(3,3,4,.5) 100%); }
  .hero-copy { padding-bottom: 150px; }
  .hud { display: none; }
  .tag { display: block; font-size: 10px; }
  .tag .dot { display: inline-block; vertical-align: middle; margin-right: 6px; }
  .h-hero { font-size: 6.6vw; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats div:nth-child(3) { border-left: 0; }
  .hero-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-stats div { padding: 12px var(--gutter); }
  .btn { height: 48px; padding: 0 20px; }
  .cta .btn { flex: 1 1 auto; }
  .ca { width: 100%; text-align: left; }
  .ca #caText { flex: 1; white-space: normal; word-break: break-all; font-size: 12px; }
  .outputs-pin { min-height: 0; gap: 36px; }
  .track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
  .track::-webkit-scrollbar { display: none; }
  .card { width: 72vw; scroll-snap-align: center; }
  .track-progress { display: none; }
  .ep-list, .steps, .stat-row { grid-template-columns: 1fr; }
  .stat-row div { border-left: 0; border-top: 1px solid var(--line); }
  .stat-row div:first-child { border-top: 0; }
  .ep, .ep + .ep { padding: 26px 0; border-left: 0; }
  .ep + .ep { border-top: 1px solid var(--line); }
  .w-list b { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  body::after, .marquee-track, .dot { animation: none; }
  .card:hover .gl1, .card:hover .gl2 { animation: none; }
}
