@import url("/warm-tokens.css");

:root {
  --paper: #fbf7f0;
  --paper-deep: #f3ebe0;
  --ink: #1c1a17;
  --ink-secondary: #3e3a35;
  --muted: #6b6560;
  --line: rgba(0, 0, 0, .09);
  --teal: #1e6e6e;
  --teal-dark: #1e6e6e;
  --signal: #d4a55a;
  --danger: #d47b8a;
  --safe: #5abd8c;
  --white: #fdfaf4;
  --display: "Fraunces", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
button, select { font: inherit; }

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  z-index: 10000;
  padding: .5rem 1.5rem;
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  color: var(--paper);
  background: var(--teal);
  font-size: .85rem;
  font-weight: 700;
}
.skip-link:focus { top: 0; }

.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 247, 240, .88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: border-color .3s;
}
.site-nav.scrolled { border-bottom-color: rgba(0, 0, 0, .13); }
.brand {
  display: flex;
  gap: .6rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
}
.brand svg { width: 26px; height: 26px; }
.brand-wordmark {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.brand-right, .brand-fidelity { font-weight: 600; }
.brand-fidelity { color: var(--teal); }
.brand-ai { color: var(--muted); font-size: .72rem; font-weight: 400; }
.site-links { display: flex; gap: 0; align-items: center; margin: 0; padding: 0; list-style: none; }
.site-links a {
  display: block;
  padding: .4rem .8rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
}
.site-links a:hover { color: var(--teal); background: rgba(30, 110, 110, .08); }
.site-links a[aria-current="page"] { color: var(--teal); font-weight: 600; }
.site-links .nav-cta {
  padding: .4rem 1rem;
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
}
.site-links .nav-cta:hover { color: #fff; background: #278888; }
.menu-button {
  display: none;
  position: relative;
  width: 22px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-button span { position: absolute; left: 0; display: block; width: 100%; height: 2px; background: var(--ink); }
.menu-button span:nth-child(1) { top: 0; }
.menu-button span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-button span:nth-child(3) { bottom: 0; }

.hero {
  padding: 5rem 0 2rem;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
}
.hero-inner { max-width: 1000px; margin: 0 auto; padding: 0 2rem; }
.eyebrow {
  margin-bottom: 1rem;
  color: var(--teal);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; }
h1 { max-width: 780px; margin: 0 0 1.25rem; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -.02em; }
h1 em { color: var(--teal); font-weight: 600; }
.hero-lede { max-width: 720px; margin: 0; color: var(--ink-secondary); font-size: 1.05rem; line-height: 1.7; }
.hero-meta { margin-top: 1rem; color: var(--muted); font-family: var(--mono); font-size: .7rem; }

.decision-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1000px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
}
.decision-cell { flex: 1 1 220px; text-align: center; }
.metric {
  color: var(--teal);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.metric.danger { color: var(--danger); }
.metric.signal { color: #a6762f; }
.metric-label { margin-top: .35rem; color: var(--muted); font-family: var(--mono); font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

main { max-width: 1000px; margin: 0 auto; padding: 0 2rem 6rem; }
.narrow { max-width: 780px; }
section { margin: 0; padding: 4rem 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
section:first-child { border-top: 0; }
.section-tag { margin-bottom: .5rem; color: var(--teal); font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
h2 { max-width: 820px; margin: 0 0 1rem; font-size: 1.7rem; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 0 0 .75rem; font-size: 1.2rem; font-weight: 600; }
.lede { max-width: 800px; color: var(--ink-secondary); font-size: 1.05rem; line-height: 1.7; }
.callout {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: var(--paper-deep);
}
.callout strong { color: var(--ink); }
.warning { border-left-color: var(--danger); background: #fff1ed; }
.note { color: var(--muted); font-size: .88rem; }
.mono { font-family: var(--mono); }

.ledger {
  margin: 2rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}
.ledger-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(130px, .6fr) 2fr;
  gap: 1rem;
  align-items: center;
  min-height: 72px;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row.header {
  min-height: 44px;
  color: var(--muted);
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ledger-value { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; gap: .4rem; align-items: center; font-size: .8rem; font-weight: 650; }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--safe); }
.status.caution::before { background: var(--signal); }
.status.danger::before { background: var(--danger); }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.card {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.card::before {
  content: attr(data-index);
  display: block;
  margin-bottom: .8rem;
  color: var(--signal);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .09em;
}
.card p { margin: .4rem 0 1rem; color: var(--muted); }
.card-link { font-weight: 650; text-decoration-thickness: 1px; }
.full { grid-column: 1 / -1; }

.ladder { counter-reset: fidelity; border-top: 1px solid var(--line); }
.ladder-step {
  counter-increment: fidelity;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
.ladder-step::before {
  content: "L" counter(fidelity);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
}
.ladder-step p { margin: .35rem 0 0; color: var(--muted); }

.bar-list { display: grid; gap: .65rem; margin-top: 1.8rem; }
.bar-row { display: grid; grid-template-columns: 65px 1fr 110px; gap: .8rem; align-items: center; }
.bar-track { height: 18px; border: 1px solid var(--line); background: var(--paper-deep); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), #59a6a2); }
.bar-fill.alert { background: linear-gradient(90deg, var(--signal), var(--danger)); }
.bar-value { font-family: var(--mono); font-size: .78rem; text-align: right; }

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.control label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; }
.control select { width: 100%; padding: .65rem; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; }
.button {
  border: 1px solid var(--teal);
  padding: .62rem .9rem;
  color: var(--teal-dark);
  background: transparent;
  cursor: pointer;
}
.button:hover, .button:focus-visible { color: var(--white); background: var(--teal); }
.result-panel {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #244e53;
  color: var(--white);
}
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.result-number { color: #f3bd6b; font-family: var(--display); font-size: 2rem; line-height: 1; }
.result-label { margin-top: .35rem; color: #b9ccce; font-size: .72rem; text-transform: uppercase; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: var(--paper-deep); font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
td { font-size: .92rem; }
tr:last-child td { border-bottom: 0; }

.source-list { display: grid; gap: .8rem; padding: 0; list-style: none; }
.source-list li { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.source-list small { display: block; color: var(--muted); }

.subnav { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.5rem 0 0; }
.subnav a { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .76rem; text-decoration: none; }
.subnav a:hover { border-color: var(--teal); color: var(--teal); }
.page-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.page-nav a { flex: 1; max-width: 320px; padding: .75rem 1.5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: .8rem; font-weight: 500; text-align: center; text-decoration: none; }
.page-nav a:hover { border-color: var(--teal); }

footer { padding: 3.5rem 2rem; border-top: 1px solid rgba(255, 255, 255, .07); color: rgba(251, 247, 240, .35); background: var(--wt-bg-footer, #23201c); text-align: center; }
.footer-tagline { margin-bottom: 1.6rem; color: rgba(251, 247, 240, .45); font-family: var(--display); font-size: .95rem; font-style: italic; font-weight: 300; letter-spacing: .01em; }
.footer-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem 2rem; position: static; max-width: 800px; margin: 0 auto 1.6rem; padding: 0; border: 0; background: transparent; text-align: left; }
.footer-col h4 { margin: 0 0 .65rem; color: rgba(251, 247, 240, .38); font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.footer-col a { display: block; padding: .18rem 0; color: rgba(251, 247, 240, .5); font-size: .83rem; text-decoration: none; }
.footer-col a:hover { color: rgba(251, 247, 240, .88); }
.footer-info { margin-bottom: .8rem; color: rgba(251, 247, 240, .35); font-family: var(--mono); font-size: .78rem; }
.footer-info a { color: rgba(251, 247, 240, .55); text-decoration: none; }
.footer-info a:hover { color: rgba(251, 247, 240, .88); }
.footer-legal { color: rgba(251, 247, 240, .3); font-family: var(--mono); font-size: .71rem; letter-spacing: .04em; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 960px) {
  .site-nav { padding: 0 1.25rem; }
  .js .menu-button { display: block; }
  .js .site-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .75rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 247, 240, .97);
  }
  .js .site-links.open { display: flex; }
  .site-links a { padding: .7rem .75rem; font-size: .95rem; }
  .site-links .nav-cta { display: inline-block; align-self: flex-start; }
  .hero { padding-top: 5rem; }
  .decision-strip { gap: 1.5rem; }
  main { padding-inline: 1rem; }
  section { padding: 3.5rem 0; }
  .card-grid, .controls, .result-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .ledger-row { grid-template-columns: 1fr; gap: .2rem; }
  .ledger-row.header { display: none; }
  .bar-row { grid-template-columns: 48px 1fr; }
  .bar-value { grid-column: 2; text-align: left; }
  .page-nav { flex-direction: column; }
  .page-nav a { max-width: none; }
}

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