/* Dectyl shared design system — loaded by index.html, security.html.
   Page-specific styles stay inline in each page's <style> and override these. */

/* Fonts: Geist and Geist Mono (Vercel, SIL OFL), self-hosted in /fonts so
   the site loads nothing from Google. Same families as the decks. */
@font-face {
  font-family: 'Geist'; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono'; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2');
}

:root {
  --paper: #F7F8F5;
  --card: #FFFFFF;
  --ink: #121815;
  --muted: #5C6660;
  --line: #E0E4DF;
  --teal: #0E7C6F;
  --teal-bg: #EAF5F2;
  --red: #B42318;
  --red-bg: #FBEFED;
  --amber: #A15C07;
  --amber-bg: #FAF3E7;
  --display: 'Geist', sans-serif;
  --body: 'Geist', sans-serif;
  --mono: 'Geist Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; width: 100%; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

a { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

/* ---------- header ---------- */
.site-head { border-bottom: 2px solid var(--ink); }
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 20px; padding-bottom: 20px;
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--mono); font-weight: 600; font-size: 15px;
  letter-spacing: 0.28em; text-decoration: none;
}
.wm-box {
  display: inline-block; border: 2px solid var(--ink);
  padding: 3px 3px 3px 7px; line-height: 1;
}
/* Wordmark spec, the single source for every page. The teal square is a
   full stop after the L: 4px at the wordmark's fixed 15px size (Geist Mono 600), on the
   baseline. Whole pixels only: a fractional size (em) renders as a
   rectangle on Retina screens because the browser rounds each edge on its
   own. Do not override it per page. */
.wm-dot {
  display: inline-block; width: 4px; height: 4px; margin-left: -2px;
  background: var(--teal);
}
.head-cta {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  text-decoration: none; border: 1.5px solid var(--ink);
  padding: 8px 16px; background: var(--card);
  transition: background 120ms ease, color 120ms ease;
}
.head-cta:hover { background: var(--ink); color: var(--paper); }

/* Right-hand header group: the founder address stays the loud CTA, the app
   link is a quiet second affordance for customers who already have a code. */
.head-actions { display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.head-login {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  padding-left: 18px; border-left: 1px solid var(--line);
  transition: color 120ms ease;
}
.head-login:hover { color: var(--ink); text-decoration: underline; }
.head-actions .head-login:first-child { padding-left: 0; margin-left: 0; border-left: none; }
.wordmark { white-space: nowrap; }
/* Phone header: four items do not fit on one row. The address is the hero's
   primary CTA a few lines down, so the header keeps the three page links. */
@media (max-width: 640px) {
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 16px; padding-bottom: 14px; }
  .head-actions { gap: 0; flex-wrap: nowrap; }
  .head-login { font-size: 12px; padding-left: 14px; margin-left: 14px; white-space: nowrap; }
}

/* ---------- section scaffolding ---------- */
.doc-section { padding: 72px 0 8px; }
.section-rule {
  border-top: 2px solid var(--ink);
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px; margin-bottom: 40px; gap: 16px;
}
/* Section labels are teal, like the eyebrow, so they read in both themes.
   The right-hand page tag stays ink. Small card labels are ink, never muted. */
.section-label, .section-page {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal);
}
.section-page { color: var(--ink); text-align: right; }

/* ---------- footer ---------- */
.site-foot { border-top: 2px solid var(--ink); }
.site-foot .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 22px; padding-bottom: 30px; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* Allow navigation and long evidence labels to fit narrow screens. */
@media (max-width: 640px) {
  .head-actions { flex-wrap: wrap; row-gap: 10px; }
  .head-login { margin-left: 0; padding: 0 12px 0 0; border-left: 0; }
  .ws-head { flex-wrap: wrap; gap: 12px; }
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --paper: #181B1F;
  --card: #20242A;
  --ink: #ECEFEC;
  --muted: #9AA39E;
  --line: #33393F;
  --teal: #3CC3A6;
  --teal-bg: #183330;
  --red: #F2766B;
  --red-bg: #36211F;
  --amber: #F0A13A;
  --amber-bg: #372A19;
  color-scheme: dark;
}

/* ---------- Light / Dark switch ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 18px;
  background: none; border: 0; padding: 4px 0; cursor: pointer; min-height: 32px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted);
}
.tt-track {
  position: relative; width: 34px; height: 18px; border-radius: 9px;
  border: 1.5px solid var(--ink); background: var(--paper); flex: none;
}
.tt-knob {
  position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink);
}
.tt-anim .tt-knob { transition: transform 160ms ease; }
/* Driven by the theme on <html>, set before first paint, so the switch never jumps on page load. */
:root[data-theme="dark"] .tt-knob { transform: translateX(16px); background: var(--teal); }
:root:not([data-theme="dark"]) .tt-l, :root[data-theme="dark"] .tt-r { color: var(--ink); }
.theme-toggle:hover .tt-track { border-color: var(--teal); }
@media (prefers-reduced-motion: reduce) { .tt-knob { transition: none; } }
@media (max-width: 640px) { .theme-toggle { margin-left: 0; } }

/* Dark mode primary button: teal, not an off-white slab. */
:root[data-theme="dark"] .btn-primary { background: var(--teal); border-color: var(--teal); color: #0C0F12; }
:root[data-theme="dark"] .btn-primary:hover { background: transparent; color: var(--teal); }
/* No colour transitions on first paint: they only run after the visitor flips the switch. */
html:not(.tt-anim) .btn-primary { transition: none; }
