/* Gridproof landing — shared stylesheet.
   Palette built from the app icon: near-black #0E1116, signal amber #F59E0B.
   Amber is the BRAND (links, CTA, kickers). Green (--ok) means verified and red
   (--warn) means flagged — status colours the brand never borrows, so a receipt
   still reads as a receipt. Status is never colour-alone: every row keeps its
   glyph. Every text pair is >=4.5:1 in both themes.
   Versioned filename: Cloudflare Pages serves assets max-age=14400, so a new
   URL is the only way to guarantee HTML and CSS ship together. Bump to v3 next. */

:root {
  color-scheme: light dark;
  --bg: #fbfcfd;
  --surface: #ffffff;
  --ink: #12161c;
  --muted: #5a6473;
  --line: #dde2e9;
  /* brass, not raw amber: #f59e0b is only 2.1:1 on white and fails as text */
  --accent: #b45309;
  --accent-ink: #ffffff;
  --ok: #0f7a54;
  --warn: #b91c1c;
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 10px 26px rgba(14, 17, 22, 0.05);
  --radius: 14px;
  --measure: 880px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #171c24; --ink: #e9edf3; --muted: #98a2b3;
    --line: #242b36; --accent: #fbbf24; --accent-ink: #1a1206;
    --ok: #34d399; --warn: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116; --surface: #171c24; --ink: #e9edf3; --muted: #98a2b3;
  --line: #242b36; --accent: #fbbf24; --accent-ink: #1a1206;
  --ok: #34d399; --warn: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

main { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 4rem; }
main.wide { max-width: 1040px; }
main.narrow { max-width: 720px; }
section { margin-top: 3.2rem; }

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 1.1rem; }
h3 { font-size: 1.06rem; line-height: 1.35; letter-spacing: -0.01em; }
p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.3rem; margin-bottom: 0.9rem; }
li + li { margin-top: 0.4rem; }
strong { color: var(--ink); font-weight: 650; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.35em;
}

/* ---- top bar (every page) ---- */
nav.topnav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem 1.5rem;
  max-width: var(--measure); margin: 0 auto; padding: 1.1rem 1.25rem;
}
main.wide ~ nav.topnav, nav.topnav.wide { max-width: 1040px; }
.logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 800; letter-spacing: -0.02em; font-size: 1.12rem;
  color: var(--ink); text-decoration: none;
}
.logo svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.logo span { color: var(--accent); }
.navlinks { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-size: 0.92rem; }
.navlinks a { color: var(--muted); text-decoration: none; }
.navlinks a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the icon of the theme you would switch TO. */
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---- home hero ---- */
header.hero { text-align: center; padding: 3.5rem 0 1rem; }
header.hero h1 { margin: 0 0 1rem; }
.sub { color: var(--muted); font-size: 1.15rem; margin-bottom: 1.5rem; }
header.hero .sub { max-width: 620px; margin: 0 auto 1.9rem; }
.cta {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; padding: 0.85rem 1.6rem; border-radius: 10px; text-decoration: none;
}
.cta:hover { filter: brightness(1.07); }
.cta-note { display: block; margin-top: 0.6rem; color: var(--muted); font-size: 0.9rem; }
.watch-link { display: inline-block; margin-top: 1rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.watch-link:hover { text-decoration: underline; }
.watch-lead { color: var(--muted); margin-bottom: 1.1rem; }

.trust {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.93rem;
}
.trust .tick { color: var(--ok); font-weight: 700; margin-right: 0.3rem; }

/* ---- cards ---- */
.pillars, .plans, .guide-grid { display: grid; gap: 1rem; }
/* 320px keeps the four pillars as a 2x2 block rather than 3+1;
   196px keeps the four plans on one row so the ladder reads left to right. */
.pillars { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.plans { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.guide-grid { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }

.pillar, .plan, .story, .note, .warn-box, .guide-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pillar { padding: 1.2rem 1.3rem; }
.pillar .num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.04em; display: block; margin-bottom: 0.35rem;
}
.pillar h3 { margin-bottom: 0.4rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; }

.story { border-left: 4px solid var(--warn); padding: 1.4rem 1.5rem; }
.story p + p { margin-top: 0.8rem; }

.evidence {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem; line-height: 1.7;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.85rem 1rem; margin-top: 0.9rem;
  overflow-x: auto; white-space: pre;
}
.evidence .ok { color: var(--ok); }
.evidence .bad { color: var(--warn); }

.plan { padding: 1.3rem; position: relative; }
.plan h3 { font-size: 1.06rem; margin-bottom: 0.1rem; }
.plan .price { font-size: 1.5rem; font-weight: 800; margin: 0.2rem 0 0.8rem; letter-spacing: -0.02em; }
.plan ul { padding-left: 1.1rem; color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }
.plan li + li { margin-top: 0.35rem; }
.plan.featured { border-color: var(--accent); }
.plan .flag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 0.4rem;
}

a.guide-card { display: block; padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; }
a.guide-card:hover { border-color: var(--accent); }
a.guide-card h3 { color: var(--ink); margin-bottom: 0.3rem; }
a.guide-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

video { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }

/* ---- guide / legal pages ---- */
header.page-hero { padding: 1rem 0 2.2rem; border-bottom: 1px solid var(--line); margin-bottom: 2.2rem; }
header.page-hero h1 { font-size: clamp(1.8rem, 4.4vw, 2.5rem); line-height: 1.18; margin: 0.6rem 0 0.9rem; }
.kicker {
  color: var(--accent); font-weight: 700; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.dek { color: var(--muted); font-size: 1.08rem; max-width: 680px; }
.note { border-left: 4px solid var(--accent); padding: 1rem 1.2rem; margin: 1rem 0; font-size: 0.95rem; }
.warn-box { border-left: 4px solid var(--warn); padding: 1.2rem 1.4rem; margin: 1rem 0; }
.cta-inline {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; padding: 0.55rem 1.1rem; border-radius: 8px;
  text-decoration: none; font-size: 0.9rem; margin-top: 0.6rem;
}
.cta-inline:hover { filter: brightness(1.07); }

/* ---- comparison tables ---- */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { border: 1px solid var(--line); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
thead th { background: var(--surface); font-weight: 700; }
tbody th { background: var(--surface); font-weight: 650; }
tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.foot-note { color: var(--muted); font-size: 0.88rem; }

/* ---- checklist guide ---- */
.checklist { display: grid; gap: 1rem; }
.check-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem;
}
.check-item h3 { margin-bottom: 0.35rem; }
.check-item .num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; color: var(--accent); margin-right: 0.4rem;
}
.automates {
  margin-top: 0.8rem; padding-top: 0.7rem;
  border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.92rem;
}

/* ---- legal pages (no <section> wrappers, so headings carry their own rhythm) ---- */
main.narrow h1 { margin-top: 1.5rem; }
main.narrow h2 { margin-top: 2.2rem; }
.updated { color: var(--muted); margin-bottom: 2rem; }

/* ---- screencast page ---- */
main.wide > h1 { margin: 1.5rem 0 0.5rem; }

footer {
  margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap;
}
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
