/* ============================================================================
   Midos — marketing site
   Design language: "Electric Violet" (dark-only), ported 1:1 from the app's
   token file at mobile/constants/theme.ts. Token VALUES here must stay in sync
   with that file; token names mirror it so a re-skin is a value-only edit.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
  /* Backgrounds — warm violet-black, not blue-black (theme.ts `bg`…`surface3`) */
  --bg: #131022;
  --bg-elevated: #181430;
  --surface: #1e1832;
  --surface-2: #241d3d;
  --surface-3: #2c2448;

  /* Borders — lavender-tinted rgba (theme.ts `border`, `borderStrong`) */
  --border: rgba(167, 159, 206, 0.15);
  --border-strong: rgba(167, 159, 206, 0.28);

  /* Brand. Violet = action. Each fill ships a darker "edge" for press physics. */
  --primary: #7c6af7;
  --primary-edge: #5b4fe9;
  --primary-deep: #453bb4;
  --primary-dim: rgba(124, 106, 247, 0.15);
  /* Web-only: a lighter violet that clears 4.5:1 as text on --surface. */
  --accent-text: #a594ff;

  /* Lime = "earned by saving". Coral = spent. Amber = streak. Ice = freeze. */
  --success: #c9f73a;
  --success-edge: #93c214;
  --success-dim: rgba(201, 247, 58, 0.15);
  --success-text: #d9f87e;
  --danger: #ff6e5e;
  --danger-text: #ff8a7a;
  --warning: #ffb02e;
  --info: #6fd3ff;

  /* Text hierarchy — lavender tints, never neutral gray.
     `--text-dim` is lifted from the app's #645C86 to #8880AC so small print
     still clears WCAG AA (5.1:1) on --bg; the app value is 3.0:1. */
  --text: #f2efff;
  --text-muted: #9d94c0;
  --text-dim: #8880ac;
  --text-faint: #3a3550;

  /* Radial background glow (theme.ts `bgGlowFrom`/`bgGlowTo`, `earnGlow`) */
  --glow-from: #2a2050;
  --glow-to: #131022;
  --earn-glow: rgba(201, 247, 58, 0.35);

  /* Spacing rhythm — the app's 4/8/12/16/20/24/32 plus web-scale steps. */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-2xl: 24px;
  --s-3xl: 32px;
  --s-4xl: 48px;
  --s-5xl: 64px;
  --s-6xl: 96px;

  /* Radii — the app's 14/18/20/24/28 + pill */
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-card: 28px;
  --r-pill: 999px;

  /* Type. Unbounded = display (money, headings). Onest = everything else. */
  --font-display: "Unbounded", "Onest", ui-rounded, "Segoe UI", system-ui,
    -apple-system, sans-serif;
  --font-body: "Onest", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 68ch;
  --wrap: 1120px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* `clip` (not `hidden`) keeps position:sticky working in the header. */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The radial violet glow that sits behind the app's Home screen. Fixed, so it
   never contributes to layout or to horizontal scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      120% 70% at 50% -12%,
      var(--glow-from) 0%,
      var(--glow-to) 62%
    ),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: auto 0 0 0;
  height: 60vh;
  pointer-events: none;
  background: radial-gradient(
    70% 100% at 85% 100%,
    rgba(124, 106, 247, 0.1) 0%,
    transparent 70%
  );
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

p {
  margin: 0;
}

a {
  color: var(--accent-text);
  text-decoration-color: rgba(165, 148, 255, 0.4);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: #c3b7ff;
  text-decoration-color: currentColor;
}

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

::selection {
  background: rgba(124, 106, 247, 0.35);
  color: #fff;
}

/* ------------------------------------------------------------- utilities -- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 32px);
}

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

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--primary-edge);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
  color: #fff;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 var(--s-md);
}

.lead {
  font-size: clamp(17px, 0.98rem + 0.35vw, 20px);
  color: var(--text-muted);
  max-width: 62ch;
}

.accent-lime {
  color: var(--success-text);
}

.accent-violet {
  color: var(--accent-text);
}

/* ----------------------------------------------------------------- logo --- */
.logo {
  width: 36px;
  height: 36px;
  border-radius: 22.5%;
  flex: 0 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

/* --------------------------------------------------------------- header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(19, 16, 34, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  min-height: 68px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.2vw, 26px);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 2px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* On phones the header must stay one row: drop the in-page section links and
   keep the two links that matter everywhere (Privacy Policy, Terms). */
@media (max-width: 760px) {
  .site-nav .nav-anchor {
    display: none;
  }
  .site-header .wrap {
    min-height: 60px;
  }
}

/* ---------------------------------------------------------------- chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.chip--violet {
  border-color: rgba(124, 106, 247, 0.45);
  background: var(--primary-dim);
  color: #cfc6ff;
}

.chip--lime {
  border-color: rgba(201, 247, 58, 0.35);
  background: var(--success-dim);
  color: var(--success-text);
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

/* --------------------------------------------------------------- buttons -- */
/* The app's "press physics": a solid bottom edge that collapses on press. */
.btn {
  --edge: var(--primary-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  border: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary-edge);
  color: #fff;
  box-shadow: 0 4px 0 var(--edge);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.15s ease;
}

.btn:hover {
  background: #6a5af0;
  color: #fff;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--edge);
}

.btn--ghost {
  --edge: rgba(167, 159, 206, 0.22);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 4px 0 var(--edge);
}

.btn--ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  align-items: center;
}

