/* ═══════════════════════════════════════════════════════════════════════════
   CHORDIAN — MARKETING SITE
   One stylesheet, no build step. Brand tokens live here and nowhere else:
   no hex value should appear in any .html file.

   Palette is taken from the logo — dark gray ink, light gray structure,
   golden yellow accent on white.

   Gold is used sparingly and on purpose: hairlines, small marks, and the
   eyebrow. It is never a large fill, never the primary button, and never a
   text colour on white (its contrast is ~1.9:1) — `--gold-ink` is the AA-safe
   variant for text and links. Highlight backgrounds use `--tint`, a neutral
   gray, so a callout reads as emphasis rather than as a warning banner.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-alt: #f4f4f5;
  --surface-deep: #1a1d21;

  /* Structure */
  --border: #e8e8ea;
  --border-strong: #d4d4d8;

  /* Ink */
  --ink: #1a1d21;
  --ink-2: #3f454c;
  --ink-3: #6b7280;
  --ink-invert: #f7f7f8;

  /* Gold — accents only */
  --gold: #f0b429;
  --gold-ink: #8c6100;

  /* Highlight background. Neutral on purpose: a cream fill over a large card
     reads as a caution notice, which is the wrong tone for the one card on the
     page that is meant to be the good outcome. */
  --tint: #f2f3f4;

  /* Semantic */
  --ok: #1e7c52;
  --ok-tint: #eff8f3;

  /* Type */
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Rhythm */
  --page: 1180px;
  --prose: 68ch;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  --shadow-sm: 0 1px 2px rgb(26 29 33 / 0.05);
  --shadow: 0 1px 2px rgb(26 29 33 / 0.04), 0 10px 30px -14px rgb(26 29 33 / 0.16);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--tint);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--gold) 55%, transparent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Type scale ────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  color: var(--ink);
  letter-spacing: -0.025em;
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
}
h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
}
h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
}
h4 {
  font-size: 1rem;
}

p {
  text-wrap: pretty;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
}

.muted {
  color: var(--ink-3);
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ── Layout ────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(64px, 9vw, 116px);
}

.section--tint {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

/* A hero already carries generous bottom padding; stacking a full section pad on
   top of it opens a gap that reads as a missing element rather than as rhythm. */
.hero + .section,
.marquee + .section {
  padding-top: clamp(28px, 3.6vw, 52px);
}

.section--dark {
  background: var(--surface-deep);
  color: rgb(247 247 248 / 0.72);
}

.section--dark h2,
.section--dark h3 {
  color: var(--ink-invert);
}

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.section-head h2 {
  margin-block: 12px 14px;
}

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Dark gray, not gold. The primary button appears on every page and in the
   sticky header, so making it the accent colour meant gold was on screen
   permanently — which is exactly how an accent stops reading as one. */
.btn--primary {
  background: var(--ink);
  color: var(--ink-invert);
}
.btn--primary:hover {
  background: var(--ink-2);
}

/* On the dark panels the same button has to invert, or it disappears into the
   background it sits on. */
.section--dark .btn--primary,
.cta .btn--primary {
  background: var(--ink-invert);
  color: var(--ink);
}
.section--dark .btn--primary:hover,
.cta .btn--primary:hover {
  background: var(--bg);
}

.btn--ghost {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--surface-alt);
}

.btn--onDark {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.16);
  color: var(--ink-invert);
}
.btn--onDark:hover {
  background: rgb(255 255 255 / 0.12);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--gold-ink);
}
.link-arrow svg {
  transition: transform 0.16s var(--ease);
}
.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand img {
  height: 22px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-inline-start: auto;
}

.nav a {
  font-size: 0.9375rem;
  color: var(--ink-3);
  transition: color 0.15s var(--ease);
}
.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--ink);
}
.nav a[aria-current='page'] {
  font-weight: 600;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  margin-inline-start: auto;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 880px) {
  .nav,
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .site-header[data-open='true'] .nav {
    display: flex;
    position: absolute;
    inset-inline: 0;
    top: 62px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 24px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    margin: 0;
  }
  .site-header[data-open='true'] .nav a {
    padding-block: 8px;
    font-size: 1rem;
  }
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(64px, 10vw, 120px) clamp(48px, 7vw, 84px);
  overflow: hidden;
}

/* A faint dotted field, masked to fade out — the same motif as the product
   diagrams, so the site and the app feel like one system. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 5%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.hero h1 {
  margin-block: 18px 0;
  max-width: 17ch;
}

.hero .lede {
  margin-block: 22px 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 34px;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-meta svg {
  color: var(--gold-ink);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO STAGE — five rotating value statements, each with its own artwork.

   Two columns: a copy deck on the left and a matching scene on the right, both
   switching together. Five claims shown one at a time rather than five stacked
   cards — a single sentence holding for six seconds reads as a position, five
   at once reads as a list of features.

   Both decks stack every panel into one CSS grid cell, so the section is sized
   by its tallest panel and nothing reflows when the panel changes. A rotator
   that changes the page height is the difference between "confident" and
   "cheap", and it is the one thing visitors notice.
   ═══════════════════════════════════════════════════════════════════════════ */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: center;
}

