/* The page goes down from the surface of the sea to the deep. The colors of
   the chart marks (--mark-*) are apart for readers with a color vision
   deficiency on the chart surface (--surface). */

:root {
  color-scheme: dark;
  --ink-0: #f1fbfd;
  --ink-1: #bcd6de;
  --ink-2: #86a7b3;
  --surface: #0b2a3a;
  --surface-2: #0e3344;
  --line: rgba(170, 225, 240, 0.14);
  --line-strong: rgba(170, 225, 240, 0.26);
  --aqua: #5eead4;
  --aqua-deep: #2dd4bf;
  --sand: #f6d2a2;
  --mark-aqua: #12a594;
  --mark-blue: #3987e5;
  --mark-orange: #d95926;
  --mark-gray: #5d7a89;
  --paper: #ffffff;
  --radius: 16px;
  --sans: "Recursive Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-0);
  background:
    linear-gradient(180deg,
      #0d6079 0,
      #0a4a62 420px,
      #073a51 900px,
      #052b40 1700px,
      #04202f 3000px,
      #03151f 4600px,
      #020d15 100%);
  background-color: #020d15;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--aqua); text-underline-offset: 3px; }
a:hover { color: #a7f3e6; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 750; }
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
.accent { color: var(--aqua); }

.lead { color: var(--ink-1); font-size: 1.13rem; max-width: 46em; margin: 18px 0 0; }
.fine { color: var(--ink-2); font-size: 0.9rem; margin: 14px 0 0; }
.center { text-align: center; justify-content: center; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aqua);
  margin: 0 0 14px;
}
.eyebrow span { color: var(--ink-2); margin-right: 10px; }

/* ---- Navigation ---- */

.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 12px max(24px, calc((100% - 1160px) / 2));
  background: rgba(5, 40, 58, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-0); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { display: block; flex: none; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--ink-1); text-decoration: none; font-size: 0.95rem; }
.nav nav a:hover { color: var(--ink-0); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: 0.98rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--aqua); color: #04202b; }
.btn-primary:hover { background: #99f6e4; color: #04202b; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink-0); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: var(--aqua); color: var(--ink-0); }
.nav-gh { padding: 7px 16px; font-size: 0.9rem; }
.btn:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, .bar:focus-visible {
  outline: 2px solid var(--aqua); outline-offset: 3px;
}

/* ---- Hero ---- */

.hero { position: relative; padding: 72px 0 0; overflow: hidden; }
.rays {
  position: absolute; inset: -20% -10% auto -10%; height: 760px; pointer-events: none;
  background:
    linear-gradient(104deg, transparent 18%, rgba(190, 255, 245, 0.10) 24%, transparent 31%),
    linear-gradient(100deg, transparent 40%, rgba(190, 255, 245, 0.07) 47%, transparent 55%),
    linear-gradient(96deg, transparent 62%, rgba(190, 255, 245, 0.09) 68%, transparent 75%),
    radial-gradient(ellipse 60% 55% at 50% 0, rgba(140, 240, 230, 0.22), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 32px; align-items: center; }
.hero-copy .lead { font-size: 1.2rem; }

.install {
  display: flex; align-items: center; gap: 12px; margin-top: 28px;
  padding: 6px 6px 6px 18px; max-width: 34em;
  background: rgba(2, 20, 30, 0.55); border: 1px solid var(--line-strong); border-radius: 12px;
}
.install code { font-family: var(--mono); font-size: 0.92rem; color: var(--ink-0); overflow-x: auto; white-space: nowrap; flex: 1; padding: 8px 0; }
.copy {
  font: inherit; font-size: 0.82rem; font-weight: 650; color: var(--ink-1);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer;
}
.copy:hover { color: var(--ink-0); border-color: var(--aqua); }
.copy.done { color: var(--aqua); border-color: var(--aqua); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero-art { position: relative; width: 100%; max-width: 400px; justify-self: center; }
.glow {
  position: absolute; inset: 4% 2% 10% 2%;
  background: radial-gradient(closest-side, rgba(210, 255, 250, 0.55), rgba(140, 235, 225, 0.2) 55%, transparent 100%);
  filter: blur(6px);
}
.mascot { position: relative; display: block; width: 100%; height: auto; animation: drift 7s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-12px) rotate(1.2deg); }
}

.kpis {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  margin: 56px 0 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(3, 26, 38, 0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.kpi { padding: 22px 24px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi dt { font-size: 0.8rem; color: var(--ink-2); letter-spacing: 0.02em; }
.kpi dd { margin: 4px 0 2px; font-size: 2.3rem; font-weight: 780; letter-spacing: -0.03em; line-height: 1.1; }
.kpi dd small { font-size: 1rem; font-weight: 500; color: var(--ink-1); letter-spacing: 0; }
.kpi p { margin: 0; font-size: 0.86rem; color: var(--ink-2); }

.waves { display: block; width: 200%; height: 96px; margin-top: 56px; }
.wave { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; animation: swell 26s linear infinite; }
.w1 { stroke: rgba(170, 245, 235, 0.34); animation-duration: 38s; }
.w2 { stroke: rgba(170, 245, 235, 0.2); animation-duration: 27s; animation-direction: reverse; }
.w3 { stroke: rgba(170, 245, 235, 0.12); animation-duration: 19s; }
@keyframes swell { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Sections ---- */

.band { padding: 96px 0 24px; position: relative; }

.panel {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.panel-note { margin: 6px 0 0; color: var(--ink-2); font-size: 0.88rem; max-width: 46em; }

.seg { display: inline-flex; padding: 4px; background: rgba(2, 18, 27, 0.6); border: 1px solid var(--line); border-radius: 999px; }
.seg button { font: inherit; font-size: 0.88rem; font-weight: 650; color: var(--ink-1); background: transparent; border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; font-family: var(--mono); }
.seg button[aria-selected="true"] { background: var(--aqua); color: #04202b; }

/* ---- Proof ---- */

.proof-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; margin-top: 40px; align-items: start; }
.unit-wrap, .dumbbell-wrap { position: relative; }
#unit-grid { display: block; width: 100%; cursor: crosshair; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 16px 0 0; font-size: 0.86rem; color: var(--ink-1); }
.legend b { color: var(--ink-0); font-weight: 700; margin-left: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; vertical-align: -1px; }
.sw-exact { background: var(--mark-aqua); }
.sw-error { background: var(--mark-blue); }
.sw-other { background: var(--mark-orange); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot-gray { background: var(--mark-gray); }
.dot-aqua { background: var(--mark-aqua); }

.tip {
  position: absolute; z-index: 5; pointer-events: none; opacity: 0;
  max-width: 340px; padding: 9px 12px;
  background: #021521; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 0.82rem; line-height: 1.4; color: var(--ink-1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity .12s ease;
}
.tip.on { opacity: 1; }
.tip strong { display: block; color: var(--ink-0); font-size: 0.9rem; }
.tip .key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.tiles { display: grid; gap: 12px; }
.tile { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.tile-label { margin: 0; font-size: 0.84rem; color: var(--ink-2); }
.tile-value { margin: 2px 0 10px; font-size: 1.7rem; font-weight: 760; letter-spacing: -0.02em; line-height: 1.15; }
.tile-value small { font-size: 0.95rem; font-weight: 500; color: var(--ink-1); letter-spacing: 0; }
.meter { height: 6px; border-radius: 999px; background: rgba(18, 165, 148, 0.22); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--mark-aqua); border-radius: 999px; }

.table-view { margin-top: 18px; font-size: 0.88rem; color: var(--ink-1); }
.table-view summary { cursor: pointer; color: var(--ink-2); width: fit-content; }
.table-view summary:hover { color: var(--ink-0); }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); }
th { color: var(--ink-2); font-weight: 600; font-size: 0.8rem; }
.n { text-align: right; padding-right: 0; padding-left: 12px; }

/* ---- Speed ---- */

.race-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 40px 0 24px; }
.hero-num { margin: 4px 0 18px; font-size: clamp(3rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.hero-num small { font-size: 1.25rem; font-weight: 500; letter-spacing: 0; color: var(--ink-1); }
.x { font-weight: 450; margin-left: 0.04em; }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 11.5em minmax(0, 1fr) 5.5em; align-items: center; gap: 12px; font-size: 0.9rem; }
.bar-name { color: var(--ink-1); }
.bar-name.strong { color: var(--ink-0); font-weight: 700; }
.bar-track { display: block; height: 14px; border-left: 1px solid var(--line-strong); }
.bar { display: block; height: 14px; width: 0; min-width: 3px; border-radius: 0 4px 4px 0; transition: width 1.1s cubic-bezier(.2, .7, .2, 1), filter .15s ease; }
.in .bar { width: var(--w); }
.bar:hover, .bar:focus-visible { filter: brightness(1.25); }
.bar.gray { background: var(--mark-gray); }
.bar.aqua { background: var(--mark-aqua); }
.bar-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

#dumbbell { display: block; width: 100%; height: auto; font-family: var(--sans); }
#dumbbell text { fill: var(--ink-1); font-size: 12px; }
#dumbbell .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
#dumbbell .gridline { stroke: var(--line); stroke-width: 1; }
#dumbbell .stem { stroke: rgba(170, 225, 240, 0.22); stroke-width: 2; stroke-linecap: round; }
#dumbbell .pt { stroke: var(--surface); stroke-width: 2; }
#dumbbell .hit { fill: transparent; cursor: default; }
#dumbbell .row:hover .stem, #dumbbell .row:focus .stem { stroke: rgba(170, 225, 240, 0.5); }
#dumbbell .row:focus { outline: none; }
#dumbbell .row:focus .hit { stroke: var(--aqua); stroke-width: 1; }

/* ---- Gallery ---- */

.gallery { columns: 2 420px; column-gap: 24px; margin-top: 40px; }
.card { break-inside: avoid; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: color-mix(in srgb, var(--surface) 86%, transparent); }
.paper { background: var(--paper); color: #111; padding: 18px; display: flex; align-items: center; justify-content: center; }
.paper svg { display: block; height: auto; max-height: 460px; }
.card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.card figcaption strong { display: block; font-size: 0.98rem; }
.card figcaption span { display: block; font-size: 0.82rem; color: var(--ink-2); }
.btn-mini { flex: none; font: inherit; font-size: 0.78rem; font-weight: 650; color: var(--ink-1); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.btn-mini:hover { border-color: var(--aqua); color: var(--ink-0); }

/* ---- Playground ---- */

.play { margin-top: 40px; padding: 0; overflow: hidden; }
.play-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.play-bar label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--ink-2); }
.play-bar select { font: inherit; font-size: 0.88rem; color: var(--ink-0); background: #052434; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; }
.play-status { margin-left: auto; font-size: 0.85rem; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.play-status.err { color: #ffb4a2; }
.play-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); min-height: 460px; }
#play-src { display: block; width: 100%; height: 100%; min-height: 320px; resize: vertical; border: 0; padding: 18px; background: #031a27; color: #d8f3f5; font-family: var(--mono); font-size: 0.86rem; line-height: 1.55; tab-size: 2; }
.play-out { overflow: auto; align-items: center; }
.play-out svg { max-height: none; }

/* ---- Inside ---- */

.pipeline { margin-top: 40px; border-radius: var(--radius); padding: 24px; overflow-x: auto; }
.pipeline svg { max-height: 300px; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.features article { padding: 20px; border-top: 2px solid var(--mark-aqua); background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 0 0 12px 12px; }
.features p { margin: 8px 0 0; font-size: 0.92rem; color: var(--ink-1); }

/* ---- Use it ---- */

.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.code { padding: 0; overflow: hidden; }
.code header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); font-size: 0.84rem; color: var(--ink-2); font-family: var(--mono); }
.code pre { margin: 0; padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; color: #d8f3f5; }
.code .fine { margin: 0; padding: 0 18px 18px; }
.tk-k { color: #7dd3fc; }
.tk-s { color: #a7f3d0; }
.tk-n { color: var(--sand); }
#use .actions { margin-top: 36px; }

/* ---- Footer ---- */

footer { margin-top: 96px; padding: 36px 0 56px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.88rem; }
.foot p { margin: 0 0 8px; max-width: 60em; }
.foot strong { color: var(--ink-0); }

/* ---- The depth gauge ---- */

.depth { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 20; display: none; flex-direction: column; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); }
.depth-track { width: 2px; height: 180px; background: var(--line); border-radius: 2px; overflow: hidden; }
.depth-fill { width: 100%; height: 0; background: var(--aqua); }
.depth-read { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
@media (min-width: 1320px) { .depth { display: flex; } }

/* ---- Reveal ---- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Small screens ---- */

@media (max-width: 980px) {
  .hero-grid, .proof-grid, .race-grid, .code-grid, .play-split { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 300px; margin-inline: auto; order: -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav nav { display: none; }
  .nav-gh { margin-left: auto; }
  .band { padding-top: 72px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero-art { max-width: 240px; }
  .kpis, .features { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:first-child { border-top: 0; }
  .bar-row { grid-template-columns: 8.5em minmax(0, 1fr) 5em; }
  .play-status { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mascot, .wave { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar { transition: none; }
}
