/* Relay landing page.
 *
 * Structure follows the same rule as the app's design system (docs/ui/design-system.md §2.1):
 *   - Containers are flush and only decide the gap between children (flex/grid `gap`).
 *   - Components pad themselves.
 *   - No margins anywhere. The reset below zeroes them; don't add any back.
 *
 * Sections, top to bottom: tokens → reset → layout primitives → atoms → molecules → organisms →
 * motion. Change a value in :root, not in a component.
 */

/* ───────────────────────────── Tokens ───────────────────────────── */

/* --gap and --min are per-container settings. Registered as non-inheriting so a nested
 * .stack/.cluster/.grid without its own value gets the primitive's default, not its ancestor's. */
@property --gap { syntax: "*"; inherits: false; }
@property --min { syntax: "*"; inherits: false; }

/* Dark is the default. The head script sets data-theme from ?theme= or the OS, so the light
 * values below are defined once, under [data-theme="light"]. */
:root {
  /* Colour */
  --bg: #08090b;
  --bg-raised: #0e1013;
  --surface: #13161a;
  --surface-hover: #181c21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ecedef;
  --text-muted: #8b9098;
  --text-faint: #7a808a;       /* ≥4.5:1 on --bg: used for small text */
  --accent: #4ba1f1;           /* the app icon's blue */
  --accent-soft: rgba(75, 161, 241, 0.14);
  --accent-text: #9fcbff;
  --highlight: #d69828;        /* the app's search-match amber */
  --highlight-soft: rgba(214, 152, 40, 0.18);
  --success: #3fb67a;
  --warn: #d69828;
  --acct-1: #4ba1f1;           /* account colours in the mock-ups */
  --acct-2: #3fb67a;
  --ascii: 210, 220, 235;      /* r,g,b for the hero field */
  --ascii-signal: 75, 161, 241;
  --ascii-strength: 1;         /* multiplies the field's opacity */

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
  --text-3xl: clamp(2.5rem, 1.6rem + 4vw, 5rem);
  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-body: 1.6;
  --tracking-tight: -0.035em;
  --tracking-snug: -0.01em;
  --tracking-caps: 0.08em;

  /* Space: one scale, used for both padding and gap. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --gutter: clamp(1rem, 4vw, 2rem);          /* page side padding */
  --section-y: clamp(4rem, 8vw, 8rem);       /* section top/bottom padding */
  --content-max: 72rem;
  --hero-max: 52rem;
  --prose-max: 38rem;

  /* Size */
  --dot: 8px;
  --pip: 10px;
  --icon-box: 2.25rem;
  --index-col: 4rem;           /* principle numbers */

  /* Shape */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-mid: 300ms;
  --dur-reveal: 900ms;
  --stagger: 70ms;
}

:root[data-theme="light"] {
  --bg: #fbfbfc;
  --bg-raised: #ffffff;
  --surface: #f3f4f6;
  --surface-hover: #eceef1;
  --border: rgba(10, 20, 30, 0.09);
  --border-strong: rgba(10, 20, 30, 0.16);
  --text: #111316;
  --text-muted: #5b616b;
  --text-faint: #6b717b;
  --accent: #1f7fd8;
  --accent-soft: rgba(31, 127, 216, 0.1);
  --accent-text: #1667b3;
  --highlight-soft: rgba(214, 152, 40, 0.2);
  --success: #23804f;
  --warn: #8a5d08;
  --acct-1: #1f7fd8;
  --acct-2: #23804f;
  --ascii: 40, 48, 60;
  --ascii-signal: 31, 127, 216;
  --ascii-strength: 0.6;
  --shadow-lg: 0 30px 80px -30px rgba(20, 30, 50, 0.25), 0 0 0 1px var(--border);
}

/* ───────────────────────────── Reset ───────────────────────────── */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
code, kbd, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ───────────────────────────── Layout primitives ─────────────────────────────
 * Flush containers. They only set direction, alignment and gap. */

.stack   { display: flex; flex-direction: column; gap: var(--gap, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-3)); }
.cluster--center { justify-content: center; }
.split   { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-8)); }
.split--top { align-items: flex-start; }
.split > * { flex: 1 1 22rem; min-width: 0; }
.grid    { display: grid; gap: var(--gap, var(--space-4)); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 18rem)), 1fr)); }

