/* Satiate — shared styles.
   Light only, to match the app's marketing surface. Tokens are pulled straight from
   frontend/docs/DESIGN.md and frontend/src/theme/tokens.js (the `light` palette) so this
   site and the app read as the same product. Font is Inter — DESIGN.md's documented
   substitute for the licensed CoinbaseSans/CoinbaseDisplay faces the app's type scale
   is built on (see frontend/src/theme/typography.ts). */

:root {
  /* surfaces */
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --card: #ffffff;
  --surface-strong: #eef0f3;

  /* text */
  --text: #0a0b0d;
  --text-2: #5b616e;
  --text-3: #7c828a;
  --text-4: #a8acb3;
  --on-primary: #ffffff;

  /* structure */
  --border: #dee1e6;
  --line: #eef0f3;

  /* brand */
  --primary: #0052ff;
  --primary-active: #003ecc;
  --primary-soft: #eef3ff;

  /* semantics — same hexes as the app's dataLight series (protein/carbs/fat) */
  --protein: #0052ff;
  --carbs: #f4b000;
  --fat: #05b169;
  --success: #05b169;
  --error: #cf202f;
  --warning: #f4b000;

  --r-sm: 8px;
  --r-input: 12px;
  --r-lg: 16px;
  --r-card: 24px;
  --r-btn: 100px;
  --wrap: 1160px;
  --doc: 800px;

  --font-display: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  /* DESIGN.md's single elevation tier — used only on hover, never as a resting state. */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-right: auto;
  flex-shrink: 0;
}

.brand svg {
  width: 22px;
  height: 27.7px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav a.link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav a.link:hover {
  color: var(--primary);
}

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

.nav-store {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 620px) {
  .nav-store {
    display: none;
  }
}

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

/* Same pill as button-primary in DESIGN.md — brand blue, not the third-party badge's
   default black, so the one store CTA on the page reads as ours. */
.store {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px 8px 13px;
  border-radius: var(--r-btn);
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  line-height: 1.15;
  white-space: nowrap;
  min-height: 44px;
  transition: background 0.15s ease;
}

.store:hover {
  background: var(--primary-active);
}

.store svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.store small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.3px;
  opacity: 0.88;
  text-transform: uppercase;
}

.store b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.store-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-store .store {
  padding: 6px 12px 6px 10px;
  min-height: 40px;
}

.nav-store .store b {
  font-size: 13px;
}

.nav-store .store small {
  font-size: 8.5px;
}

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

.hero {
  padding: 56px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 7px 16px 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
  margin-bottom: 20px;
}

.chip .dots {
  display: inline-flex;
  gap: 4px;
}

.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

/* Display copy stays at weight 400 with tight negative tracking — DESIGN.md's most
   distinctive typographic rule (see typography.display-* / frontend/src/theme/typography.ts). */
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -1.6px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 16px;
}

.hero p.lead {
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.55;
  max-width: 46ch;
  margin: 0 0 26px;
}

.hero-shot {
  justify-self: center;
}

/* demo1-hero.png is demo1.png cropped to the phone — the original has ~35%
   white margin baked in, which made it read small at any box size. */
.hero-shot img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
}

.sub {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-4);
  letter-spacing: 0;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero p.lead {
    margin-inline: auto;
  }
  .store-row {
    justify-content: center;
  }
  .hero-shot {
    order: -1;
  }
  .hero-shot img {
    max-width: 320px;
    max-height: 62vh;
  }
}

@media (max-width: 380px) {
  .hero {
    padding-top: 40px;
  }
}

/* ---------- generic section ---------- */

section.band {
  background: var(--bg-alt);
}

.section {
  padding: 60px 0;
}

.section h2 {
  text-align: center;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.6px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.15;
}

.section .kicker {
  text-align: center;
  color: var(--text-2);
  margin: 0 auto 34px;
  max-width: 52ch;
  font-size: 16.5px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line);
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 14px 0 7px;
  letter-spacing: 0;
}

.card p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.num {
  width: 34px;
  height: 34px;
  border-radius: var(--r-btn);
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
}

.dot {
  width: 42px;
  height: 42px;
  border-radius: var(--r-btn);
  display: grid;
  place-items: center;
  font-size: 20px;
}

/* ---------- split (phone + list) ---------- */

.split {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 44px;
  align-items: center;
}

.split-shot {
  justify-self: center;
}

.split-shot img {
  width: 100%;
  max-width: 260px;
  display: block;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 17px 20px;
}

.row h3 {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0;
}

.row p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
}