/* Not-yet-shipped status. Deliberately NOT a link and NOT an App Store badge. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  background: linear-gradient(
    180deg,
    rgba(124, 106, 247, 0.14),
    rgba(124, 106, 247, 0.05)
  );
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.status-pill .pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(201, 247, 58, 0.55);
  animation: pulse 2.6s ease-out infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 247, 58, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(201, 247, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 247, 58, 0);
  }
}

/* -------------------------------------------------------------- sections -- */
.section {
  padding-block: clamp(56px, 7vw, 104px);
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 66ch;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head h2 {
  font-size: clamp(28px, 1.3rem + 2.4vw, 42px);
  margin-bottom: var(--s-lg);
}

.section-head p {
  color: var(--text-muted);
  font-size: clamp(16px, 0.95rem + 0.3vw, 19px);
}

/* ----------------------------------------------------------------- hero --- */
.hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(48px, 6vw, 88px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero h1 {
  /* Capped so "Log in seconds." holds a single line in the left column. */
  font-size: clamp(32px, 1.1rem + 3.6vw, 50px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-2xl);
}

.hero h1 .line2 {
  display: block;
  color: var(--success-text);
  text-shadow: 0 0 34px var(--earn-glow);
}

.hero .lead {
  margin-bottom: var(--s-2xl);
}

.hero-cta {
  margin-bottom: var(--s-xl);
}

.hero-note {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 46ch;
}

/* ------------------------------------------------- hero device mock-up ---- */
.mock {
  position: relative;
  margin-inline: auto;
  width: min(100%, 360px);
}

/* Inline icon set — stroke-based, inherits colour, no emoji font dependency. */
.i {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i--solid {
  fill: currentColor;
  stroke: none;
}

.mock-icon .i {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
}

.mock-streak .i {
  width: 14px;
  height: 14px;
}

.mock-card {
  border-radius: var(--r-card);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: var(--s-2xl);
  display: grid;
  gap: var(--s-xl);
}

.mock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
}

.mock-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.mock-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 176, 46, 0.14);
  border: 1px solid rgba(255, 176, 46, 0.32);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
}

.mock-earned {
  display: grid;
  gap: 4px;
}

.mock-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 8vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--success);
  text-shadow: 0 0 30px var(--earn-glow);
}

.mock-label {
  font-size: 13px;
  color: var(--text-muted);
}

.mock-bar {
  display: grid;
  gap: 10px;
}

.mock-bar-track {
  position: relative;
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: visible;
}

.mock-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 62%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary-edge), var(--primary));
}

.mock-bar-marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 71%;
  width: 2px;
  border-radius: 2px;
  background: var(--text-muted);
}

.mock-bar-legend {
  display: flex;
  justify-content: space-between;
  gap: var(--s-sm);
  font-size: 12px;
  color: var(--text-dim);
}

.mock-rows {
  display: grid;
  gap: var(--s-sm);
  border-top: 1px solid var(--border);
  padding-top: var(--s-lg);
}

.mock-row {
  display: flex;
  align-items: center;
  gap: var(--s-md);
}

.mock-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.mock-row-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-row-amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.is-spent {
  color: var(--danger-text);
}

.is-earned {
  color: var(--success-text);
}

.mock-caption {
  margin-top: var(--s-md);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- cards --- */
.grid {
  display: grid;
  gap: var(--s-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 264px), 1fr));
}

.card {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--s-2xl);
  display: grid;
  gap: var(--s-md);
  align-content: start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, transform 0.18s ease,
    background-color 0.18s ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--primary-dim);
  border: 1px solid rgba(124, 106, 247, 0.3);
  color: var(--accent-text);
  font-size: 20px;
  line-height: 1;
}

.card-icon--lime {
  background: var(--success-dim);
  border-color: rgba(201, 247, 58, 0.3);
  color: var(--success-text);
}

.card-icon--amber {
  background: rgba(255, 176, 46, 0.14);
  border-color: rgba(255, 176, 46, 0.3);
  color: var(--warning);
}

.card-icon--ice {
  background: rgba(111, 211, 255, 0.13);
  border-color: rgba(111, 211, 255, 0.3);
  color: var(--info);
}

/* Numbered "how it works" steps */
.steps {
  counter-reset: step;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-text);
  background: var(--primary-dim);
  border: 1px solid rgba(124, 106, 247, 0.3);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

