/* ==========================================================================
   The ATM Blueprint — design system v3 "Drafting Table"
   Cyanotype-blueprint + engineer's-paper editorial. No frameworks, no build.
   Fonts self-hosted (OFL): Instrument Serif, Instrument Sans, IBM Plex Mono.
   ========================================================================== */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-400i.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* paper */
  --paper:   #f4f1e8;
  --paper2:  #ece7d9;
  --card:    #fdfcf7;
  --line:    #d8d1bf;
  --line-soft: #e4ded0;
  /* ink */
  --ink:     #17202b;
  --ink2:    #46515f;
  --muted:   #71798a;
  /* blueprint */
  --bp:      #10305f;   /* deep cyanotype field */
  --bp-deep: #0b2549;
  --bp-line: rgba(173, 203, 245, .85);
  --bp-grid: rgba(150, 185, 235, .13);
  --bp-ink:  #eef3fb;   /* text on blueprint */
  --bp-mut:  #a4b8d6;
  --bp-edge: rgba(173,203,245,.28);
  /* accents */
  --blue:    #1d4fd7;
  --green:   #0d7a4b;
  --green-b: #38d189;
  --red:     #b8392a;
  --brass:   #a97e2f;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1140px;
  --r: 10px;
  --shadow: 0 1px 2px rgba(23,32,43,.05), 0 10px 32px -12px rgba(23,32,43,.14);
  --shadow-lg: 0 2px 4px rgba(23,32,43,.06), 0 24px 60px -18px rgba(23,32,43,.22);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
::selection { background: #1d4fd7; color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* faint paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

/* ---------- type utilities ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--blue);
}
.kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.on-bp .kicker, .hero .kicker { color: var(--bp-mut); }
.serif { font-family: var(--serif); font-weight: 400; }
.gold { color: var(--brass); } /* legacy hook */

.sec-head { max-width: 720px; margin-bottom: 44px; }
.sec-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(32px, 4vw, 48px); letter-spacing: -.01em; margin: 14px 0 14px;
}
.sec-head p { color: var(--ink2); font-size: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px;
  line-height: 1.2; letter-spacing: .01em; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  box-shadow: 0 1px 0 rgba(23,32,43,.2);
}
.btn:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(29,79,215,.55); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); }
.btn.small { padding: 10px 18px; font-size: 14.5px; white-space: nowrap; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.2;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--card); transform: translateY(-1px); text-decoration: none; }
/* on blueprint sections */
.hero .btn, .on-bp .btn { background: var(--green-b); border-color: var(--green-b); color: #07231a; box-shadow: 0 10px 26px -10px rgba(56,209,137,.6); }
.hero .btn:hover, .on-bp .btn:hover { background: #4be09a; border-color: #4be09a; color: #07231a; }
.hero .btn-ghost, .on-bp .btn-ghost { border-color: var(--bp-edge); color: var(--bp-ink); }
.hero .btn-ghost:hover, .on-bp .btn-ghost:hover { border-color: var(--bp-line); background: rgba(255,255,255,.06); color: #fff; }

/* ---------- header / nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,241,232,.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow .25s ease;
}
header.site.scrolled { box-shadow: 0 6px 24px -12px rgba(23,32,43,.18); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 66px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 22px; color: var(--ink); letter-spacing: .01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand em { font-style: italic; color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a.plain {
  color: var(--ink2); font-size: 15px; font-weight: 500;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.nav-links a.plain:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--ink); }

/* ---------- hero (cyanotype) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 500px at 78% -10%, rgba(84,140,255,.22), transparent 60%),
    linear-gradient(180deg, var(--bp-deep), var(--bp) 55%, #123568);
  color: var(--bp-ink);
  border-bottom: 4px solid var(--brass);
}
.hero::before { /* drafting grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px),
    linear-gradient(rgba(150,185,235,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150,185,235,.05) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}
.hero::after { /* sheet frame */
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 1px solid rgba(173,203,245,.18); border-radius: 4px;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 48px; align-items: center; padding: 84px 0 72px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5vw, 66px); line-height: 1.04; letter-spacing: -.01em;
  margin: 20px 0 22px; color: #fff;
}
.hero h1 em { color: var(--green-b); font-style: italic; }
.hero .sub { color: var(--bp-mut); font-size: 19px; max-width: 56ch; margin-bottom: 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.sheet-meta {
  position: absolute; top: 26px; right: 28px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  color: rgba(164,184,214,.75); text-transform: uppercase; text-align: right; line-height: 1.9;
}

/* hero schematic */
.schematic { position: relative; }
.schematic svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 40px rgba(4,12,28,.45)); }
@media (prefers-reduced-motion: no-preference) {
  .schematic .draw { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: drawline 2.6s cubic-bezier(.55,.06,.28,.99) forwards .2s; }
  .schematic .draw2 { stroke-dasharray: 900; stroke-dashoffset: 900; animation: drawline 2s ease-out forwards 1.1s; }
  .schematic .anno { opacity: 0; animation: fadein .8s ease 1.9s forwards; }
}
@keyframes drawline { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* stat strip below hero copy */
.stat-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--bp-edge); border: 1px solid var(--bp-edge); border-radius: var(--r);
  overflow: hidden; margin-top: 44px;
}
.tile { background: rgba(9,26,52,.72); padding: 20px 20px 17px; }
.tile .num {
  font-family: var(--serif); font-size: clamp(26px, 2.6vw, 36px);
  color: var(--green-b); line-height: 1.05; letter-spacing: -.01em;
}
.tile .lbl {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bp-mut); margin-top: 8px; line-height: 1.5;
}

