/* Site styles. Every color, font and easing comes from brand/tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fog);
  font: 400 17px/1.55 var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  --gutter: clamp(20px, 4vw, 56px);
}
/* Ambient: faint drafting grid and grain. Static, so it costs nothing per frame. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--steel) 55%, transparent) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(to bottom, color-mix(in srgb, var(--steel) 55%, transparent) 1px, transparent 1px) 0 0 / 96px 96px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 0%, transparent 75%);
  opacity: 0.45;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.05;
  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='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
strong { color: var(--bone); font-weight: 600; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
::selection { background: var(--oxide); color: var(--ink); }
:focus-visible { outline: 2px solid var(--oxide); outline-offset: 3px; border-radius: 4px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--bone); color: var(--ink); border-radius: 8px; }
.skip:focus { top: 12px; }

.label {
  font: 500 11.5px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}
.label b { color: var(--bone); font-weight: 500; }

.section { padding: clamp(110px, 14vw, 210px) var(--gutter); position: relative; }
.section__label { display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(28px, 4vw, 56px); }
.section__label span { color: var(--oxide); }
.section__label::after { content: ""; flex: 0 0 64px; height: 1px; background: var(--steel); }

.display {
  margin: 0;
  color: var(--bone);
  font-weight: 560;
  font-size: clamp(2.5rem, 5.6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.042em;
  text-wrap: balance;
}
.display em { letter-spacing: -0.02em; }

/* Progress + crosshair cursor ------------------------------------------- */
.progress {
  position: fixed; left: 0; top: 0; right: 0; height: 2px; z-index: 60;
  background: var(--oxide); transform-origin: 0 50%; transform: scaleX(0);
}
.cursor { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; transition: opacity var(--dur-standard) var(--ease-out); }
.cursor.is-on { opacity: 1; }
.cursor__x, .cursor__y { position: absolute; background: var(--bone); opacity: 0.09; }
.cursor__x { top: 0; bottom: 0; left: 0; width: 1px; }
.cursor__y { left: 0; right: 0; top: 0; height: 1px; }
.cursor__label { position: absolute; left: 0; top: 0; font: 500 10px var(--font-mono); letter-spacing: 0.08em; color: var(--slate); white-space: nowrap; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* Nav -------------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 92%, transparent), transparent);
  transition: transform var(--dur-standard) var(--ease-out);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--bone); font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.nav__brand img { border-radius: 6px; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a {
  font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--fog);
  background: linear-gradient(var(--oxide), var(--oxide)) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size var(--dur-standard) var(--ease-out), color var(--dur-quick);
}
.nav__links a:hover { background-size: 100% 1px; color: var(--bone); }
.nav__status { margin: 0; display: flex; align-items: center; gap: 10px; font: 500 12px var(--font-mono); color: var(--fog); padding: 8px 14px; border: 1px solid var(--steel); border-radius: 999px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* Buttons ---------------------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 24px; border-radius: 999px; border: 1px solid var(--steel);
  color: var(--bone); text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  overflow: hidden; isolation: isolate;
  transition: border-color var(--dur-quick), color var(--dur-standard) var(--ease-out);
}
.btn span { display: block; position: relative; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bone);
  transform: translateY(101%); border-radius: inherit;
  transition: transform var(--dur-standard) var(--ease-out);
}
.btn:hover { color: var(--ink); border-color: var(--bone); }
.btn:hover::before { transform: translateY(0); }
.btn--solid { background: var(--oxide); border-color: var(--oxide); color: var(--ink); }
.btn--big { font-size: clamp(17px, 2vw, 24px); padding: 22px 36px; }

