/* PaidUpNow landing page. Visual direction: "papel sobre tinta" (specs/design.md).
   The page is ink; everything the buyer receives is paper. */

/* ---------- Fonts (self-hosted, latin subset, OFL) ---------- */
@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-latin-var.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin-var.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial tuned to Inter's metrics, so text doesn't jump when Inter arrives */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
  size-adjust: 107.4%;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --ink: #0A0A09;
  --ink-raised: #121211;
  --ink-high: #1A1A18;
  --paper: #F4F1EA;
  --text-2: #A8A49B;
  --text-3: #85817A;
  --line: rgba(244, 241, 234, 0.08);
  --line-strong: rgba(244, 241, 234, 0.16);

  --paid: #7EE2B0;
  --due: #F2B84B;
  --late: #F07A5F;

  --paper-ink: #1C1B19;
  --paper-muted: #5E5A53;
  --paper-line: #E2DDD2;
  --highlight: #F6E3A1;
  --field: rgba(240, 204, 92, 0.34);
  --paid-ink: #146C45;
  --due-ink: #8A5A00;
  --late-ink: #A63A22;

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Inter Fallback', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Fluid type scale: phone value -> desktop value (design.md §5) */
  --fs-display-xl: clamp(2.75rem, 1.6rem + 4.6vw, 5rem);
  --fs-display-l: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --fs-display-m: clamp(1.875rem, 1.5rem + 1.3vw, 2.5rem);
  --fs-title: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-body: clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;
  --fs-data: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);

  --gutter: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --container: 1200px;
  --space-section: clamp(6rem, 3.5rem + 8vw, 10rem);
  --space-head: clamp(2.5rem, 1.8rem + 2.4vw, 4rem);
  --header-h: 56px;

  --r-paper: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --paper-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 10px 20px -6px rgba(0, 0, 0, 0.45),
    0 40px 80px -20px rgba(0, 0, 0, 0.75),
    0 90px 160px -40px rgba(0, 0, 0, 0.6);
}