/* ---------- sections ---------- */
.block { padding: 96px 0; border-bottom: 1px solid var(--line-soft); }
.block.alt { background: var(--paper2); }
.block.on-bp {
  background: linear-gradient(180deg, var(--bp-deep), var(--bp));
  color: var(--bp-ink); border-bottom: none; position: relative; overflow: hidden;
}
.block.on-bp::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 96px 96px;
}
.block.on-bp .wrap { position: relative; }
.block.on-bp .sec-head h2 { color: #fff; }
.block.on-bp .sec-head p { color: var(--bp-mut); }

/* ---------- cards ---------- */
.cards { display: grid; gap: 22px; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 30px 28px; box-shadow: var(--shadow); position: relative;
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -.005em; margin: 14px 0 10px; }
.card p { color: var(--ink2); font-size: 15.5px; margin-bottom: 0; }
.card p + p { margin-top: 14px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
  border: 1px solid rgba(169,126,47,.45);
  padding: 5px 10px 4px; border-radius: 4px; background: rgba(169,126,47,.07);
}

/* ---------- modules (sheet index) ---------- */
.modules {
  counter-reset: mod;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow);
}
.module {
  counter-increment: mod; position: relative;
  padding: 26px 28px 24px 84px; border-bottom: 1px solid var(--line-soft);
  transition: background .18s ease;
}
.module:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.module:nth-last-child(-n+2) { border-bottom: none; }
.module:hover { background: #f4f6ff; }
.module::before {
  content: counter(mod, decimal-leading-zero);
  position: absolute; left: 28px; top: 26px;
  font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--blue);
}
.module::after {
  content: ""; position: absolute; left: 62px; top: 30px; bottom: 26px; width: 1px;
  background: var(--line-soft);
}
.module h4 { font-size: 16.5px; font-weight: 650; margin: 0 0 6px; letter-spacing: -.005em; }
.module p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.55; }

.badge-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badge {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  background: var(--card); color: var(--ink2);
}

