/* site.css — shared chrome + tokens for the redesigned public site
 * (the "paper" theme, #4 redesign).
 *
 * Scoped to body.site so the legacy dark pages (still on Layout) are
 * untouched until their slice migrates. Holds the paper design
 * tokens, the site nav, the site footer, and the shared primitives
 * (container, section header, buttons) every redesigned marketing
 * page reuses. Page-specific styles live in css/<surface>.css.
 *
 * Loaded with css/fonts.css (self-hosted DM Serif Display / IBM Plex
 * Mono / Geist). No Google Fonts <link> at runtime (RFC 006).
 */

/* ── Paper tokens ───────────────────────────────────────────────── */

body.site {
  color-scheme: light;

  /* Restrained, cool, light system — modelled on premium product
   * sites (near-monochrome, one accent used sparingly, semantic
   * color quarantined to artifacts). Deliberately not the warm
   * cream + terracotta of the source mockups. */
  --ink: #11141b;          /* primary text + dark surfaces */
  --paper: #f7f8fa;        /* page background (cool near-white) */
  --paper-2: #eef0f4;      /* raised panels */
  --paper-3: #e2e5ec;      /* deeper panels / hovers */

  --surface-dark: #0f1118; /* dark bands (cool, not pure black) */
  --surface-dark-2: #161a24;/* cards on dark bands */

  /* One brand accent. Used sparingly: links, the eyebrow, one
   * emphasized phrase per heading, interactive hovers. Never as
   * decoration on mono labels. */
  --accent: #3a5bd9;
  --accent-light: #6f8cf5;
  --accent-pale: #eaeefb;

  /* Semantic signal — only inside artifacts (receipts, proof rows). */
  --green-signal: #1f7a47;
  --green-pale: #e6f1ea;
  --red-signal: #b3382f;
  --red-pale: #f6e6e4;

  --muted: #5a616f;
  --muted-2: #939aa8;
  --border: rgba(17, 20, 27, 0.10);
  --border-strong: rgba(17, 20, 27, 0.22);

  --serif: 'DM Serif Display', Georgia, serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: 'Geist', system-ui, sans-serif;

  --site-radius: 4px;
  --site-max: 1200px;

  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Compatibility aliases: the prose-heavy secondary pages (docs,
 * whitepaper, security, legal, receipt) were authored against the
 * dark base tokens (--fg/--bg/--rule/...). Rather than rewrite each
 * file, map those names to the paper palette inside body.site so the
 * same CSS renders correctly on the light theme. Page-specific files
 * stay token-driven; only these aliases differ between themes. */
body.site {
  --fg: var(--ink);
  --fg-soft: #3b424f;
  --fg-muted: var(--muted);
  --bg: var(--paper);
  --bg-elev: #ffffff;
  --bg-code: #0f1118;
  --rule: var(--border-strong);
  --rule-soft: var(--border);
  --rule-width: 1px;
  --accent-soft: var(--accent-light);
  --danger: var(--red-signal);
  --warn: #9a6a00;
  --ok: var(--green-signal);
  --max-page: var(--site-max);
  --max-prose: 68ch;
}

/* Paint the document element too, so short pages and scroll
 * overscroll never reveal the legacy dark app.css html background
 * below the footer. */
html:has(body.site) {
  background: #f7f8fa;
}

body.site h1,
body.site h2,
body.site h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}

/* One emphasized phrase per heading carries the accent. */
body.site h1 em,
body.site h2 em,
body.site h3 em {
  font-style: italic;
  color: var(--accent);
}

body.site a {
  color: inherit;
  text-decoration: none;
}

/* ── Shared layout primitives ───────────────────────────────────── */

.site-container {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 3rem;
}

.site-section {
  border-bottom: 0.5px solid var(--border);
}

.site-section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 1rem;
}

.site-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-pale);
  border: 0.5px solid color-mix(in oklab, var(--accent) 30%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
}

.site-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Buttons ────────────────────────────────────────────────────── */
/* Colors are scoped under body.site so they win over the generic
 * `body.site a { color: inherit }` rule (which otherwise made the
 * solid primary button render dark-on-dark). */

.site-btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--site-radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.site .site-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

body.site .site-btn-primary:hover {
  background: #000;
  border-color: #000;
}

body.site .site-btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
  font-weight: 400;
}

body.site .site-btn-secondary:hover {
  background: var(--paper-2);
  border-color: var(--ink);
}

body.site .site-btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.site .site-btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

/* ── Site nav ───────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 0.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 56px;
}

.site-logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-logo span { color: var(--accent); }

.site-nav-disclosure {
  display: contents;
}

.site-nav-disclosure > summary {
  display: none;
  list-style: none;
  cursor: pointer;
  padding: 8px;
}

.site-nav-disclosure > summary::-webkit-details-marker { display: none; }

.site-nav-disclosure nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.site-nav-link,
.site-nav-disclosure nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.site-nav-link:hover,
.site-nav-disclosure nav a:hover {
  color: var(--ink);
}

.site-nav-active {
  color: var(--ink);
  font-weight: 500;
}

.site-nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 6px 16px;
  border-radius: var(--site-radius);
  font-weight: 500 !important;
  font-size: 13px !important;
}

.site-nav-cta:hover {
  background: #2a2a27 !important;
  color: var(--paper) !important;
}

.burger {
  display: inline-block;
  width: 1.25rem;
  height: 0.875rem;
  position: relative;
}

.burger::before,
.burger::after,
.burger {
  background: linear-gradient(var(--ink), var(--ink)) no-repeat;
  background-size: 100% 2px;
}

.burger { background-position: 0 50%; }

.burger::before,
.burger::after {
  content: '';
  position: absolute;
  inset: 0;
  background-position: 0 0;
}

.burger::after { background-position: 0 100%; }

/* ── Site footer ────────────────────────────────────────────────── */

.site-footer {
  border-top: 0.5px solid var(--border-strong);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 0.8fr);
  gap: 2rem;
  background: var(--paper);
}

.site-footer-brand .site-logo {
  display: block;
  margin-bottom: 0.75rem;
}

.site-footer-tagline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}

.site-footer-badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  background: var(--paper-2);
  padding: 3px 8px;
  border-radius: 2px;
  border: 0.5px solid var(--border);
}

.site-footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer-col-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.site-footer-col a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 300;
}

.site-footer-col a:hover { color: var(--ink); }

/* ── Responsive chrome ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .site-nav { padding: 0 1.5rem; position: relative; flex-wrap: wrap; }
  .site-container { padding: 0 1.5rem; }

  .site-nav-disclosure { display: block; }
  .site-nav-disclosure > summary { display: inline-flex; align-items: center; }
  .site-nav-disclosure nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    padding: 1rem 0 1.25rem;
  }
  .site-nav-disclosure[open] nav { display: flex; }
}

@media (max-width: 720px) {
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .site-footer { grid-template-columns: 1fr; }
}
