@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Michroma"; font-weight: 400; font-display: swap; src: url("fonts/michroma-latin-400-normal.woff2") format("woff2"); }

/* One visual world (the studio's dark "void"), painted explicitly so it holds on any host theme. */
:root {
  --void: #04050a;
  --navy: #0b1026;
  --panel: rgba(11, 16, 38, 0.72);
  --line: rgba(120, 150, 255, 0.16);
  --line-strong: rgba(120, 150, 255, 0.32);
  --cyan: #18c5fd;
  --blue: #3089fe;
  --violet: #9b5cff;
  --white: #f5f7ff;
  --muted: #8c95b5;
  --grad: linear-gradient(90deg, #18c5fd 0%, #3089fe 45%, #9b5cff 100%);
  --f-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-mark: "Michroma", "Space Grotesk", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--void); }
body { margin: 0; background: var(--void); color: var(--white); font-family: var(--f-head); font-weight: 500; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
/* anchors and focused fields stop below the fixed header */
input, select, textarea, button { scroll-margin-block: calc(env(safe-area-inset-top, 0px) + 96px) 24px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 12px; background: var(--navy); border-radius: 8px; }
.skip:focus { left: 8px; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { margin: 0 0 14px; font-family: var(--f-mark); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- header */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 14px; transition: background 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; }
.top.solid { background: rgba(4, 5, 10, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); }
.brand:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; }
.word { font-family: var(--f-mark); font-size: 15px; letter-spacing: 0.16em; }
nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 30px); }
nav a { color: var(--white); font-size: 15px; opacity: 0.82; }
nav a:hover { opacity: 1; text-decoration: none; }
.nav-cta { padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 99px; opacity: 1; }
@media (max-width: 640px) { nav a:not(.nav-cta) { display: none; } .nav-cta { font-size: 14px; padding: 8px 14px; } }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border-radius: 99px; border: 1px solid transparent;
  font: 700 16px/1 var(--f-head); color: var(--white); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--grad); color: #03040a; box-shadow: 0 10px 30px rgba(48, 137, 254, 0.28); }
.btn.primary:hover { box-shadow: 0 14px 38px rgba(48, 137, 254, 0.4); }
.btn.ghost { background: rgba(245, 247, 255, 0.04); border-color: var(--line-strong); }

/* ---------------------------------------------------------------- journey (sticky WebGL stage) */
.journey { position: relative; height: 620vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 5, 10, 0.72) 0%, rgba(4, 5, 10, 0.25) 42%, rgba(4, 5, 10, 0) 60%),
              linear-gradient(0deg, rgba(4, 5, 10, 0.6) 0%, rgba(4, 5, 10, 0) 30%); opacity: 0; transition: opacity 0.3s; }
.chapter { position: absolute; left: var(--gutter); bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(28px, 9vh, 96px)); max-width: 520px;
  opacity: 0; visibility: hidden; transform: translateY(18px); }
.chapter.on { visibility: visible; }
.chapter p { margin: 0 0 18px; color: rgba(245, 247, 255, 0.84); }
.hero { left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(24px, 7vh, 80px)); top: auto; width: min(760px, calc(100% - 2 * var(--gutter))); max-width: none; text-align: center; transform: translate(-50%, 0); }
.hero h1 { font-size: clamp(46px, 8.6vw, 104px); margin-bottom: 18px; }
.hero .lede { font-size: clamp(17px, 2.1vw, 21px); max-width: 560px; margin: 0 auto 28px; }
/* wide screens: headline on the left, the 3D mark on the right (stage.js shifts the mark) */
@media (min-aspect-ratio: 105/100) {
  .hero { left: var(--gutter); top: 50%; bottom: auto; width: min(620px, 48vw); text-align: left; transform: translate(0, -50%); }
  .hero .lede { margin-left: 0; }
  .hero .actions { justify-content: flex-start; }
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hint { margin-top: 34px !important; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted) !important; display: inline-flex; gap: 10px; align-items: center; }
.hint span { width: 18px; height: 28px; border: 1.5px solid var(--muted); border-radius: 10px; position: relative; }
.hint span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(8px); opacity: 0; } 100% { opacity: 0; } }
.world h2 { font-size: clamp(34px, 4.4vw, 58px); margin-bottom: 14px; }
.world { padding: 26px 28px 28px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.facts { font-family: var(--f-mono); font-size: 13px; color: var(--muted) !important; letter-spacing: 0.02em; }
.loading { position: absolute; right: var(--gutter); top: calc(env(safe-area-inset-top, 0px) + 80px); margin: 0; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  .hero .eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .world { left: 12px; right: 12px; max-width: none; padding: 20px 20px 22px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }
  .world p:not(.facts):not(.eyebrow) { font-size: 15px; }
  .scrim { background: linear-gradient(0deg, rgba(4, 5, 10, 0.75) 0%, rgba(4, 5, 10, 0) 55%); }
}

/* ---------------------------------------------------------------- sections */
.section { position: relative; padding: clamp(80px, 12vw, 150px) var(--gutter); max-width: 1240px; margin: 0 auto; }
.head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.head h2 { font-size: clamp(36px, 5.4vw, 64px); }
.sub { margin: 18px 0 0; color: var(--muted); font-size: 18px; max-width: 620px; }

.work { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.card { position: relative; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius); background: linear-gradient(180deg, rgba(11, 16, 38, 0.9), rgba(11, 16, 38, 0.55)); border: 1px solid var(--line); }
.card h3 { font-size: clamp(26px, 3vw, 34px); margin: 6px 0 12px; }
.card p { margin: 0 0 16px; color: rgba(245, 247, 255, 0.8); }
.card.feature { grid-row: span 2; display: flex; flex-direction: column; }
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: auto 0 24px; }
.shelf img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--navy); }
.num { font-family: var(--f-mono); font-size: 13px; color: var(--cyan) !important; margin: 0 !important; }
.specs { list-style: none; margin: 4px 0 26px; padding: 0; display: grid; gap: 10px; }
.specs li { font-family: var(--f-mono); font-size: 14px; color: var(--white); padding: 12px 14px; border-radius: 12px; background: rgba(245, 247, 255, 0.04); border: 1px solid var(--line); }
.link { font-weight: 700; }
.experiment { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; }
.experiment .loop { width: 150px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--navy); }
@media (max-width: 860px) { .work { grid-template-columns: 1fr; } .card.feature { grid-row: auto; } }
@media (max-width: 480px) { .experiment { grid-template-columns: 1fr; } .experiment .loop { width: 100%; aspect-ratio: 16 / 10; } }