@media (max-width: 940px) {
  .stage {
    grid-template-columns: 1fr;
  }
}

.stage__deck {
  display: grid;
  margin-block: 16px 30px;
}

.stage__slide {
  grid-area: 1 / 1;
}

/* Smaller than a single-statement hero would be: this headline shares its
   column with a sentence, a link, two buttons and five tabs, and at the full
   display size it takes three lines and pushes the rest out of the fold. */
.stage__slide h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.25rem, 4.1vw, 3.25rem);
}

.stage__slide .lede {
  margin-block: 20px 0;
  max-width: 47ch;
}

.stage__slide .link-arrow {
  margin-top: 22px;
}

/* `visibility` rather than `display` so the panel keeps contributing its height
   to the shared grid cell — and so its links leave the tab order while out. */
.stage__slide[data-state='out'],
.scene[data-state='out'] {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s var(--ease),
    visibility 0s 0.4s;
}

.stage__slide[data-state='in'],
.scene[data-state='in'] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s var(--ease);
}

/* The panel's own lines arrive in reading order — heading, then sentence, then
   link — which is what makes the change read as a statement being made rather
   than as a slide sliding. */
.stage__slide[data-state='in'] > * {
  animation: stageIn 0.55s var(--ease) both;
}
.stage__slide[data-state='in'] > *:nth-child(2) {
  animation-delay: 0.07s;
}
.stage__slide[data-state='in'] > *:nth-child(3) {
  animation-delay: 0.14s;
}

@keyframes stageIn {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Stage dots ─────────────────────────────────────────────────────────
   Light gray, the active one in gold. Position only — the panel already says
   what it is, and six labels repeating it competed with the headline.

   Each button carries an `aria-label`; a control with no text content and no
   label is unreachable and unannounced. */

.stage__tabs {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 34px;
}

.stage__tab {
  position: relative;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--border-strong);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

/* A 9px target is unhittable on a phone; the pseudo-element widens the hit
   area to 27px without widening the dot. */
.stage__tab::after {
  content: '';
  position: absolute;
  inset: -9px;
}

.stage__tab:hover {
  background: var(--ink-3);
}

.stage__tab[aria-selected='true'] {
  background: var(--gold);
  transform: scale(1.3);
}

/* ── Stage artwork ─────────────────────────────────────────────────────── */

.stage__art {
  display: grid;
}

.scene {
  grid-area: 1 / 1;
}

.scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Shared vocabulary across all five scenes, so they read as one system seen
   from five angles. Gold means exactly one thing: the machine you own. */
.sv-zone {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.25;
  stroke-dasharray: 5 4;
}
.sv-zone--gold {
  fill: var(--tint);
  stroke: var(--gold);
}
.sv-card {
  fill: var(--bg);
  stroke: var(--border-strong);
  stroke-width: 1.25;
}
.sv-chip {
  fill: var(--surface-alt);
}
.sv-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  fill: var(--ink-3);
}
.sv-label--gold {
  fill: var(--gold-ink);
}
.sv-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  fill: var(--ink);
}
.sv-micro {
  font-family: var(--sans);
  font-size: 10.5px;
  fill: var(--ink-3);
}
.sv-mono {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-3);
}
.sv-line {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.sv-line--gold {
  stroke: var(--gold);
}
.sv-flow {
  stroke-dasharray: 6 8;
  animation: svFlow 1.7s linear infinite;
}
@keyframes svFlow {
  to {
    stroke-dashoffset: -28;
  }
}
.sv-soft {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
}
.sv-line--ink {
  stroke: var(--ink-3);
}
.sv-label--ink {
  fill: var(--ink);
}

.sv-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: svPulse 2.6s var(--ease) infinite;
}
.sv-pulse--b {
  animation-delay: 0.5s;
}
.sv-pulse--c {
  animation-delay: 1s;
}
.sv-pulse--d {
  animation-delay: 1.5s;
}
@keyframes svPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.14);
  }
}

/* A slow drift, so a card of stored data reads as something live rather than
   as a screenshot. Offsets are negative so the group is already mid-cycle on
   load and the three cards never rise together. */
.sv-float {
  animation: svFloat 5.5s ease-in-out infinite;
}
.sv-float--b {
  animation-delay: -1.8s;
}
.sv-float--c {
  animation-delay: -3.4s;
}
@keyframes svFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Sequenced reveal: the steps of a process appearing in order, holding, then
   clearing so the loop reads as one pass rather than as a flicker. */