/* ------------------------------------------------------- privacy section -- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-lg);
}

.check-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: var(--s-md);
  align-items: start;
  font-size: 16px;
  color: var(--text-muted);
}

.check-list li strong {
  color: var(--text);
  font-weight: 600;
}

.check-list li::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--success-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9F73A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 13px 13px no-repeat;
  border: 1px solid rgba(201, 247, 58, 0.3);
}

/* ------------------------------------------------------------- pricing ---- */
.plans {
  display: grid;
  gap: var(--s-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: stretch;
}

.plan {
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(24px, 3vw, 32px);
  display: grid;
  gap: var(--s-lg);
  align-content: start;
}

.plan--pro {
  border-color: rgba(124, 106, 247, 0.42);
  background: linear-gradient(
    180deg,
    rgba(124, 106, 247, 0.12),
    var(--surface) 55%
  );
}

.plan-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-price {
  font-size: 15px;
  color: var(--text-muted);
}

.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.plan li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 15.5px;
  color: var(--text-muted);
}

.plan li::before {
  content: "";
  margin-top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

.plan--pro li::before {
  background: var(--primary);
}

.fineprint {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 78ch;
  margin-top: var(--s-2xl);
}

/* ------------------------------------------------------------ languages --- */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

.langs li {
  list-style: none;
}

/* ------------------------------------------------------------------ faq --- */
.faq {
  display: grid;
  gap: var(--s-md);
  max-width: 82ch;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.faq details[open] {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--s-lg) var(--s-xl);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-md);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.18s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.faq .faq-body {
  padding: 0 var(--s-xl) var(--s-xl);
  color: var(--text-muted);
  font-size: 16px;
  max-width: 72ch;
}

/* --------------------------------------------------------------- footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(24, 20, 48, 0.5);
  padding-block: clamp(40px, 5vw, 64px);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg) var(--s-2xl);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-legal {
  margin-top: var(--s-3xl);
  padding-top: var(--s-xl);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--s-md);
}

.footer-legal p {
  font-size: 13.5px;
  color: var(--text-dim);
  max-width: 88ch;
  line-height: 1.6;
}

/* ============================================================ legal pages == */
.legal-hero {
  padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-size: clamp(30px, 1.4rem + 3vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-lg);
}

.legal-hero .lead {
  max-width: 60ch;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(36px, 5vw, 64px) clamp(56px, 7vw, 96px);
  align-items: start;
}

@media (min-width: 1000px) {
  .legal-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

/* --- table of contents (built by site/legal.js from the injected <h2>s) --- */
.toc {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--s-lg) var(--s-xl);
}

.toc[hidden] {
  display: none;
}

@media (min-width: 1000px) {
  .toc {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

.toc > summary {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  list-style: none;
}

.toc > summary::-webkit-details-marker {
  display: none;
}

@media (min-width: 1000px) {
  .toc > summary {
    cursor: default;
    pointer-events: none;
  }
}

.toc ol {
  list-style: none;
  margin: var(--s-md) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
}

.toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* --- long-form legal typography ------------------------------------------ */
.legal-body {
  max-width: var(--measure);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.legal-body > * + * {
  margin-top: var(--s-lg);
}

.legal-body h1 {
  font-size: clamp(28px, 1.3rem + 2.2vw, 38px);
  color: var(--text);
  margin-top: var(--s-4xl);
  scroll-margin-top: 96px;
}

.legal-body h2 {
  font-size: clamp(22px, 1.1rem + 1.2vw, 28px);
  color: var(--text);
  margin-top: var(--s-4xl);
  padding-top: var(--s-2xl);
  border-top: 1px solid var(--border);
  scroll-margin-top: 96px;
}

.legal-body h2:first-of-type {
  margin-top: var(--s-2xl);
  border-top: 0;
  padding-top: 0;
}

.legal-body h3 {
  font-size: 19px;
  color: var(--text);
  margin-top: var(--s-3xl);
  scroll-margin-top: 96px;
}

.legal-body h4 {
  font-family: var(--font-body);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
  margin-top: var(--s-2xl);
  scroll-margin-top: 96px;
}

.legal-body p {
  margin-top: var(--s-lg);
}

.legal-body strong {
  color: var(--text);
  font-weight: 600;
}

.legal-body ul,
.legal-body ol {
  margin-top: var(--s-lg);
  padding-left: 1.35em;
  display: grid;
  gap: var(--s-sm);
}

.legal-body li::marker {
  color: var(--primary);
}

.legal-body li > ul,
.legal-body li > ol {
  margin-top: var(--s-sm);
}

.legal-body a {
  font-weight: 500;
}

.legal-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.legal-body blockquote {
  margin-inline: 0;
  padding: var(--s-lg) var(--s-xl);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface);
  color: var(--text-muted);
}

.legal-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--s-3xl);
}

/* Wide tables must scroll inside their own box — the page never scrolls sideways. */
.legal-body .table-scroll,
.legal-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.legal-body table {
  border-collapse: collapse;
  font-size: 15.5px;
  white-space: nowrap;
}

.legal-body th,
.legal-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.legal-body thead th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.legal-body .updated,
.legal-body em.updated {
  display: inline-block;
  font-style: normal;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* Small screens: keep everything inside 360px. */
@media (max-width: 380px) {
  body {
    font-size: 16px;
  }
  .mock-card {
    padding: var(--s-xl);
  }
  .card,
  .plan {
    padding: var(--s-xl);
  }
}
