/* ============================================================================
   DinnerDate — public site design system
   dinnerdate.pipchat.in

   No build step, no web fonts, no third-party anything. The CSP on the public
   pages is `style-src 'self'` with no 'unsafe-inline', so there are deliberately
   NO inline style attributes and no <style> blocks anywhere on this site — every
   visual decision lives in this file. Staggered animations use :nth-child rather
   than a --delay custom property set per element, for the same reason.

   Palette is lifted from the app (frontend/src/theme/palette.js) so the web and
   the product read as one brand: flame #F65E3B on warm near-black / warm off-white.
   ========================================================================= */

/* ---------------------------------------------------------------- tokens -- */

:root {
  color-scheme: light dark;

  --flame-50: #fff3ee;
  --flame-100: #ffe4d9;
  --flame-200: #ffc9b3;
  --flame-300: #ffa585;
  --flame-400: #ff7f57;
  --flame-500: #f65e3b;
  --flame-600: #e04a28;
  --flame-700: #b93a1f;
  --gold: #e8b54d;
  --teal: #2e9e8f;
  --rose: #c4426b;

  /* Light is the default so a no-JS, no-preference visitor gets the warm paper
     look the brand is built around. Dark is applied below, twice: once for the
     system preference and once for the explicit toggle. */
  --bg: #fbf8f5;
  --bg-sunk: #f4eee7;
  --surface: #ffffff;
  --surface-2: #fffdfb;
  --border: #eae2da;
  --border-strong: #ded2c6;
  --text: #221b14;
  --text-2: #5f554a;
  --muted: #94897c;
  --accent: var(--flame-500);
  --accent-hover: var(--flame-600);
  --accent-soft: var(--flame-50);
  --accent-line: var(--flame-100);
  --on-accent: #ffffff;
  --code-bg: #f4ece6;

  --shadow-sm: 0 1px 2px rgba(34, 27, 20, .05), 0 1px 3px rgba(34, 27, 20, .04);
  --shadow-md: 0 4px 6px -1px rgba(34, 27, 20, .06), 0 12px 24px -8px rgba(34, 27, 20, .10);
  --shadow-lg: 0 18px 48px -14px rgba(120, 42, 27, .22), 0 4px 12px rgba(34, 27, 20, .05);
  --ring: 0 0 0 3px rgba(246, 94, 59, .28);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
    Roboto, Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;

  --container: 1140px;
  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 40px);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 68px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d0b;
    --bg-sunk: #0a0908;
    --surface: #1a1613;
    --surface-2: #201b17;
    --border: #302823;
    --border-strong: #423830;
    --text: #f5efe9;
    --text-2: #b8ac9f;
    --muted: #7d7265;
    --accent: var(--flame-400);
    --accent-hover: var(--flame-300);
    --accent-soft: rgba(255, 127, 87, .10);
    --accent-line: rgba(255, 127, 87, .22);
    --on-accent: #1a0d07;
    --code-bg: #241d18;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, .45), 0 16px 32px -12px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .75), 0 4px 14px rgba(0, 0, 0, .4);
    --ring: 0 0 0 3px rgba(255, 127, 87, .34);
  }
}

:root[data-theme="dark"] {
  --bg: #0f0d0b;
  --bg-sunk: #0a0908;
  --surface: #1a1613;
  --surface-2: #201b17;
  --border: #302823;
  --border-strong: #423830;
  --text: #f5efe9;
  --text-2: #b8ac9f;
  --muted: #7d7265;
  --accent: var(--flame-400);
  --accent-hover: var(--flame-300);
  --accent-soft: rgba(255, 127, 87, .10);
  --accent-line: rgba(255, 127, 87, .22);
  --on-accent: #1a0d07;
  --code-bg: #241d18;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, .45), 0 16px 32px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .75), 0 4px 14px rgba(0, 0, 0, .4);
  --ring: 0 0 0 3px rgba(255, 127, 87, .34);
}

/* ------------------------------------------------------------------ base -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

::selection { background: var(--flame-200); color: #221b14; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-weight: 650;
}
.skip-link:focus { left: 12px; color: var(--on-accent); }

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

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

/* ------------------------------------------------------------ typography -- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.12;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -.032em;
}
.title-xl { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.2rem); line-height: 1.08; }
.title-lg { font-size: clamp(1.65rem, 1.15rem + 2vw, 2.4rem); }
.title-md { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.55rem); }

.ink-gradient {
  background: linear-gradient(104deg, var(--flame-500) 0%, var(--flame-400) 42%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* The serif's descenders get clipped by background-clip on some engines. */
  padding-bottom: .06em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.lede {
  font-size: clamp(1.06rem, 1rem + .45vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-2);
  max-width: 56ch;
  margin: 22px 0 0;
  text-wrap: pretty;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: .96rem;
  font-weight: 650;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--flame-500), var(--flame-600));
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(224, 74, 40, .65);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 14px 30px -10px rgba(224, 74, 40, .75);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn-quiet { background: transparent; color: var(--text-2); padding-inline: 14px; }
.btn-quiet:hover { color: var(--accent); }