.sv-step {
  opacity: 0;
  animation: svStep 6s var(--ease) infinite;
}
.sv-step--1 {
  animation-delay: 0.1s;
}
.sv-step--2 {
  animation-delay: 1s;
}
.sv-step--3 {
  animation-delay: 1.9s;
}
.sv-step--4 {
  animation-delay: 2.8s;
}
.sv-step--5 {
  animation-delay: 3.7s;
}
@keyframes svStep {
  0% {
    opacity: 0;
  }
  6%,
  74% {
    opacity: 1;
  }
  86%,
  100% {
    opacity: 0;
  }
}

/* A bar filling — confidence rising, a set being reranked. */
.sv-grow {
  transform-box: fill-box;
  transform-origin: left center;
  animation: svGrow 6s var(--ease) infinite;
}
@keyframes svGrow {
  0% {
    transform: scaleX(0);
  }
  26%,
  74% {
    transform: scaleX(1);
  }
  88%,
  100% {
    transform: scaleX(0);
  }
}

/* Two halves of a hybrid key under the same attack: the classical bar collapses,
   the lattice bar holds. They share a duration so the contrast is the point. */
.sv-shrink {
  transform-box: fill-box;
  transform-origin: left center;
  animation: svShrink 5.2s var(--ease) infinite;
}
.sv-shrink--b {
  animation-delay: 0.25s;
}
@keyframes svShrink {
  0%,
  16% {
    transform: scaleX(1);
  }
  52%,
  84% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.sv-hold {
  transform-box: fill-box;
  transform-origin: left center;
  animation: svHold 5.2s var(--ease) infinite;
}
.sv-hold--b {
  animation-delay: 0.25s;
}
@keyframes svHold {
  0%,
  100% {
    opacity: 0.6;
  }
  52% {
    opacity: 1;
  }
}

/* A slow rotation, for something grinding away at a problem. */
.sv-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: svSpin 14s linear infinite;
}
@keyframes svSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Concentric rings leaving a point: something radiating outward. */
.sv-ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: svRipple 3s ease-out infinite;
}
.sv-ripple--b {
  animation-delay: 1s;
}
.sv-ripple--c {
  animation-delay: 2s;
}
@keyframes svRipple {
  0% {
    opacity: 0.5;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

/* ── Split section: copy beside a diagram ───────────────────────────────
   The diagram column carries no card of its own. A bordered box around a
   drawing that already has its own boundaries reads as a frame around a
   frame, and it competes with the dashed zone that means something. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: clamp(30px, 4.5vw, 60px);
  align-items: center;
}

.split h2 {
  margin-block: 14px 16px;
}

/* Diagram first in the source order for the reversed layout, so the reading
   order on a phone is still copy-then-picture. */
.split--rev .split__art {
  order: -1;
}

@media (max-width: 940px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split--rev .split__art {
    order: 0;
  }
}

.split__art svg {
  width: 100%;
  height: auto;
}

/* ── Checked list ───────────────────────────────────────────────────────── */

.list-check {
  list-style: none;
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
}

.list-check li {
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 12px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.list-check svg {
  margin-top: 6px;
  color: var(--gold-ink);
  flex-shrink: 0;
}

.list-check strong {
  color: var(--ink);
  font-weight: 600;
}

.section--dark .list-check strong {
  color: var(--ink-invert);
}
.section--dark .list-check svg {
  color: var(--gold);
}

/* ── Status marker ──────────────────────────────────────────────────────
   For a capability that is real work in progress but is not running yet.

   The dashed border is the whole point: solid borders elsewhere on the page
   mean shipped, and a reader scanning for what they can rely on needs the
   difference visible before they read a word. Remove the element entirely when
   the capability lands — do not leave it saying something softer. */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  vertical-align: middle;
}

.status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}

.section--dark .status {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.22);
  color: rgb(247 247 248 / 0.6);
}
.section--dark .status::before {
  background: rgb(247 247 248 / 0.6);
}

/* ── Pills ──────────────────────────────────────────────────────────────── */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.pill svg {
  color: var(--gold-ink);
  flex-shrink: 0;
}

.section--dark .pill {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.13);
  color: rgb(247 247 248 / 0.72);
}
.section--dark .pill svg {
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEMORY BANNER — the animated value line.

   Reads as a memory being recalled: a fixed stem ("Chordian remembers") and a
   rotating clause that slides up and out. Deliberately one word-group at a
   time — a carousel of five claims at once reads as noise, a single claim
   holding for three seconds reads as a statement.
   ═══════════════════════════════════════════════════════════════════════════ */

.memory-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  font-size: clamp(1.25rem, 2.6vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ink);
  line-height: 1.3;
}

.memory-line__stem {
  color: var(--ink-3);
  font-weight: 500;
}

