/* WK sales site - one stylesheet for every page.

   Palette: the client's own navy and blue, unchanged. Type: Chakra Petch for display (cut corners,
   a HUD's letters - used for headings and labels only), IBM Plex Sans for reading, Plex Mono for
   code and the API. Motion: slow, low-contrast, ambient - see site.js. */

:root {
  --bg: #090e1a;
  --bg-2: #0e1526;
  --bg-3: #121b30;
  --bg-code: #070b15;
  --line: rgba(120, 160, 220, .14);
  --line-soft: rgba(120, 160, 220, .09);
  --line-strong: rgba(120, 160, 220, .26);
  --text: #e8eefb;
  --text-2: #c7d3ea;
  --dim: #8ca0bf;
  --faint: #5d7091;
  --accent: #4bb4ff;
  --accent-2: #2b86ff;
  --accent-soft: rgba(75, 180, 255, .14);

  /* Lua highlighting - muted, so code reads as text first. */
  --t-kw: #7cc4ff;
  --t-fn: #e8eefb;
  --t-str: #8fd9be;
  --t-num: #f2c08a;
  --t-var: #aab8ff;
  --t-com: #5d7091;

  --radius: 16px;
  --maxw: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex: none; }

/* ── Brand ─────────────────────────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .1em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(75, 180, 255, .22), 0 6px 18px rgba(43, 134, 255, .22);
}

/* ── Nav ───────────────────────────────────────────────────────────────── */
/* Clear at the top of the page, so the hero's glow runs up behind it; a glass bar once scrolled. */
.nav-wrap {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 14, 26, 0);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s, backdrop-filter .4s;
}
.nav-wrap.is-scrolled {
  border-bottom-color: var(--line-soft); background: rgba(9, 14, 26, .84);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--dim); font-size: 15px; transition: color .2s; }
.nav-links a:not(.btn):hover { color: var(--text); }
/* API Docs is the last stop before signing in - the one link in the accent. */
.nav-links a.nav-docs { color: var(--accent); font-weight: 500; }
.nav-links a.nav-docs:hover { color: #8fd0ff; }
.nav-links a.nav-docs[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]:not(.nav-docs) { color: var(--text); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .25s, opacity .4s, filter .4s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #04101f; box-shadow: 0 8px 26px rgba(43, 134, 255, .32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(43, 134, 255, .48); }
.btn-ghost { background: rgba(120, 160, 220, .08); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(120, 160, 220, .14); border-color: var(--line-strong); }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-lg .icon { width: 20px; height: 20px; }
.btn[disabled], .btn[disabled]:hover {
  cursor: not-allowed; transform: none; box-shadow: none; opacity: .42; filter: saturate(.35);
}

/* ── Shared type ───────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .24em;
  font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 16px;
}
.accent { color: var(--accent); }
.lead { margin: 22px auto 0; max-width: 640px; font-size: clamp(16px, 2.1vw, 19px); color: var(--dim); }

.section { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section-head { text-align: center; }
.section-head h2 {
  font-family: var(--display); font-size: clamp(28px, 4vw, 42px); font-weight: 700;
  line-height: 1.1; letter-spacing: -.005em;
}
.section-lead { color: var(--dim); margin: 14px auto 0; max-width: 620px; }

/* ── Motion primitives ─────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Hero lines arrive one after another on load. */
.js .rise { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }

/* Sections arrive the first time they scroll into view (site.js adds .is-in). */
.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate; text-align: center;
  padding: 104px 24px 24px;
}
.hero > :not(.hero-field) { max-width: 860px; margin-left: auto; margin-right: auto; }
.hero h1 {
  font-family: var(--display); font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04;
  font-weight: 700; letter-spacing: -.012em;
}
/* The thesis' last words carry a light that drifts across them, slowly. */
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent) 35%, #b9e4ff 50%, var(--accent) 65%, var(--accent) 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen { 0%, 20% { background-position: 100% 0; } 60%, 100% { background-position: 0% 0; } }
.cta-row { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--dim); }

/* The field: a tile grid drifting like a map being panned, a glow breathing above it, and the
   odd waypoint lighting up. Masked so it fades out long before the edges. */