/* Hero ------------------------------------------------------------------- */
.hero { position: relative; height: 100svh; min-height: 680px; overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.hero__canvas:active { cursor: grabbing; }
.hero__frame i { position: absolute; width: 18px; height: 18px; border-color: var(--slate); border-style: solid; border-width: 0; pointer-events: none; }
.hero__frame i:nth-child(1) { left: var(--gutter); top: 92px; border-top-width: 1px; border-left-width: 1px; }
.hero__frame i:nth-child(2) { right: var(--gutter); top: 92px; border-top-width: 1px; border-right-width: 1px; }
.hero__frame i:nth-child(3) { left: var(--gutter); bottom: 28px; border-bottom-width: 1px; border-left-width: 1px; }
.hero__frame i:nth-child(4) { right: var(--gutter); bottom: 28px; border-bottom-width: 1px; border-right-width: 1px; }
.hero__copy {
  position: absolute; left: var(--gutter); bottom: clamp(120px, 15vh, 170px); z-index: 2;
  width: min(980px, calc(100% - 2 * var(--gutter)));
  pointer-events: none;
}
.hero__copy a, .hero__copy button { pointer-events: auto; }
.hero__kicker { display: flex; gap: 24px; margin: 0 0 22px; }
.hero__kicker span + span::before { content: "/"; margin-right: 24px; color: var(--steel); }
.hero__title {
  margin: 0; color: var(--bone);
  font-size: clamp(3rem, 6.9vw, 8.4rem); font-weight: 560; line-height: 0.92; letter-spacing: -0.05em;
}
.hero__title .line { display: block; }
.hero__title em { color: var(--oxide); padding-right: 0.06em; }
.hero__lede { max-width: 34rem; margin: 28px 0 0; font-size: clamp(16px, 1.3vw, 19px); }
.hero__ctas { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.hud { position: absolute; z-index: 2; margin: 0; }
.hud--tr { right: calc(var(--gutter) + 30px); top: 112px; display: grid; gap: 4px; text-align: right; }
.hud--br { right: calc(var(--gutter) + 30px); bottom: 52px; font-size: 10.5px; line-height: 1.6; letter-spacing: 0.02em; white-space: pre; }
.hud--bl { left: auto; right: calc(var(--gutter) + 30px); bottom: 186px; display: grid; gap: 12px; justify-items: end; }
.shapes { display: inline-flex; padding: 4px; border: 1px solid var(--steel); border-radius: 999px; background: color-mix(in srgb, var(--ink) 70%, transparent); }
.shape {
  font: 500 11.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fog); background: none; border: 0; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background var(--dur-quick), color var(--dur-quick);
}
.shape:hover { color: var(--bone); }
.shape.is-active { background: var(--bone); color: var(--ink); }
.hint { margin: 0; }
.numbers__note { margin-top: 28px; max-width: 70ch; }
.support { border-block: 1px solid var(--steel); }
.status-chip { display: inline-block; padding: 4px 9px; border: 1px solid var(--steel); border-radius: 999px; color: var(--fog); font: 500 11px/1.6 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle; }
.hero__lede .status-chip { margin-top: 10px; }
.manifesto .section__label { flex-wrap: wrap; }

/* Marquee ---------------------------------------------------------------- */
.marquee { border-block: 1px solid var(--steel); overflow: hidden; padding: 22px 0; }
.marquee__track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 48s linear infinite; }
.marquee span { font-size: clamp(1.4rem, 2.4vw, 2.2rem); color: var(--bone); letter-spacing: -0.03em; white-space: nowrap; }
.marquee i { width: 8px; height: 8px; background: var(--oxide); transform: rotate(45deg); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Manifesto -------------------------------------------------------------- */
.manifesto__text {
  margin: 0; max-width: 1180px; color: var(--bone);
  font-size: clamp(1.75rem, 3.5vw, 3.4rem); line-height: 1.12; letter-spacing: -0.035em; font-weight: 450;
}
.manifesto__text em { color: var(--oxide); }
.manifesto__sig { display: flex; align-items: center; gap: 16px; margin-top: 56px; }
.manifesto__sig p { margin: 0; font-size: 15px; }
.manifesto__sig img { border-radius: 8px; }

/* Kernel anatomy (pinned) ------------------------------------------------ */
.anatomy { height: 100vh; min-height: 640px; position: relative; }
.anatomy__inner { height: 100%; display: grid; grid-template-rows: auto 1fr; padding: 110px var(--gutter) 48px; }
.anatomy__head { display: flex; justify-content: space-between; align-items: baseline; }
.anatomy__head .section__label { margin: 0; }
.anatomy__count b { color: var(--oxide); }
.anatomy__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 72px); min-height: 0; }
.anatomy__steps { position: relative; align-self: center; height: min(480px, 100%); }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; opacity: 0; visibility: hidden; }
.step.is-active { opacity: 1; visibility: visible; }
.step__tag { margin: 0 0 10px; }
.step__title { margin: 0; color: var(--bone); font-size: clamp(3.2rem, 6.2vw, 6.8rem); font-weight: 600; letter-spacing: -0.055em; line-height: 0.95; }
.step__text { max-width: 30rem; font-size: clamp(16px, 1.25vw, 19px); margin: 24px 0 0; }
.step__specs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.step__specs li { border: 1px solid var(--steel); border-radius: 999px; padding: 6px 12px; color: var(--fog); }
.anatomy__stage { position: relative; min-height: 0; }
.anatomy__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.anatomy__rail { position: absolute; right: 0; top: 10%; bottom: 10%; width: 1px; background: var(--steel); }
.anatomy__rail i { position: absolute; inset: 0; background: var(--oxide); transform-origin: 50% 0; transform: scaleY(0); }
.anatomy__index { position: absolute; right: 22px; bottom: 10%; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: right; }
.anatomy__index li { transition: color var(--dur-standard) var(--ease-out); }
.anatomy__index li.is-active { color: var(--bone); }

