/*
 * chesscanvas.app — the public site (WEB-1).
 *
 * Midnight's tokens, copied by value from src/styles/themes.css and
 * tokens.css: this site ships none of the application, so it cannot import
 * them. Brass is the primary action and the emphasis, used sparingly; the
 * muted board green marks what works in ChessCanvas today.
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/fonts/source-serif-4.woff2') format('woff2-variations');
}

:root {
  --background: #131416;
  --canvas-deep: #0d0e10;
  --surface: #1a1b1e;
  --surface-raised: #222327;
  --surface-interactive: #2b2c31;
  --surface-interactive-hover: #33353a;
  --text-primary: #ecebe7;
  --text-secondary: #b0aea8;
  --text-muted: #979590;
  --text-on-accent: #17140e;
  --accent: #c9a66b;
  --accent-hover: #d6b67e;
  --accent-subtle: rgb(201 166 107 / 0.14);
  --accent-line: rgb(201 166 107 / 0.42);
  --green: #8fa892;
  --green-subtle: rgb(143 168 146 / 0.14);
  --border-subtle: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.16);
  --focus-ring: #e2c48f;
  --shadow-3: 0 16px 48px rgb(0 0 0 / 0.5);
  --shadow-hero: 0 40px 120px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06);

  --font-ui: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Source Serif 4 Variable', 'Source Serif 4', Georgia, serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --section: clamp(72px, 10vw, 136px);
  --gutter: clamp(16px, 3.5vw, 32px);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
figure,
ol,
ul,
dl,
dd {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.wrap--narrow {
  max-width: calc(760px + 2 * var(--gutter));
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
}
.skip:focus {
  top: var(--space-4);
}

/* ── Type ─────────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-size: clamp(2.5rem, 1.3rem + 5vw, 5rem);
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.875rem, 1.3rem + 2.2vw, 3rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

.lede {
  max-width: 40rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.muted {
  color: var(--text-muted);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--border-subtle);
}

.section__head {
  display: grid;
  gap: var(--space-4);
  max-width: 46rem;
  margin-bottom: clamp(var(--space-7), 6vw, 80px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.prose {
  max-width: 44rem;
  color: var(--text-secondary);
}
.prose p + p,
.prose p + ul,
.prose ul + p,
.prose ol + p,
.prose p + ol {
  margin-top: var(--space-4);
}
.prose h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}
.prose h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}
.prose ul,
.prose ol {
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-2);
}
.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}
.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* ── Wordmark ─────────────────────────────────────────────────────────── */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.wordmark__logo {
  flex: none;
  width: 32px;
  height: 32px;
}

.wordmark__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(19 20 22 / 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: env(safe-area-inset-top);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 64px;
}

.top__nav {
  display: none;
  gap: var(--space-1);
  margin-left: var(--space-5);
}

.top__nav a,
.top__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color 120ms ease;
}
.top__nav a:hover,
.top__link:hover,
.top__nav a[aria-current='page'] {
  color: var(--text-primary);
}

.top__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

@media (min-width: 960px) {
  .top__nav {
    display: flex;
  }
}

@media (max-width: 419.98px) {
  .top__link {
    display: none;
  }
  .wordmark__name {
    font-size: 1.125rem;
  }
}

@media (max-width: 359.98px) {
  .top__inner {
    gap: var(--space-3);
  }
  .top__actions .button--small {
    padding: 0 var(--space-3);
  }
  .wordmark__logo {
    width: 28px;
    height: 28px;
  }
}

