/* Tally website: shared styles for the home page and the legal pages.
   Colours mirror the app's DesignTokens.swift and PWCategory (light and dark);
   type mirrors the app: Tiempos Headline for headings, GT America for the rest.
   The home page alternates white, cream and warm-black sections, and each
   section takes one category colour as its accent. Spacing stays on the 8pt grid. */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --white: #FFFFFF;          /* section surfaces */
  --cream: #FBFAF5;
  --ink: #1A1410;            /* warm black */
  --bg: var(--cream);
  --surface: #F3F0E6;
  --paper: #FFFDF8;          /* the receipt stays paper in both themes */
  --fg: #1A1410;
  --fg-2: #5E574F;
  --fg-3: #8C8378;           /* large text only */
  --rule: #DDD8CA;
  --brand: #3E4D31;          /* wordmark green */
  --cta: #A84F00;            /* cinnamon */
  --cta-hover: #8E4300;
  --cta-fg: #FFFFFF;
  --link: #A84F00;
  --note-bg: #FFF4DB;
  --note-fg: #5A3B00;
  --note-rule: #E8C77A;
  --shadow-phone: 0 48px 80px -32px rgb(32 20 8 / .55), 0 16px 32px -16px rgb(32 20 8 / .3);
  --shadow-paper: drop-shadow(0 24px 24px rgb(32 20 8 / .28)) drop-shadow(0 2px 3px rgb(32 20 8 / .16));

  --font-display: "Iowan Old Style", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-wide: -apple-system, sans-serif;
  --font-cond: "Arial Narrow", sans-serif;
  --font-mono: ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --wrap: 1200px;
  --gutter: 16px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --white: #211D18;
    --cream: #16130F;
    --ink: #0C0A08;
    --surface: #211D18;
    --fg: #F1EADE;
    --fg-2: #B8AFA2;
    --fg-3: #8E857A;
    --rule: #3A342C;
    --brand: #C3CC9B;
    --cta: #E07C22;
    --cta-hover: #F08F3A;
    --cta-fg: #1A1410;
    --link: #F0A55A;
    --note-bg: #2E2410;
    --note-fg: #F3D9A0;
    --note-rule: #6B5220;
    --shadow-phone: 0 48px 80px -32px rgb(0 0 0 / .8), 0 16px 32px -16px rgb(0 0 0 / .55);
    --shadow-paper: drop-shadow(0 24px 24px rgb(0 0 0 / .5)) drop-shadow(0 2px 3px rgb(0 0 0 / .3));
  }
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

/* Category colours (PWCategory), one per section. --accent fills shapes,
   --on-accent is text on it, --accent-ink is the accent as text on the page. */