/* 8 demos: 4 columns = 2 full rows, 2 columns = 4 full rows, 1 column on phones — always full rows */
.demos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (max-width: 599px) { .demo img { aspect-ratio: 5 / 4; } .demo .line { min-height: 0; } }
@media (min-width: 600px) { .demos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .demos { grid-template-columns: repeat(4, 1fr); } }
.demo { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); border: 1px solid var(--line); transition: transform 0.25s, border-color 0.25s; }
.demo:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.demo button { all: unset; display: block; width: 100%; cursor: pointer; }
.demo button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.demo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.demo .meta { position: absolute; inset: auto 0 0; padding: 60px 18px 18px; background: linear-gradient(0deg, rgba(4, 5, 10, 0.94) 35%, rgba(4, 5, 10, 0)); }
.demo h3 { font-size: 24px; margin-bottom: 6px; }
.demo p { margin: 0; font-size: 15px; line-height: 1.45; color: rgba(245, 247, 255, 0.8); }
.demo .line { min-height: 2.9em; }
.demo.lead .line { min-height: 0; }
.demo .size { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.demo .play { font: 700 14px/1 var(--f-head); color: #03040a; background: var(--grad); padding: 9px 14px; border-radius: 99px; }

.steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.steps li { padding: 26px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(11, 16, 38, 0.5); }
.step-n { font-family: var(--f-mono); font-size: 13px; color: var(--cyan); }
.steps h3 { font-size: 22px; margin: 18px 0 10px; }
.steps p { margin: 0; color: rgba(245, 247, 255, 0.78); font-size: 16px; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.stats div { padding: 24px 18px 0 0; }
.stats dt { font-family: var(--f-mark); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 10px 0 0; font-family: var(--f-mono); font-size: clamp(26px, 3.4vw, 40px); font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.form { display: grid; gap: 16px; max-width: 820px; padding: clamp(22px, 3vw, 36px); border-radius: var(--radius); border: 1px solid var(--line); background: rgba(11, 16, 38, 0.6); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.opt { color: rgba(140, 149, 181, 0.7); }
.form input, .form select, .form textarea { width: 100%; font: 500 16px/1.4 var(--f-head); color: var(--white); background: rgba(4, 5, 10, 0.7); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 13px 14px; }
.form textarea { resize: vertical; min-height: 130px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(24, 197, 253, 0.18); }
.form [aria-invalid="true"] { border-color: #ff6b5e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.send { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.status { margin: 0; font-size: 15px; color: var(--muted); }
.status.ok { color: #6ee7b7; }
.status.err { color: #ff8f85; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 36px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 36px);
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { margin: 0; }

/* ---------------------------------------------------------------- demo player */
.player { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgba(4, 5, 10, 0.92); color: var(--white); }
.player::backdrop { background: rgba(4, 5, 10, 0.7); backdrop-filter: blur(6px); }
.player[open] { display: grid; grid-template-rows: auto 1fr; }
.player-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; }
.player-bar p { margin: 0; font-family: var(--f-mark); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--navy); color: var(--white); font-size: 16px; cursor: pointer; }
.phone { display: grid; place-items: center; padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 16px); min-height: 0; }
.phone iframe { width: min(420px, 100vw); height: min(860px, calc(100dvh - 90px)); border: 0; border-radius: 26px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-strong); }
@media (max-width: 520px) { .phone { padding: 0; } .phone iframe { width: 100vw; height: calc(100dvh - 64px); border-radius: 0; box-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint span::after { animation: none; }
  .btn, .demo { transition: none; }
}
