/* BAFA Labs marketing site
   Layout: navy brand bands (hero, founder, footer) bracket cool-paper reading bands.
   One orchestrated moment: the hero proof record builds once on load. */

:root {
  /* Brand constants, sampled from the logo. Same in both themes. */
  --navy: #001a3d;
  --navy-2: #0a2a5c;
  --royal: #4a7fe6;
  --gold: #f4b942;
  --band-fg: #eef2fa;
  --band-muted: #a9b7d4;
  --band-line: rgba(169, 183, 212, 0.22);
  --gold-hover: #ffcb5c;
  --on-navy: #ffffff;
  --hero-glow: rgba(74, 127, 230, 0.18);
  --panel-top: rgba(10, 42, 92, 0.85);
  --panel-bottom: rgba(0, 26, 61, 0.95);
  --panel-shadow: rgba(0, 0, 0, 0.6);

  /* Reading surfaces, light theme. */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --fg: #0c1a33;
  --muted: #4f5d78;
  --line: #d7deea;
  --accent-ink: #1f4fb8;
  --gold-ink: #7c5300;
  --focus: #1f4fb8;

  /* Type */
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --step--2: 0.8125rem;
  --step--1: 0.875rem;
  --step-ui: 0.9375rem;
  --step-ui-lg: 1rem;
  --step-0: 1.0625rem;
  --step-0-5: 1.125rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem);
  --step-4: clamp(2.375rem, 1.4rem + 4.2vw, 4.25rem);
  --step-hero: clamp(2.125rem, 1.3rem + 3.2vw, 3.5rem);
  --step-numeral: 3rem;

  --radius: 6px;
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #031230;
    --surface: #071c42;
    --fg: #e7ecf5;
    --muted: #9fadc8;
    --line: #1d3260;
    --accent-ink: #93b4ff;
    --gold-ink: #f4b942;
    --focus: #f4b942;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #031230;
  --surface: #071c42;
  --fg: #e7ecf5;
  --muted: #9fadc8;
  --line: #1d3260;
  --accent-ink: #93b4ff;
  --gold-ink: #f4b942;
  --focus: #f4b942;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 700; font-stretch: 108%; }
p { margin: 0; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.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;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--gold); color: var(--navy); padding: 0.5rem 1rem; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- Bands ---------- */
.band { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.band--tight { padding-top: 0; }
.band--brand { background: var(--navy); color: var(--band-fg); --focus: var(--gold); }
.band--paper { background: var(--bg); }
.band--surface { background: var(--surface); border-block: 1px solid var(--line); }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .wrap {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-stretch: 105%;
  font-size: var(--step-ui-lg); text-decoration: none; white-space: nowrap;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: var(--step-ui); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-hover); }
.btn--ghost { border-color: var(--band-line); color: var(--band-fg); }
.btn--ghost:hover { border-color: var(--band-fg); }
.btn--navy { background: var(--navy); color: var(--on-navy); }
.btn--navy:hover { background: var(--navy-2); }
:root[data-theme="dark"] .btn--navy,
.contact .btn--navy { box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Header ---------- */
.site-header {
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--band-line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) {
  color: var(--band-muted); text-decoration: none; font-size: var(--step-ui); font-weight: 500;
}
.nav a:not(.btn):hover { color: var(--band-fg); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }
@media (min-width: 761px) { .brand img { width: 180px; } }
@media (max-width: 380px) {
  .brand img { width: 118px; }
  .nav .btn--sm { padding: 0 0.75rem; font-size: var(--step--1); }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(2.5rem, 1rem + 5vw, 5rem); overflow: hidden; position: relative; }
.hero::before {
  /* Soft field glow, echoing the logo's backdrop. Decorative. */
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, var(--hero-glow), transparent);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; gap: clamp(2.5rem, 4vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

.hero-copy { display: grid; gap: 1.5rem; min-width: 0; }
.kicker { color: var(--gold); font-weight: 600; font-size: var(--step--1); letter-spacing: 0.01em; }
.hero h1 {
  font-size: var(--step-hero);
  max-width: 16ch;
  font-weight: 900;
  font-stretch: 118%;
  letter-spacing: -0.015em;
  line-height: 1.02;
}
.lede { color: var(--band-muted); font-size: var(--step-1); line-height: 1.55; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; }

/* Proof record: the page's one memorable object. Compute, decide, seal. */
.proof {
  margin: 0; min-width: 0;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid var(--band-line);
  border-radius: 10px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: grid; gap: 1.25rem;
  box-shadow: 0 30px 60px -30px var(--panel-shadow);
}
.p-label { color: var(--band-muted); font-size: var(--step--1); }

/* Steps hang off a vertical chain; the sealed step gets the gold link. */
.p-steps {
  list-style: none; margin: 0; padding: 0 0 0 1.75rem;
  position: relative; display: grid; gap: 1.1rem;
}
.p-steps::before {
  content: ""; position: absolute; left: 0.45rem; top: 0.45rem; bottom: 0.45rem; width: 2px;
  background: var(--band-line);
}
.p-step {
  position: relative; display: grid; gap: 0.15rem;
  animation: step-in 0.4s ease-out both;
  animation-delay: calc(0.2s + var(--i) * 0.35s);
}
.p-step::before {
  content: ""; position: absolute; left: -1.62rem; top: 0.4rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--navy); border: 3px solid var(--royal);
}
.p-step--seal::before { border-color: var(--gold); background: var(--gold); }
.p-who { font-family: var(--font-display); font-weight: 700; font-stretch: 108%; font-size: var(--step-0); color: var(--band-fg); }
.p-step--seal .p-who { color: var(--gold); }
.p-what { color: var(--band-muted); font-size: var(--step-ui); }

.p-record {
  margin: 0; display: grid; gap: 0;
  border-top: 2px solid var(--gold);
  animation: step-in 0.45s ease-out both; animation-delay: 1.3s;
}
.p-record div {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.75rem;
  padding-block: 0.5rem; border-bottom: 1px solid var(--band-line);
  font-size: var(--step-ui);
}
.p-record dt { color: var(--band-muted); }
.p-record dd { margin: 0; color: var(--band-fg); overflow-wrap: anywhere; }
.p-record .hash { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .p-step, .p-record { animation: none; }
}

/* ---------- Split sections ---------- */
.split {
  display: grid; gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4rem; } }
