/* ── piptracker.org — shared visual system ────────────────────────────────
   One stylesheet for every page on the site, hand-written and generated
   alike. Tokens are the design system's Clay preset (light + dark via
   prefers-color-scheme), same names as the app's `--pt-*` seam.

   Brand rules honored here (see .agents/skills/piptracker-design):
   one typeface (Onest, self-hosted — no third-party requests), sentence
   case, cards lighter than the page in light mode, raised two-layer card
   shadows, pill buttons, no gradients, no photos, no emoji.
─────────────────────────────────────────────────────────────────────────── */

/* ── Onest, self-hosted (SIL OFL — see fonts/LICENSE-Onest-OFL.txt) ────── */
@font-face { font-family: 'Onest'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/onest_regular.ttf') format('truetype'); }
@font-face { font-family: 'Onest'; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/onest_medium.ttf') format('truetype'); }
@font-face { font-family: 'Onest'; font-weight: 600; font-style: normal; font-display: swap; src: url('/assets/fonts/onest_semibold.ttf') format('truetype'); }
@font-face { font-family: 'Onest'; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/onest_bold.ttf') format('truetype'); }

/* ── Tokens — Clay light, Clay dark ────────────────────────────────────── */
:root {
  --pt-surface: #fffaf4;
  --pt-surface-container: #fffdfa;
  --pt-surface-container-high: #f3ebe0;
  --pt-surface-container-highest: #ece0d2;
  --pt-on-surface: #2a1c15;
  --pt-on-surface-variant: #6b5a4e;
  --pt-on-surface-muted: #9c8a7c;
  --pt-outline: #b7a594;
  --pt-outline-variant: #e3d6c7;
  --pt-primary: #a73a1c;
  --pt-on-primary: #fff8f4;
  --pt-primary-container: #ffdbcd;
  --pt-on-primary-container: #3d1207;
  --pt-input-fill: #f6f0e7;
  --pt-card-shadow: 0 1px 2px rgba(90,55,40,.10), 0 7px 18px rgba(90,55,40,.10);
  --pt-primary-shadow: 0 4px 14px rgba(167,58,28,.26);

  --font: 'Onest', system-ui, -apple-system, sans-serif;
  --max: 960px;
  --max-prose: 720px;
  --pad-x: clamp(20px, 5vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --pt-surface: #1a1310;
    --pt-surface-container: #241a15;
    --pt-surface-container-high: #2f231c;
    --pt-surface-container-highest: #3b2d24;
    --pt-on-surface: #f0e3d8;
    --pt-on-surface-variant: #cdb9a9;
    --pt-on-surface-muted: #9c8678;
    --pt-outline: #5f4f44;
    --pt-outline-variant: #3a2e26;
    --pt-primary: #f08a63;
    --pt-on-primary: #4d1605;
    --pt-primary-container: #7a2e15;
    --pt-on-primary-container: #ffdbcd;
    --pt-input-fill: #3b2d24;
    --pt-card-shadow: 0 2px 10px rgba(0,0,0,.40);
    --pt-primary-shadow: 0 4px 16px rgba(0,0,0,.45);
  }
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light dark; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--pt-on-surface);
  background: var(--pt-surface);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad-x); }
.wrap-prose { max-width: var(--max-prose); margin: 0 auto; padding: 0 var(--pad-x); }
img { max-width: 100%; }
a { color: var(--pt-primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ── Header ────────────────────────────────────────────────────────────── */
header.top { padding: 22px 0 0; }
header.top .wrap, header.top .wrap-prose { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
a.brand { text-decoration: none; color: var(--pt-on-surface); display: inline-flex; align-items: center; gap: 11px; }
a.brand img { width: 32px; height: 32px; display: block; }
.wordmark { font-size: 20px; letter-spacing: -0.025em; }
.wordmark .bold { font-weight: 700; }
.wordmark .lite { font-weight: 400; opacity: 0.55; }
header.top nav { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; }
header.top nav a { font-size: 15px; font-weight: 500; color: var(--pt-on-surface-variant); text-decoration: none; padding: 6px 0; }
header.top nav a:hover { color: var(--pt-on-surface); }

/* ── Type scale (site interpretation of the app scale) ─────────────────── */
h1.display {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  font-size: clamp(34px, 7vw, 56px);
  margin: 0 0 18px;
}
.lede { font-size: clamp(17px, 2.5vw, 19px); color: var(--pt-on-surface-variant); max-width: 54ch; margin: 0 0 28px; }
h2 { font-weight: 600; font-size: clamp(24px, 4vw, 30px); letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 14px; }
h3 { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 8px; }
p, li { color: var(--pt-on-surface-variant); }
p { margin: 0 0 1em; max-width: 64ch; }
strong { color: var(--pt-on-surface); font-weight: 600; }
.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--pt-on-surface-muted); margin: 0 0 14px;
}

/* ── Sections ──────────────────────────────────────────────────────────── */
section { padding: clamp(48px, 9vw, 96px) 0 0; }
section:last-of-type { padding-bottom: clamp(48px, 9vw, 96px); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--pt-surface-container);
  border-radius: 28px;
  box-shadow: var(--pt-card-shadow);
  padding: 22px;
}

/* ── Buttons (pill, 56px, press morph 100→24) ──────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 30px;
  border-radius: 100px;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 0;
  transition: border-radius 180ms ease;
}
.btn:active { border-radius: 24px; }
.btn-primary { background: var(--pt-primary); color: var(--pt-on-primary); box-shadow: var(--pt-primary-shadow); }
.btn-tonal { background: var(--pt-surface-container-high); color: var(--pt-on-surface); }

/* ── Store row (equal weight; "coming soon" chips, not links) ──────────── */
.stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.store {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px;
}
.store .name { font-weight: 600; font-size: 17px; color: var(--pt-on-surface); }
.store .sub { font-size: 13px; color: var(--pt-on-surface-muted); margin-top: 2px; }
.soon {
  flex: none;
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--pt-on-primary-container); background: var(--pt-primary-container);
  border-radius: 100px; padding: 5px 12px; white-space: nowrap;
}