/* Assembly video --------------------------------------------------------- */
.assembly { position: relative; height: 110vh; min-height: 640px; overflow: hidden; display: flex; align-items: flex-end; }
.assembly__media { position: absolute; inset: 0; }
.assembly__media video { width: 100%; height: 100%; object-fit: cover; }
.assembly__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--ink) 0%, transparent 22%, transparent 55%, var(--ink) 100%),
    linear-gradient(to right, color-mix(in srgb, var(--ink) 75%, transparent), transparent 60%);
}
.assembly__copy { position: relative; padding: 0 var(--gutter) clamp(64px, 10vh, 120px); max-width: 1100px; }
.assembly__copy .display { font-size: clamp(2.6rem, 6.4vw, 6.6rem); }
.assembly__note { margin: 28px 0 0; max-width: 40rem; }

/* Numbers ---------------------------------------------------------------- */
.numbers { padding-block: clamp(80px, 10vw, 140px); }
.numbers__grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--steel); }
.stat { padding: 32px 24px 0 0; border-right: 1px solid var(--steel); }
.stat + .stat { padding-left: 24px; }
.stat:last-child { border-right: 0; }
.stat__n { margin: 0 0 10px; color: var(--bone); font-size: clamp(2.6rem, 5.4vw, 5.6rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__n small { font-size: 0.5em; color: var(--oxide); margin-left: 4px; letter-spacing: -0.02em; }
.stat .label { margin: 0; }

/* Code ------------------------------------------------------------------- */
.code { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.code__aside { position: sticky; top: 120px; }
.code__lede { max-width: 30rem; margin: 28px 0 0; }
.code__notes { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; counter-reset: n; }
.code__notes li { counter-increment: n; display: flex; gap: 12px; }
.code__notes li::before { content: "0" counter(n); color: var(--oxide); }
.code__stack { display: grid; gap: 28px; }
.window { margin: 0; background: var(--graphite); border: 1px solid var(--steel); border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -40px #000; }
.window__bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--steel); font: 500 12px var(--font-mono); color: var(--slate); }
.window__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--steel); }
.window__bar i:first-child { background: var(--oxide); }
.window__bar span { margin-left: 10px; }
.window__code { margin: 0; padding: 22px 24px 26px; overflow-x: auto; font: 400 13.5px/1.72 var(--font-mono); color: var(--fog); tab-size: 4; }
.window__code .ln { display: block; width: fit-content; min-height: 1.72em; white-space: pre; }
.c-com { color: var(--slate); }
.c-kw { color: var(--bone); font-weight: 650; }
.c-ty { color: var(--datum); }
.c-fn { color: var(--bone); }
.c-num, .c-str { color: var(--signal); }
.c-attr, .c-mac { color: var(--oxide); }
.caret { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; margin-left: 2px; background: var(--bone); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Work ------------------------------------------------------------------- */
.work__head { display: grid; gap: 0; margin-bottom: clamp(40px, 6vw, 80px); }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; min-height: 460px; padding: 30px;
  background: var(--graphite); border: 1px solid var(--steel); border-radius: 18px;
  text-decoration: none; overflow: hidden; transform-style: preserve-3d; will-change: transform;
  transition: border-color var(--dur-standard) var(--ease-out);
}
.card:hover { border-color: var(--slate); }
.card__glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--bone) 9%, transparent), transparent 60%);
  transition: opacity var(--dur-standard) var(--ease-out);
}
.card:hover .card__glare { opacity: 1; }
.card__top { display: flex; justify-content: space-between; }
.card__top span:first-child { color: var(--oxide); }
.card__art { width: 100%; max-width: 340px; height: auto; margin: 26px auto 18px; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.card__art .a { stroke: var(--bone); stroke-width: 1.2; }
.card__art .d { stroke: var(--slate); stroke-width: 1; stroke-dasharray: 3 4; }
.card__art .o { fill: var(--oxide); }
.card__art .o-line { stroke: var(--oxide); stroke-width: 1.5; }
.card__title { margin: auto 0 10px; color: var(--bone); font-size: clamp(1.8rem, 2.8vw, 2.6rem); font-weight: 560; letter-spacing: -0.04em; }
.card__text { margin: 0; max-width: 36rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--steel); }