/* ---------- founder letter ---------- */
.letter {
  max-width: 800px; margin: 0 auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 56px 60px; position: relative;
}
.letter::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--line-soft);
  border-radius: 6px; pointer-events: none;
}
.letter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px,3.4vw,40px); margin: 14px 0 22px; }
.letter p { font-size: 17.5px; color: var(--ink2); }
.letter .sig { font-family: var(--serif); font-style: italic; font-size: 27px; color: var(--ink); margin: 26px 0 0; }
.stamp {
  position: absolute; top: 34px; right: 38px; transform: rotate(7deg);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--red);
  border: 2px solid rgba(184,57,42,.7); border-radius: 6px;
  padding: 7px 12px 6px; opacity: .75;
}

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq-item {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 16px;
  padding: 20px 24px; font-weight: 600; font-size: 17px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+"; font-family: var(--mono); color: var(--blue); font-size: 18px;
  line-height: 1; transition: transform .25s ease; flex: 0 0 auto;
}
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item .a { padding: 0 24px 22px 58px; color: var(--ink2); font-size: 15.5px; }

/* ---------- waitlist ---------- */
.waitlist { max-width: 680px; margin: 0 auto; text-align: center; }
.waitlist h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px,4vw,46px); color: #fff; }
.waitlist > p { color: var(--bp-mut); font-size: 17.5px; }
.wl-form { display: flex; gap: 12px; margin: 30px auto 14px; max-width: 520px; }
.wl-form input[type="email"] {
  flex: 1; min-width: 0; padding: 14px 18px; border-radius: 8px;
  border: 1px solid var(--bp-edge); background: rgba(9,26,52,.6); color: #fff; font-size: 16px;
}
.wl-form input[type="email"]::placeholder { color: rgba(164,184,214,.6); }
.wl-form input[type="email"]:focus { outline: 2px solid var(--green-b); outline-offset: 1px; border-color: transparent; }
.form-note { font-size: 14px; color: var(--bp-mut); }
.form-note a { color: var(--green-b); }

/* ---------- footer ---------- */
footer.site { background: var(--ink); color: #b9c2ce; padding: 56px 0 40px; }
footer.site a { color: #dfe5ec; }
footer.site a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.foot-grid h5 {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: #8792a1; margin-bottom: 14px;
}
.foot-grid .col a { display: block; margin-bottom: 9px; font-size: 15px; }
.foot-grid .col p { font-size: 14.5px; color: #8792a1; max-width: 40ch; }
.disclaimer {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px;
  font-size: 12.5px; line-height: 1.65; color: #8792a1;
}
.disclaimer strong { color: #aeb8c5; }

/* ==========================================================================
   CALCULATOR
   ========================================================================== */
.calc-hero { padding: 64px 0 40px; border-bottom: none; }
.calc-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px,4.6vw,54px); letter-spacing: -.01em; margin: 14px 0 16px; }
.calc-hero .lede { color: var(--ink2); font-size: 18px; max-width: 760px; }

.presets { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 30px; }
.preset {
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink2);
  transition: border-color .16s, color .16s, transform .16s, box-shadow .16s;
}
.preset small { color: var(--muted); font-size: 12px; }
.preset:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); box-shadow: var(--shadow); }
.preset.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.preset.active small { color: #aeb8c5; }
.preset.active:hover { color: var(--paper); }

.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 26px; align-items: start; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 26px 20px; box-shadow: var(--shadow);
}
.panel h3 {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.panel h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.panel.sticky { position: sticky; top: 86px; }

.field { margin-bottom: 20px; }
.field label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14.5px; color: var(--ink2); margin-bottom: 8px; }
.field label b { color: var(--ink); font-weight: 600; }
.field-row { display: flex; gap: 14px; align-items: center; }
.field-row input[type="number"] {
  width: 110px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.field-row input[type="number"]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,79,215,.18); }
.field-row input[type="range"] { flex: 1; accent-color: var(--blue); height: 4px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 7px; line-height: 1.55; }