/* It starts under the nav (which is translucent), so the glow has no top edge to show. */
.hero-field {
  position: absolute; inset: -80px 0 -120px; z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 36%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 62% 70% at 50% 36%, #000 25%, transparent 78%);
}
.hero-grid {
  position: absolute; inset: -44px;
  background-image:
    linear-gradient(rgba(120, 160, 220, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 220, .075) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: drift 36s linear infinite;
}
@keyframes drift { to { transform: translate(44px, 44px); } }
.hero-aura {
  position: absolute; left: 50%; top: -220px; width: 1000px; height: 640px;
  translate: -50% 0;
  background:
    radial-gradient(closest-side at 42% 50%, rgba(43, 134, 255, .30), transparent),
    radial-gradient(closest-side at 64% 46%, rgba(75, 200, 255, .16), transparent);
  filter: blur(8px);
  animation: breathe 16s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { transform: translate3d(-40px, 0, 0) scale(1); opacity: .85; }
  to   { transform: translate3d(40px, 18px, 0) scale(1.08); opacity: 1; }
}
.hero-blips { position: absolute; inset: 0; }
.blip {
  position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px 1px rgba(75, 180, 255, .7);
  opacity: 0; animation: blip 6s var(--ease) infinite both;
}
.blip::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1px solid rgba(75, 180, 255, .55);
  animation: inherit; animation-name: blip-ring;
}
@keyframes blip {
  0%   { opacity: 0; transform: scale(.4); }
  12%  { opacity: .9; transform: scale(1); }
  55%  { opacity: .35; }
  100% { opacity: 0; transform: scale(1); }
}
@keyframes blip-ring {
  0%   { opacity: 0; transform: scale(.3); }
  12%  { opacity: .8; }
  70%, 100% { opacity: 0; transform: scale(1.8); }
}

/* Ribbon: every module at a glance, one chip each. */
.ribbon {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 64px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 11px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(14, 21, 38, .65);
  color: var(--dim); font-size: 13.5px; font-weight: 500;
  transition: color .2s, border-color .2s, background .2s, transform .25s var(--ease);
}
.chip .icon { width: 15px; height: 15px; color: var(--accent); }
.chip:hover { color: var(--text); border-color: var(--line-strong); background: rgba(18, 27, 48, .9); transform: translateY(-1px); }
.js .chip { animation: rise .7s var(--ease) both; animation-delay: calc(560ms + var(--k, 0) * 45ms); }

/* ── Modules showcase ──────────────────────────────────────────────────── */
.modules { margin-top: 110px; scroll-margin-top: 40px; }

.showcase {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  gap: 32px; margin-top: 52px; align-items: start;
}

/* One column, grouped like the client's own sidebar - the stage is the module's screen. */
.mod-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
.mod-group {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  padding: 14px 2px 4px; font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--faint);
}
.mod-group::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.mod-group:first-child { padding-top: 0; }

.mod {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px; text-align: left; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg-2), rgba(14, 21, 38, .35));
  color: var(--text); font: inherit;
  transition: border-color .3s, background .3s, box-shadow .35s, transform .3s var(--ease);
}
.mod:hover { border-color: var(--line); transform: translateY(-1px); }
.mod:focus-visible { outline-offset: 2px; border-radius: 14px; }
.mod-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(75, 180, 255, .07); border: 1px solid rgba(75, 180, 255, .14); color: var(--dim);
  transition: color .3s, background .3s, border-color .3s, box-shadow .35s;
}
.mod-icon .icon { width: 19px; height: 19px; }
.mod-name { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.mod-line { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--dim); }