/* Benchmarks ------------------------------------------------------------- */
.bench__head { margin-bottom: clamp(40px, 5vw, 72px); }
.bench__lede { margin: 20px 0 0; }
.bench__table { border-top: 1px solid var(--steel); }
.bench__row { display: grid; grid-template-columns: minmax(0, 2.3fr) repeat(3, minmax(0, 1fr)); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--steel); align-items: center; }
.bench__row > span:first-child { color: var(--bone); font-size: 17px; }
.bench__row small { display: block; font: 500 11.5px var(--font-mono); letter-spacing: 0.04em; color: var(--slate); margin-top: 4px; }
.bench__row [data-v], .bench__row .is-na { position: relative; padding-top: 14px; font: 500 15px var(--font-mono); font-variant-numeric: tabular-nums; }
.bench__row b { font-weight: 500; color: var(--fog); }
.bench__row .is-us b { color: var(--bone); }
.bench__row .is-na b { color: var(--slate); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.bar { position: absolute; left: 0; top: 0; height: 3px; width: calc(var(--w) * 100%); background: var(--slate); transform-origin: 0 50%; border-radius: 2px; }
.is-us .bar { background: var(--oxide); }
.bench__row--head { padding: 14px 0; }
.bench__foot { max-width: 52rem; margin: 28px 0 0; font-size: 14px; color: var(--slate); }

/* CI video --------------------------------------------------------------- */
.ci { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: center; }
.ci__copy p:not(.label) { max-width: 30rem; margin: 28px 0 0; }
.ci__list { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--steel); }
.ci__list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--steel); }
.ci__term { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--steel); box-shadow: 0 50px 100px -50px #000, 0 0 0 8px color-mix(in srgb, var(--graphite) 60%, transparent); }
.ci__term video { width: 100%; aspect-ratio: 16 / 9; background: var(--graphite); }
.ci__term figcaption { padding: 16px; margin: 0; line-height: 1.7; }

/* Contact + footer ------------------------------------------------------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.contact__title { margin: 0; max-width: 14ch; color: var(--bone); font-size: clamp(3rem, 9vw, 10rem); font-weight: 560; letter-spacing: -0.055em; line-height: 0.92; }
.contact__lede { max-width: 34rem; margin: 36px 0 0; font-size: clamp(16px, 1.3vw, 19px); }
.contact__ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 44px; }
.contact__ctas .btn { max-width: 100%; }
.contact__ctas .btn span { overflow-wrap: anywhere; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px var(--gutter); border-top: 1px solid var(--steel); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .nav__status { margin-left: auto; }
  .hud--br { display: none; }
}
@media (max-width: 900px) {
  .hero__copy { bottom: 48px; }
  .hud--tr { top: 96px; }
  .hud--bl { bottom: auto; top: 84px; right: 50%; transform: translateX(50%); justify-items: center; }
  .hint { display: none; }
  .anatomy__body { grid-template-columns: 1fr; grid-template-rows: 42% 1fr; }
  .anatomy__stage { order: -1; }
  .anatomy__steps { height: 100%; }
  .step { justify-content: flex-start; }
  .step__text { margin-top: 14px; }
  .anatomy__index { display: none; }
  .numbers__grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat { padding-bottom: 32px; border-bottom: 1px solid var(--steel); }
  .code, .ci { grid-template-columns: 1fr; }
  .code__aside { position: static; }
  .work__grid { grid-template-columns: 1fr; }
  .bench__row { grid-template-columns: 1fr 1fr 1fr; gap: 10px 16px; }
  .bench__row > span:first-child { grid-column: 1 / -1; }
  .bench__row--head > span:first-child { display: none; }
}
@media (max-width: 560px) {
  .nav__status { display: none; }
  .hud--tr { display: none; }
  .hero__kicker { flex-direction: column; gap: 4px; }
  .hero__kicker span + span::before { content: none; }
  .step__title { font-size: 2.8rem; }
  .step__specs { margin-top: 16px; gap: 6px; }
  .step__specs li { padding: 4px 8px; font-size: 11px; }
  .btn--big { padding: 18px 20px; font-size: 17px; }
  .window__bar { font-size: 10px; gap: 4px; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track, .dot, .caret { animation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}
