/* sagearchive.com — marketing site.
 *
 * Built on the app's own design system: assets/vendor/tokens.css and type.css
 * are copied verbatim from sagearchive-design-system/ and deploy-web.sh fails
 * if they have drifted. Everything below is site-only layout that has no place
 * in the app itself.
 *
 * Design-system rules this file obeys:
 *   - The accent marks what responds to a click. Nothing else.
 *   - Nothing moves in space. Opacity and background only.
 *   - No shimmer, no skeletons, no numbers that count up.
 */

/* ── Reset ─────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sa-bg);
  color: var(--sa-text-1);
  font-family: var(--sa-font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--sa-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--sa-accent);
  outline-offset: 2px;
  border-radius: var(--sa-radius-sm);
}

/* ── Layout ────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

section { padding: 88px 0; border-top: 1px solid var(--sa-border); }
section:first-of-type { border-top: none; }

@media (max-width: 720px) { section { padding: 56px 0; } }

.stack > * + * { margin-top: var(--sa-space-6); }

/* ── Type roles, extended for a page rather than an app window ─── */

.label {
  font-family: var(--sa-font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sa-text-3);
}

h1.display {
  font-family: var(--sa-font-display);
  font-size: clamp(38px, 6.2vw, 62px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

h2.section-title {
  font-family: var(--sa-font-display);
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
  max-width: 20ch;
}

h3.item-title {
  font-family: var(--sa-font-ui);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.014em;
}

.lede {
  font-family: var(--sa-font-read);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.62;
  color: var(--sa-text-2);
  max-width: 58ch;
  text-wrap: pretty;
}

.body {
  font-family: var(--sa-font-read);
  font-size: 16.5px;
  line-height: 1.64;
  color: var(--sa-text-2);
  max-width: 62ch;
  text-wrap: pretty;
}

.caption { font-size: 13px; color: var(--sa-text-3); }
.mono { font-family: var(--sa-font-mono); }

/* ── Header ────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--sa-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--sa-border);
}

.site-header .wrap {
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--sa-space-7);
}

.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand img { width: 20px; height: 20px; }
.brand span {
  font-family: var(--sa-font-mono);
  font-size: 12.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sa-text-1);
}

.site-nav { display: flex; align-items: center; gap: var(--sa-space-7); }
.site-nav a { font-size: 14px; color: var(--sa-text-2); }
.site-nav a:hover { color: var(--sa-text-1); text-decoration: none; }
@media (max-width: 700px) { .site-nav .hide-sm { display: none; } }

/* ── Buttons ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--sa-radius);
  border: 1px solid transparent;
  font-family: var(--sa-font-ui);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--sa-dur-hover) var(--sa-ease);
}

.btn-primary { background: var(--sa-accent); color: var(--sa-accent-on); }
.btn-primary:hover {
  background: color-mix(in srgb, var(--sa-accent) 88%, var(--sa-text-1));
  text-decoration: none;
}

.btn-quiet {
  background: transparent;
  border-color: var(--sa-border-strong);
  color: var(--sa-text-1);
}
.btn-quiet:hover { background: var(--sa-sunken); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────────────── */

.hero { padding-top: 76px; padding-bottom: 0; }
.hero .lede { margin-top: var(--sa-space-6); }
.hero-cta { margin-top: var(--sa-space-8); }

.shot {
  margin-top: 64px;
  border: 1px solid var(--sa-border-strong);
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
  background: var(--sa-sunken);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--sa-border);
  background: var(--sa-canvas);
  font-size: 12.5px;
  color: var(--sa-text-3);
}

/* ── Signup form ───────────────────────────────────────────────── */

.signup { display: flex; flex-wrap: wrap; gap: var(--sa-space-3); max-width: 470px; }

.signup input[type="email"] {
  flex: 1 1 240px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sa-border-strong);
  border-radius: var(--sa-radius);
  background: var(--sa-surface);
  color: var(--sa-text-1);
  font-family: var(--sa-font-ui);
  font-size: 15px;
}
.signup input[type="email"]::placeholder { color: var(--sa-text-3); }
.signup input[type="email"]:focus-visible { border-color: var(--sa-accent); }

/* Honeypot: off-screen rather than display:none, so a form-filling bot that
   skips hidden fields still sees it. Never focusable by a real keyboard user. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The price. Loud enough to be the answer to the ledger above it, quiet
   enough not to become the headline — the headline is the archive, not the
   discount. */
.price-line {
  margin-top: var(--sa-space-6);
  font-family: var(--sa-font-ui);
  font-size: 17px;
  color: var(--sa-text-2);
}
.price-line b { color: var(--sa-text-1); font-weight: 600; }

