/*
  mydietbot.com — the only stylesheet.
  Tokens mirror apps/mobile/src/design/tokens.ts ("The Living Journal": cream paper, sage ink,
  tonal layering instead of hard lines). No build step: edit and deploy.
*/

/* Fonts: Manrope (headlines) + Inter (body), self-hosted variable woff2 (SIL OFL 1.1, see assets/fonts). */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  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: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  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";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

  --surface: #fbf9f5;
  --surface-low: #f5f4ef;
  --surface-container: #efeee9;
  --surface-high: #e9e8e3;
  --surface-highest: #e3e3dc;
  --surface-lowest: #ffffff;
  --primary: #4d654a;
  --primary-dim: #41593f;
  --on-primary: #eaffe3;
  --primary-container: #ceeac7;
  --on-primary-container: #40583d;
  --secondary-container: #dae8be;
  --tertiary-container: #f6fad5;
  --text: #31332f;
  --muted: #5e605b;
  --outline: rgba(178, 178, 173, 0.5);
  --ghost-border: rgba(178, 178, 173, 0.28);
  --shadow: 0 10px 40px rgba(49, 51, 47, 0.07);
  --shadow-soft: 0 2px 12px rgba(49, 51, 47, 0.05);
  --tile: #fbf9f5;
  --tile-border: rgba(49, 51, 47, 0.08);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --font-head: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;

  --container: 1120px;
  --prose: 44rem;
  --gutter: clamp(16px, 5vw, 40px);
  --section-space: clamp(64px, 10vw, 120px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #141712;
    --surface-low: #1a1e18;
    --surface-container: #20251e;
    --surface-high: #272d25;
    --surface-highest: #2f362d;
    --surface-lowest: #1d221b;
    --primary: #a8cfa1;
    --primary-dim: #bcdcb5;
    --on-primary: #10240e;
    --primary-container: #2f462d;
    --on-primary-container: #cfeac8;
    --secondary-container: #34402a;
    --tertiary-container: #34371f;
    --text: #e7e9e1;
    --muted: #b6bbaf;
    --outline: rgba(182, 187, 175, 0.35);
    --ghost-border: rgba(182, 187, 175, 0.16);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.25);
    --tile-border: rgba(255, 255, 255, 0.08);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
}

h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.625rem);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary-dim);
  text-decoration-thickness: 0.12em;
}

strong {
  font-weight: 650;
}

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

::selection {
  background: var(--primary-container);
  color: var(--text);
}

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--on-primary);
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  line-height: 1.6;
  color: var(--muted);
}

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

/* ---------- Header ---------- */
.site-header {
  padding-block: 18px;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

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

.brand-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px var(--tile-border);
}

.brand-tile img {
  width: 30px;
  height: auto;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--surface-container);
  color: var(--text);
}

.nav-list a[aria-current="page"] {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

@media (max-width: 640px) {
  .site-nav {
    width: 100%;
  }

  .nav-list {
    justify-content: space-between;
    margin-inline: -6px;
  }

  .nav-list a {
    padding: 8px 6px;
    font-size: 0.875rem;
  }
}

/* ---------- Buttons & badges ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.button-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dim));
  color: var(--on-primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.button-primary:hover {
  color: var(--on-primary);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface-container);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-highest);
  color: var(--text);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 22px 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--surface);
}

.store-badge svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.store-badge-kicker {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.store-badge-title {
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 800;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(32px, 7vw, 88px) var(--section-space);
  overflow-x: clip; /* the tilted backdrop behind the phone must never cause sideways scrolling */
}

.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }
}

.hero h1 {
  max-width: 17ch;
}

.hero .lead {
  max-width: 36rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Phone mock (decorative, aria-hidden in markup) ---------- */
.phone {
  position: relative;
  width: min(100%, 400px);
  margin: 0 auto;
}

.phone::before {
  content: "";
  position: absolute;
  inset: 8% -8% -6% 10%;
  z-index: -1;
  border-radius: 48px;
  background: var(--primary-container);
  opacity: 0.55;
  transform: rotate(4deg);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px 18px;
  border-radius: 40px;
  background: var(--surface-low);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--ghost-border);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 10px;
}