.memory-line__slot {
  position: relative;
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
  vertical-align: bottom;
}

.memory-line__item {
  display: block;
  white-space: nowrap;
  color: var(--gold-ink);
  opacity: 0;
  transform: translateY(0.55em);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease);
}

/* Only the active clause occupies the flow; the rest are stacked underneath so
   the slot width animates to the phrase rather than to the longest one. */
.memory-line__item[data-state='out'] {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  opacity: 0;
  transform: translateY(-0.55em);
}

.memory-line__item[data-state='in'] {
  opacity: 1;
  transform: translateY(0);
}

.memory-line__caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--gold);
  translate: 0 0.08em;
  animation: caret 1.1s steps(1) infinite;
}

@keyframes caret {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* ── Value marquee ─────────────────────────────────────────────────────── */

.marquee {
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding-block: 14px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: marquee 42s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-inline: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  white-space: nowrap;
}

.marquee__item::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  padding: 24px;
  transition:
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9375rem;
  color: var(--ink-3);
}

a.card:hover,
.card--hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--tint);
  color: var(--gold-ink);
  margin-bottom: 16px;
}

.card--dark {
  background: rgb(255 255 255 / 0.03);
  border-color: rgb(255 255 255 / 0.1);
}
.card--dark p {
  color: rgb(247 247 248 / 0.6);
}

/* ── Value block (numbered, for the values page) ───────────────────────── */

.value {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  padding-block: 30px;
  border-top: 1px solid var(--border);
}

.value:first-of-type {
  border-top: 0;
}

.value__num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-ink);
  padding-top: 5px;
  letter-spacing: 0.06em;
}

.value h3 {
  margin-bottom: 8px;
}

.value p {
  max-width: var(--prose);
  font-size: 0.9375rem;
}

.value p + p {
  margin-top: 10px;
}

@media (max-width: 620px) {
  .value {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── Pills, stats, tables ──────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pill--live {
  background: var(--ok-tint);
  border-color: color-mix(in oklab, var(--ok) 32%, transparent);
  color: var(--ok);
}

.pill--gold {
  background: var(--tint);
  border-color: color-mix(in oklab, var(--gold) 45%, transparent);
  color: var(--gold-ink);
}

.stat {
  border-inline-start: 2px solid var(--gold);
  padding-inline-start: 16px;
}
.stat b {
  display: block;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat span {
  font-size: 0.875rem;
  color: var(--ink-3);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 620px;
}

thead {
  background: var(--surface-alt);
}

th,
td {
  text-align: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong {
  color: var(--ink);
}

/* ── Code sample ───────────────────────────────────────────────────────── */

.code {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.code__bar {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--ink-3);
  font-family: var(--mono);
}

.code pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.code .k {
  color: var(--gold-ink);
}
.code .s {
  color: var(--ok);
}
.code .c {
  color: var(--ink-3);
}

/* ── Diagram ───────────────────────────────────────────────────────────── */

.diagram {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 14px;
  max-width: 460px;
}

.diagram svg {
  width: 100%;
  height: auto;
}

.diagram-label {
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.diagram-caption {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
}
.diagram-micro {
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
}

.flow {
  animation: dash 1.4s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -28;
  }
}

/* ── CTA ───────────────────────────────────────────────────────────────── */

.cta {
  border-radius: var(--r-lg);
  background: var(--surface-deep);
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
}

.cta h2 {
  color: var(--ink-invert);
  max-width: 20ch;
  margin-inline: auto;
}

.cta p {
  color: rgb(247 247 248 / 0.66);
  max-width: 52ch;
  margin: 14px auto 28px;
}

.cta .hero-actions {
  justify-content: center;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 52px 32px;
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-grid h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-grid ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-grid a {
  color: var(--ink-3);
}
.footer-grid a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* ── Scroll reveal ─────────────────────────────────────────────────────── */

/* Scoped to `.js`, which an inline script sets on <html>. Without it the
   content is simply visible — a reveal animation must never be load-bearing. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ── Reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* With the rotator frozen, show the first clause rather than nothing. */
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .memory-line__item {
    opacity: 1;
    transform: none;
  }
  .memory-line__item[data-state='out'] {
    display: none;
  }

  /* These animate from opacity 0 or scale 0. Frozen at 0.01ms they land on
     whatever frame the delay puts them on, and the sequenced ones are only
     visible for part of their cycle — so pin them open rather than trusting
     where they stop. Half a diagram is worse than a still one. */
  .sv-step,
  .sv-ripple {
    opacity: 1;
  }
  .sv-grow,
  .sv-shrink {
    transform: scaleX(1);
  }
  .sv-hold {
    opacity: 1;
  }
  .sv-pulse {
    opacity: 1;
    transform: none;
  }
}