/* A section pads itself; its inner .container caps the width. */
.section { padding: var(--section-y) var(--gutter); position: relative; }
.section--tight { padding-block: var(--space-7); }
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; } /* the one auto-margin: centring, not spacing */

/* ───────────────────────────── Atoms ───────────────────────────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.h1 { font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: 600; }
.h2 { font-size: var(--text-2xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: 600; }
.h3 { font-size: var(--text-lg); line-height: var(--leading-snug); letter-spacing: var(--tracking-snug); font-weight: 600; }
.lede { font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--text-muted); max-width: var(--prose-max); letter-spacing: var(--tracking-snug); }
.body { color: var(--text-muted); max-width: var(--prose-max); }
.small { font-size: var(--text-sm); color: var(--text-muted); }
.muted { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.link { text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--text); }
.text-gradient {
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; line-height: 1.4;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn--primary:hover { background: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.btn--lg { padding: var(--space-3) var(--space-5); font-size: var(--text-md); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { color: var(--text); background: var(--surface); }

/* Query chip — same idea as the app's widgets::eql_chip. */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.1em 0.5em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  white-space: nowrap;
}
.chip--neg { background: transparent; color: var(--text-muted); border-style: dashed; }

/* A rule action, in plain words rather than query syntax. */
.action {
  display: inline-flex; align-items: center;
  padding: 0.15em 0.6em;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 500;
  background: var(--surface); border: 1px solid var(--border-strong);
}

.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.15em 0.6em;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 500;
  border: 1px solid var(--border-strong); color: var(--text-muted);
}
.badge--accent { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.badge--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6em; padding: 0.05em 0.4em;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; font-size: 0.8em; color: var(--text);
  background: var(--surface);
}

.mark { background: var(--highlight-soft); color: inherit; border-radius: var(--radius-xs); padding: 0 0.15em; }

.dot { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--accent); flex: none; }

/* Inline placeholder for copy the owner still has to write. */
.placeholder-inline { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); width: fit-content; }

/* ───────────────────────────── Molecules ───────────────────────────── */

.card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg));
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast);
}
.card:hover { border-color: var(--border-strong); }
/* Pointer-following glow; --mx/--my set by main.js. */
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(25rem circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity var(--dur-mid);
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

.feature-icon {
  display: grid; place-items: center;
  width: var(--icon-box); height: var(--icon-box);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent-text);
  font-family: var(--font-mono); font-size: var(--text-lg); line-height: 1;
}

/* Image placeholder: replace each with an <img>/<video> of the same aspect ratio. */
.placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-2);
  padding: var(--space-6);
  aspect-ratio: var(--ratio, 16 / 10);
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--text) 3%, transparent) 12px 13px),
    var(--bg-raised);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: left;
}
.placeholder strong { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.placeholder p { max-width: var(--prose-max); }

/* Pillars under the hero: three one-line reasons. */
.pillars { --min: 15rem; --gap: var(--space-5); }
.pillar { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) 0; border-top: 1px solid var(--border); }

/* ───────────────────────────── Organisms ───────────────────────────── */

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: var(--space-3) var(--gutter);
  transition: background var(--dur-fast), border-color var(--dur-fast);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.nav__links { display: flex; align-items: center; gap: var(--space-1); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; letter-spacing: -0.02em; padding: var(--space-1) 0; }
.brand svg { width: 24px; height: 24px; }
@media (max-width: 720px) { .nav__links .btn--ghost { display: none; } }

/* Hero. Shorter than the viewport so the product shot peeks in below. */
.hero {
  min-height: 86svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--space-10) + var(--space-4)) var(--gutter) var(--space-8);
  position: relative; overflow: hidden;
  isolation: isolate;
}
.hero__field {
  position: absolute; inset: -10% 0 0 0; z-index: -1;
  width: 100%; height: 110%;
  /* Fade the field into the page at the edges. */
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
}
.hero__content { --gap: var(--space-5); align-items: center; text-align: center; max-width: var(--hero-max); position: relative; isolation: isolate; }
/* A soft panel of page colour behind the copy so it reads over the field. The mask fades its
 * edges out, so it has no visible boundary. (No backdrop blur: it would recomposite every frame
 * the canvas redraws.) */