.check-row {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px;
  background: #f2f7f0; margin-bottom: 14px;
  transition: border-color .15s;
}
.check-row:hover { border-color: rgba(13,122,75,.5); }
.check-row input[type="checkbox"] { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--green); flex: 0 0 auto; }
.check-row .t { display: block; font-weight: 600; font-size: 15px; }
.check-row .d { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.subfields { padding: 2px 0 6px 30px; transition: opacity .2s ease; }
.subfields.disabled-group { opacity: .45; }
.subfields.disabled-group input { cursor: not-allowed; }

/* results panel — dark blueprint card */
.panel.results {
  background: linear-gradient(180deg, var(--bp-deep), var(--bp));
  border: 1px solid #0b2549; color: var(--bp-ink);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.panel.results::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
.panel.results > * { position: relative; }
.panel.results h3 { color: var(--bp-mut); }
.panel.results h3::after { background: var(--bp-edge); }

.big-number { text-align: center; padding: 10px 0 18px; border-bottom: 1px solid var(--bp-edge); margin-bottom: 18px; }
.big-number .val {
  font-family: var(--serif); font-size: clamp(46px, 4.6vw, 60px); line-height: 1;
  color: var(--green-b); letter-spacing: -.01em;
}
.big-number .val.neg { color: #ff8a75; }
.big-number .cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bp-mut); margin-top: 10px;
}

.kv { display: grid; grid-template-columns: 1fr auto; margin: 0 0 22px; font-size: 14.5px; }
.kv dt { color: var(--bp-mut); padding: 8px 0; border-bottom: 1px dashed rgba(173,203,245,.18); }
.kv dd { margin: 0; padding: 8px 0 8px 16px; text-align: right; font-family: var(--mono); font-size: 14px; color: var(--bp-ink); border-bottom: 1px dashed rgba(173,203,245,.18); }
.kv dd.pos { color: var(--green-b); }
.kv dd.neg { color: #ff9c8a; }

.bar-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bp-mut); margin-bottom: 10px; }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(9,26,52,.8); border: 1px solid var(--bp-edge); }
.bar > div { height: 100%; transition: width .5s cubic-bezier(.3,.7,.3,1); }
.legend { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 14px 0 20px; font-size: 13.5px; }
.legend .k { display: flex; align-items: center; gap: 9px; color: var(--bp-mut); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.legend .v { text-align: right; font-family: var(--mono); font-size: 13px; color: var(--bp-ink); }

.callout {
  border: 1px solid var(--bp-edge); border-left: 3px solid var(--green-b);
  background: rgba(9,26,52,.55); border-radius: 8px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--bp-mut); margin-bottom: 12px;
}
.callout b { color: var(--bp-ink); }
.callout.warn { border-left-color: #ff8a75; }
.callout.warn b { color: #ffb3a5; }
/* callouts on paper (compliance page, event inputs) */
.article .callout, .panel:not(.results) .callout, .on-paper .callout {
  background: #f2f4fc;
  border: 1px solid var(--line); border-left: 3px solid var(--blue); color: var(--ink2);
}
.article .callout b, .panel:not(.results) .callout b, .on-paper .callout b { color: var(--ink); }
.article .callout.warn, .on-paper .callout.warn { border-left-color: var(--red); background: #faf1ef; }
.article .callout.warn b { color: var(--red); }

/* ==========================================================================
   ARTICLE (compliance)
   ========================================================================== */
.article { max-width: 800px; }
.article h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px,4.6vw,56px); letter-spacing: -.01em; margin: 14px 0 16px; }
.article p.lede { color: var(--ink2); font-size: 19px; margin-bottom: 26px; }
.article h2 {
  font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.01em;
  margin: 52px 0 16px; padding-top: 30px; border-top: 1px solid var(--line);
}
.article ul { padding-left: 22px; color: var(--ink2); }
.article li { margin-bottom: 9px; font-size: 16px; }
.article p { color: var(--ink2); font-size: 16.5px; }
.article strong { color: var(--ink); }
.tbl-scroll { overflow-x: auto; }
.article table {
  width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14.5px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.article th {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; text-align: left; color: var(--ink2);
  background: var(--paper2); padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.article td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink2); }
.article tr:last-child td { border-bottom: none; }
.verified {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green);
  border: 1.5px solid rgba(13,122,75,.55);
  border-radius: 6px; padding: 7px 12px; transform: rotate(-1.2deg); background: rgba(13,122,75,.06);
}

