/* Iron Tuna — shared design system.
 *
 * Single source of truth for the site's tokens and its chrome (header, nav,
 * footer). Linked BEFORE each page's inline <style>, so a page can still
 * override anything here and a rule left behind in an inline block is
 * harmless rather than a conflict.
 *
 * Owned by this file, and removed from the page-level <style> blocks:
 *   - the :root palette
 *   - the type scale
 *   - base resets (*, html, body, a)
 *   - .wrap
 *   - header.site, .brand, .nav, .nav-dd, the mobile disclosure nav
 *   - footer.site and the footer sitemap
 *   - the :focus-visible ring
 *
 * The header and footer MARKUP is generated by tools/build-chrome.mjs. Change
 * the nav or footer link set there, not by hand in 94 files.
 */

:root {
  /* ── surfaces ─────────────────────────────────────────────────────────────
     Light, as of the auction-first pass. Every reading surface on the site is
     white; the one dark zone left is the draft app (index.html), which is a tool
     you work in on draft night rather than a page you read, and the black
     masthead band on the front page. */
  --bg: #ffffff;
  --panel: #f7f9fa;
  --elev: #eef2f5;
  --line: #e3e8ec;
  --line2: #ccd6dc;

  /* ── text ─────────────────────────────────────────────────────────────────
     Every value below clears WCAG AA (4.5:1) against --bg, --panel and --elev.
     --muted is the floor: 5.1:1 on --panel. Do not lighten it. */
  --text: #111820;
  --sec: #39454f;
  --muted: #6b7a85;

  /* ── accents ──────────────────────────────────────────────────────────────
     #2dd4a3 is about 1.9:1 on white and cannot be the accent here; --teal is the
     white-safe green the whole site is drawn in.
     GOLD IS A FILL, NOT AN INK. #f2a900 as a block with #231700 type on it is
     fine; as type on white it is barely there, so anything that says a NUMBER or
     a label in gold uses --goldink instead. */
  --teal: #0e7c63;
  --gold: #f2a900;
  --goldink: #7a5300;
  --danger: #c0322f;
  --brand: #0e7c63;

  /* ── type ─────────────────────────────────────────────────────────────────
     A 1.25 scale off a 16px base. Before this, front.html alone computed 31
     distinct sizes including 9.5px, 13.3333px and four half-pixel steps.
     Use these; do not invent intermediate values. */
  --fs-3xs: 11px;
  --fs-2xs: 12px;
  --fs-xs:  13px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  20px;
  --fs-xl:  25px;
  --fs-2xl: 31px;
  --fs-3xl: 39px;
  --fs-4xl: 49px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ── geometry ─────────────────────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --header-h: 56px;
}

/* ── base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box }
html { scroll-behavior: smooth }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important }
}
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(14, 124, 99, .06), transparent), var(--bg);
  color: var(--text);
  /* Inter, so the content pages match front.html and the app instead of
     rendering in whatever UI font the OS happens to supply. */
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none }
a:hover { text-decoration: underline }

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

/* Visible keyboard focus (WCAG 2.4.7). Gold reads >=9:1 on every surface here.
   Listed per element so it beats any `outline:none` in a page's own rules. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px;
}

/* Keyboard users must be able to jump the nav. Visible only when focused. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--panel); color: var(--text);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--teal);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0 }

/* ── header ─────────────────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  max-width: 1080px; display: flex; align-items: center;
  justify-content: space-between; height: var(--header-h); gap: var(--space-4);
}
.brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: .14em; font-size: var(--fs-md); color: var(--text); flex: 0 0 auto }
.brand:hover { text-decoration: none }
.brand b { color: var(--teal) }
.brand-logo { height: 30px; width: auto; display: block }
header.site .brand-logo { height: 26px }

.nav { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-1) }
.nav a {
  color: var(--sec); font-size: var(--fs-2xs); letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: rgba(17, 24, 32, .05); text-decoration: none }
/* The page you are on, so the nav answers "where am I". */
.nav a[aria-current="page"] { color: var(--teal); background: rgba(14, 124, 99, .10) }
header.site > .wrap > a.cta {
  color: #231700; border: 1px solid var(--gold); border-radius: 9px; font-weight: 700;
  padding: var(--space-2) var(--space-3); background: var(--gold);
  font-size: var(--fs-2xs); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; margin-left: auto; flex: 0 0 auto;
}
header.site > .wrap > a.cta:hover { filter: brightness(1.07); text-decoration: none }

