/* ==========================================================================
   Kaldrik · shared shell for the static marketing/legal pages.
   Visual language matches the app: slab display type, blood-red accent, and
   the modernized sleek skin — soft elevation and rounded corners.
   Each page links this file and keeps only a small page-specific <style>.
   ========================================================================== */

/* Same bundled font files the app loads (see src/fonts.css). */
@font-face { font-family: 'Archivo Black'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/archivo-black.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/archivo.woff2') format('woff2'); }

:root {
  --bg: #0c0c0e;
  --surface: #151518;
  --surface-2: #1d1d21;
  --ink: #ededf0;
  --ink-soft: #8b8b93;  /* secondary/large text only */
  --body: color-mix(in srgb, var(--ink) 62%, var(--ink-soft)); /* body text, derived per theme */
  --line: #2d2d33;
  --rust: #d1232f;      /* accent: fills, borders, large text only (fails AA small) */
  --rust-text: #ef4444; /* AA-safe accent for small text and links */
  --on-accent: #fff;
  /* Sleek elevation + rounding, matching the app (was a brutalist 3px offset
     and square corners). */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 28px -14px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --slab: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Themed scrollbar to match the app (neutral, on the dark forge surface). */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-soft) 42%, transparent) transparent;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-soft) 38%, transparent);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink-soft) 62%, transparent);
  background-clip: padding-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--rust); color: var(--on-accent); }
a { color: var(--rust-text); }
a:hover { color: #ff6f6f; }
:focus-visible { outline: 2px solid var(--rust-text); outline-offset: 2px; }

/* Static warm forge glow rising from the bottom of the viewport. The landing
   animates embers over this; content pages keep just the still glow. */
.site-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(62% 42% at 20% 108%, rgba(255, 120, 30, 0.13), transparent 72%),
    radial-gradient(62% 42% at 80% 108%, rgba(255, 84, 20, 0.11), transparent 72%);
}

/* ---- Skip-to-content (matches the landing's .skip-link) ---- */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--rust);
  color: var(--on-accent);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- Sticky top nav (matches .lp-nav) ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 13px clamp(16px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  /* Theme-aware translucent surface (was a hardcoded forge-dark bar). */
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--rust);
  text-decoration: none;
}
.brand:hover { color: var(--rust); }
.brand .mark { width: 26px; height: 26px; flex: none; overflow: visible; }
.wordmark {
  font-family: var(--slab);
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.beta-badge {
  top: -0.7em;
  margin-left: 0.34em;
  padding: 1px 5px;
  border: 1px solid rgba(209, 35, 47, 0.55);
  border-radius: 999px;
  background: rgba(209, 35, 47, 0.16);
  color: var(--rust-text);
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: baseline;
}
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); }

/* ---- Theme switcher (injected into the nav by theme-switcher.js) ---- */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-switch-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.theme-switch-sel {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 26px 5px 10px;
  /* caret */
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
                    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.theme-switch-sel:hover { border-color: var(--rust); }
.theme-switch-sel:focus-visible { outline: 2px solid var(--rust-text); outline-offset: 2px; }
@media (max-width: 560px) {
  .theme-switch-label { display: none; } /* save room on phones */
}

/* ---- Buttons (matches the landing's .btn) ---- */
.btn {
  display: inline-block;
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
  transition: background 0.12s, border-color 0.12s, transform 0.05s, color 0.12s, box-shadow 0.05s;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--rust);
  color: var(--rust-text);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--on-accent);
}
.btn.primary:hover { background: #a8121d; color: var(--on-accent); }

/* ---- Content column + page hero ---- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px 72px; }
.page-hero { padding: clamp(34px, 7vw, 60px) 0 10px; }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust-text);
  margin-bottom: 14px;
}
h1 {
  font-family: var(--slab);
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.08;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.lead {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--body);
  margin: 0;
  max-width: 58ch;
}
.updated { color: var(--ink-soft); font-size: 14px; margin: 2px 0 24px; }

/* ---- Prose (legal/long-form pages) ---- */
.prose h2 {
  font-family: var(--slab);
  font-size: clamp(16px, 2.4vw, 20px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 42px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 84px;
}
.prose h3 { font-size: 15.5px; color: var(--ink); margin: 20px 0 4px; }
.prose p, .prose li { color: var(--body); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}
hr { border: none; border-top: 1px solid var(--line); margin: 40px 0 0; }

/* ---- Cards (matches .lp-trust-card / .lp-stat: surface, hairline border,
        2px rust top edge) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--rust);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px 22px;
  margin: 24px 0;
}
.card > h2:first-child, .card > .card-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.card-title {
  display: block;
  font-family: var(--slab);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rust-text);
  margin: 0 0 8px;
}

/* ---- Footer (matches .lp-footer) ---- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 26px clamp(16px, 5vw, 56px) 48px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.heart { color: var(--rust); }

/* ---- Motion & print sanity ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link, .btn { transition: none; }
}
@media print {
  .site-nav, .site-footer, .site-glow, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
  h1, .prose h2, .prose h3, .prose strong { color: #000; }
  .prose p, .prose li, .lead, p, li { color: #111; }
  a { color: #000; }
  .eyebrow, .updated, .card-title { color: #555; }
  .card { background: #fff; border-color: #ccc; border-top-color: #b3122a; }
}