.hero__content::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(-1 * var(--space-8)) calc(-1 * var(--space-6));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 50%, transparent 100%);
}

/* Product shot under the hero: tilts back and flattens as it scrolls in. */
.showcase { padding: 0 var(--gutter); perspective: 1600px; }
.showcase__frame {
  transform-origin: 50% 0;
  transform: rotateX(var(--tilt, 18deg)) scale(var(--scale, 0.92));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  will-change: transform;
}
.showcase__frame .placeholder { border-style: solid; }

/* Feature rows: text beside a visual. --flip puts the visual first on wide screens. */
@media (min-width: 761px) { .feature-row--flip > :first-child { order: 2; } }

/* Shared list mock-up (Smart view, search results) */
.result-list { display: flex; flex-direction: column; border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; }
.result {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  background: var(--bg-raised);
}
.result:last-child { border-bottom: 0; }
.result.is-selected { background: var(--surface); }
.result__what { display: flex; gap: var(--space-2); color: var(--text-muted); overflow: hidden; white-space: nowrap; }
.result__what > * { flex: none; }
.result__who { font-weight: 600; color: var(--text); }
.result__when { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-faint); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.acct { width: var(--dot); height: var(--dot); border-radius: 50%; }
.acct--1 { background: var(--acct-1); }
.acct--2 { background: var(--acct-2); }
.strip { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--text-muted); background: var(--surface); border-bottom: 1px solid var(--border); }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-faint); background: var(--surface); border-bottom: 1px solid var(--border); }

/* Search demo */
.searchbox {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono); font-size: var(--text-sm);
  min-height: 3rem;
}
.searchbox__mode { color: var(--text-faint); font-size: var(--text-xs); padding-right: var(--space-3); border-right: 1px solid var(--border); }
.searchbox__input { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); color: var(--text); }
.caret { width: 1px; height: 1.1em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#search-results { transition: opacity 200ms; }

/* Smart view "why" demo. The panel hangs off the selected row on wide screens and sits under
 * the list on narrow ones, so it never covers rows. */
.why-demo { position: relative; display: flex; flex-direction: column; gap: var(--space-3); }
.why-pin { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.why {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
}
.why__title { font-weight: 600; }
.why__row { color: var(--text); }
.why__caption { font-size: var(--text-xs); color: var(--text-faint); padding-top: var(--space-1); }
@media (min-width: 761px) {
  .why { position: absolute; right: calc(-1 * var(--space-3)); top: 5.5rem; width: min(17rem, 80%); }
}

/* Thread chain mock */
.chain { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.chain__node { display: grid; grid-template-columns: 1.25rem 1fr; gap: var(--space-3); align-items: start; }
.chain__node[data-depth="1"] { padding-left: var(--space-5); }
.chain__node[data-depth="2"] { padding-left: var(--space-7); }
.chain__pip { width: var(--pip); height: var(--pip); border-radius: 50%; border: 2px solid var(--accent); }
.chain__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-raised); }
.chain__note { font-size: var(--text-xs); color: var(--text-faint); padding-left: calc(1.25rem + var(--space-3)); }

/* Rule mock */
.rule { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-raised); font-size: var(--text-sm); }
.rule__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.verdict { font-family: var(--font-mono); font-size: var(--text-xs); padding: 0.1em 0.45em; border-radius: var(--radius-sm); color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }

/* Composer mock */
.compose { display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-raised); font-size: var(--text-sm); overflow: hidden; }
.compose__field { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border); }
.compose__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--text-xs); }
.compose__sep { width: 1px; height: 1em; background: var(--border-strong); }
.compose__swatch { width: 0.9em; height: 0.9em; border-radius: var(--radius-xs); background: var(--accent); }
.compose__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.compose__table { border-collapse: collapse; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.compose__table th, .compose__table td { border: 1px solid var(--border-strong); padding: var(--space-1) var(--space-3); text-align: left; }
.compose__table th { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.compose__files { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }

/* Grid of smaller features */
.features { --min: 20rem; --gap: var(--space-3); }
.features .card { display: flex; flex-direction: column; gap: var(--space-3); }

/* Roadmap strip */
.roadmap { --min: 12rem; --gap: var(--space-3); }
.roadmap li { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-md); border: 1px dashed var(--border-strong); }

/* Principles: a numbered list with a mono index. */
.principles { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.principle {
  display: grid; grid-template-columns: var(--index-col) minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-5);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.principle__n { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-faint); }
.sublist { display: flex; flex-direction: column; gap: var(--space-1); color: var(--text-muted); }
.sublist li { display: flex; gap: var(--space-2); }
.sublist li::before { content: "–"; color: var(--text-faint); }
@media (max-width: 760px) {
  .principle { grid-template-columns: calc(var(--index-col) * 0.625) 1fr; gap: var(--space-2) var(--space-4); }
  .principle__body { grid-column: 2; }
}

/* FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item > summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-4) 0;
  font-weight: 500; cursor: pointer; list-style: none;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after { content: "+"; font-family: var(--font-mono); color: var(--text-faint); transition: transform var(--dur-fast); }
.faq__item[open] > summary::after { transform: rotate(45deg); }
.faq__item > p { padding-bottom: var(--space-4); }

/* Downloads */
.dl-hero { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: radial-gradient(50rem circle at 0% 0%, var(--accent-soft), transparent 50%), var(--bg-raised); }
.dl-hero__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); cursor: pointer; width: fit-content; }
.toggle input { accent-color: var(--accent); }

.releases { display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.release { border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.release:last-child { border-bottom: 0; }
.release > summary {
  display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto auto; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  cursor: pointer; list-style: none;
}
.release > summary::-webkit-details-marker { display: none; }
.release > summary:hover { background: var(--surface); }
.release__ver { font-family: var(--font-mono); font-weight: 600; }
.release__title { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release__date { font-size: var(--text-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.release__chev { transition: transform var(--dur-fast); color: var(--text-faint); }
.release[open] .release__chev { transform: rotate(90deg); }
.release__body { display: flex; flex-direction: column; gap: var(--space-4); padding: 0 var(--space-5) var(--space-5); }
.release__empty { padding: var(--space-5); }
.assets { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.asset { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-muted); }
.asset:hover { border-color: var(--accent); color: var(--text); }
.minor-head { padding: var(--space-2) var(--space-5); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); background: var(--surface); border-bottom: 1px solid var(--border); }
@media (max-width: 640px) {
  .release > summary { grid-template-columns: 1fr auto; }
  .release__title { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .release__date { display: none; }
}

/* Past releases: collapsed by default under one quiet toggle. */
.history > .stack { padding-top: var(--space-4); } /* <details> can't be a flex container in every browser */
.history__toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm); color: var(--text-muted);
  cursor: pointer; list-style: none; width: fit-content;
}
.history__toggle::-webkit-details-marker { display: none; }
.history__toggle:hover { color: var(--text); }
.history[open] > .history__toggle .release__chev { transform: rotate(90deg); }

/* Footer */
.footer { padding: var(--space-8) var(--gutter); border-top: 1px solid var(--border); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-6); }
.footer a { color: var(--text-muted); font-size: var(--text-sm); }
.footer a:hover { color: var(--text); }

/* Section divider glow, Linear-style */
.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); }

/* ───────────────────────────── Motion ─────────────────────────────
 * [data-reveal] fades/slides in when main.js adds .is-in. --i staggers siblings.
 * Without JS (no .js on <html>) everything is simply visible. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js [data-reveal="scale"] { transform: scale(0.96); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .showcase__frame { transform: none; }
  [data-parallax] { transform: none !important; }
  .caret { animation: none; }
}

/* ───────────────────────────── Providers ─────────────────────────────
   "Works with" strip under the pillars. Every logo is a single-colour
   inline SVG in currentColor, so the row reads as one muted band in both
   themes and only lifts to full text colour on hover. */

.providers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding-top: var(--space-6); }
.provider-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); list-style: none; padding: 0; margin: 0; }
.provider { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-snug); transition: color 160ms ease; }
.provider:hover { color: var(--text); }
.provider svg { height: 1.25rem; width: auto; flex: none; }
.provider--wordmark svg { height: 1.1rem; }

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

@media (max-width: 40rem) {
  .providers { gap: var(--space-3); }
  .provider-list { gap: var(--space-3) var(--space-5); }
}
