/* AnswerLedger - The Public Record.
   Design tokens + global styles. Palette and fonts are frozen brand rules. */

/* ---------- Fonts (self-hosted WOFF2, latin + latin-ext subsets) ---------- */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/hanken-grotesk-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #1A1D22;
  --inverse: #191C21;
  --muted: #5B6069;
  --rust: #C2410C;
  --rust-hover: #9A3412;
  --border: #E7E3DB;
  --success: #1E7F4F;
  --warning: #946300;
  --critical: #A11E2E;
  --evidence-bg: #FDF6E3;
  --evidence-text: #7A5A00;

  --font-sans: 'Hanken Grotesk', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --container: 1152px;
  --measure: 720px;
  --radius: 4px;
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --t: 140ms ease;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0 0 var(--s4); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem); }
p, ul, ol { margin: 0 0 var(--s4); max-width: var(--measure); }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: var(--s2); }
a { color: var(--rust); text-decoration: underline; text-underline-offset: 2px; transition: color var(--t); }
a:hover { color: var(--rust-hover); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
code { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layout primitives ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s5); }
.measure { max-width: var(--measure); }
.section { padding: var(--s8) 0; border-top: 1px solid var(--border); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--inverse); color: var(--paper);
  padding: var(--s3) var(--s4); text-decoration: none;
}
.skip-link:focus { left: var(--s4); top: var(--s4); color: var(--paper); }

.section-label {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: var(--s4);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--border);
  max-width: var(--measure);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  position: relative;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: var(--s4);
}
.brand-link {
  display: flex; align-items: center; gap: var(--s3);
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.05rem;
}
.brand-link img { width: 32px; height: 32px; object-fit: contain; border-radius: var(--radius); }
.site-nav ul { display: flex; gap: var(--s5); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: var(--s3) 0; display: inline-block;
}
.site-nav a:hover { color: var(--rust-hover); }
.site-nav a[aria-current='page'] { color: var(--rust); border-bottom: 2px solid var(--rust); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink);
  cursor: pointer; min-height: 44px; min-width: 44px;
}
@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .site-nav { display: none; }
  .site-nav.open {
    display: block; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--paper); border-bottom: 1px solid var(--border); z-index: 50;
  }
  .site-nav.open ul { flex-direction: column; gap: 0; padding: var(--s3) var(--s5) var(--s5); }
  .site-nav.open a { display: block; padding: var(--s3) 0; min-height: 44px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; text-align: center;
  font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: 14px 24px; border-radius: var(--radius);
  min-height: 44px; border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--t), color var(--t), border-color var(--t);
}
.btn-primary { background: var(--rust); color: #FFFFFF; }
.btn-primary:hover { background: var(--rust-hover); color: #FFFFFF; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { color: var(--rust-hover); border-color: var(--rust-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ---------- Ledger / evidence primitives ---------- */
.ledger {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.ledger-caption {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; color: var(--evidence-text); background: var(--evidence-bg);
  padding: var(--s2) var(--s4); border-bottom: 1px solid var(--border);
}
.prompt-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--s3);
  align-items: baseline; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted);
}
.prompt-row:last-child { border-bottom: 0; }
.prompt-row .field { color: var(--ink); }
@media (max-width: 640px) {
  .prompt-row { grid-template-columns: 1fr; gap: var(--s1); }
}
.engine-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 8px;
  background: var(--paper);
}
.status-label { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; }
.status-success { color: var(--success); }
.status-warning { color: var(--warning); }
.status-critical { color: var(--critical); }