/* ==========================================================================
   STATE COMPLIANCE MAP
   ========================================================================== */
.state-article { max-width: 1100px; }
.state-map-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
  margin: 36px 0 8px; align-items: start;
}
.map-col {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px 18px 8px;
}
.us-map { width: 100%; height: auto; display: block; }
.us-map .us-map-sep { stroke: var(--line); stroke-width: 1.2; }
.us-map .st {
  fill: #b9c8dd; stroke: var(--card); stroke-width: 1.1;
  cursor: pointer; transition: fill .12s ease;
}
.us-map .st.cat-licensed { fill: var(--brass); }
.us-map .st.cat-pending { fill: #6f8fc9; }
.us-map .st.cat-banned { fill: var(--red); }
.us-map .st:hover { fill: var(--blue); }
.us-map .st.active { fill: var(--blue); stroke: var(--bp-deep); stroke-width: 1.6; }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 14px 22px; padding: 14px 4px 16px;
  font-family: var(--mono); font-size: 12px; color: var(--ink2);
}
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw-none { background: #b9c8dd; }
.sw-licensed { background: var(--brass); }
.sw-pending { background: #6f8fc9; }
.sw-banned { background: var(--red); }
.state-detail { position: sticky; top: 86px; }
.state-detail .hint { color: var(--bp-mut); font-size: 14.5px; }
.state-filter-input {
  width: 100%; max-width: 360px; margin: 14px 0 16px; padding: 11px 14px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.state-filter-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,79,215,.14); }
#state-table tr.active td { background: #eef3fb; }
#state-table td.ck-licensed { color: var(--brass); font-weight: 500; }
#state-table td.ck-pending { color: #4c67a8; font-weight: 500; }
#state-table td.ck-banned { color: var(--red); font-weight: 500; }
#state-table td.st-name { font-family: var(--mono); font-size: 13.5px; color: var(--ink); white-space: nowrap; }
@media (max-width: 900px) {
  .state-map-grid { grid-template-columns: 1fr; }
  .state-detail { position: static; }
}

/* ---------- scroll reveal (only when JS has tagged <html class="js">,
   so content never hides if scripts fail to load) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.65,.25,1); }
  .js .rv.in { opacity: 1; transform: none; }
  .js .rv-d1 { transition-delay: .08s; } .js .rv-d2 { transition-delay: .16s; } .js .rv-d3 { transition-delay: .24s; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .calc-grid { grid-template-columns: 1fr; }
  .panel.sticky { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .schematic { max-width: 520px; margin: 0 auto; }
}
@media (max-width: 900px) {
  .cards.c3 { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: 1fr; }
  .module:nth-child(odd) { border-right: none; }
  .module:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .module:last-child { border-bottom: none; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .letter { padding: 46px 32px; }
  .stamp { top: 18px; right: 18px; }
}
@media (max-width: 760px) {
  .block { padding: 68px 0; }
  .cards.c2 { grid-template-columns: 1fr; }
  .nav-links a.plain { display: none; }
  .brand { font-size: 18px; gap: 8px; }
  .brand svg { width: 22px; height: 22px; }
  .nav .btn.small { padding: 9px 13px; font-size: 13.5px; }
  .hero-grid { padding: 56px 0 48px; gap: 30px; }
  .schematic { max-width: 340px; }
  .sheet-meta { display: none; }
  .wl-form { flex-direction: column; }
  .faq-item .a { padding-left: 24px; }
}
@media (max-width: 480px) {
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .field-row { flex-wrap: wrap; }
  .field-row input[type="range"] { flex-basis: 100%; order: 2; }
}