.phone-top .brand-tile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.phone-top .brand-tile img {
  width: 26px;
}

.phone-coach {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.phone-coach-name {
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--primary);
}

.phone-coach-role {
  font-size: 0.8125rem;
  color: var(--muted);
}

.bubble {
  max-width: 86%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 24px;
}

.bubble-user {
  align-self: flex-end;
  border-bottom-right-radius: 8px;
  background: var(--surface-highest);
  color: var(--text);
}

.bubble-coach {
  align-self: flex-start;
  border-bottom-left-radius: 8px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.bubble-photo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 8px 12px;
}

.bubble-photo span {
  padding-inline: 8px;
}

.plate {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--surface-lowest);
}

.plate::before {
  content: "";
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  /* A stylised bowl: chicken, rice, avocado and a little sesame, drawn with gradients (no image request). */
  background:
    radial-gradient(circle at 34% 34%, #d49a5c 0 13%, transparent 14%),
    radial-gradient(circle at 52% 26%, #c98a4f 0 10%, transparent 11%),
    radial-gradient(circle at 24% 52%, #dca46a 0 9%, transparent 10%),
    radial-gradient(circle at 66% 60%, #8fb86f 0 15%, transparent 16%),
    radial-gradient(circle at 74% 40%, #b9d494 0 10%, transparent 11%),
    radial-gradient(circle at 42% 70%, #fbf8ef 0 19%, transparent 20%),
    radial-gradient(circle at 58% 80%, #f6f1e3 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, #efe6cf 0 62%, #e7dcc0 63% 100%);
  box-shadow: 0 0 0 9px #f4f2ec, 0 0 0 10px rgba(49, 51, 47, 0.08), 0 12px 24px rgba(49, 51, 47, 0.12);
}

.draft-card {
  align-self: stretch;
  padding: 16px 16px 14px;
  border-radius: 24px;
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--ghost-border);
}

.draft-eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 800;
}

.draft-items {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.draft-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.draft-items li span:last-child {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.draft-total {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ghost-border);
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.draft-total strong {
  color: var(--text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-container);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.chip-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-lowest);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--ghost-border);
}

.composer svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--primary);
}

.composer span {
  flex: 1;
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-space);
}

.section-tinted {
  background: var(--surface-low);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head p:last-child {
  margin-bottom: 0;
}

.section-foot {
  margin: 32px 0 0;
  font-weight: 600;
}

.card-grid {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

  .card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (min-width: 640px) and (max-width: 999px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  padding: clamp(24px, 3vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--ghost-border);
}

.section-tinted .card {
  background: var(--surface-lowest);
}

.card h3 {
  margin-bottom: 8px;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.split {
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

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

  .split-reverse > :first-child {
    order: 2;
  }
}

.check-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 36px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-container);
}

.check-list li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: calc(0.2em + 5px);
  width: 8px;
  height: 11px;
  border: solid var(--on-primary-container);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.panel {
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-xl);
  background: var(--surface-container);
}

.panel-stack {
  display: grid;
  gap: 14px;
}

.memory-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft);
}

.memory-kind {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.memory-title {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-weight: 700;
}

.correction {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-lowest);
  box-shadow: inset 0 0 0 1px var(--ghost-border);
  font-size: 0.9375rem;
}

.correction-label {
  font-weight: 650;
  color: var(--muted);
}

.pace-grid {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 560px) {
  .pace-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pace {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft);
}

.pace-name {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--primary);
}

.pace-value {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.pace-meta {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.floor-note {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--tertiary-container);
  font-size: 0.9375rem;
}

/* ---------- FAQ ---------- */
.faq-section h2 {
  margin-bottom: 24px;
}

.faq {
  display: grid;
  gap: 12px;
  max-width: 50rem;
}

.faq details {
  border-radius: var(--radius-md);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--ghost-border);
}