@media (min-width: 1024px) {
  :root { --header-h: 64px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Vignette and film grain sit behind the content, so they never lower text contrast */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background: radial-gradient(ellipse 85% 80% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
}
body::after {
  opacity: 0.08;
  mix-blend-mode: overlay;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--paid);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 300;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Visible marker for information that is still missing (specs/copy.md ⏳) */
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--due);
  background: rgba(242, 184, 75, 0.12);
  border-radius: 4px;
  padding: 0 0.3em;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
/* The lamp light is wider than the screen; clip it sideways so phones never zoom out */
.hero, .section, .final { overflow-x: clip; }

/* Single-column grids never grow wider than the screen because of one long word */
.hero-grid, .kit-grid, .decide-grid, .panels, .panel, .fit-grid, .offer-grid, .footer-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.display-xl { font-size: var(--fs-display-xl); }
.display-l { font-size: var(--fs-display-l); line-height: 1.08; letter-spacing: -0.02em; }
.display-m { font-size: var(--fs-display-m); line-height: 1.1; letter-spacing: -0.015em; }
.soft { color: var(--text-2); }

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lead {
  max-width: 34em;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 500 1rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease), box-shadow 150ms var(--ease), border-color 150ms var(--ease);
}
@media (min-width: 768px) {
  .btn { min-height: 48px; }
}
.btn-primary { background: var(--paper); color: var(--ink); }
.btn-primary:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -10px rgba(244, 241, 234, 0.45);
}
.btn-primary:active { transform: none; box-shadow: none; }
.btn-secondary { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--ink-high); }
.btn-compact { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }
@media (min-width: 768px) {
  .btn-compact { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms var(--ease);
}
.text-link:hover { color: var(--paper); }

/* ---------- Chips (status, always with text) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.85em;
  border-radius: var(--r-pill);
  font: 500 var(--fs-label)/1 var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.chip-due { color: var(--due); background: rgba(242, 184, 75, 0.12); }
.chip-late { color: var(--late); background: rgba(240, 122, 95, 0.12); }
.chip-paid { color: var(--paid); background: rgba(126, 226, 176, 0.12); }
.paper .chip-due { color: var(--due-ink); background: rgba(138, 90, 0, 0.10); }
.paper .chip-late { color: var(--late-ink); background: rgba(166, 58, 34, 0.10); }
.paper .chip-paid { color: var(--paid-ink); background: rgba(20, 108, 69, 0.10); }

/* ---------- Paper (the product) ---------- */
.paper {
  background: linear-gradient(172deg, #F9F6F0 0%, #F3EFE7 55%, #EAE5DB 100%);
  color: var(--paper-ink);
  border-radius: var(--r-paper);
  box-shadow: var(--paper-shadow);
}
.field {
  background: var(--field);
  color: var(--paper-ink);
  border-radius: 2px;
  padding: 0 0.14em;
  white-space: nowrap;
}
.doc-kicker {
  font: 500 0.6875rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.doc-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Warm desk-lamp light; at most two on the page */
.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(244, 226, 196, 0.22), rgba(244, 226, 196, 0.07) 55%, rgba(244, 226, 196, 0));
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 10, 9, 0.8);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
/* With JS, the header stays transparent until the page scrolls */
.js .site-header:not(.is-scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
}
@media (min-width: 768px) {
  .wordmark { font-size: 1.5rem; }
}
.site-nav { display: none; }
@media (min-width: 1024px) {
  .site-nav { display: block; }
  .site-nav ul { display: flex; gap: 32px; }
  .site-nav a {
    color: var(--text-2);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 150ms var(--ease);
  }
  .site-nav a:hover { color: var(--paper); }
}
.scroll-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 1.5rem + 4vw, 6rem));
}
.hero-grid { display: grid; gap: 56px; }
.hero-copy .label { display: block; margin-bottom: 20px; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-facts { margin-top: 24px; font: 400 var(--fs-data)/1.5 var(--font-mono); color: var(--text-3); }
@media (max-width: 639px) {
  .hero-actions .btn-primary { width: 100%; }
}

/* The stack of kit papers. Decorative (aria-hidden); a text description sits next to it. */
.hero-visual { position: relative; }
.hero-glow { left: -15%; top: -10%; width: 130%; height: 120%; }
.hero-papers { position: relative; height: 440px; }
.hero-papers .paper { position: absolute; overflow: hidden; }

.p-email { z-index: 3; left: 0; right: 0; top: 34px; height: 406px; padding: 24px 24px 0; }
.p-tracker { z-index: 2; right: 0; top: 0; width: 82%; height: 300px; padding: 18px 18px 0; }
.p-guide { display: none; }

.p-email .chip { margin-bottom: 14px; }
.email-subject {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--paper-line);
  font-size: 0.875rem;
  color: var(--paper-muted);
}
.email-subject b { color: var(--paper-ink); font-weight: 600; margin-right: 0.5em; }
.email-body { font-size: 0.9375rem; line-height: 1.5; }
.email-body p + p { margin-top: 0.7em; }

.tracker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.tracker-head .doc-title { font-size: 1.375rem; white-space: nowrap; }
.tracker-head .doc-kicker { white-space: nowrap; }
/* On the narrowest phones only the sheet's title peeks out from behind the email */
@media (max-width: 359px) {
  .tracker-head .doc-kicker { display: none; }
}
.mini-sheet { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.mini-sheet th {
  background: var(--paper-ink);
  color: var(--paper);
  font-weight: 600;
  text-align: left;
  padding: 7px 8px;
}
.mini-sheet td { padding: 8px; border-bottom: 1px solid var(--paper-line); white-space: nowrap; }
.mini-sheet th:first-child { width: 42%; }
.mini-sheet .now { background: var(--highlight); font-weight: 600; }

.guide-list { font-size: 0.875rem; }
.guide-list li { padding: 8px 10px; border-bottom: 1px solid var(--paper-line); }
.guide-list .head { background: var(--paper-ink); color: var(--paper); font-weight: 600; border: 0; }
.p-guide .doc-title { font-size: 1.75rem; margin: 8px 0 4px; }
.p-guide .doc-lede { font-size: 0.875rem; color: var(--paper-muted); margin-bottom: 16px; }

@media (min-width: 768px) {
  .hero-papers { height: 560px; max-width: 640px; margin-inline: auto; }
  .p-guide { display: block; z-index: 1; left: 0; top: 40px; width: 58%; height: 480px; padding: 28px; rotate: -2deg; }
  .p-tracker { right: 0; top: 0; width: 60%; height: 500px; padding: 26px 22px 0; rotate: 2deg; }
  .p-email { left: 14%; right: auto; top: 96px; width: 68%; height: 480px; padding: 30px 32px 0; rotate: -1deg; }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: center; }
  .hero-copy { grid-column: 1 / span 6; }
  .hero-visual { grid-column: 7 / span 6; }
  .hero-papers { height: 600px; max-width: none; }
  .hero-papers .paper { transform: perspective(2200px) rotateX(5deg); }
  /* Rotated corners stick out of their boxes, so the side papers stay inside the column */
  .p-guide { left: 4%; top: 70px; width: 58%; height: 500px; rotate: -4deg; }
  .p-tracker { right: 0; top: 10px; width: 60%; height: 520px; rotate: 3.5deg; }
  .p-email { left: 12%; top: 120px; width: 72%; height: 520px; rotate: -1.5deg; }
  /* The email covers the left of the sheet, so Next step sits in the visible right part */
  .mini-sheet th:first-child { width: 54%; }
}