.signup-note { margin-top: var(--sa-space-3); font-size: 13.5px; color: var(--sa-text-3); max-width: 58ch; }
.signup-status { margin-top: var(--sa-space-4); font-size: 14px; min-height: 1.4em; }
.signup-status[data-state="ok"] { color: var(--sa-success); }
.signup-status[data-state="error"] { color: var(--sa-error); }

/* ── Grids ─────────────────────────────────────────────────────── */

.grid { display: grid; gap: var(--sa-space-8); margin-top: var(--sa-space-9); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.grid h3.item-title { margin-bottom: var(--sa-space-4); }
.grid .body { font-size: 15.5px; }

/* ── The cost table ────────────────────────────────────────────── */

.ledger {
  margin-top: var(--sa-space-9);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  overflow: hidden;
}
.ledger-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sa-space-4);
  align-items: baseline;
  padding: 14px 18px;
  border-top: 1px solid var(--sa-border);
}
.ledger-row:first-child { border-top: none; }
.ledger-row .what { flex: 1 1 260px; font-weight: 600; font-size: 15px; }
.ledger-row .detail { flex: 2 1 320px; font-size: 14px; color: var(--sa-text-2); }
.ledger-row .cost { font-family: var(--sa-font-mono); font-size: 14px; color: var(--sa-text-1); white-space: nowrap; }
.ledger-total { background: var(--sa-sunken); }
.ledger-total .what { font-family: var(--sa-font-display); font-size: 17px; }
.ledger-total .cost { font-size: 16px; }

/* ── Device list ───────────────────────────────────────────────── */

.devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: var(--sa-space-9);
  background: var(--sa-border); border: 1px solid var(--sa-border); border-radius: var(--sa-radius); overflow: hidden; }
@media (max-width: 860px) { .devices { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .devices { grid-template-columns: 1fr; } }

.device { background: var(--sa-bg); padding: 20px 18px; }
.device .name { font-weight: 600; font-size: 15px; }
.device .kind { margin-top: 3px; font-size: 13px; color: var(--sa-text-3); }

/* ── Honesty strip ─────────────────────────────────────────────── */

.honest {
  border: 1px solid var(--sa-border-strong);
  border-radius: var(--sa-radius);
  padding: 28px;
  background: var(--sa-canvas);
}
.honest .body { max-width: none; }

.status-list { margin-top: var(--sa-space-7); }
.status-list li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sa-space-4);
  padding: 11px 0;
  border-top: 1px solid var(--sa-border);
  font-size: 14.5px;
}
.status-list li:first-child { border-top: none; }
.status-list .state {
  flex: 0 0 132px;
  font-family: var(--sa-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 4px;
}
.status-list .state[data-s="verified"] { color: var(--sa-success); }
.status-list .state[data-s="untested"] { color: var(--sa-warning); }
.status-list .thing { flex: 1 1 320px; color: var(--sa-text-2); }
.status-list .thing b { color: var(--sa-text-1); font-weight: 600; }

/* ── Roadmap ───────────────────────────────────────────────────── */

.later { border-left: 2px solid var(--sa-border-strong); padding-left: 22px; }
.later + .later { margin-top: var(--sa-space-9); }

/* ── Closing CTA ───────────────────────────────────────────────── */

.closer { background: var(--sa-canvas); }
.closer .signup { margin-top: var(--sa-space-8); }

/* ── Footer ────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--sa-border);
  padding: 40px 0 56px;
  font-size: 13.5px;
  color: var(--sa-text-3);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--sa-space-7); align-items: baseline; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sa-space-6); margin-left: auto; }
.site-footer a { color: var(--sa-text-2); }

/* ── Long-form pages (privacy, support, how it works) ──────────── */

.doc { padding: 64px 0 88px; }
.doc h1 {
  font-family: var(--sa-font-display);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.038em;
}
.doc h2 {
  font-family: var(--sa-font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.024em;
  margin-top: 48px;
}
.doc h3 { font-size: 17px; font-weight: 600; margin-top: 30px; }
.doc p, .doc li {
  font-family: var(--sa-font-read);
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--sa-text-2);
  max-width: 66ch;
  text-wrap: pretty;
}
.doc p { margin-top: 16px; }
.doc ul { margin-top: 16px; }
.doc ul li { position: relative; padding-left: 20px; margin-top: 8px; }
.doc ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sa-text-3);
}
.doc .updated { margin-top: 12px; font-family: var(--sa-font-mono); font-size: 12px; color: var(--sa-text-3); }
.doc strong { color: var(--sa-text-1); font-weight: 600; }

/* ── Theme toggle ──────────────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--sa-border-strong);
  border-radius: var(--sa-radius);
  background: transparent;
  color: var(--sa-text-2);
  font-family: var(--sa-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--sa-dur-hover) var(--sa-ease);
}
.theme-toggle:hover { background: var(--sa-sunken); color: var(--sa-text-1); }