.evidence-quote {
  background: var(--evidence-bg); color: var(--evidence-text);
  border-left: 3px solid var(--evidence-text); border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s4) var(--s5); margin: 0 0 var(--s4); max-width: var(--measure);
  font-size: 1rem;
}
.evidence-quote p { color: var(--evidence-text); }
.evidence-quote p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--border); }
caption { text-align: left; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); padding: var(--s2) 0; }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); font-size: 0.95rem; vertical-align: top; }
th { font-weight: 600; font-size: 0.85rem; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Cards / rows ---------- */
.product-card {
  border: 1px solid var(--ink); border-radius: var(--radius); background: var(--surface);
  padding: var(--s6); max-width: var(--measure);
}
.product-card .price { font-family: var(--font-mono); font-weight: 500; font-size: 1.6rem; margin: 0 0 var(--s3); }
.product-card ul { margin-bottom: var(--s5); }
.path-row {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: baseline;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: var(--s4) var(--s5); margin-bottom: var(--s3); max-width: var(--measure);
}
.path-row .name { font-weight: 600; }
.path-row .price { font-family: var(--font-mono); font-size: 0.9rem; }
.path-row .note { color: var(--muted); font-size: 0.9rem; flex-basis: 100%; }

/* ---------- Process steps ---------- */
.process-steps { list-style: none; padding: 0; counter-reset: step; max-width: var(--measure); }
.process-steps li {
  counter-increment: step; display: flex; gap: var(--s4); align-items: baseline;
  padding: var(--s3) 0; border-bottom: 1px solid var(--border); margin: 0;
}
.process-steps li:last-child { border-bottom: 0; }
.process-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-weight: 500; color: var(--rust); font-size: 0.85rem;
  flex: 0 0 auto;
}

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s3); max-width: var(--measure); }
.faq summary {
  cursor: pointer; font-weight: 600; padding: var(--s4) var(--s5);
  list-style: none; min-height: 44px; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-mono); color: var(--rust); margin-left: auto; padding-left: var(--s4); }
.faq details[open] summary::after { content: '\2212'; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq-body { padding: var(--s4) var(--s5); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Founder block ---------- */
.founder-block {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: var(--s6); max-width: var(--measure);
}
.founder-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.founder-head img { width: 48px; height: 48px; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--border); }
.founder-head .name { font-weight: 600; }
.founder-head .role { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.founder-meta { list-style: none; padding: 0; margin: var(--s4) 0 0; border-top: 1px solid var(--border); }
.founder-meta li { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); margin: 0; }
.founder-meta li:last-child { border-bottom: 0; }
.founder-meta .k { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); flex: 0 0 130px; }
.founder-meta .v { flex: 1 1 300px; font-size: 0.95rem; }

/* ---------- Placeholder ---------- */
.placeholder-asset {
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); padding: var(--s6); max-width: var(--measure);
  margin-bottom: var(--s4);
}
.placeholder-asset .ph-label {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: var(--s2);
}
.placeholder-asset p:last-child { margin-bottom: 0; }

/* ---------- CTA section ---------- */
.cta-section { background: var(--inverse); color: var(--paper); }
.cta-section .section-label { color: var(--paper); opacity: 0.8; border-color: rgba(250, 248, 244, 0.25); }
.cta-section h2, .cta-section p { color: var(--paper); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: var(--s7) 0;
  color: var(--muted); font-size: 0.9rem;
}
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s4); margin: 0 0 var(--s5); padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--rust-hover); }
.site-footer .legal { max-width: var(--measure); }
.site-footer .fine { font-size: 0.8rem; }

/* ---------- Hero ---------- */
.hero { padding: var(--s9) 0 var(--s8); }
.hero .overline {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust);
  display: block; margin-bottom: var(--s4);
}
.hero h1 { max-width: 880px; }
.hero .promise { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.hero .btn-row { margin-top: var(--s5); }
.hero-ledger { margin-top: var(--s7); max-width: var(--measure); }

/* ---------- Misc ---------- */
.limitations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.limitation-card { border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius); background: var(--surface); padding: var(--s5); }
.limitation-card h3 { font-size: 1rem; margin-bottom: var(--s2); }
.limitation-card p { margin-bottom: 0; font-size: 0.95rem; color: var(--muted); }
.weights-row { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.weights-row .w {
  font-family: var(--font-mono); font-weight: 500; font-size: 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: var(--s3) var(--s4);
}
.notfound { padding: var(--s9) 0; }

/* ---------- Email CTA (mailto + copy fallback) ---------- */
.email-cta .email-fallback {
  margin-top: var(--s4);
  font-size: 0.9rem;
  color: var(--muted);
  max-width: var(--measure);
}
.email-cta .email-fallback a { color: inherit; text-decoration: underline; }
.email-cta .email-fallback a:hover { color: var(--rust-hover); }
.copy-email-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}
.copy-email-btn:hover { border-color: var(--rust); color: var(--rust); }
.copy-email-btn:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.copy-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--success);
  margin-left: var(--s2);
}
.cta-section .email-fallback { color: rgba(250, 248, 244, 0.75); }
.cta-section .email-fallback a { color: var(--paper); }
.cta-section .copy-email-btn {
  color: var(--paper);
  background: transparent;
  border-color: rgba(250, 248, 244, 0.4);
}
.cta-section .copy-email-btn:hover { border-color: var(--paper); color: var(--paper); }
.cta-section .copy-status { color: var(--paper); }
