:root {
  --bg: #f7f4ef;
  --text: #1c1916;
  --muted: #5c574f;
  --purple: #1c1916;
  --purple-hover: #000000;
  --purple-glow: rgba(28, 25, 22, 0.25);
  --green: #2f9e6b;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

@media (max-width: 768px) {
  /* Decoration only. The video reads as a faint wash on a phone and the file
     is 21 MB, so the phone should not pay for it. */
  .bg-video { display: none; }
}

/* Background */
.bg { position: fixed; inset: 0; z-index: 0; }
/* The ambient video is near-white (measured median luminance 240 of 255), so
   it holds under the copy without darkening the page. It sits at 0.40: a
   visible wash, quiet enough that the text is still what the eye reads first.
   The veil only softens it towards the page colour at the edges; fading it
   towards black is what used to make the whole page read as dark. */
.bg-video { position: absolute; inset: -5%; width: 110%; height: 110%; object-fit: cover; opacity: 0.32; }
.bg-overlay { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(247,244,239,0.16) 0%, rgba(247,244,239,0.28) 55%, rgba(247,244,239,0.55) 100%); }

/* Page */
.page { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; min-height: 100dvh; padding: 20px 32px; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1100px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { width: 36px; height: 36px; border-radius: 8px; }
.logo-text { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav-link:hover { color: var(--text); }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: 10px;
  background: var(--purple); color: #f7f4ef;
  font-size: 14px; font-weight: 600;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px var(--purple-glow);
}
.btn-primary:hover { background: var(--purple-hover); transform: translateY(-1px); box-shadow: 0 0 30px var(--purple-glow); }
.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: 12px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 15px; font-weight: 500;
  border: 1px solid rgba(28,25,22,0.18);
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover { border-color: rgba(28,25,22,0.35); background: rgba(28,25,22,0.08); }

/* Hero */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 24px; max-width: 720px; padding: 20px 0; animation: fadeInUp 0.8s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.hero .badge { animation: fadeInUp 0.8s ease-out 0.1s both; }
.hero .headline { animation: fadeInUp 0.8s ease-out 0.2s both; }
.hero .subhead { animation: fadeInUp 0.8s ease-out 0.3s both; }
.hero .cta-row { animation: fadeInUp 0.8s ease-out 0.4s both; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: rgba(28,25,22,0.10); border: 1px solid rgba(28,25,22,0.14);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Headline */
.headline {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #1c1916;
}

/* Subhead */
.subhead {
  font-size: 16px;
  font-weight: 400;
  color: rgba(28,25,22,0.7);
  line-height: 1.65;
  max-width: 480px;
}

/* CTA */
.cta-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  width: 100%; max-width: 700px;
  padding: 32px 0 16px;
  margin-top: auto;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}
.stat { text-align: center; transition: transform 0.2s; }
.stat:hover { transform: translateY(-2px); }
.stat-value {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Hamburger */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(247,244,239,0.97); backdrop-filter: blur(20px);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 80px 20px;
}
.mobile-nav.open { display: flex; }
/* The overlay is a child of `.page`, and `.page` carries `z-index: 1` — the
   same value the sections stacked after it use (`.live-section`, `.how-section`,
   `.dev-section`, `.site-footer`). A fixed child cannot climb out of its
   ancestor's stacking context, so those later siblings painted over the open
   menu: on a phone the live tiles and the "network right now" heading sat on
   top of the links, and `elementFromPoint` returned them — the band was not
   just ugly, it was untappable. While the menu is up, the page outranks them.
   The toggle is lifted for the same reason: it is the only way to close the
   menu, and an overlay that covers the whole viewport was hiding its own
   close button behind itself. */
body.menu-open .page { z-index: 200; }
body.menu-open .menu-toggle { position: relative; z-index: 110; }
.mobile-nav-link {
  font-size: 20px; font-weight: 500; color: var(--text);
  padding: 12px 0; transition: color 0.2s;
}
.mobile-nav-link:hover { color: var(--purple); }
/* The X row is glyph-only — "X" beside the logo printed as "X x" — so it needs
   the width the word used to give it: the icon on its own is a 20px tap target,
   which is under what a thumb can reliably hit. */
.mobile-nav-icon { padding-left: 24px; padding-right: 24px; }
.desktop-only { display: inline-flex; }

/* Mobile */
@media (max-width: 768px) {
  .page { padding: 12px 16px; }
  .nav { display: none; }
  .menu-toggle { display: flex; }
  /* theme.css is linked after this file and gives `.btn-primary` a `display`
     of its own. That ties on specificity and wins on order, so the header's
     desktop-only CTA stayed on a phone, squeezed between the wordmark and the
     menu button. Two classes deep, this rule wins instead — the same fix
     deck.html uses against the same tie. */
  .desktop-only.desktop-only { display: none; }
  .header { padding: 8px 0; }
  .logo img { width: 32px; height: 32px; }
  .logo-text { font-size: 16px; }
  .hero { padding: 0 4px; gap: 16px; min-height: auto; flex: unset; }
  .headline { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
  .subhead { font-size: 13px; line-height: 1.5; display: block; max-width: 100%; }
  .cta-row { flex-direction: column; width: 100%; gap: 10px; }
  .btn-primary, .btn-outline { width: 100%; justify-content: center; padding: 14px 20px; font-size: 15px; min-height: 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 0 8px; }
  .stat { padding: 8px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .badge { font-size: 11px; padding: 5px 12px; }
  .how-section { padding: 40px 16px; }
  .how-title { font-size: 20px; }
  .how-sub { font-size: 13px; margin-bottom: 32px; }
  .how-grid { grid-template-columns: 1fr; gap: 12px; }
  .how-card { padding: 20px 16px; }
  .how-icon { width: 40px; height: 40px; }
  .site-footer { padding: 32px 16px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .footer-copy { font-size: 11px; }
}

/* Small phones */
@media (max-width: 380px) {
  .headline { font-size: 22px; }
  .subhead { font-size: 12px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 9px; }
}

/* How It Works */
/* 72px, not 100: the live section above ends on a 40px pad, and the two
   together were leaving about 200px of empty background between the numbers
   and the next heading — a void, not breathing room. */
.how-section {
  position: relative; z-index: 1;
  width: 100%; padding: 72px 32px;
  display: flex; justify-content: center;
  border-top: 1px solid rgba(28,25,22,0.10);
}
.how-inner { max-width: 1000px; width: 100%; text-align: center; }
.how-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: rgba(28,25,22,0.10); border: 1px solid rgba(28,25,22,0.14);
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 24px;
}
.how-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.how-sub {
  font-size: 15px; color: rgba(28,25,22,0.6);
  max-width: 520px; margin: 0 auto 48px;
  line-height: 1.6;
}
.how-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; text-align: center;
  padding: 0 20px;
}
.how-card {
  position: relative;
  z-index: 1;
  background: transparent !important;
  border: none !important;
  padding: 0 8px !important;
}
.how-icon {
  margin: 0 auto 12px;
}
.how-card h3 {
  font-size: 14px;
  margin-bottom: 6px;
}
.how-card p {
  font-size: 12px;
  line-height: 1.5;
}

/* Mobile override for how-grid.
   The icon spans both rows so the title and its one-line explanation stack
   beside it. The explanation used to be hidden here, which left a phone showing
   five bare titles — "Register, Bond, Enforce, Slash, Compensate" — with
   nothing saying what any of them meant. */
@media (max-width: 768px) {
  .how-grid { grid-template-columns: 1fr !important; gap: 12px; padding: 0; width: fit-content; margin: 0 auto; max-width: 100%; }
  .how-grid::before, .how-grid::after { display: none; }
  .how-card {
    display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 3px;
    align-items: center; text-align: left;
    padding: 12px 16px !important;
    background: rgba(28,25,22,0.07); border: 1px solid rgba(28,25,22,0.10) !important;
    border-radius: 12px;
  }
  .how-card p { display: block; font-size: 12px; line-height: 1.45; }
  .how-card h3 { font-size: 14px; margin-bottom: 0; }
  .how-icon { grid-row: span 2; margin: 0 !important; width: 40px !important; height: 40px !important; }
}
.how-card {
  background: rgba(28,25,22,0.07);
  border: 1px solid rgba(28,25,22,0.10);
  border-radius: 14px; padding: 28px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.how-card:hover { border-color: rgba(28, 25, 22, 0.3); transform: translateY(-2px); }
.how-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(28, 25, 22, 0.12); border: 1px solid rgba(28, 25, 22, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--purple); margin-bottom: 16px;
}
.how-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #1c1916; }
.how-card p { font-size: 13px; color: rgba(28,25,22,0.65); line-height: 1.55; }

/* Keyboard focus — one visible ring for everything interactive.
   Without it, tabbing through the header and the cards is invisible. */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Motion here is all decoration — the background video and the entrance
   animations stop when the reader's system asks for less. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto !important; }
  .bg-video { display: none; }
}

/* Footer */
.site-footer {
  position: relative; z-index: 1;
  width: 100%; padding: 40px 32px;
  border-top: 1px solid rgba(28,25,22,0.10);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: rgba(28,25,22,0.5); }