.btn-lg { padding: 16px 32px; font-size: 1.02rem; }
.btn[aria-disabled="true"] { cursor: default; opacity: .95; }
.btn[aria-disabled="true"]:hover { transform: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 34px;
}

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 93%, transparent);
}
.site-header > .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--flame-400), var(--flame-600));
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px -3px rgba(224, 74, 40, .7);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 400; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: .93rem;
  font-weight: 550;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.icon-btn svg { width: 18px; height: 18px; }

/* Which glyph the theme button shows is decided in CSS, not JS — the button holds
   both and the active theme reveals one. Keeps the toggle from flashing the wrong
   icon before the script runs. */
.icon-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .icon-moon { display: block; }
}
:root[data-theme="dark"] .icon-btn .icon-sun { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px var(--gutter) 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav[data-open="true"] { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 13px 12px; font-size: 1rem; border-radius: var(--radius-sm); }
}

/* ------------------------------------------------------------------ hero -- */

.hero {
  position: relative;
  padding: clamp(64px, 9vw, 128px) 0 clamp(56px, 8vw, 104px);
  overflow: hidden;
  isolation: isolate;
}

/* Candlelight: a warm radial bloom behind the headline, plus a fine grain so the
   large flat areas don't band on wide screens. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: -32%;
  left: 50%;
  width: min(1500px, 155vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 42%, rgba(246, 94, 59, .20), transparent 46%),
    radial-gradient(circle at 22% 28%, rgba(232, 181, 77, .16), transparent 40%),
    radial-gradient(circle at 78% 62%, rgba(196, 66, 107, .12), transparent 44%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before {
    background:
      radial-gradient(circle at 50% 42%, rgba(255, 127, 87, .22), transparent 46%),
      radial-gradient(circle at 22% 28%, rgba(232, 181, 77, .13), transparent 40%),
      radial-gradient(circle at 78% 62%, rgba(196, 66, 107, .14), transparent 44%);
  }
  :root:not([data-theme="light"]) .hero::after { opacity: .32; mix-blend-mode: overlay; }
}
:root[data-theme="dark"] .hero::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 127, 87, .22), transparent 46%),
    radial-gradient(circle at 22% 28%, rgba(232, 181, 77, .13), transparent 40%),
    radial-gradient(circle at 78% 62%, rgba(196, 66, 107, .14), transparent 44%);
}
:root[data-theme="dark"] .hero::after { opacity: .32; mix-blend-mode: overlay; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(36px, 5vw, 76px);
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-art { order: -1; max-width: 440px; margin-inline: auto; }
}

.hero h1 .line { display: block; }
.hero .lede { max-width: 48ch; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .82rem;
  font-weight: 550;
  color: var(--text-2);
  margin-bottom: 26px;
}
.pill b {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero-note {
  margin-top: 20px;
  font-size: .86rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-note svg { width: 15px; height: 15px; flex: none; color: var(--accent); }

/* The hero illustration is a single inline SVG: a table laid for two. Inline so it
   inherits theme tokens via currentColor and costs no extra request. */
.hero-art {
  position: relative;
  filter: drop-shadow(0 30px 60px rgba(120, 42, 27, .18));
}
.hero-art svg { width: 100%; height: auto; }

/* The illustration's colours come from the theme tokens rather than from fill/stroke
   attributes, so it reads correctly in both themes — and because the CSP forbids
   inline style attributes, classes are the only way to reach it at all. */