@media (max-width: 800px) {
  .split {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .split-shot img {
    max-width: 220px;
  }
}

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

.callout {
  border-radius: var(--r-card);
  padding: 22px 24px;
  margin: 26px 0;
  border-left: 4px solid var(--protein);
  background: var(--bg-alt);
}

.callout p {
  color: var(--text-2);
}

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

.callout .tag {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--protein);
  margin-bottom: 7px;
}

.callout.ai {
  border-left-color: var(--carbs);
}
.callout.ai .tag {
  color: var(--carbs);
}

.callout.plain {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--protein);
}

.reviewer {
  border: 1px dashed var(--border);
  border-left: 4px solid var(--text-3);
  background: transparent;
}

.reviewer .tag {
  color: var(--text-3);
}

.reviewer li,
.reviewer p {
  font-size: 15px;
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 20px;
  transition: border-color 0.15s ease;
}

.faq details.is-open {
  border-color: var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 30px 16px 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  position: relative;
  min-height: 24px;
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 23px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.22s ease;
}

.faq details.is-open summary::after {
  transform: rotate(-135deg);
  top: 26px;
}

/* Height is animated by JS (details.animate()); overflow is toggled to hidden only
   while that animation runs, set inline, so a resting open item keeps a visible
   focus ring instead of clipping it. */
.faq details p {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------- legal document ---------- */

.doc {
  max-width: var(--doc);
  padding-top: 44px;
  padding-bottom: 20px;
}

.doc h1 {
  font-size: clamp(30px, 6vw, 42px);
  letter-spacing: -1.1px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.1;
}

.meta {
  color: var(--text-3);
  font-size: 15px;
  margin: 0 0 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.doc h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  margin: 38px 0 10px;
  scroll-margin-top: 84px;
}

.doc h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 6px;
  letter-spacing: 0;
}

.doc p,
.doc li {
  color: var(--text-2);
  font-size: 16.5px;
}

.doc p,
.doc li,
.doc td,
.doc code {
  overflow-wrap: break-word;
}

.doc li {
  margin-bottom: 7px;
}

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

.doc ul {
  padding-left: 22px;
}

.doc code {
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 13.5px;
}

.doc a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

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

/* wide tables scroll inside themselves rather than the page */
.doc .table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 520px;
}

.doc th,
.doc td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-2);
  line-height: 1.5;
}

.doc th {
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-alt);
  white-space: nowrap;
}

.doc tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .doc .table-scroll {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
  }

  .doc table {
    display: block;
    min-width: 0;
  }

  .doc thead {
    display: none;
  }

  .doc tbody {
    display: block;
  }

  .doc tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 4px 16px 14px;
    margin-bottom: 10px;
  }

  .doc tr:last-child {
    margin-bottom: 0;
  }

  .doc td {
    display: block;
    padding: 10px 0 0;
    border-bottom: none;
  }

  .doc td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-4);
    margin-bottom: 1px;
  }
}

.toc {
  background: var(--bg-alt);
  border-radius: var(--r-card);
  padding: 20px 24px;
  margin-bottom: 34px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 26px;
}

.toc li {
  font-size: 15px;
  margin-bottom: 5px;
  break-inside: avoid;
  color: var(--text-2);
}

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

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

@media (max-width: 560px) {
  .toc ol {
    columns: 1;
  }

  .wrap {
    padding: 0 18px;
  }

  .nav-inner {
    padding: 12px 18px;
  }
}

/* an unresolved placeholder, so it cannot be missed on the page.
   It must stay wrappable: these run to ~60 characters and would otherwise
   push the document wider than a phone viewport. */
.ph {
  background: rgba(244, 176, 0, 0.18);
  border-bottom: 1px solid var(--warning);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

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

.footer {
  border-top: 1px solid var(--border);
  margin-top: 70px;
  padding: 44px 0 40px;
  background: var(--bg-alt);
}

.footer-cols {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 34px;
}

.footer h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-4);
  margin: 0 0 14px;
  font-weight: 600;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
}

.footer a:hover {
  color: var(--primary);
}

.footer .blurb {
  color: var(--text-3);
  font-size: 14.5px;
  max-width: 34ch;
  margin: 12px 0 18px;
}

.footer-base {
  max-width: var(--wrap);
  margin: 34px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.footer-base .copy {
  color: var(--text-4);
  font-size: 14px;
  margin-right: auto;
}

.footer-base a:hover {
  color: var(--primary);
}

@media (max-width: 760px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  .footer-cols > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ---------- focus ring — keyboard-visible, matching the brand blue ---------- */

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