/* The client's own on/off switch, in miniature: the selected module is the one switched on. */
.mod-switch {
  position: relative; width: 26px; height: 15px; border-radius: 99px;
  background: rgba(120, 160, 220, .16); transition: background .4s;
}
.mod-switch span {
  position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--dim); transition: transform .45s var(--ease), background .4s;
}
.mod.is-active {
  border-color: rgba(75, 180, 255, .42);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  box-shadow: 0 0 0 1px rgba(75, 180, 255, .1), 0 14px 34px -14px rgba(43, 134, 255, .5);
}
.mod.is-active .mod-icon {
  color: var(--accent); background: var(--accent-soft); border-color: rgba(75, 180, 255, .34);
  box-shadow: 0 0 18px -4px rgba(75, 180, 255, .5);
}
.mod.is-active .mod-switch { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.mod.is-active .mod-switch span { transform: translateX(11px); background: #fff; }

/* The tour's timer: a line filling under the active card. Its end is what moves the tour on. */
.mod-progress {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(75, 180, 255, .15), var(--accent));
  transform: scaleX(0); transform-origin: left; opacity: 0;
}
.showcase.is-touring .mod.is-active .mod-progress {
  opacity: .85; animation: progress var(--tour, 7s) linear forwards; animation-play-state: paused;
}
.showcase.is-touring.is-visible .mod.is-active .mod-progress { animation-play-state: running; }
.showcase.is-touring.is-visible:hover .mod.is-active .mod-progress { animation-play-state: paused; }
@keyframes progress { to { transform: scaleX(1); } }

/* The stage: a window onto the selected module. */
.stage {
  position: sticky; top: 92px; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .75), 0 0 0 1px rgba(75, 180, 255, .04);
}
.stage::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(75, 180, 255, .55), transparent);
}
.stage-bar {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft); background: rgba(9, 14, 26, .55);
  font-family: var(--mono); font-size: 12.5px; color: var(--dim);
}
.stage-mark { width: 18px; height: 18px; border-radius: 50%; }
.stage-path b { color: var(--text); font-weight: 500; }
.stage-sep { color: var(--faint); margin: 0 2px; }
.stage-live { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: live 2.8s ease-out infinite;
}
@keyframes live {
  0%       { box-shadow: 0 0 0 0 rgba(75, 180, 255, .45); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(75, 180, 255, 0); }
}

.stage-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: radial-gradient(70% 80% at 50% 45%, rgba(43, 134, 255, .13), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line-soft);
  transition: opacity .22s ease;
}
.stage-media::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 220, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 220, .06) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
          mask-image: radial-gradient(closest-side, #000, transparent);
}
.stage-media.is-out { opacity: 0; }
.stage-gif { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }

/* Until a module has its preview: its icon, with the rings the client's sign-in screen breathes. */
.stage-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ph-ring {
  position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s);
  translate: -50% -50%; border-radius: 50%; border: 1px solid rgba(75, 180, 255, .2);
  animation: wave 6s ease-in-out infinite;
}
.ph-ring:nth-child(1) { --s: 128px; }
.ph-ring:nth-child(2) { --s: 212px; border-color: rgba(75, 180, 255, .13); animation-delay: 1s; }
.ph-ring:nth-child(3) { --s: 304px; border-color: rgba(75, 180, 255, .08); border-style: dashed; animation-delay: 2s; }
@keyframes wave { 0%, 100% { scale: 1; opacity: .55; } 50% { scale: 1.04; opacity: 1; } }
.ph-icon {
  position: relative; width: 78px; height: 78px; border-radius: 22px;
  display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(180deg, rgba(75, 180, 255, .2), rgba(43, 134, 255, .06));
  border: 1px solid rgba(75, 180, 255, .34);
  box-shadow: 0 0 44px -8px rgba(75, 180, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: float 7s ease-in-out infinite;
}
.ph-icon .icon { width: 34px; height: 34px; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

.stage-body { padding: 22px 26px 26px; transition: opacity .22s ease, transform .22s var(--ease); }
.stage-body.is-out { opacity: 0; transform: translateY(6px); }
.stage-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stage-head h3 { font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1.2; }
.stage-group {
  font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint);
  padding: 2px 9px; border: 1px solid var(--line-soft); border-radius: 99px;
}
.stage-sub { margin-top: 2px; font-size: 15px; color: var(--dim); }
.stage-points { list-style: none; display: grid; gap: 9px; margin-top: 18px; }
.stage-points li { position: relative; padding-left: 24px; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.stage-points li::before {
  content: ""; position: absolute; left: 3px; top: .55em; width: 7px; height: 7px;
  border: 1.5px solid var(--accent); border-radius: 2px; transform: rotate(45deg);
}
.js .stage-points li { animation: rise .55s var(--ease) both; animation-delay: calc(var(--k, 0) * 60ms + 40ms); }
.stage-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px;
  color: var(--accent); font-weight: 600; font-size: 14.5px;
}
.stage-link[hidden] { display: none; }
.stage-link span { transition: transform .25s var(--ease); }
.stage-link:hover span { transform: translateX(3px); }

/* ── Scripting ─────────────────────────────────────────────────────────── */
.api {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center;
  margin-top: 150px;
}
.api-copy h2 { font-family: var(--display); font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; line-height: 1.12; }
.api-copy p:not(.eyebrow) { margin: 16px 0 28px; color: var(--dim); font-size: 16.5px; }

.code-window {
  overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-code);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8), 0 0 60px -30px rgba(43, 134, 255, .35);
}
.code-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg-2);
}
.code-dots { display: inline-flex; gap: 6px; }
.code-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(120, 160, 220, .2); }
.code-file { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.code-window pre { margin: 0; padding: 20px 22px 22px; overflow-x: auto; font: 13.5px/1.75 var(--mono); color: var(--text); }
/* A caret resting at the end of the script - it fades, it does not blink. */
.code-window code::after {
  content: ""; display: inline-block; width: 8px; height: 1.15em; margin-left: 3px;
  vertical-align: text-bottom; background: var(--accent); border-radius: 1px;
  animation: caret 1.8s ease-in-out infinite;
}
@keyframes caret { 0%, 100% { opacity: .9; } 50% { opacity: .12; } }

.t-kw  { color: var(--t-kw); }
.t-fn  { color: var(--t-fn); font-weight: 500; }
.t-str { color: var(--t-str); }
.t-num { color: var(--t-num); }
.t-var { color: var(--t-var); }
.t-com { color: var(--t-com); font-style: italic; }

/* ── Pricing ───────────────────────────────────────────────────────────── */
.pricing { margin-top: 150px; text-align: center; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.plan-card {
  position: relative; padding: 30px 24px; text-align: center;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.plan-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.plan-card.is-best {
  border-color: rgba(75, 180, 255, .5);
  box-shadow: 0 0 0 1px rgba(75, 180, 255, .22), 0 20px 60px rgba(43, 134, 255, .18);
  background: linear-gradient(180deg, var(--bg-3), var(--bg));
}
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(100deg, var(--accent) 35%, #c4e9ff 50%, var(--accent) 65%) var(--accent);
  background-size: 300% 100%; background-position: 100% 0;
  color: #04101f; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  animation: badge-sheen 7s ease-in-out infinite;
}
@keyframes badge-sheen { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0% 0; } }
.plan-name { font-family: var(--display); font-size: 21px; font-weight: 700; }
.plan-dur { color: var(--dim); font-size: 14px; margin-top: 2px; }
.plan-price { font-size: 26px; font-weight: 600; margin: 18px 0 20px; }
.plan-card .btn { width: 100%; }

.plan-row { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.plan-pill {
  display: inline-flex; align-items: center; gap: 12px;
  background: rgba(120, 160, 220, .07); border: 1px solid var(--line-soft); color: var(--text);
  border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.plan-pill:hover { border-color: var(--line-strong); background: rgba(120, 160, 220, .12); }
.plan-pill-price { color: var(--dim); }
.pricing-note { margin-top: 28px; font-size: 13px; color: var(--dim); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  max-width: var(--maxw); margin: 140px auto 0; padding: 36px 24px 56px;
  border-top: 1px solid var(--line-soft); color: var(--dim);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .brand { color: var(--text); font-size: 18px; }
.footer .brand-mark { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 22px; font-size: 14px; }
.footer-links a { transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer .fine { margin-top: 18px; font-size: 12px; opacity: .7; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 12px 20px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); z-index: 50;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ══ API Docs page ══════════════════════════════════════════════════════ */
.page-hero { position: relative; isolation: isolate; padding: 76px 24px 8px; }
.page-hero > :not(.hero-field) { max-width: calc(var(--maxw) - 48px); margin-left: auto; margin-right: auto; }
.page-hero .hero-field {
  inset: -80px 0 -80px;
  -webkit-mask-image: radial-gradient(ellipse 55% 85% at 30% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 55% 85% at 30% 20%, #000 20%, transparent 75%);
}
.page-hero .hero-aura { left: 30%; top: -260px; width: 820px; }
.page-hero h1 { font-family: var(--display); font-size: clamp(36px, 5.4vw, 56px); font-weight: 700; line-height: 1.06; }
.page-hero .lead { margin: 16px 0 0; max-width: 640px; }
.page-hero .hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.page-hero .hero-meta span {
  font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  border: 1px solid var(--line-soft); background: rgba(14, 21, 38, .6); padding: 4px 11px; border-radius: 99px;
}

.docs-layout {
  max-width: var(--maxw); margin: 56px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; align-items: start;
}
.toc {
  position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 2px 6px 24px 0;
  scrollbar-width: thin; scrollbar-color: rgba(120, 160, 220, .2) transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, .2); border-radius: 3px; }
.toc-group {
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint); margin: 16px 0 5px;
}
.toc-group:first-child { margin-top: 0; }
.toc a {
  display: block; padding: 3px 0 3px 13px; border-left: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 13px; color: var(--dim);
  transition: color .2s, border-color .2s;
}
.toc a.is-plain { font-family: var(--font); font-size: 14px; }
.toc a:hover { color: var(--text); }
.toc a.is-current { color: var(--accent); border-left-color: var(--accent); }

.doc { min-width: 0; }
.doc-section { margin-bottom: 64px; scroll-margin-top: 90px; }
.doc-section > h2 {
  font-family: var(--display); font-size: 27px; font-weight: 700;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--line-soft);
}
.doc-section > h2 small { font-family: var(--font); font-size: 15px; font-weight: 400; color: var(--dim); margin-left: 10px; letter-spacing: 0; }
.doc p, .doc li { color: var(--text-2); font-size: 15.5px; }
.doc p + p, .doc p + ul, .doc ul + p { margin-top: 12px; }
.doc ul { padding-left: 20px; display: grid; gap: 6px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc :not(pre) > code {
  font-family: var(--mono); font-size: .86em; color: var(--text);
  background: rgba(120, 160, 220, .09); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px;
  white-space: nowrap;
}
.doc pre {
  margin-top: 14px; overflow-x: auto; padding: 14px 18px; border-radius: 12px;
  border: 1px solid var(--line-soft); background: var(--bg-code); font: 13.5px/1.7 var(--mono);
}

.fn { padding: 28px 0; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 84px; }
.fn:first-of-type { padding-top: 6px; }
.fn:last-child { border-bottom: 0; }
.fn h3 { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 18px; font-weight: 500; color: var(--dim); }
.fn h3 .fn-name { color: var(--accent); }
.fn h3 .anchor { font-family: var(--font); font-size: 15px; color: var(--faint); opacity: 0; transition: opacity .2s; }
.fn:hover h3 .anchor, .fn h3 .anchor:focus-visible { opacity: 1; }
.doc .fn-sum { margin-top: 6px; font-size: 16.5px; color: var(--text); }

.params { width: 100%; border-collapse: collapse; margin: 18px 0 4px; font-size: 14.5px; }
.params th {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.doc .params code { white-space: normal; }
.params th:nth-child(1) { width: 26%; }
.params th:nth-child(2) { width: 20%; }
.params td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--text-2); }
.params td:first-child { font-family: var(--mono); color: var(--text); white-space: nowrap; }
.params td:nth-child(2) { font-family: var(--mono); font-size: 13px; color: var(--t-var); white-space: nowrap; }
.opt { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--faint); font-style: italic; }
.doc .returns { margin-top: 14px; }
.returns-label {
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); margin-right: 8px;
}
.doc .callout {
  margin-top: 16px; padding: 13px 16px; border-radius: 12px;
  border: 1px solid rgba(75, 180, 255, .24); background: rgba(75, 180, 255, .06);
}

/* ══ Download page ══════════════════════════════════════════════════════ */
.dl { margin-top: 48px; }
.dl-grid {
  display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 64px; align-items: start;
}

/* The card. Its one motion is a light that travels the border, slowly - a full lap in 14 s. */
@property --lap { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.dl-card {
  position: relative; isolation: isolate; padding: 30px;
  border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2) 60%, var(--bg));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8), 0 0 80px -40px rgba(43, 134, 255, .45);
}
.dl-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--lap), transparent 0deg 250deg, rgba(75, 180, 255, .75) 300deg, transparent 340deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: lap 14s linear infinite;
}
@keyframes lap { to { --lap: 360deg; } }
.dl-head { display: flex; align-items: center; gap: 16px; }
.dl-logo {
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 1px rgba(75, 180, 255, .25), 0 10px 30px -6px rgba(43, 134, 255, .5);
}
.dl-head h2 { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.15; }
.dl-version { margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.dl-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 22px; }
.dl-tags li {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: rgba(9, 14, 26, .45);
}