/* ── Buttons and links ────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.button--primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.button--primary:hover {
  background: var(--accent-hover);
}

.button--quiet {
  background: var(--surface-interactive);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.button--quiet:hover {
  background: var(--surface-interactive-hover);
  border-color: var(--border-strong);
}

.button--small {
  min-height: 40px;
  padding: 0 var(--space-4);
  font-size: 0.9375rem;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.textlink::after {
  content: '→';
  transition: transform 140ms ease;
}
.textlink:hover::after {
  transform: translateX(3px);
}

@media (max-width: 479.98px) {
  .actions .button {
    flex: 1 1 100%;
  }
}

.microcopy {
  margin-top: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 38rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-top: clamp(56px, 8vw, 112px);
  padding-bottom: clamp(56px, 7vw, 96px);
  background:
    radial-gradient(60% 50% at 50% 0%, rgb(201 166 107 / 0.09) 0%, transparent 70%),
    radial-gradient(120% 60% at 50% 100%, var(--canvas-deep) 0%, transparent 70%), var(--background);
  overflow: hidden;
}

.hero__copy {
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero__copy .eyebrow {
  margin-bottom: var(--space-5);
}

.hero__copy .lede {
  margin-top: var(--space-5);
}

.hero__copy .actions {
  justify-content: center;
}

.hero__shot {
  margin-top: clamp(var(--space-7), 6vw, 88px);
}

.hero__shot .shot__frame {
  box-shadow: var(--shadow-hero);
}

/* Subpage hero: left aligned, smaller. */
.hero--page {
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 88px);
}
.hero--page .display {
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  max-width: 18ch;
}
.hero--page .lede {
  margin-top: var(--space-5);
}
.hero--page .eyebrow {
  margin-bottom: var(--space-4);
}

/* ── Screenshots ──────────────────────────────────────────────────────── */

.shot__frame {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--canvas-deep);
  box-shadow:
    var(--shadow-3),
    0 0 0 6px rgb(255 255 255 / 0.02);
  overflow: hidden;
}

.shot__frame img {
  width: 100%;
}

.shot figcaption {
  margin-top: var(--space-3);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  text-wrap: balance;
}

.shot--phone {
  max-width: 270px;
  margin-inline: auto;
}
.shot--phone .shot__frame {
  border-radius: 28px;
  border-width: 6px;
  border-color: #2a2b2f;
}

/* ── Facts strip ──────────────────────────────────────────────────────── */

.facts {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(var(--space-7), 5vw, 72px);
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.facts li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  background: var(--background);
}

.facts strong {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
}

.facts span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Problem: scattered vs connected ─────────────────────────────────── */

.problem__grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.problem__copy p + p {
  margin-top: var(--space-4);
}
.problem__copy p {
  color: var(--text-secondary);
  max-width: 34rem;
}
.problem__copy .h2 {
  margin-bottom: var(--space-5);
}

.contrast {
  display: grid;
  gap: var(--space-4);
}

.contrast__panel {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.contrast__panel h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.contrast__panel--connected {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-subtle), transparent 80%), var(--surface);
}
.contrast__panel--connected h3 {
  color: var(--accent);
}

.scatter {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.scatter li {
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.scatter li:nth-child(2) {
  transform: translateY(6px) rotate(-1.5deg);
}
.scatter li:nth-child(4) {
  transform: translateY(-4px) rotate(1.5deg);
}

.joined {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.joined li {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  font-size: 0.875rem;
  color: var(--text-primary);
}
.joined li + li::before {
  content: '';
}
.joined__link {
  color: var(--accent);
  font-size: 0.875rem;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
}

@media (min-width: 960px) {
  .problem__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-9);
  }
}

/* ── The seven stages ────────────────────────────────────────────────── */

.stages {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: stage;
  position: relative;
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: var(--space-4);
  padding-bottom: var(--space-6);
}

/* The line that joins the stages: vertical on phones. */
.stage::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent-line), var(--border-subtle));
}
.stage:last-child::before {
  display: none;
}

.stage__n {
  grid-row: span 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--background);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.stage__name {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 10px;
}

.stage__body {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.stage__how {
  margin-top: var(--space-3);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  margin-top: var(--space-3);
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  justify-self: start;
}
.tag--live {
  background: var(--green-subtle);
  color: var(--green);
}
.tag--you {
  background: var(--accent-subtle);
  color: var(--accent);
}
.tag--manual {
  background: var(--surface-interactive);
  color: var(--text-secondary);
}

.stages__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-6);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.stages__legend .tag {
  margin: 0 var(--space-2) 0 0;
}

@media (min-width: 1100px) {
  .stages {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--space-4);
  }
  .stage {
    grid-template-columns: 1fr;
    align-content: start;
    padding-bottom: 0;
  }
  .stage__n {
    grid-row: auto;
  }
  /* Horizontal on wide screens. */
  .stage::before {
    left: 52px;
    right: calc(-1 * var(--space-4));
    top: 21px;
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-line), var(--border-subtle));
  }
  .stage__name {
    margin-top: var(--space-4);
  }
}