.hero-art .orb { fill: var(--accent-soft); }
.hero-art .chair { fill: none; stroke: var(--border-strong); stroke-width: 2.4; }
.hero-art .table-top { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2.2; }
.hero-art .table-edge { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: .5; }
.hero-art .table-leg { fill: none; stroke: var(--border-strong); stroke-width: 2.4; }
.hero-art .plate { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; }
.hero-art .plate-inner { fill: none; stroke: var(--accent-line); stroke-width: 1.6; }
.hero-art .cutlery { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hero-art .glass { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-linejoin: round; }
.hero-art .glass-fill { fill: var(--accent); opacity: .22; }
.hero-art .candle { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; }
.hero-art .wick { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.hero-art .halo { fill: var(--gold); opacity: .16; }

.hero-art .flicker { transform-origin: 50% 100%; animation: flicker 3.6s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: 1; transform: scale(1) }
  38% { opacity: .82; transform: scale(.94) translateY(1px) }
  61% { opacity: .96; transform: scale(1.03) }
}

/* -------------------------------------------------------------- sections -- */

.section { padding: clamp(58px, 8vw, 104px) 0; }
/* For a section that directly follows .doc-header, which already carries its own
   bottom padding and a rule — the full section lead-in doubles up as a dead band. */
.section-tight { padding-top: clamp(34px, 4vw, 52px); }
.section-sunk { background: var(--bg-sunk); border-block: 1px solid var(--border); }

.section-head { max-width: 62ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .lede { margin-inline: auto; }
.section-head .lede { margin-top: 18px; }

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

/* ----------------------------------------------------------------- cards -- */

/* 240px, not 280px: the four-card sections (safety, policies) only fit on one row at
   the 1140px container if each track can go to 240 — at 280 the fourth card wraps and
   leaves an orphan. */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 22px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.card {
  position: relative;
  padding: clamp(22px, 2.4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card h3 { font-size: 1.18rem; margin-bottom: 9px; letter-spacing: -.012em; }
.card p { margin: 0; color: var(--text-2); font-size: .965rem; line-height: 1.58; }
.card p + p { margin-top: 10px; }

a.card { color: inherit; display: block; }
a.card:hover,
.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.card-icon svg { width: 21px; height: 21px; }

/* ----------------------------------------------------------------- steps -- */

.steps {
  counter-reset: step;
  display: grid;
  gap: clamp(18px, 2.2vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 58px;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  color: transparent;
  background: linear-gradient(140deg, var(--flame-500), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
}
.steps li::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 62px;
  right: -14px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
}
.steps li:last-child::after { display: none; }
@media (max-width: 700px) { .steps li::after { display: none; } }
.steps h3 { font-size: 1.14rem; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--text-2); font-size: .95rem; }

/* -------------------------------------------------------------- features -- */

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(24px, 3vw, 44px);
}
.feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  margin-bottom: 10px;
}
.feature h3 svg { width: 19px; height: 19px; color: var(--accent); flex: none; }
.feature p { margin: 0; color: var(--text-2); font-size: .95rem; line-height: 1.6; }

/* --------------------------------------------------------------- callout -- */

.callout {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--text-2);
  font-size: .94rem;
  line-height: 1.6;
}
.callout svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout strong { color: var(--text); }

/* ------------------------------------------------------------ policy list -- */

.policy-group + .policy-group { margin-top: clamp(38px, 5vw, 56px); }
.policy-group > h2 {
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

/* `.card.policy-card`, not `.policy-card`: `a.card { display: block }` above is an
   element+class selector and outranks a lone class, so a single class here loses and
   the card silently stacks into one column. */
.card.policy-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}
.policy-card .card-icon { margin: 0; width: 42px; height: 42px; }
.policy-card h3 { font-size: 1.06rem; margin: 0 0 3px; }
.policy-card p { font-size: .89rem; }
.policy-card .chev { color: var(--muted); width: 18px; height: 18px; transition: transform .2s var(--ease); }
.policy-card:hover .chev { transform: translateX(3px); color: var(--accent); }
@media (max-width: 560px) {
  .card.policy-card { grid-template-columns: 42px 1fr; }
  .policy-card .chev { display: none; }
}

/* ------------------------------------------------------------- doc pages -- */

.doc-header {
  padding: clamp(34px, 5vw, 60px) 0 clamp(26px, 3vw, 38px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 100% at 12% 0%, var(--accent-soft), transparent 62%);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 13px; height: 13px; opacity: .6; }

.doc-header h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); }
.doc-header .lede { margin-top: 14px; font-size: 1.06rem; }

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
/* `max-width: 100%` is load-bearing, not defensive. A flex item's min-width defaults to
   auto, so a long value — "Version 1.1 (pending final legal review before public launch)"
   — sets an intrinsic width the chip refuses to go below, widening .wrap past the viewport
   and pushing the whole page into horizontal overflow on a phone. */
.doc-meta span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  max-width: 100%;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  font-size: .8rem;
  color: var(--text-2);
}
.doc-meta b { color: var(--text); font-weight: 650; }