/* Terms: a real checkbox, drawn. The tick draws itself in when it is checked. */
.check {
  position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(9, 14, 26, .5);
  font-size: 14.5px; line-height: 1.5; color: var(--text-2);
  transition: border-color .3s, background .3s;
}
.check:hover { border-color: var(--line); }
.check:has(input:checked) { border-color: rgba(75, 180, 255, .36); background: rgba(75, 180, 255, .06); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: rgba(9, 14, 26, .6);
  transition: background .3s, border-color .3s, box-shadow .35s;
}
.check-box svg {
  width: 14px; height: 14px; fill: none; stroke: #04101f; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .4s var(--ease) .05s;
}
.check input:checked + .check-box {
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-color: transparent;
  box-shadow: 0 0 16px -2px rgba(75, 180, 255, .6);
}
.check input:checked + .check-box svg { stroke-dashoffset: 0; }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check a { color: var(--accent); }
.check a:hover { text-decoration: underline; text-underline-offset: 3px; }

.dl-btn { width: 100%; margin-top: 16px; }
.dl-hint { margin-top: 10px; text-align: center; font-size: 13px; color: var(--faint); transition: color .3s; }
.dl-hint.is-ok { color: var(--dim); }

.dl-facts { margin-top: 24px; border-top: 1px solid var(--line-soft); }
.dl-facts div {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.dl-facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.dl-facts dt {
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint);
}
.dl-facts dd { font-size: 14px; color: var(--text-2); }
.dl-facts a { color: var(--accent); }
.dl-sha { color: var(--dim) !important; }
.dl-sha.is-hash { font-family: var(--mono); font-size: 12px !important; word-break: break-all; color: var(--text-2) !important; }