/* ── Use cases ────────────────────────────────────────────────────────── */

.cases {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.case {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}
.case:hover,
.case:focus-within {
  border-color: var(--accent-line);
}
@media (prefers-reduced-motion: no-preference) {
  .case:hover {
    transform: translateY(-2px);
  }
}

.case__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--canvas-deep);
  border-bottom: 1px solid var(--border-subtle);
}
.case__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.case__body {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
}

.case__who {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.case__body p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.case__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin-top: auto;
  padding-top: var(--space-2);
}
.case__links .textlink--quiet {
  color: var(--text-secondary);
}

@media (min-width: 720px) {
  .cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .cases {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .case--wide {
    grid-column: span 2;
  }
  .case--wide .case__media {
    aspect-ratio: 16 / 7.6;
  }
}

/* ── Features: alternating rows with real screenshots ────────────────── */

.feature-rows {
  display: grid;
  gap: clamp(var(--space-8), 8vw, 120px);
}

.feature-row {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.feature-row__copy {
  display: grid;
  gap: var(--space-4);
  align-content: center;
}
.feature-row__copy p {
  color: var(--text-secondary);
  max-width: 32rem;
}

.checks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.checks li {
  position: relative;
  padding-left: 1.5rem;
}
.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg) scale(0.8);
}

@media (min-width: 960px) {
  .feature-row {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-8);
  }
  .feature-row--flip {
    grid-template-columns: 7fr 5fr;
  }
  .feature-row--flip .feature-row__copy {
    order: 2;
  }
}

/* ── Audiences ────────────────────────────────────────────────────────── */