/* ── nav dropdown ───────────────────────────────────────────────────────── */
.nav-dd { position: relative; display: inline-block }
.nav-dd > a::after { content: "▾"; margin-left: 5px; font-size: .85em; opacity: .7 }
.nav-dd .nav-dd-menu {
  display: flex; flex-direction: column; visibility: hidden; opacity: 0;
  transition: opacity .12s ease, visibility 0s linear .3s;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid rgba(14, 124, 99, .4);
  border-radius: var(--radius-md); padding: var(--space-2); z-index: 40; min-width: 180px;
  box-shadow: 0 10px 26px rgba(17, 24, 32, .12), 0 0 16px rgba(14, 124, 99, .14);
}
/* Bridges the gap between trigger and menu so the pointer can cross it. */
.nav-dd .nav-dd-menu::before { content: ""; position: absolute; top: -16px; left: -14px; right: -14px; height: 18px }
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { visibility: visible; opacity: 1; transition-delay: 0s }
.nav-dd .nav-dd-menu a {
  display: block; margin: 0; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); text-transform: none; letter-spacing: .02em;
  font-size: var(--fs-sm); color: var(--sec);
}
.nav-dd .nav-dd-menu a:hover { background: rgba(14, 124, 99, .13); color: var(--text); text-decoration: none }

/* ── mobile disclosure nav ───────────────────────────────────────────────── */
.nav-toggle { display: none }
@media (max-width: 860px) {
  /* The canonical nav carries more destinations than fit on a phone. Rather
     than let them overflow into an unmarked horizontal scroll, they collapse
     into a real disclosure menu.
     This keeps the outcome main's cee7d10 was after — the header is always one
     line and about 52px, and the CTA never scrolls out of reach — but reaches
     it with a disclosure button instead of a scrolling link strip. A strip
     works for the three links that nav used to hold; at eleven it hides most
     of them behind a scroll with no affordance, which is the problem the
     canonical nav exists to fix. */
  header.site .wrap { flex-wrap: nowrap; height: auto; min-height: 52px; gap: 10px; padding-top: 7px; padding-bottom: 7px }
  header.site .brand { flex: 0 0 auto }
  header.site .brand-logo { height: 20px }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; min-width: 44px; padding: 0 var(--space-3);
    background: transparent; border: 1px solid var(--line2); border-radius: var(--radius-sm);
    color: var(--sec); font: inherit; font-size: var(--fs-2xs);
    letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  }
  .nav-toggle:hover { color: var(--text); border-color: var(--teal) }
  .nav-toggle-bars { display: block; width: 16px; height: 10px; position: relative }
  .nav-toggle-bars::before, .nav-toggle-bars::after,
  .nav-toggle-bars span { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px }
  .nav-toggle-bars::before { top: 0 }
  .nav-toggle-bars span { top: 4px }
  .nav-toggle-bars::after { top: 8px }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; justify-content: flex-start;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: var(--space-2) var(--space-3) var(--space-4);
    box-shadow: 0 18px 40px rgba(17, 24, 32, .12); max-height: calc(100vh - 52px);
    overflow-y: auto; gap: 0;
  }
  header.site { position: sticky }
  header.site[data-nav-open="1"] .nav { display: flex }
  .nav a { font-size: var(--fs-sm); padding: var(--space-3) var(--space-4); min-height: 44px; display: flex; align-items: center }
  header.site > .wrap > a.cta { padding: var(--space-2) 11px; min-height: 38px; display: inline-flex; align-items: center }
  /* Flattened: a hover dropdown is unusable on touch, so the children are
     simply listed under an inline heading. */
  .nav-dd { display: block }
  .nav-dd > a::after { display: none }
  .nav-dd .nav-dd-menu {
    position: static; transform: none; visibility: visible; opacity: 1;
    display: flex; background: transparent; border: 0; box-shadow: none;
    padding: 0 0 0 var(--space-4); min-width: 0;
  }
  .nav-dd .nav-dd-menu::before { display: none }
  .nav-dd .nav-dd-menu a { font-size: var(--fs-xs); color: var(--muted) }
}

/* ── footer ─────────────────────────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--line); margin-top: var(--space-7);
  padding: var(--space-6) 0 var(--space-5);
  color: var(--muted); font-size: var(--fs-sm);
}
footer.site .wrap { max-width: 1080px }
footer.site a { color: var(--muted) }
footer.site a:hover { color: var(--text) }
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-5); margin-bottom: var(--space-5);
}
.foot-col h2 {
  font-size: var(--fs-3xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--sec); margin: 0 0 var(--space-3); font-weight: 700;
}
.foot-col ul { list-style: none; margin: 0; padding: 0 }
.foot-col li { margin-bottom: var(--space-2) }
.foot-col a { font-size: var(--fs-xs) }
.foot-note { border-top: 1px solid var(--line); padding-top: var(--space-4); font-size: var(--fs-xs); line-height: 1.6 }
.foot-note p { margin: 0 0 var(--space-2) }
.foot-legal { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center }