.split-body { display: grid; gap: 1.5rem; min-width: 0; max-width: 40rem; }
.split-body > p { color: var(--muted); font-size: var(--step-1); line-height: 1.55; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts li { padding-block: 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.facts strong { display: block; color: var(--fg); font-weight: 600; }

.section-title { margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }

/* ---------- Chassis ---------- */
.flagship {
  display: grid; gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 900px) { .flagship { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3.5rem; } }
.flagship-copy { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.flagship h3 { font-size: var(--step-3); font-weight: 900; font-stretch: 118%; color: var(--accent-ink); }
.flagship-sub { font-family: var(--font-display); font-weight: 600; font-stretch: 105%; font-size: var(--step-1); }
.flagship-copy > p:not(.flagship-sub) { color: var(--muted); }

.guarantees { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; align-content: center; border-top: 1px solid var(--line); }
.guarantees li { display: grid; gap: 0.15rem; padding-block: 0.9rem; border-bottom: 1px solid var(--line); }
.g-title { font-weight: 600; }
.g-body { color: var(--muted); font-size: var(--step-ui); }

/* ---------- Engines ---------- */
.engines-head { display: grid; gap: 0.75rem; max-width: 40rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.engines-head p { color: var(--muted); font-size: var(--step-0-5); }
.engines { list-style: none; margin: 0; padding: 0; display: grid; border-top: 2px solid var(--fg); }
.engine {
  display: grid; gap: 0.35rem 2.5rem;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 1.4rem; border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) {
  .engine { grid-template-columns: 13rem minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .e-name { grid-column: 1; grid-row: 1; }
  .e-role { grid-column: 1; grid-row: 2; }
  .e-body { grid-column: 2; grid-row: 1 / span 2; }
}
.e-name { font-size: var(--step-2); font-weight: 900; font-stretch: 118%; color: var(--accent-ink); }
.e-role { color: var(--gold-ink); font-weight: 600; font-size: var(--step-ui); }
.e-body { color: var(--muted); max-width: 44rem; }

/* ---------- Steps (a true sequence, so numbered) ---------- */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; } }
.steps li { counter-increment: step; display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display); font-weight: 900; font-stretch: 120%;
  font-size: var(--step-numeral); line-height: 1; color: var(--accent-ink);
}
.steps p { color: var(--muted); }

/* ---------- Founder ---------- */
.founder-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .founder-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4rem; } }
.founder h2 { font-size: var(--step-3); font-stretch: 116%; }
.founder-body { display: grid; gap: 1rem; color: var(--band-muted); font-size: var(--step-1); line-height: 1.55; max-width: 38rem; }

/* ---------- Contact ---------- */
.contact-row { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 900px) { .contact-row { grid-template-columns: minmax(0, 1.4fr) auto; gap: 4rem; } }
.contact-row > div:first-child { display: grid; gap: 1rem; min-width: 0; }
.contact-row > div:first-child p { color: var(--muted); font-size: var(--step-1); }
.contact-actions { display: grid; gap: 0.75rem; justify-items: start; }
.email-line { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; color: var(--muted); font-size: var(--step-ui); }
#contact-email { user-select: all; color: var(--fg); }
.copy {
  font: inherit; font-size: var(--step--1); font-weight: 600;
  background: transparent; color: var(--accent-ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.3rem 0.7rem; cursor: pointer;
}
.copy:hover { border-color: var(--accent-ink); }

/* ---------- Footer ---------- */
.site-footer { padding-top: 3rem; padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px)); }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); font-size: var(--step--1); color: var(--band-muted); }
@media (min-width: 820px) { .footer-grid { grid-template-columns: auto minmax(0, 1fr); gap: 4rem; align-items: start; } }
.footer-grid > div { display: grid; gap: 0.75rem; }
.disclaimer { max-width: 44rem; line-height: 1.6; }

/* ---------- 404 ---------- */
.not-found .wrap { display: grid; gap: 1.25rem; justify-items: start; }
.not-found h1 { font-size: var(--step-3); font-weight: 900; font-stretch: 116%; }
.not-found p { color: var(--muted); font-size: var(--step-1); max-width: 34rem; }
