/* ============================================================
   Reset, document defaults, and the primitives every page uses.
   No colour is hardcoded here. Everything resolves through a
   token, so both themes are correct by construction.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip`, never `hidden`. overflow-x: hidden turns the body into a scroll
     container, which silently stops the sticky nav from sticking. `clip`
     guards against sideways overflow without that side effect. */
  overflow-x: clip;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }          /* so width and height attributes never beat aspect-ratio */
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ============================================================
   The details that carry the price tag
   ============================================================ */

::selection { background: color-mix(in srgb, var(--purple) 30%, transparent); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

* { scrollbar-width: thin; scrollbar-color: var(--border-glow) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 10px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--purple-2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--card); color: var(--text);
  padding: 12px 18px; border-radius: 0 0 var(--r-btn) 0;
  border: 1px solid var(--border-glow);
}
.skip:focus { left: 0; }

/* ============================================================
   Ambient ground
   ============================================================ */

.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient {
  background:
    radial-gradient(60% 50% at 50% 110%, var(--amb-3), transparent 70%);
}
.ambient::before,
.ambient::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px);
}
/* violet from the top left, magenta pouring in from the right edge */
.ambient::before {
  top: -20%; left: -12%; width: 62%; height: 70%;
  background: radial-gradient(circle, var(--amb-1), transparent 64%);
}
.ambient::after {
  top: 18%; right: -18%; width: 58%; height: 86%;
  background: radial-gradient(circle, var(--amb-2), transparent 62%);
}

/* Fine grain. Kills banding across the large gradients, which is
   the clearest tell of a cheap page. */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter>\
<rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* ============================================================
   Layout primitives
   ============================================================ */

.wrap {
  width: 100%; max-width: var(--max);
  margin-inline: auto; padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--max-narrow); }

main { position: relative; z-index: 2; }
section { position: relative; }
.sec { padding-block: var(--sec-y); }
.sec__head { max-width: 760px; margin-bottom: clamp(34px, 4vw, 54px); }
.sec__head .h2 { margin: 14px 0 16px; }

.rule {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--border) 18%, var(--border) 82%, transparent);
}

/* ============================================================
   Type primitives
   ============================================================ */

.eyebrow {
  font-size: clamp(15px, 0.6vw + 13px, 20px); font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 10px;
}

.h1 { font-size: var(--step-5); font-weight: 900; line-height: 1.01; letter-spacing: -.035em; }
.h2 { font-size: var(--step-4); font-weight: 900; line-height: 1.05; letter-spacing: -.03em; }
.h3 { font-size: var(--step-2); font-weight: 800; line-height: 1.2;  letter-spacing: -.015em; }
.h4 { font-size: var(--step-1); font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }

.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; max-width: 58ch; }
.body { color: var(--muted); }
.fine { font-size: var(--step--1); color: var(--muted-2); }
.mono { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .02em; color: var(--muted-2); }

/* Gradient ink, for single emphasis words only. */
.ink-grad, .ink-cool, .ink-hot {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  /* keeps descenders inside the painted box */
  padding-bottom: .06em;
}
.ink-cool { background-image: var(--grad-cool); }
.ink-hot  { background-image: var(--grad-hot); }
.ink-cyan { color: var(--cyan); }
.ink-pink { color: var(--pink); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px;
  border-radius: var(--r-btn); border: 1px solid transparent;
  font-size: var(--step--1); font-weight: 700; letter-spacing: .01em;
  cursor: pointer; background: none;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--grad-btn); color: var(--btn-ink); box-shadow: var(--sh-btn); font-weight: 800; }
.btn--primary:hover { box-shadow: var(--sh-btn-h); }

.btn--ghost {
  border-color: color-mix(in srgb, var(--purple) 45%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}
.btn--ghost:hover {
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  border-color: var(--purple);
}


.btn--block { width: 100%; padding: 16px 22px; }

/* Small round control: theme toggle, hero and marquee pause buttons */
.ctl {
  width: 38px; height: 38px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-glow);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  color: var(--text); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.ctl:hover { border-color: var(--purple); background: color-mix(in srgb, var(--bg) 88%, transparent); }
.ctl svg { width: 17px; height: 17px; }

/* A pause control carries both icons and shows the one that applies.
   `.is-paused` lives on the section, so these read down to the button. */
.ctl .ico-pause { display: block; }
.ctl .ico-play  { display: none; }
.is-paused .ctl .ico-pause { display: none; }
.is-paused .ctl .ico-play  { display: block; }

/* ============================================================
   Surfaces
   ============================================================ */

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition:
    transform var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--border-glow); box-shadow: var(--sh-lift); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 40px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 12px; font-weight: 700; color: var(--muted);
}

/* ============================================================
   Status labels. Three words, never blurred.
   ============================================================ */

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.status--live  { color: var(--live); }
.status--live::before  { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 18%, transparent); }
.status--prod  { color: var(--purple); }
.status--prod::before  { background: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 20%, transparent); }
.status--demo  { color: var(--muted-2); }
.status--demo::before  { background: transparent; box-shadow: inset 0 0 0 1px var(--muted-2); }
.status--draft { color: var(--muted-2); }
.status--draft::before { background: var(--muted-2); opacity: .5; }

/* ============================================================
   Reduced motion. A complete still page, never a broken one.
   ============================================================ */

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