.faq summary {
  position: relative;
  padding: 20px 56px 20px 24px;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-md);
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 50%;
  width: 10px;
  height: 10px;
  border: solid var(--primary);
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.faq-body {
  padding: 0 24px 20px;
  color: var(--muted);
}

.faq-body p:last-child,
.faq-body ol:last-child,
.faq-body ul:last-child {
  margin-bottom: 0;
}

/* ---------- Callouts ---------- */
.callout {
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--secondary-container);
  color: var(--text);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 800;
}

.disclaimer-band {
  padding-block: 40px;
}

.disclaimer-band .callout {
  max-width: 60rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding-block: 56px 32px;
  background: var(--surface-container);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

.footer-tagline {
  max-width: 22rem;
  margin: 14px 0 0;
  color: var(--muted);
}

.footer-heading {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-links {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--outline);
  color: var(--muted);
  font-size: 0.8125rem;
}

.footer-bottom p {
  margin: 0 0 6px;
}

/* ---------- Document pages (legal, support, AI) ---------- */
.doc {
  padding-block: clamp(24px, 5vw, 56px) var(--section-space);
}

.doc-header {
  max-width: var(--prose);
  margin-bottom: 32px;
}

.doc-header h1 {
  font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.25rem);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--muted);
}

.doc-meta span {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-container);
}

.doc-layout {
  display: grid;
  gap: 40px;
}

@media (min-width: 1000px) {
  .doc-layout {
    grid-template-columns: 15rem minmax(0, var(--prose));
    gap: 64px;
  }

  .toc {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow: auto;
  }
}

.toc {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-low);
  font-size: 0.9375rem;
}

.toc-title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.25rem;
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

.toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.summary-card {
  margin-bottom: 40px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.summary-card h2 {
  margin-bottom: 12px;
  font-size: 1.25rem;
  color: var(--on-primary-container);
}

.summary-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
}

.prose {
  min-width: 0;
}

.prose > section + section {
  margin-top: 48px;
}

.prose h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  scroll-margin-top: 24px;
}

.prose h3 {
  margin-top: 28px;
  font-size: 1.1875rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 6px;
}

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

.table-wrap {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--ghost-border);
}

.table-wrap:focus-visible {
  outline-offset: 2px;
}

table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

caption {
  padding: 14px 16px 6px;
  text-align: left;
  font-weight: 650;
  color: var(--muted);
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--ghost-border);
}

thead th {
  border-top: 0;
  background: var(--surface-low);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.875rem;
}

tbody th {
  font-weight: 650;
}

@media (max-width: 600px) {
  table {
    font-size: 0.875rem;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
  }

  caption {
    padding-inline: 12px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  th:first-child,
  td:first-child {
    padding-left: 12px;
  }

  th:last-child,
  td:last-child {
    padding-right: 12px;
  }
}

.formula {
  margin: 0 0 1.25rem;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-container);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-x: auto;
}

.formula p {
  margin: 0;
}

.contact-grid {
  display: grid;
  gap: 16px;
  margin: 0 0 40px;
}

@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.contact-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--ghost-border);
}

.contact-card h2 {
  font-size: 1.1875rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.contact-email {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.steps,
.prose .steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  counter-increment: step;
  padding: 16px 18px 16px 64px;
  border-radius: var(--radius-md);
  background: var(--surface-low);
}

.steps li + li {
  margin-top: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-head);
  font-weight: 800;
}

/* ---------- 404 ---------- */
.not-found {
  padding-block: clamp(48px, 10vw, 120px);
  text-align: center;
}

.not-found .brand-tile {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  border-radius: 28px;
}

.not-found .brand-tile img {
  width: 64px;
}

.not-found .lead {
  max-width: 32rem;
  margin-inline: auto;
}

.not-found .hero-actions {
  justify-content: center;
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .button-primary:hover {
    transform: none;
  }
}

@media print {
  .site-header nav,
  .skip-link,
  .toc,
  .hero-visual {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-footer {
    background: none;
  }

  .doc-layout {
    display: block;
  }
}
