/* ThreeRT visual system: tokens and the landing page's shared components.
   Dark "unlit" ink, warm bone text, one light colour (tungsten) that only ever means "traced light". */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300..800&family=Geist+Mono:wght@400..600&display=swap");

:root {
  /* Ink: the unlit scene. */
  --ink-0: #060709;
  --ink-1: #0b0d11;
  --ink-2: #111419;
  --ink-3: #191c23;
  --ink-4: #262a33;
  --line: rgba(236, 232, 225, 0.1);
  --line-2: rgba(236, 232, 225, 0.2);
  /* Bone: light on plaster, the text colour. */
  --bone: #ece8e1;
  --bone-2: #bdb8af;
  --mute: #80858e;
  /* Tungsten: traced light. The only accent; never used for decoration that isn't light. */
  --ember: #ff6a13;
  --tungsten: #ffb454;
  --filament: #ffebc4;
  --ray: linear-gradient(100deg, var(--ember) 0%, var(--tungsten) 52%, var(--filament) 100%);
  /* three.js is neutral in comparisons (never red: it is the baseline, not the enemy). */
  --c-three: #8b919b;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-1: 10px;
  --r-2: 16px;
  --r-3: 24px;
  --wrap: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--bone);
  font: 400 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--tungsten); color: #111; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.mute { color: var(--mute); }
.ray-text { background: var(--ray); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.h-display { font-size: clamp(56px, 8.4vw, 124px); letter-spacing: -0.05em; line-height: 0.92; font-weight: 620; }
.h-1 { font-size: clamp(40px, 5vw, 72px); letter-spacing: -0.045em; line-height: 0.98; }
.h-3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.lede { font-size: clamp(17px, 1.45vw, 20px); line-height: 1.5; color: var(--bone-2); max-width: 60ch; }
p { margin: 0; }

/* ---------- Brand lockup ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: -0.035em; }
.logo img { width: 28px; height: 28px; }
.logo .rt { background: var(--ray); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); background: color-mix(in srgb, var(--ink-0) 72%, transparent); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav .links { display: flex; gap: 24px; margin-left: auto; font-size: 14px; color: var(--bone-2); }
.nav .links a { text-decoration: none; }
.nav .links a:hover { color: var(--bone); }
.nav.overlay { position: absolute; left: 0; right: 0; background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 999px; font: 500 15px/1 var(--font-sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--bone); color: var(--ink-0); }
.btn.ghost { border-color: var(--line-2); color: var(--bone); background: transparent; }
.btn.ghost:hover { border-color: var(--bone-2); }

/* ---------- Wipe comparison ---------- */
.cmp { position: relative; overflow: hidden; border-radius: var(--r-2); background: #000; aspect-ratio: 16 / 9; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize; isolation: isolate; }
.cmp .pa, .cmp .pb { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cmp .pb { clip-path: inset(0 0 0 var(--x, 50%)); }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp.zoom img { transform: scale(var(--z, 2)); transform-origin: var(--o, 50% 50%); }
.cmp .bar, .seqp .bar { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: var(--filament); box-shadow: 0 0 18px 2px rgba(255, 180, 84, 0.65); z-index: 3; pointer-events: none; }
.cmp .knob { position: absolute; top: 50%; left: var(--x, 50%); width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: rgba(10, 11, 14, 0.66); border: 1.5px solid #ffebc4; z-index: 4; display: grid; place-items: center; color: #ffebc4; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.lab { position: absolute; top: 14px; z-index: 5; display: inline-flex; align-items: flex-start; gap: 8px; padding: 7px 11px; border-radius: 8px; background: rgba(8, 9, 11, 0.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 12px/1.25 var(--font-mono); color: #ece8e1; pointer-events: none; white-space: nowrap; }
.lab.a { left: 14px; }
.lab.b { right: 14px; text-align: right; flex-direction: row-reverse; }
.lab i { flex: none; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #8b919b; }
.lab.b i { background: #ffb454; box-shadow: 0 0 8px #ffb454; }
.lab small { display: block; opacity: 0.66; font-size: 11px; margin-top: 3px; }
.cmp:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; }

/* Figure caption */
.cap { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font: 400 12.5px/1.5 var(--font-mono); color: var(--mute); }
.cap b { color: var(--bone-2); font-weight: 500; }

/* ---------- Synced camera-move player ---------- */
.seqp { position: relative; border-radius: var(--r-2); overflow: hidden; background: #000; aspect-ratio: 16 / 9; cursor: ew-resize; touch-action: pan-y; }
.seqp canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.seqp .ctl { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(8, 9, 11, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 12px/1 var(--font-mono); color: #ece8e1; cursor: default; }
.seqp .ctl button { appearance: none; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; width: 18px; height: 18px; display: grid; place-items: center; }
.seqp .ctl .track { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); position: relative; cursor: pointer; }
.seqp .ctl .track b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #ffb454; }
.seqp .loading { position: absolute; inset: 0; display: grid; place-items: center; font: 500 12px var(--font-mono); color: #80858e; z-index: 7; }

/* ---------- Code ---------- */
.code { font: 400 13.5px/1.7 var(--font-mono); color: #c9c4bb; background: #0a0b0e; border: 1px solid var(--line); border-radius: var(--r-2); padding: 20px 22px; overflow: auto; white-space: pre; tab-size: 2; }
.code .k { color: #ff9e64; }
.code .s { color: #b5d77b; }
.code .n { color: #ffd08a; }
.code .c { color: #5f646d; font-style: italic; }
.code .f { color: #8fc1ff; }
.code .hl { background: rgba(255, 180, 84, 0.1); box-shadow: -22px 0 0 rgba(255, 180, 84, 0.1), 22px 0 0 rgba(255, 180, 84, 0.1); display: inline-block; width: 100%; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px 0 64px; font-size: 13px; color: var(--mute); line-height: 1.6; }
.foot a { color: var(--bone-2); }
.foot .cols { display: grid; grid-template-columns: 1.2fr 2fr; gap: 48px; }

/* ---------- Reveal on scroll ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .nav .links { display: none; }
  .bars .row { grid-template-columns: 110px 1fr 48px; }
  .foot .cols { grid-template-columns: 1fr; }
}
