@font-face {
  font-family: 'BV Serif';
  src: url('bv-serif.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'BV Sans';
  src: url('bv-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'BV Mono';
  src: url('bv-mono.woff') format('woff');
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Same 5-color system as the brand guideline: Paper, Surface, Ink, Accent, Border.
     Everything else is a fixed-opacity derivative; see Brand Guideline.html. */
  --paper: rgba(248, 245, 239, 1);
  --surface: rgba(255, 255, 255, 1);
  --ink: rgba(13, 11, 7, 1);
  --ink-muted: rgba(13, 11, 7, 0.70);
  --ink-faint: rgba(13, 11, 7, 0.60);
  --accent: rgba(187, 9, 22, 1);
  --accent-hover: rgba(165, 0, 0, 1);
  --accent-ink: rgba(255, 255, 255, 1);
  --border: rgba(13, 11, 7, 0.13);
  --border-strong: rgba(13, 11, 7, 1);
  --selection: rgba(187, 9, 22, 0.25);
  --header-glass: rgba(248, 245, 239, 0.65);
  --shadow: 0 1px 2px rgba(13, 11, 7, 0.06);

  --font-display: 'BV Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'BV Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'BV Mono', ui-monospace, monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  --gutter: 56px;
  --gutter-mobile: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --paper: rgba(15, 13, 8, 1);
  --surface: rgba(26, 24, 18, 1);
  --ink: rgba(244, 241, 237, 1);
  --ink-muted: rgba(244, 241, 237, 0.70);
  --ink-faint: rgba(244, 241, 237, 0.60);
  --accent: rgba(233, 80, 72, 1);
  --accent-hover: rgba(255, 101, 90, 1);
  --accent-ink: rgba(15, 13, 8, 1);
  --border: rgba(244, 241, 237, 0.15);
  --border-strong: rgba(244, 241, 237, 1);
  --selection: rgba(233, 80, 72, 0.3);
  --header-glass: rgba(15, 13, 8, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: rgba(15, 13, 8, 1);
    --surface: rgba(26, 24, 18, 1);
    --ink: rgba(244, 241, 237, 1);
    --ink-muted: rgba(244, 241, 237, 0.70);
    --ink-faint: rgba(244, 241, 237, 0.60);
    --accent: rgba(233, 80, 72, 1);
    --accent-hover: rgba(255, 101, 90, 1);
    --accent-ink: rgba(15, 13, 8, 1);
    --border: rgba(244, 241, 237, 0.15);
    --border-strong: rgba(244, 241, 237, 1);
    --selection: rgba(233, 80, 72, 0.3);
    --header-glass: rgba(15, 13, 8, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
.story-text a, .legal p a, .consent-check a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.story-text a:hover, .legal p a:hover, .consent-check a:hover { color: var(--accent-hover); }
::selection { background: var(--selection); color: var(--ink); }

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap { max-width: 720px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--gutter);
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.logo-lockup { display: flex; align-items: center; }
.logo-lockup svg { width: 150px; height: auto; flex: 0 0 auto; color: var(--ink); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; flex: 0 0 auto; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding-top: var(--space-6); padding-bottom: var(--space-6); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-1);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px var(--space-2);
  margin-bottom: var(--space-4);
}
.eyebrow span { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.flag-icon { width: 17px; height: 9px; flex: 0 0 auto; }
.hero h1 {
  font-size: clamp(2.25rem, 3vw + 1.6rem, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0 auto;
  max-width: 18ch;
}
.hero .sub {
  margin: var(--space-4) auto 0;
  font-size: 1.1875rem;
  color: var(--ink-muted);
  max-width: 46ch;
  line-height: 1.55;
}

/* ---------- Diagram ---------- */
.diagram {
  margin-top: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.diagram-col { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.diagram-group { display: flex; gap: var(--space-2); }
.diagram-icon {
  width: 56px; height: 56px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.diagram-icon svg { width: 26px; height: 26px; color: var(--ink-muted); }
.diagram-arrow-box { height: 56px; display: flex; align-items: center; }
.diagram-arrow { font-family: var(--font-mono); color: var(--ink-faint); font-size: 1.25rem; }
.diagram-icon.binder { border-color: var(--accent); }
.diagram-icon.binder svg { color: var(--accent); }
.diagram-caption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- Story ---------- */
.story { padding-top: var(--space-5); padding-bottom: var(--space-2); }
.story .section-label { display: block; color: var(--ink-faint); margin-bottom: var(--space-2); }
.story-text {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 58ch;
}

/* ---------- Benefits ---------- */
.benefits { padding-top: var(--space-4); padding-bottom: var(--space-5); }
.benefit-row { padding: var(--space-2) 0; border-top: 1px solid var(--border); font-size: 0.9375rem; color: var(--ink-muted); line-height: 1.55; opacity: 1; transform: none; }
.benefit-row:first-of-type { border-top: none; }
.benefit-row h3 { display: inline; font-family: var(--font-body); font-size: inherit; font-weight: 700; color: var(--ink); margin: 0; text-wrap: initial; }
.benefit-row.js-armed { opacity: 0; transform: translateY(14px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.benefit-row.js-armed.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Signup ---------- */
.signup {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--border);
}
.signup-box {
  border: 1px solid var(--border-strong);
  padding: var(--space-5);
  background: var(--surface);
}
.signup-box h2 { font-size: 1.375rem; margin-bottom: var(--space-1); }
.signup-box .lead { color: var(--ink-muted); font-size: 0.9375rem; margin-bottom: var(--space-4); }
.signup-form { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.signup-form input[type="email"] {
  flex: 1 1 240px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: var(--space-2);
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 0 var(--accent);
  transition: box-shadow 220ms var(--ease);
}
.signup-form input[type="email"]:focus { box-shadow: 0 0 0 2px var(--accent); }
.btn-primary {
  font-family: var(--font-body); font-weight: 700; font-size: 0.9375rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  padding: var(--space-2) var(--space-4); cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.status-msg { margin-top: var(--space-3); font-size: 0.9375rem; }
.status-msg:empty { display: none; }
.status-msg:not(:empty) { animation: status-in 420ms var(--ease); }
@keyframes status-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.signup-box.is-done .signup-form,
.signup-box.is-done .consent-check { display: none; }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.4;
  cursor: pointer;
}
.consent-check input { margin-top: 2px; flex: 0 0 auto; }

.status-msg.success { color: var(--ink); }
.status-msg.error { color: var(--accent); }

.disclaimer {
  margin-top: var(--space-4);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.55;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.disclaimer p + p { margin-top: var(--space-1); }

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-4) var(--gutter) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  gap: var(--space-2);
}
.site-footer--flag {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: var(--space-2);
}
.site-footer--flag > *:first-child { justify-self: start; }
.site-footer--flag > *:last-child { justify-self: end; }
.footer-flag { justify-self: center; display: inline-flex; align-items: center; gap: 6px; }
.footer-flag .flag-icon { color: var(--ink-faint); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .site-header, .wrap { padding-left: var(--gutter-mobile); padding-right: var(--gutter-mobile); }
  .site-footer { padding-left: var(--gutter-mobile); padding-right: var(--gutter-mobile); justify-content: center; text-align: center; }
  .signup-form { flex-direction: column; }
  .signup-form input[type="email"] { flex: 1 1 auto; }
  .signup-form .btn-primary { width: 100%; }
  .signup-box { padding: var(--space-3); }
  .diagram { gap: var(--space-2); margin-top: var(--space-4); }
  .diagram-icon { width: 44px; height: 44px; }
  .diagram-icon svg { width: 20px; height: 20px; }
  .diagram-arrow-box { height: 44px; }
  .hero { padding-top: var(--space-4); padding-bottom: var(--space-4); }
  .story { padding-top: var(--space-4); padding-bottom: var(--space-1); }
  .benefits { padding-top: var(--space-3); }
  .signup { padding-top: var(--space-4); padding-bottom: var(--space-5); }
  .site-footer { flex-direction: column; gap: var(--space-2); }
  .site-footer--flag { display: flex; flex-direction: column; gap: var(--space-2); }
  .footer-flag { flex-direction: column; gap: 6px; }
  .flag-icon { width: 24px; height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .signup-form input[type="email"] { transition: none; }
  .status-msg:not(:empty) { animation: none; }
  .benefit-row.js-armed { opacity: 1 !important; transform: none !important; transition: none !important; }
}