.doc-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: clamp(30px, 4vw, 64px);
  align-items: start;
  padding: clamp(34px, 4vw, 56px) 0 clamp(70px, 9vw, 120px);
}
@media (max-width: 960px) {
  /* `minmax(0, 1fr)`, not `1fr`. An fr track's automatic minimum is min-content, and the
     article's min-content is set by its widest table (~800px) — so a bare `1fr` sizes the
     column to the table and pushes the whole page into horizontal overflow on a phone.
     The zero minimum lets the track shrink and leaves .tablewrap to scroll the table,
     which is what it is there for. The desktop rule above already guards this. */
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}
.toc h2 {
  font-family: var(--font-sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-2);
  font-size: .875rem;
  line-height: 1.45;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .lvl-3 a { padding-left: 26px; font-size: .83rem; color: var(--muted); }
.toc .lvl-3 a:hover, .toc .lvl-3 a.is-active { color: var(--accent); }

/* On narrow screens the sidebar becomes a collapsed disclosure above the text —
   a 200-entry sticky rail is unusable on a phone. */
@media (max-width: 960px) {
  .toc {
    position: static;
    max-height: none;
    padding: 0;
    margin-top: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .toc details { padding: 4px 6px; }
  .toc summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 650;
    font-size: .95rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary::after { content: "+"; color: var(--accent); font-size: 1.25rem; font-weight: 600; line-height: 1; }
  .toc details[open] summary::after { content: "\2212"; }
  .toc h2 { display: none; }
  /* Ships open (see the generator) so the desktop rail is never collapsed. On a phone
     that would otherwise push the document a full screen down, so cap and scroll it. */
  .toc ol { padding: 0 14px 14px; max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 961px) {
  .toc summary { display: none; }
}

/* ------------------------------------------------------------------ prose -- */

.prose {
  max-width: var(--measure);
  font-size: 1.0rem;
  line-height: 1.72;
  color: var(--text-2);
  /* Policy text carries bare emails, URLs and statute references that have no break
     opportunity; without this they widen the column on a narrow screen. */
  overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 1.9rem; margin: 0 0 20px; color: var(--text); }
.prose h2 {
  font-size: 1.45rem;
  margin: 46px 0 14px;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h3 {
  font-family: var(--font-sans);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -.005em;
  margin: 30px 0 10px;
  color: var(--accent);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose p { margin: 0 0 15px; }
.prose strong { color: var(--text); font-weight: 650; }
.prose em { font-style: italic; }
.prose a { border-bottom: 1px solid var(--accent-line); }
.prose ul { list-style: none; margin: 12px 0 20px; padding: 0; }
.prose li { position: relative; padding-left: 22px; margin: 0 0 9px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
}
.prose blockquote {
  margin: 0 0 24px;
  padding: 17px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
.prose blockquote p { margin: 0 0 10px; }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: .87em;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--text);
}
/* The document's own front matter (version, operator, grievance officer, contacts),
   set as labelled rows rather than the run-on paragraph the source lines fold into. */
.doc-front {
  margin: 0 0 34px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .9rem;
}
.doc-front > div {
  display: grid;
  grid-template-columns: minmax(120px, 27%) 1fr;
  gap: 4px 18px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.doc-front > div:first-child { padding-top: 0; }
.doc-front > div:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-front dt { color: var(--muted); font-weight: 600; }
.doc-front dd { margin: 0; color: var(--text); }
@media (max-width: 560px) {
  .doc-front > div { grid-template-columns: 1fr; gap: 2px; }
}

.prose .tablewrap {
  overflow-x: auto;
  margin: 16px 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose tr:last-child td { border-bottom: 0; }
.prose th {
  background: var(--bg-sunk);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--bg-sunk);
  border-top: 1px solid var(--border);
  padding: clamp(48px, 6vw, 76px) 0 34px;
  font-size: .93rem;
}
/* Uniform auto-fit tracks on narrow screens, an explicit layout only once there is room.
   An explicit first track combined with auto-fit repetitions cannot collapse below
   (first + one repetition + gap) ≈ 420px whatever `min(100%, …)` is applied to it, because
   auto-fit always places at least one repetition — so that shape overflows every phone.
   A single repeat() has no such floor. `minmax(0, …)` on the wide layout keeps a long link
   like "Delete your account" from setting a track minimum of its own. */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(28px, 4vw, 52px);
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
}
.footer-brand p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .9rem;
  max-width: 34ch;
  line-height: 1.6;
}
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer li a { color: var(--text-2); }
.site-footer li a:hover { color: var(--accent); }

.footer-legal {
  margin-top: clamp(38px, 5vw, 58px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}
.footer-legal p { margin: 0; max-width: 72ch; }

/* --------------------------------------------------------------- utility -- */

.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 34px; }
.center { text-align: center; }

.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 7vw, 88px) clamp(24px, 4vw, 60px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(ellipse 90% 130% at 50% -20%, var(--accent-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.cta-band .lede { margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }

/* Reveal on scroll. `.js` is set by site.js, so with JS off or blocked by CSP
   everything is simply visible — the content never depends on the animation. */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-in:nth-child(2) { transition-delay: .07s; }
.js .reveal.is-in:nth-child(3) { transition-delay: .14s; }
.js .reveal.is-in:nth-child(4) { transition-delay: .21s; }
.js .reveal.is-in:nth-child(5) { transition-delay: .28s; }
.js .reveal.is-in:nth-child(6) { transition-delay: .35s; }

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

/* --------------------------------------------------------------- 404 page -- */

.stub {
  min-height: 62vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 60px 0;
}
.stub .display { font-size: clamp(3.4rem, 2rem + 7vw, 7rem); }