.ac-cinnamon { --accent: #A84F00; --on-accent: #FFFFFF; --accent-ink: #A84F00; }
.ac-produce  { --accent: #7CA35A; --on-accent: #1A1410; --accent-ink: #3F6222; }
.ac-dairy    { --accent: #D37700; --on-accent: #1A1410; --accent-ink: #E8913A; }
.ac-pantry   { --accent: #146783; --on-accent: #FFFFFF; --accent-ink: #146783; }
.ac-meat     { --accent: #C73A25; --on-accent: #FFFFFF; --accent-ink: #A4301E; }
.ac-dry      { --accent: #BE8C27; --on-accent: #1A1410; --accent-ink: #7A5A14; }
.ac-condiments { --accent: #1A426A; --on-accent: #FFFFFF; --accent-ink: #1A426A; }
.ac-baby     { --accent: #D081AA; --on-accent: #1A1410; --accent-ink: #87406F; }
.ac-bar      { --accent: #606C38; --on-accent: #FFFFFF; --accent-ink: #51582F; }
@media (prefers-color-scheme: dark) {
  .ac-cinnamon { --accent-ink: #F0A55A; }
  .ac-produce  { --accent-ink: #A9CB83; }
  .ac-pantry   { --accent-ink: #6FB3CC; }
  .ac-meat     { --accent-ink: #E8806C; }
  .ac-dry      { --accent-ink: #DDB563; }
  .ac-condiments { --accent-ink: #8FB4DE; }
  .ac-baby     { --accent-ink: #E3A6C6; }
  .ac-bar      { --accent-ink: #B5C27D; }
}

/* ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cta); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 20;
  padding: 8px 16px; border-radius: 8px;
  background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 16px; }

/* ── Navigation ─────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-nav.is-scrolled { border-bottom-color: var(--rule); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--nav-h); }
.brand { display: inline-flex; color: var(--brand); border-radius: 4px; }
.brand svg { height: 28px; width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding-inline: 16px; border-radius: 999px;
  font: 500 .9375rem/1 var(--font-body); text-decoration: none;
  transition: translate .2s var(--ease), background-color .15s ease;
}
.btn-primary { background: var(--cta); color: var(--cta-fg); }
.btn-primary:hover { background: var(--cta-hover); translate: 0 -1px; }

/* Apple's badge artwork, served by Apple, swapped to the white version in dark mode. */
.badge { display: inline-block; line-height: 0; border-radius: 10px; transition: translate .2s var(--ease); }
.badge img { height: 56px; width: auto; }
.badge[aria-disabled="true"] { cursor: default; }
.badge:not([aria-disabled="true"]):hover { translate: 0 -1px; }

/* ── Sections ───────────────────────────────────────────────────────── */
.sec { position: relative; padding-block: 96px; background: var(--sec-bg, var(--cream)); color: var(--fg); }
@media (min-width: 960px) { .sec { padding-block: 144px; } }
.sec--white { --sec-bg: var(--white); }
.sec--cream { --sec-bg: var(--cream); }
.sec--dark {
  --sec-bg: var(--ink);
  --fg: #F1EADE; --fg-2: #B8AFA2; --fg-3: #7F766B; --rule: #3A342C;
  --bg: #211D18; --surface: #2A241E; --link: #F0A55A;
  color-scheme: dark;
}

/* Kicker: section number in the accent colour, then the section's name. */
.kicker {
  display: flex; align-items: center; gap: 12px;
  font: 500 .8125rem/1.2 var(--font-cond); letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-ink, var(--fg-2));
}
.kicker .num {
  display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding-inline: 8px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font: 400 .75rem/1 var(--font-mono); letter-spacing: 0;
}
.sec-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem); line-height: 1.04;
  letter-spacing: -.012em; text-wrap: balance;
}
.sec-body { color: var(--fg-2); font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); line-height: 1.5; max-width: 34ch; text-wrap: pretty; }
.sec-head { display: flex; flex-direction: column; gap: 24px; max-width: 44rem; }

/* Text beside a phone. */
.split { display: grid; gap: 48px; align-items: center; }
.split-copy { display: flex; flex-direction: column; gap: 24px; }
.split .swatch { min-height: 600px; padding: 56px 24px; }
.split .phone { --w: min(290px, 64vw); }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; }
  .split--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split--flip .split-copy { order: 2; }
  .split .swatch { min-height: 760px; }
  .split .phone { --w: 310px; }
}

/* ── Colour swatch behind each phone ────────────────────────────────── */
.swatch {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  background:
    radial-gradient(70% 55% at 20% 16%, rgb(255 255 255 / .24), transparent 70%),
    radial-gradient(60% 55% at 86% 92%, rgb(0 0 0 / .22), transparent 70%),
    var(--accent);
}
.swatch::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply; opacity: .32;
}

/* ── Phone frame (iPhone 17 Pro proportions) ────────────────────────── */
.phone {
  --w: 300px;
  position: relative; z-index: 1;
  width: var(--w); max-width: 100%;
  padding: calc(var(--w) * .032);
  border-radius: calc(var(--w) * .165);
  background: linear-gradient(150deg, #4A433B 0%, #1A1612 38%, #0E0B08 62%, #3A332C 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1), var(--shadow-phone);
}
.phone-screen {
  position: relative; overflow: hidden;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * .135);
  background: var(--cream);
}
.phone-island {
  position: absolute; z-index: 3; top: 1.4%; left: 50%; translate: -50% 0;
  width: 31%; height: 4%; border-radius: 999px; background: #000;
}
/* One screen per recording or screenshot; several stack and cross-fade. */
.screen { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.screen.is-active { opacity: 1; }
.screen video, .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 24px 16px; text-align: center;
  background: linear-gradient(180deg, #FBFAF5, #F3F0E6);
  color: #5E574F;
}
.screen.has-media .phone-placeholder { display: none; }
.phone-placeholder img { position: static; width: 44px; height: 44px; border-radius: 10px; margin-bottom: 8px; }
.ph-title { font: 400 1.125rem/1.2 var(--font-display); color: #1A1410; }
.ph-hint { font-size: .75rem; line-height: 1.4; max-width: 22ch; }
.ph-file { margin-top: 4px; font: .625rem/1.4 var(--font-mono); color: #8C8378; }

.video-toggle {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px;
  background: rgb(255 255 255 / .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #1A1410; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(26 20 16 / .12);
}
.video-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.video-toggle[data-state="paused"] .i-pause,
.video-toggle:not([data-state="paused"]) .i-play { display: none; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { padding-block: 40px 96px; }
.hero .split { gap: 40px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 5.5rem);
  line-height: 1; letter-spacing: -.018em; text-wrap: balance;
}
.hero h1 .hl { color: var(--accent-ink); }
.hero .lede {
  max-width: 32ch;
  font-size: clamp(1.1875rem, 1rem + .6vw, 1.375rem); line-height: 1.45;
  color: var(--fg-2); text-wrap: pretty;
}
.hero .badge { margin-top: 16px; }
@media (min-width: 960px) {
  .hero { padding-block: 56px 144px; }
  .hero .split { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 64px; }
  .hero .phone { --w: 320px; }
}

/* ── 2: scroll-driven steps (after harvey.ai) ───────────────────────── */
.scrolly { margin-top: 64px; }
.scrolly-stage { display: grid; gap: 32px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { border-top: 1px solid var(--rule); transition: border-color .3s ease; }
.step.is-active { border-top: 2px solid var(--accent); }
.step-title {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer;
  padding: 24px 0 16px;
  font: 400 clamp(1.5rem, 1.1rem + 1.1vw, 2.125rem)/1.15 var(--font-display);
  color: var(--fg-3); transition: color .3s ease;
}
.step-title:hover, .step.is-active .step-title { color: var(--fg); }
.step-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.step-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--ease); }
.step-body > div { overflow: hidden; }
.step-body p { padding-bottom: 32px; max-width: 36ch; color: var(--fg-2); font-size: 1.125rem; line-height: 1.5; }
.js .step:not(.is-active) .step-body { grid-template-rows: 0fr; }
.steps-progress { display: none; }
.scrolly .swatch { padding: 32px 24px; }
.scrolly .phone { --w: min(300px, 64vw); }

.js .scrolly { height: calc(100vh + (var(--steps) - 1) * 80vh); }
.js .scrolly-stage {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h));
  padding-block: 24px; align-content: center;
}
@media (min-width: 960px) {
  .scrolly-stage { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: center; }
  .scrolly .phone { --w: min(320px, calc((100vh - var(--nav-h) - 160px) / 2.12)); }
  .js .scrolly .swatch { height: calc(100vh - var(--nav-h) - 64px); }
}
@media (max-width: 959px) {
  .scrolly-swatch { order: -1; }
  .js .scrolly-stage { grid-template-rows: minmax(0, 1fr) auto; gap: 24px; }
  .js .scrolly .phone { --w: min(260px, calc((100svh - var(--nav-h) - 330px) / 2.12)); }
  .js .step:not(.is-active) { display: none; }
  .js .step { border-top: 0; }
  .js .step-title { padding-top: 16px; }
  .js .steps-progress { display: flex; gap: 8px; }
  .steps-progress button {
    flex: 1; height: 24px; padding: 0; border: 0; cursor: pointer;
    background: linear-gradient(var(--rule), var(--rule)) center / 100% 3px no-repeat;
  }
  .steps-progress button[aria-current="step"] {
    background: linear-gradient(var(--accent), var(--accent)) center / 100% 3px no-repeat;
  }
}

/* ── 3: three tiles ─────────────────────────────────────────────────── */
.tiles {
  display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 16px;
  margin-top: 56px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.tiles::-webkit-scrollbar { display: none; }
.tile {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  height: 520px; padding: 32px 24px 0; border-radius: var(--radius-lg);
  scroll-snap-align: center;
  color: var(--on-accent);
  background:
    radial-gradient(70% 50% at 20% 10%, rgb(255 255 255 / .24), transparent 70%),
    radial-gradient(60% 50% at 90% 100%, rgb(0 0 0 / .2), transparent 70%),
    var(--accent);
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply; opacity: .3;
}
.tile h3 { align-self: flex-start; font: 400 2rem/1.1 var(--font-display); }
/* The phone rises from the bottom edge; the top of the screen is what matters. */
.tile .phone { --w: 236px; margin-top: auto; margin-bottom: calc(var(--w) * -.55); }
@media (min-width: 960px) {
  .tiles { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .tile { height: 600px; padding: 40px 32px 0; }
  .tile .phone { --w: 260px; }
}

/* ── Honest by design ───────────────────────────────────────────────── */
.honest { text-align: center; --accent-ink: #E8A45E; }
.honest .kicker { justify-content: center; }
.honest h2 {
  margin-top: 32px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.75rem, 1.4rem + 5vw, 5.5rem); line-height: 1;
  letter-spacing: -.018em; text-wrap: balance;
}
.honest p {
  margin: 32px auto 0; max-width: 38ch;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); line-height: 1.5;
  color: var(--fg-2); text-wrap: pretty;
}
.honest .link { display: inline-block; margin-top: 32px; color: var(--fg); }

/* ── Closing ────────────────────────────────────────────────────────── */
.price-line { color: var(--fg); font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); max-width: 34ch; }
.price-line strong { font-family: var(--font-wide); font-weight: 500; font-variant-numeric: tabular-nums; }
.split .swatch:has(.receipt) { min-height: 600px; }

/* The pricing slip: a paper receipt with torn edges, set in GT America Mono. */
.receipt-wrap { filter: var(--shadow-paper); rotate: -2.5deg; }
.receipt {
  --z: 8px;
  width: min(320px, 72vw);
  padding: 40px 24px;
  background: var(--paper); color: #1A1410;
  font: 400 .8125rem/1.7 var(--font-mono); letter-spacing: .02em; text-transform: uppercase;
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x;
  mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x;
}
.r-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.r-head img { width: 40px; height: 40px; border-radius: 9px; }
.r-store { font-size: .9375rem; letter-spacing: .24em; }
.r-row { display: flex; justify-content: space-between; gap: 16px; }
.r-row span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-big { font-size: 1rem; }
.r-rule { height: 0; margin: 16px 0; border-top: 1px dashed #B5AEA2; }
.r-barcode {
  height: 40px; width: 78%; margin: 24px auto 8px;
  background: repeating-linear-gradient(90deg,
    #1A1410 0 2px, #0000 2px 4px, #1A1410 4px 5px, #0000 5px 8px,
    #1A1410 8px 11px, #0000 11px 12px, #1A1410 12px 13px, #0000 13px 16px);
}
.r-foot { margin: 0; text-align: center; }

/* ── Motion ─────────────────────────────────────────────────────────────
   Only under html.motion, which the page sets when Reduce Motion is off.
   The hero plays on load; everything else plays once as it scrolls in. */
@keyframes rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes rise-far { from { opacity: 0; translate: 0 72px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.motion .hero h1 { animation: rise .9s var(--ease) both; }
.motion .hero .lede { animation: rise .9s var(--ease) .12s both; }
.motion .hero .badge { animation: rise .9s var(--ease) .24s both; }
.motion .hero .swatch { animation: fade 1.2s ease .05s both; }
.motion .hero .phone { animation: rise-far 1.3s var(--ease) .25s both; }

.motion .reveal { opacity: 0; translate: 0 32px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.motion .reveal.is-in { opacity: 1; translate: 0 0; }
.motion .reveal .phone { opacity: 0; translate: 0 64px; transition: opacity 1s var(--ease) .2s, translate 1.3s var(--ease) .2s; }
.motion .reveal.is-in .phone { opacity: 1; translate: 0 0; }
.motion .tiles.reveal .tile:nth-child(2) .phone { transition-delay: .32s; }
.motion .tiles.reveal .tile:nth-child(3) .phone { transition-delay: .44s; }
.motion .reveal .sec-body { opacity: 0; transition: opacity 1s ease .3s; }
.motion .reveal.is-in .sec-body { opacity: 1; }
/* The pricing receipt prints from the top, like it's leaving the till. */
.motion .reveal .receipt { clip-path: inset(0 0 100% 0); translate: 0 -40px; transition: clip-path 1.8s cubic-bezier(.35, .6, .25, 1) .35s, translate 1.8s cubic-bezier(.35, .6, .25, 1) .35s; }
.motion .reveal.is-in .receipt { clip-path: inset(0 0 0 0); translate: 0 0; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--rule); padding-block: 40px 48px; color: var(--fg-2); font-size: .9375rem; background: var(--cream); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .brand svg { height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--fg); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.fine { width: 100%; font-size: .8125rem; }

/* ── Legal pages (Terms, Privacy) ───────────────────────────────────── */
.eyebrow {
  font: 500 .8125rem/1.2 var(--font-cond);
  letter-spacing: .1em; text-transform: uppercase;
  color: #51582F;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: #9BA766; } }
.legal { display: grid; gap: 40px; padding-block: 48px 0; }
.legal-toc { display: none; }
@media (min-width: 1100px) {
  .legal.has-sidebar { grid-template-columns: 232px minmax(0, 44rem); justify-content: center; gap: 72px; }
  .legal.has-sidebar .legal-toc {
    display: block; position: sticky; top: calc(var(--nav-h) + 32px); align-self: start;
    max-height: calc(100vh - var(--nav-h) - 64px); overflow: auto;
  }
  .legal.has-sidebar .toc-block { display: none; }
}
.legal:not(.has-sidebar) .doc { max-width: 44rem; margin-inline: auto; }
.legal-toc-title { margin: 0 0 8px 12px; font: 500 .75rem/1.2 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: 8px; padding: 6px 12px; border-radius: 8px;
  color: var(--fg-2); text-decoration: none; font-size: .875rem; line-height: 1.35;
}
.legal-toc a::before { content: counter(toc); min-width: 1.25em; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.legal-toc a:hover,
.legal-toc a[aria-current="true"] { color: var(--fg); background: var(--surface); }

.doc { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.doc > header { display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.doc h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); line-height: 1.05;
  letter-spacing: -.01em; text-wrap: balance;
}
.doc .meta { color: var(--fg-2); font-size: .9375rem; }
.doc h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.625rem; line-height: 1.2; text-wrap: balance; }
.doc h3 { font-size: 1.0625rem; font-weight: 500; }
.doc section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.doc p, .doc ul, .doc ol { margin: 0; }
.doc ul, .doc ol { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 8px; }
.doc strong { font-weight: 500; }
.summary { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: var(--radius-md); background: var(--surface); }
.summary h2 { font-size: 1.375rem; }
.toc { display: block; columns: 2 14rem; column-gap: 32px; padding-left: 1.5rem; font-size: .9375rem; }
.toc li { break-inside: avoid; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: .9375rem; }
.doc th, .doc td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.doc th { font: 500 .75rem/1.3 var(--font-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); background: var(--surface); }
.doc tr:last-child td { border-bottom: 0; }
.draft { padding: 10px 14px; border: 1px dashed var(--note-rule); border-radius: 8px; background: var(--note-bg); color: var(--note-fg); font-size: .875rem; }
.draft::before { content: "Drafting note: "; font-weight: 500; }
.license {
  padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface);
  font: .75rem/1.55 var(--font-mono); color: var(--fg-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.doc-end { padding-top: 24px; border-top: 1px solid var(--rule); color: var(--fg-2); font-size: .875rem; }
.legal + .site-footer { margin-top: 72px; }

/* Public build only (scripts/build_public_site.py) */
.ph-file { display: none; }