/* Before you install. */
.notices { padding-top: 6px; }
.notices h2 { font-family: var(--display); font-size: clamp(26px, 3vw, 32px); font-weight: 700; line-height: 1.1; }
.notice-list { list-style: none; margin-top: 18px; }
.notice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line-soft);
}
.notice:last-child { border-bottom: 0; }
.notice-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(75, 180, 255, .24);
}
.notice-icon .icon { width: 20px; height: 20px; }
.notice h3 { font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.notice p { margin-top: 3px; font-size: 14.5px; color: var(--dim); }
.notice a, .faq-item a, .faq-foot a { color: var(--accent); }

/* Requirements. */
.req { margin-top: 140px; }
.spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 44px; }
.spec {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 22px;
  border-radius: 16px; border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg-2), rgba(14, 21, 38, .2));
}
.spec-label {
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--faint);
}
.spec-value { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.spec-note { font-size: 13px; color: var(--dim); }

.sub-head {
  display: flex; align-items: center; gap: 14px; margin: 48px 0 16px;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--faint);
}
.sub-head::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.runtime-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.runtime {
  display: flex; flex-direction: column; padding: 22px;
  border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  transition: transform .35s var(--ease), border-color .3s;
}
.runtime:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.runtime.is-optional { border-style: dashed; border-color: var(--line); }
.runtime-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.runtime-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(75, 180, 255, .24);
}
.runtime.is-optional .runtime-icon { color: var(--dim); background: rgba(120, 160, 220, .07); border-color: var(--line); }
.tag {
  font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px;
}
.tag-req { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(75, 180, 255, .3); }
.tag-rec { color: var(--dim); border: 1px solid var(--line); }
.runtime h4 { font-size: 16px; font-weight: 600; line-height: 1.35; }
.runtime-ver { margin-top: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.runtime.is-optional .runtime-ver { color: var(--dim); }
.runtime p:not(.runtime-ver) { margin: 12px 0 18px; font-size: 14px; color: var(--dim); }
.runtime-link {
  margin-top: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.runtime-link .icon { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.runtime-link:hover .icon { transform: translate(2px, -2px); }

/* Install steps, joined by a line a soft light runs along now and then. */
.steps { margin-top: 140px; }
.step-list {
  position: relative; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 48px;
}
.step-list::before, .step-list::after {
  content: ""; position: absolute; top: 19px; left: 20px; right: 20px; height: 1px; pointer-events: none;
}
.step-list::before { background: linear-gradient(90deg, rgba(75, 180, 255, .45), var(--line-soft)); }
.step-list::after {
  background: linear-gradient(90deg, transparent, rgba(75, 180, 255, .9), transparent);
  background-size: 18% 100%; background-repeat: no-repeat; background-position: -20% 0;
  animation: travel 9s ease-in-out infinite;
}
@keyframes travel { 0%, 15% { background-position: -30% 0; } 75%, 100% { background-position: 130% 0; } }
.step { position: relative; }
.step-num {
  position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--accent);
  background: var(--bg); border: 1px solid rgba(75, 180, 255, .4);
  box-shadow: 0 0 0 6px var(--bg), 0 0 22px -6px rgba(75, 180, 255, .6);
}
.step h3 { margin-top: 18px; font-size: 17px; font-weight: 600; }
.step p { margin-top: 4px; font-size: 14.5px; color: var(--dim); }

/* FAQ */
.faq { margin-top: 140px; }
.faq-list { max-width: 820px; margin: 44px auto 0; border-top: 1px solid var(--line-soft); }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 19px 4px; font-size: 16px; font-weight: 600; transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: #cfe8ff; }
.faq-item summary:focus-visible { outline-offset: -2px; }
.faq-mark {
  position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .3s, background .3s;
}
.faq-mark::before, .faq-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; border-radius: 1px;
  background: var(--accent); translate: -50% -50%;
}
.faq-mark::after { rotate: 90deg; }
.faq-item[open] .faq-mark { transform: rotate(45deg); border-color: rgba(75, 180, 255, .4); background: var(--accent-soft); }
.faq-item p { padding: 0 48px 22px 4px; font-size: 15px; color: var(--dim); }
.faq-item[open] p { animation: rise .45s var(--ease) both; }
.faq-foot { margin-top: 28px; text-align: center; color: var(--dim); font-size: 15px; }

@media (max-width: 1060px) {
  .dl-grid { gap: 44px; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
  .spec-grid, .runtime-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .dl-grid { grid-template-columns: 1fr; gap: 56px; }
  .dl-card { max-width: 520px; }
  .step-list { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .step-list::before, .step-list::after { display: none; }
}
@media (max-width: 620px) {
  .dl { margin-top: 36px; }
  .dl-card { padding: 22px; }
  .req, .steps, .faq { margin-top: 104px; }
  .runtime-grid, .step-list { grid-template-columns: 1fr; }
  .faq-item p { padding-right: 4px; }
}
@media (max-width: 440px) {
  .spec-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  .showcase { grid-template-columns: 290px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 980px) {
  .api { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; gap: 18px; }
  .stage { position: relative; top: 0; }
  /* The cards become one sideways strip above the stage. */
  .mod-list {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
    margin: 0 -24px; padding: 2px 24px 10px; scrollbar-width: none;
  }
  .mod-list::-webkit-scrollbar { display: none; }
  .mod-group, .mod-line, .mod-switch { display: none; }
  .mod { flex: none; grid-template-columns: auto auto; gap: 9px; padding: 9px 14px 9px 10px; scroll-snap-align: center; border-radius: 999px; }
  .mod:hover { transform: none; }
  .mod-icon { width: 28px; height: 28px; border-radius: 50%; }
  .mod-icon .icon { width: 16px; height: 16px; }
  .mod-name { font-size: 14px; white-space: nowrap; }
  .mod-progress { left: 18px; right: 18px; }

  .docs-layout { grid-template-columns: 1fr; gap: 32px; margin-top: 40px; }
  .toc {
    position: static; max-height: none; overflow: visible; padding: 18px 20px;
    border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(14, 21, 38, .5);
    columns: 2; column-gap: 24px;
  }
  .toc-group { break-after: avoid; }
  .toc a { break-inside: avoid; }
}

@media (max-width: 620px) {
  .nav { padding: 12px 16px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn):not(.nav-docs) { display: none; }
  .section, .hero, .page-hero, .docs-layout, .footer { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 72px; }
  .ribbon { display: none; }
  .mod-list { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .stage-body { padding: 18px 18px 20px; }
  .modules { margin-top: 84px; }
  .api, .pricing { margin-top: 110px; }
  .plan-grid { grid-template-columns: 1fr; }
  /* On a phone the contents are a block of chips, not a column as long as the screen. */
  .toc { columns: auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; }
  .toc-group { display: none; }
  .toc a {
    padding: 4px 10px; border: 1px solid var(--line-soft); border-radius: 99px;
    font-size: 12px; background: rgba(9, 14, 26, .6);
  }
  .toc a.is-plain { font-size: 12.5px; }
  .toc a.is-current { border-color: rgba(75, 180, 255, .45); }
  .params th, .params td { padding-left: 8px; padding-right: 8px; }
  .params td:nth-child(2) { white-space: normal; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