/* ── Feature list (the five types) ─────────────────────────────────────── */
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 24px 0 0; }
.types li { margin: 0; }
.types .card { height: 100%; display: flex; flex-direction: column; }
.types h3 { margin-bottom: 4px; }
.types p { margin: 0; font-size: 15px; }
.types img { display: block; width: 100%; height: auto; margin-top: auto; padding-top: 14px; }

/* ── Plain lists with pip bullets ──────────────────────────────────────── */
ul.pips { list-style: none; padding: 0; margin: 0; }
ul.pips li { position: relative; padding-left: 24px; margin: 0 0 10px; }
ul.pips li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--pt-primary);
}

/* ── FAQ accordion ─────────────────────────────────────────────────────── */
.faq details { border-bottom: 1px solid var(--pt-outline-variant); }
.faq details:first-of-type { border-top: 1px solid var(--pt-outline-variant); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 600; font-size: 16px; color: var(--pt-on-surface);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; color: var(--pt-on-surface-muted); transition: transform 180ms ease; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; }

/* ── Phone frames — real app screenshots (shot-harness renders) ────────── */
.phone {
  width: min(310px, 82vw);
  border-radius: 40px;
  border: 8px solid #2a2522;
  background: var(--pt-surface);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  overflow: hidden;
  flex: none;
}
.phone img, .phone picture { display: block; width: 100%; height: auto; }
/* crop tall screens to a pleasant window; the frame clips the rest */
.phone.crop { max-height: 560px; }
.gallery { display: flex; gap: clamp(20px, 4vw, 44px); flex-wrap: wrap; justify-content: center; align-items: flex-start; margin-top: 32px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gallery figcaption { font-size: 14px; color: var(--pt-on-surface-variant); text-align: center; max-width: 34ch; }

/* ── Guide / prose pages ───────────────────────────────────────────────── */
main.prose h1 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-size: clamp(30px, 6vw, 44px); margin: clamp(40px, 7vw, 72px) 0 16px; }
main.prose h2 { font-size: 22px; margin: 48px 0 14px; }
main.prose h3 { font-size: 17px; margin: 30px 0 10px; }
main.prose ul, main.prose ol { max-width: 64ch; padding-left: 22px; color: var(--pt-on-surface-variant); }
main.prose li { margin: 0 0 0.5em; }
main.prose hr { border: 0; border-top: 1px solid var(--pt-outline-variant); margin: 44px 0; }
main.prose blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--pt-outline-variant); color: var(--pt-on-surface-muted); }
main.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--pt-surface-container-high); padding: 1px 5px; border-radius: 4px; }
main.prose pre { background: var(--pt-surface-container-high); border: 1px solid var(--pt-outline-variant); border-radius: 8px; padding: 16px; overflow-x: auto; }
main.prose pre code { background: none; padding: 0; }
main.prose img.shot {
  display: block; width: min(300px, 92%);
  border-radius: 24px;
  border: 1px solid var(--pt-outline-variant);
  box-shadow: var(--pt-card-shadow);
  margin: 24px 0;
}
/* document pages (the PDF report) — white A4, framed on both themes.
   width AND height:auto together, or the HTML size attributes warp the page. */
main.prose img:not(.shot), img.page {
  display: block;
  width: min(420px, 92vw); height: auto;
  border: 1px solid var(--pt-outline-variant);
  border-radius: 8px;
  box-shadow: var(--pt-card-shadow);
  margin: 24px 0;
}
.gallery img.page { margin: 0; }
.table-scroll { overflow-x: auto; margin: 0 0 1.5em; }
main.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
main.prose th, main.prose td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--pt-outline-variant); color: var(--pt-on-surface-variant); }
main.prose th { color: var(--pt-on-surface); font-weight: 600; }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer.bot {
  margin-top: clamp(56px, 9vw, 96px);
  padding: 48px 0 64px;
  background: var(--pt-surface-container-high);
}
footer.bot .inner { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; align-items: flex-start; }
footer.bot .wordmark { font-size: 16px; }
footer.bot nav { display: flex; gap: 10px 24px; flex-wrap: wrap; }
footer.bot nav a { font-size: 14px; color: var(--pt-on-surface-variant); text-decoration: none; }
footer.bot nav a:hover { color: var(--pt-on-surface); }
footer.bot .small { font-size: 13px; color: var(--pt-on-surface-muted); margin: 18px 0 0; max-width: none; }

/* ── Motion restraint ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