/* Entrance: papers arrive one after another, then the lamp light comes up */
@media (prefers-reduced-motion: no-preference) {
  .hero-papers .paper { animation: paper-in 700ms var(--ease) both; }
  .p-guide { animation-delay: 150ms; }
  .p-tracker { animation-delay: 300ms; }
  .p-email { animation-delay: 450ms; }
  .hero-glow { animation: glow-in 800ms ease-out both; }
}
@keyframes paper-in {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes glow-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Sections ---------- */
.section { position: relative; padding-top: var(--space-section); }
.section-head { max-width: 760px; margin-bottom: var(--space-head); }
.section-head .label { display: block; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 20px; }
.section-head h2:last-child { margin-bottom: 0; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dark explanation card (design.md §9) */
.card {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 24px;
}
@media (min-width: 768px) {
  .card { padding: 32px; }
}

/* Reveal on scroll. main.js adds .reveal-ready, so nothing is hidden if the script fails */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal] {
    opacity: 0;
    translate: 0 12px;
    transition: opacity 500ms var(--ease), translate 500ms var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .reveal-ready [data-reveal].is-visible { opacity: 1; translate: 0 0; }
}

/* ---------- 2. Problem ---------- */
.pain-list { display: grid; gap: 32px; }
.pain-list li { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.pain-list .num { display: block; margin-bottom: 12px; font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: 0.08em; color: var(--text-3); }
.pain-list h3 { margin-bottom: 8px; font-size: var(--fs-title); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.pain-list p { color: var(--text-2); }
@media (min-width: 768px) {
  .pain-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
}
@media (min-width: 1024px) {
  .pain-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.problem-close {
  max-width: 22em;
  margin-top: var(--space-head);
  font-family: var(--font-display);
  font-size: var(--fs-display-m);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* ---------- 3. What's inside ---------- */
.kit-grid { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .kit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .kit-card:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .kit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}
.kit-card { display: flex; flex-direction: column; gap: 10px; }
.kit-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); }
.kit-card .num { font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: 0.08em; color: var(--text-3); }
.kit-card h3 { margin-top: 10px; font-size: var(--fs-title); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.kit-card p { color: var(--text-2); }
.format {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.45em 0.8em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font: 500 var(--fs-label)/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.kit-card p + .format { margin-top: 14px; }

/* ---------- 4. How it works: timeline on ink ---------- */
.timeline { position: relative; display: grid; }
/* Rail and its scroll-linked fill (vertical on phones, horizontal on desktop) */
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 131.5px;
  top: 14px;
  bottom: 56px;
  width: 1px;
  background: var(--line-strong);
}
.timeline::after { background: var(--paper); transform-origin: top; }
.milestone {
  position: relative;
  display: grid;
  grid-template-columns: 104px 56px minmax(0, 1fr);
  align-items: start;
  padding-bottom: 28px;
}
.milestone .chip { justify-self: start; margin-top: 2px; }
.milestone .dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 11px;
  height: 11px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 5px var(--ink);
}
.ms-text h3 { font-size: var(--fs-title); font-weight: 600; line-height: 1.3; }
.ms-text p { color: var(--text-2); }
.ms-text .tone { margin-top: 4px; font: 400 var(--fs-data)/1.4 var(--font-mono); color: var(--text-3); }

@media (min-width: 1024px) {
  .timeline { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; }
  .timeline::before,
  .timeline::after { left: 0; right: 0; top: 44px; bottom: auto; width: auto; height: 1px; }
  .timeline::after { transform-origin: left; }
  .milestone { display: flex; flex-direction: column; gap: 16px; padding: 0; }
  .milestone .dot { justify-self: auto; margin: 0 0 4px 4px; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline::after {
      animation: rail-fill linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 55%;
    }
  }
}
@keyframes rail-fill {
  from { scale: 1 0; }
  to { scale: 1 1; }
}
@media (min-width: 1024px) {
  @keyframes rail-fill {
    from { scale: 0 1; }
    to { scale: 1 1; }
  }
}

.decide { margin-top: var(--space-section); }
.decide h3 { max-width: 18em; margin-bottom: 32px; }
.decide-grid { display: grid; gap: 16px; }
.decide-grid h4 { margin-bottom: 8px; font-size: var(--fs-title); font-weight: 500; }
.decide-grid p { color: var(--text-2); }
@media (min-width: 768px) {
  .decide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1024px) {
  .decide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}

/* ---------- 5. See the templates ---------- */
.tablist {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.tablist::-webkit-scrollbar { display: none; }
.no-js .tablist { display: none; }
.tab {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font: 500 var(--fs-data)/1 var(--font-mono);
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.tab:hover { color: var(--paper); border-color: var(--line-strong); }
/* The chosen tab gets a paper-colored border: the background change alone is far below 3:1 (WCAG 1.4.11) */
.tab[aria-selected="true"] { background: var(--ink-high); color: var(--paper); border-color: var(--paper); }

/* Without JS every email is listed; with JS only the chosen one shows, and the block's
   height follows it smoothly (main.js), so short emails leave no empty space */
.panels { display: grid; gap: 48px; }
.js .panel[data-inactive] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .panel:not([data-inactive]) { animation: panel-in 200ms var(--ease); }
}
@keyframes panel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panel { display: grid; gap: 24px; align-content: start; }
@media (min-width: 1024px) {
  .panel { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: start; }
}
.email-doc { padding: 28px 24px 32px; }
@media (min-width: 768px) {
  .email-doc { padding: 40px 48px 44px; }
}
/* Long stage labels wrap on phones instead of pushing the paper off screen */
.email-doc .chip { margin-bottom: 18px; white-space: normal; line-height: 1.3; }
.email-doc .email-subject { margin-bottom: 4px; font-size: 0.9375rem; }
.more-subjects { margin-bottom: 20px; font: 400 var(--fs-label)/1.4 var(--font-mono); color: var(--paper-muted); }
.email-doc .email-body { font-size: var(--fs-body); line-height: 1.6; }
.email-list { padding-left: 1.4em; list-style: decimal; }
.email-list li + li { margin-top: 0.4em; }
.email-body .email-list { margin-top: 0.7em; }
.email-body .optional em { color: var(--paper-muted); }

.panel-side { display: grid; gap: 8px; align-content: start; }
.panel-side .goal { margin-bottom: 20px; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em; }
.sms {
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px 22px 22px 6px;
  background: var(--ink-high);
  line-height: 1.55;
}
.sms .label { margin-bottom: 10px; }
.sms .field { background: rgba(246, 227, 161, 0.16); color: var(--paper); white-space: normal; }

.tracker-block { margin-top: var(--space-section); }
.tracker-intro { max-width: 760px; margin-bottom: 32px; }
.tracker-intro h3 { margin-bottom: 16px; }
.sheet-card { padding: 20px 0 0; overflow: hidden; }
.sheet-scroll { overflow-x: auto; }
.sheet { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.9375rem; }
/* The caption keeps its table role; the flex row lives inside it */
.sheet caption { caption-side: top; padding: 0 24px 16px; }
.sheet caption .cap {
  display: flex;
  justify-content: space-between;
  font: 500 0.6875rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
  text-align: left;
}
.sheet thead th { padding: 11px 14px; background: var(--paper-ink); color: var(--paper); font-weight: 600; font-size: 0.875rem; text-align: left; white-space: nowrap; }
.sheet tbody th, .sheet td { padding: 14px; border-bottom: 1px solid var(--paper-line); text-align: left; white-space: nowrap; }
.sheet tbody th { font-weight: 500; }
.sheet thead th:first-child, .sheet tbody th { padding-left: 24px; }
.sheet thead th:nth-child(5) { width: 34%; }
.sheet .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.sheet .now { background: var(--highlight); font-weight: 600; }
.sheet .paid { color: var(--paid-ink); font-weight: 600; }
.sheet .late { color: var(--late-ink); font-weight: 600; }
.sheet .muted { color: var(--paper-muted); }
/* Phones: the client column stays put while the rest scrolls */
@media (max-width: 767px) {
  .sheet thead th:first-child, .sheet tbody th { position: sticky; left: 0; z-index: 1; }
  .sheet tbody th { background: #F4F1EA; box-shadow: 1px 0 0 var(--paper-line); }
}
.scroll-hint { margin-top: 10px; font: 400 var(--fs-label)/1.4 var(--font-mono); color: var(--text-3); }
@media (min-width: 768px) {
  .scroll-hint { display: none; }
}

.summary { margin-top: 32px; }
.summary .label { margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.stat { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.stat dt { font-size: var(--fs-small); color: var(--text-2); }
.stat dd { margin: 4px 0 0; font: 500 1.125rem/1.3 var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- 6. Who it's for ---------- */
.fit-grid { display: grid; gap: 40px; }
@media (min-width: 768px) {
  .fit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
.fit-col h3 { margin-bottom: 12px; font-size: var(--fs-title); font-weight: 500; }
.fit-col li { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--text-2); }
.fit-col li .icon { margin-top: 3px; color: var(--paper); }
.fit-no li .icon { color: var(--text-3); }

/* ---------- 7. Offer ---------- */
.offer-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1024px) {
  .offer-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; }
}
.offer-wrap { position: relative; isolation: isolate; }
.offer-glow { z-index: -1; left: -20%; top: -20%; width: 140%; height: 140%; }
.offer-card {
  padding: 32px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--ink-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}
@media (min-width: 768px) {
  .offer-card { padding: 40px; }
}
.offer-name { font-size: var(--fs-title); font-weight: 500; }
.price { display: flex; align-items: baseline; gap: 14px; margin: 12px 0 28px; }
.price b {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 3rem + 2vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}
.price span { font: 400 var(--fs-data)/1.4 var(--font-mono); color: var(--text-2); }
.offer-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.offer-list .fmt { font: 500 var(--fs-label)/1.6 var(--font-mono); letter-spacing: 0.06em; color: var(--text-3); }
.offer-card .btn { width: 100%; margin-top: 28px; }
.offer-notes { margin-top: 18px; font-size: var(--fs-small); color: var(--text-3); }
.offer-notes p + p { margin-top: 6px; }

/* The 7 files, stacked like the approved ad (decorative) */
.file-stack { display: none; }
@media (min-width: 1024px) {
  .file-stack { display: block; position: relative; height: 640px; }
  /* Every file ends at the bottom of the stack, so nothing spills into the next section */
  .file-stack .file {
    position: absolute;
    left: calc(var(--n) * 10px);
    right: calc(var(--n) * 10px);
    top: calc(var(--n) * 60px);
    bottom: 0;
    padding: 16px 26px;
    overflow: hidden;
    rotate: calc((var(--n) - 3) * 0.25deg);
  }
  .file-stack .band { display: flex; align-items: center; gap: 16px; height: 32px; }
  .file-stack .band .n { font: 400 0.875rem/1 var(--font-mono); color: var(--paper-muted); }
  .file-stack .band b { flex: 1; font-size: 1.25rem; font-weight: 600; }
  .file-stack .band .fmt { font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.06em; color: var(--paper-muted); background: rgba(94, 90, 83, 0.10); border-radius: var(--r-pill); padding: 0.5em 0.8em; }
  .excerpt { margin-top: 26px; }
  .excerpt-title { font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.04em; }
  .excerpt table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 1rem; }
  .excerpt th { padding: 9px 12px; background: var(--paper-ink); color: var(--paper); font-size: 0.875rem; text-align: left; }
  .excerpt td { padding: 12px; border-bottom: 1px solid var(--paper-line); }
  .excerpt-note { margin-top: 16px; font-size: 0.875rem; font-style: italic; color: var(--paper-muted); }
}

/* ---------- 8. FAQ ---------- */
.faq-list { max-width: 820px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 18px 0;
  font-size: var(--fs-title);
  font-weight: 500;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--text-2), var(--text-2)) center / 100% 1.5px no-repeat,
    linear-gradient(var(--text-2), var(--text-2)) center / 1.5px 100% no-repeat;
  transition: rotate 200ms var(--ease);
}
.faq-item[open] summary::after { rotate: 45deg; }
.faq-answer { max-width: 62ch; padding-bottom: 24px; color: var(--text-2); }

/* ---------- 9. Legal note ---------- */
.legal-note { padding-top: calc(var(--space-section) * 0.6); }
.legal-card { display: grid; gap: 12px; max-width: 820px; }
.legal-card p { color: var(--text-2); }

/* ---------- 10. Final CTA ---------- */
.final { position: relative; isolation: isolate; padding-top: var(--space-section); text-align: center; }
.final-glow { z-index: -1; left: 50%; top: 55%; width: min(900px, 160%); height: 560px; translate: -50% -40%; }
.final h2 { max-width: 14em; margin: 0 auto 32px; }
.final .hero-facts { margin-top: 20px; }

/* ---------- Legal pages and 404 ---------- */
.doc-page,
.not-found { padding-top: calc(var(--header-h) + clamp(3rem, 2rem + 4vw, 6rem)); }
.doc-wrap { max-width: 760px; }
.doc-page h1 { margin-bottom: 32px; }
.doc-updated { margin: -16px 0 32px; }
.doc-body { max-width: 62ch; color: var(--text-2); }
.doc-body > * + * { margin-top: 1em; }
.doc-body h2 { margin-top: 48px; font-size: var(--fs-title); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; color: var(--paper); }
.doc-body h3 { margin-top: 28px; font-size: var(--fs-body); font-weight: 600; line-height: 1.4; color: var(--paper); }
.doc-body h2 + *, .doc-body h3 + * { margin-top: 12px; }
.doc-body ul { padding-left: 1.25em; list-style: disc; }
.doc-body li + li { margin-top: 0.5em; }
.doc-body li::marker { color: var(--text-3); }
.doc-body li > ul { margin-top: 0.5em; list-style: circle; }
.doc-body strong { font-weight: 500; color: var(--paper); }
.doc-draft { margin-bottom: 40px; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
/* Links in running text stay underlined, so they never rely on color alone (WCAG 1.4.1) */
:is(.doc-body, .faq-answer, .offer-notes, .footer-meta) a { text-underline-offset: 3px; transition: color 150ms var(--ease); }
:is(.doc-body, .faq-answer, .offer-notes, .footer-meta) a:hover { color: var(--paper); }
/* External links show an arrow; the empty alt text keeps screen readers from announcing it */
.doc-body a[href^="http"]::after { content: "\00a0\2197" / ""; }
.not-found { min-height: 70vh; display: grid; align-content: center; }
.not-found h1 { margin-bottom: 16px; }
.not-found .lead { margin-bottom: 32px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-section);
  padding: 48px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-small);
}
.footer-grid { display: grid; gap: 32px; }
.footer-tagline { margin-top: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; color: var(--text-2); transition: color 150ms var(--ease); }
.footer-links a:hover,
.footer-links a[aria-current="page"] { color: var(--paper); }
.footer-meta p + p { margin-top: 6px; }
.footer-meta { color: var(--text-3); }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1.4fr; align-items: start; }
  .footer-links { flex-direction: column; gap: 0; }
  .footer-links a { min-height: 32px; }
}