.audiences {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.audiences li {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: var(--space-6) var(--space-5);
  background: var(--background);
}
.audiences p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

@media (min-width: 720px) {
  .audiences {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .audiences {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Trust ────────────────────────────────────────────────────────────── */

.trust {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-5) var(--space-7);
}
.trust li {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-strong);
}
.trust p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.ack {
  margin-top: var(--space-7);
  max-width: 46rem;
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent-line);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

@media (min-width: 720px) {
  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .trust {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq {
  max-width: 52rem;
  border-top: 1px solid var(--border-subtle);
}

.faq details {
  border-bottom: 1px solid var(--border-subtle);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-height: 64px;
  padding-block: var(--space-4);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  flex: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform 160ms ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding-bottom: var(--space-5);
  max-width: 44rem;
  color: var(--text-secondary);
}
.faq__answer p + p {
  margin-top: var(--space-3);
}
.faq__answer a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* ── Final call to action ─────────────────────────────────────────────── */

.final {
  padding-block: var(--section);
  border-top: 1px solid var(--border-subtle);
  background:
    radial-gradient(70% 80% at 50% 100%, rgb(201 166 107 / 0.1) 0%, transparent 70%),
    var(--background);
  text-align: center;
}
.final .wrap {
  display: grid;
  justify-items: center;
}
.final .lede {
  margin-top: var(--space-5);
}
.final .actions {
  justify-content: center;
}

/* ── Subpages ─────────────────────────────────────────────────────────── */

.crumbs ol {
  list-style: none;
  padding: var(--space-4) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.crumbs li + li::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--border-strong);
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--text-primary);
}

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--space-7);
}
.steps > li {
  counter-increment: step;
  display: grid;
  gap: var(--space-4);
}
.steps__title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.steps__title::before {
  content: counter(step, decimal-leading-zero);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.split {
  display: grid;
  gap: var(--space-7);
}
@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.related {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}
.related a {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease;
}
.related a:hover {
  border-color: var(--accent-line);
}
.related span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
@media (min-width: 720px) {
  .related {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.note {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.note strong {
  color: var(--text-primary);
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--border-subtle);
  background: var(--canvas-deep);
  padding-block: var(--space-8) max(var(--space-6), env(safe-area-inset-bottom));
  font-size: 0.9375rem;
}

.foot__top {
  display: grid;
  gap: var(--space-7);
}

.foot__brand p {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  color: var(--text-secondary);
}

.foot__group h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.foot__group ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}
.foot__group a {
  display: inline-block;
  padding-block: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.foot__group a:hover {
  color: var(--text-primary);
}

.foot__legal {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.foot__legal a {
  color: var(--text-secondary);
  text-underline-offset: 2px;
}
.foot__ack {
  max-width: 52rem;
}

@media (min-width: 720px) {
  .foot__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .foot__top {
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  }
}

/* ── 404 ──────────────────────────────────────────────────────────────── */

.notfound {
  min-height: 70vh;
}
.notfound .lede {
  margin-top: var(--space-4);
  max-width: 34rem;
}
.notfound__grid {
  display: grid;
  gap: var(--space-6, 40px);
  align-items: center;
}
.notfound__art {
  width: min(100%, 520px);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 24px 48px rgb(0 0 0 / 0.35));
}
.notfound__more {
  margin-top: var(--space-5, 24px);
  color: var(--text-muted);
}
.notfound__more a {
  color: var(--accent);
}
@media (min-width: 900px) {
  .notfound__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  }
}

/* ── Motion: gentle, and none at all when the reader asks for none ───── */

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * {
    animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero__copy > :nth-child(2) {
    animation-delay: 60ms;
  }
  .hero__copy > :nth-child(3) {
    animation-delay: 120ms;
  }
  .hero__copy > :nth-child(n + 4) {
    animation-delay: 180ms;
  }
  .hero__shot {
    animation: rise 900ms 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  /* Revealed by app.js as sections scroll into view; visible without it. */
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 600ms ease,
      transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Spacing helpers (no inline styles: the site's CSP forbids them) ──── */

.gap-below {
  margin-bottom: var(--space-6);
}
.gap-above {
  margin-top: var(--space-6);
}
.gap-above-sm {
  margin-top: var(--space-4);
}
.ack--flush {
  margin-top: 0;
}

/* The seven stages, said in one line under the heading. */
.flowline {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 2;
}
.flowline span {
  color: var(--accent);
  margin-inline: 0.35em;
}

/* A subpage's lead screenshot sits right under its hero. */
.hero--page + .section {
  border-top: 0;
  padding-top: 0;
}

/* Headings inside two-column prose are a step smaller. */
.split .h2,
.wrap--narrow.prose .h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

/* ── Legal pages (L-20) ──────────────────────────────────────────────── */

.legal__wrap {
  max-width: 52rem;
}
.legal__head .lede {
  margin-top: var(--space-4);
}
.legal__meta {
  margin-top: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.legal__draft {
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.legal__body {
  max-width: 52rem;
  padding-bottom: var(--section);
}
.legal__toc {
  margin-bottom: var(--space-7);
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.prose .legal__toc-title {
  margin-top: 0;
}
.legal__toc-title {
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.prose .legal__toc ol {
  padding-left: 0;
  list-style: none;
  columns: 2 16rem;
  column-gap: var(--space-6);
  display: block;
}
.legal__toc li {
  break-inside: avoid;
  margin-bottom: var(--space-1);
}
.legal__section {
  scroll-margin-top: 96px;
}
.legal__section + .legal__section {
  margin-top: var(--space-7);
}
.legal__section h2 {
  margin-top: 0;
}
.legal__table {
  margin-block: var(--space-4);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.legal__table table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.legal__table th,
.legal__table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}
.legal__table th {
  color: var(--text-primary);
  background: var(--surface);
  font-weight: 600;
}
.legal__table tr:last-child td {
  border-bottom: 0;
}
.legal-open {
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  background: rgb(201 166 107 / 0.28);
  color: var(--text-primary);
}
.legal-open[data-open='counsel'] {
  background: rgb(143 168 146 / 0.3);
}

.foot__links a,
.foot__choices {
  color: var(--text-secondary);
}
.foot__choices {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ── Privacy choices banner (L-20) ──────────────────────────────────── */

.consent {
  position: fixed;
  inset: auto var(--gutter) var(--gutter) var(--gutter);
  z-index: 50;
  display: flex;
  justify-content: center;
}
.consent__inner {
  max-width: 44rem;
  padding: var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
}
.consent__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
}
.consent__text,
.consent__current {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.consent__text a {
  color: var(--accent);
}
.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.consent__button {
  flex: 1 1 10rem;
}
