/* TIMIRON — Steel Meets Silicon. Dark industrial terminal-operator system. */

/* ── Self-hosted fonts (OFL licensed, CSP-clean — no Google Fonts) ───────── */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-variable-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-variable-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── D3 "Premium Infrastructure" palette (Comp C) ──────────────────────
     Layered charcoal/near-black base (never flat #000 — tonal layers),
     warm off-white ink, ONE warm brass/gold accent used sparingly. */
  --bg:        #0d0d0b;   /* page base — warm near-black */
  --bg-elev:   #181816;   /* elevated panels/cards, one step up */
  --bg-elev-2: #222220;   /* second elevation — inputs, hovers */
  --ink:       #e8e4dc;   /* warm off-white primary text */
  --ink-dim:   #a09890;   /* secondary/dimmed warm grey */
  --ink-faint: #635e57;   /* labels, captions, meta */
  --accent:      #c8a96e; /* warm brass/gold — the single accent */
  --accent-lt:   #e0c88a; /* hover/lift of the accent */
  --accent-dim:  #8a7040; /* muted brass for hairline rules, secondary marks */
  --rule:       rgba(200,169,110,0.18); /* thin brass divider */
  --rule-faint: rgba(200,169,110,0.08); /* barely-there brass hairline */

  /* Layout */
  --maxw: 1100px;         /* content measure for shell/hero rhythm */
  --maxw-text: 720px;     /* legacy reading measure (kept for footer/back-compat) */
  --maxw-prose: 960px;    /* D3.2 interior editorial column — wide, left-aligned,
                             a generous premium measure (~78ch at 17px) instead of
                             the old thin 720px centered ribbon */
  --maxw-wide: 1200px;    /* D3.2 data-page measure (matrix/widgets/tabs/lists) */
  --maxw-home: 1280px;    /* wide cinematic measure for the Home page bands
                             (matches/exceeds Comp C's 1200px content) so the
                             page fills large monitors instead of a center strip */

  /* Type scale (Fraunces display / Inter body) */
  --fs-display: clamp(2.6rem, 5.2vw, 4.4rem);
  --fs-h2:      clamp(1.7rem, 3vw, 2.6rem);
  --fs-h3:      clamp(1.15rem, 1.6vw, 1.4rem);
  --fs-body:    1.0625rem;   /* 17px */
  --fs-small:   0.8125rem;   /* 13px */
  --fs-eyebrow: 0.6875rem;   /* 11px uppercase labels */

  /* Spacing scale */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.75rem;
  --sp-4: 2.75rem;
  --sp-5: 4.5rem;
  --sp-6: 7rem;

  /* Fonts (self-hosted, from Task 1) */
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "Cascadia Code", Consolas, "SF Mono", monospace;
  --font-sans: "Inter", system-ui, sans-serif;

  /* ── Legacy aliases ────────────────────────────────────────────────────
     Downstream page components (cards, tabs, tools, markets, terminals)
     were authored against the Wave-C token names. Alias them onto the new
     D3 palette so the whole site reskins without touching that CSS. */
  --bg-deep: var(--bg);
  --bg-panel: var(--bg-elev);
  --accent-amber: var(--accent);
  --line: var(--rule-faint);
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-deep);
  line-height: 1.65;
  margin: 0;
  /* Footer pins to the viewport bottom on short pages (contact) — one bg
     color everywhere, no dead band below the footer. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  /* .hero uses a 100vw full-bleed breakout; 100vw includes the scrollbar
     gutter, so clip the few px of horizontal overflow it would create. */
  overflow-x: hidden;
}

/* ---------- Header / brand ---------- */
/* Full-bleed edge-to-edge bar (Comp C): NO max-width cap — the wordmark sits
   hard-left, the nav cluster hard-right, both anchored to a generous 48px
   side gutter that spans the whole viewport on wide monitors (kills the old
   centered-column strip). */
.brandbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 22px 48px 18px;
  background: var(--bg);
}
.brandbar a { display: block; line-height: 0; }
/* Wordmark is black serif on a white JPG box: invert -> white-on-black,
   then screen-blend so the white box disappears into the charcoal header,
   leaving a clean warm-white wordmark. Reads correctly on #0d0d0b. */
.brandbar img {
  height: 30px;
  display: block;
  filter: invert(1) brightness(0.94);
  mix-blend-mode: screen;
}
.brand-ai {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 2.5px;
  text-transform: lowercase;
  margin-right: auto;
  padding-left: 14px;
  position: relative;
  top: 1px;
}

/* ---------- Nav (CSS-only hamburger under 720px) ---------- */
/* Desktop: burger hidden, so keep the checkbox out of the tab order entirely.
   Mobile (media query below) re-enables it visually-hidden but focusable. */
.nav-toggle { display: none; }
.nav-burger { display: none; }
/* Full-bleed nav row: links cluster hard-RIGHT (justify-content:flex-end) and
   span edge-to-edge to the 48px gutter. 12 uppercase labels are tightened
   below (tracking/gap/size) to hold one row at >=1200px; flex-wrap lets the
   cluster fall to a second right-aligned line only if the viewport is truly
   too narrow, before the 720px burger takes over. */
.sitenav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 24px;
  width: 100%;
  padding: 2px 48px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.sitenav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sitenav a:hover { color: var(--accent-lt); }
.sitenav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* NAV overflow (Wave C): 11 entries fit one row at 1280px (~1020px of link
   text + gaps vs ~1126px usable). Between the burger breakpoint and 1120px,
   tighten type/gaps so the row holds instead of dropping entries; below that
   flex-wrap degrades gracefully until the burger takes over at 720px. */
@media (min-width: 721px) and (max-width: 1120px) {
  .sitenav { gap: 4px 14px; padding-left: 24px; padding-right: 24px; }
  .sitenav a { font-size: 0.7rem; letter-spacing: 1px; }
}

@media (max-width: 720px) {
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 30px;
    cursor: pointer;
    margin-left: 12px;
  }
  .nav-burger span {
    display: block;
    height: 2px;
    background: var(--accent-amber);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-toggle:checked ~ .brandbar .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .brandbar .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .brandbar .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sitenav { display: none; flex-direction: column; gap: 0; padding: 0 6vw; }
  .sitenav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
  .sitenav a.active { border-bottom-color: var(--line); }
  .nav-toggle:checked ~ .sitenav { display: flex; }
  /* Checkbox is visually hidden but keyboard-focusable; echo its focus ring
     onto the burger label so keyboard users can see where they are. */
  .nav-toggle { display: block; position: absolute; opacity: 0; }
  .nav-toggle:focus-visible ~ .brandbar .nav-burger {
    outline: 2px solid var(--accent-amber);
    outline-offset: 3px;
  }
}

/* Narrow phones (~390px): keep the brandbar on one line, wordmark legible. */
@media (max-width: 480px) {
  .brandbar { padding: 14px 5vw 10px; gap: 10px; }
  .brandbar img { height: 26px; }
  .brand-ai { font-size: 0.8rem; letter-spacing: 1.2px; padding-left: 6px; }
}
@media (max-width: 360px) {
  .brand-ai { display: none; }
}

/* ---------- Content ---------- */
/* D3.2: <main> is now a full-width flex column. Interior pages carry a
   full-bleed .page-hero banner followed by a .page-body editorial column that
   owns its own (wide, left-aligned) measure — NOT a thin 720px centered strip.
   The bare-main fallback (e.g. the 404 page, which has no hero) keeps a
   comfortable reading measure so it never looks broken. */
main {
  margin: 0 auto;
  padding: var(--sp-4) 6vw var(--sp-6);
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw-prose);
  font-size: var(--fs-body);
}

/* When a page-hero/home-hero is present, main goes edge-to-edge and its
   children (.page-body / pillars) set the inner measure. */
main:has(.page-hero) { max-width: none; padding: 0; }

/* The interior editorial body: a wide, LEFT-aligned column with strong vertical
   rhythm. margin-left/right auto centers the *column* on ultrawide screens, but
   the text inside is left-aligned — an intentional measure, not a ribbon. */
.page-body {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: var(--sp-5) 6vw var(--sp-6);
  width: 100%;
}
.page-body-wide { max-width: var(--maxw-wide); }

h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  color: var(--ink);
  font-size: var(--fs-display);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: var(--sp-4) 0 var(--sp-2);
}
h1 em { font-style: italic; color: var(--accent-lt); }
h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  color: var(--ink);
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: var(--sp-5) 0 var(--sp-2);
}
h2::after { content: ""; display: block; width: 40px; border-bottom: 1px solid var(--accent); margin-top: 14px; }
h2 em { font-style: italic; color: var(--ink-dim); }
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  font-size: var(--fs-h3);
  line-height: 1.25;
  margin: var(--sp-3) 0 var(--sp-1);
}

.deck {
  color: var(--ink-dim);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 300;
  line-height: 1.5;
  max-width: 40ch;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-lt); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main p { color: var(--ink); line-height: 1.7; margin: 0 0 var(--sp-2); }
main p a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
main p a:hover { text-decoration-color: var(--accent); color: var(--accent-lt); }
strong { color: var(--ink); font-weight: 500; }
p { color: var(--ink); }
hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, var(--accent-dim), transparent);
  opacity: 0.5;
  margin: var(--sp-4) 0;
}

/* Mono data treatment: numbers, readouts, inline code */
code, .data {
  font-family: var(--font-mono);
  color: var(--accent-amber);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
  font-size: 0.9em;
}
pre { background: var(--bg-panel); border: 1px solid var(--line); padding: 14px 16px; overflow-x: auto; }
pre code { border: 0; background: none; padding: 0; }

/* ---------- Panel cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-amber);
  padding: 14px 16px;
}
.card .expansion {
  font-family: var(--font-mono);
  color: var(--accent-amber);
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.card p { color: var(--ink-dim); }

/* ---------- Article lists ---------- */
.article-list { list-style: none; padding: 0; }
.article-list li {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-amber);
  padding: 12px 16px;
  margin: 12px 0;
}
.article-list .date { font-family: var(--font-mono); color: var(--ink-dim); font-size: 0.8rem; margin-left: 10px; }

/* ---------- CTA buttons ---------- */
/* .btn = premium solid brass; .btn-ghost = hairline (Comp C). */
.btn, a.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 14px 30px;
  margin-top: var(--sp-1);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover, a.btn:hover { background: var(--accent-lt); border-color: var(--accent-lt); color: var(--bg); text-decoration: none; }
main p a.btn { text-decoration: none; margin-right: 12px; }
.btn-ghost, a.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--rule);
}
.btn-ghost:hover, a.btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* ---------- Imagery ---------- */
img.photo { max-width: 100%; height: auto; border: 1px solid var(--line); }

/* ---------- Interior page-hero (D3.2) ----------------------------------------
   A premium, cinematic banner for every interior page: full-bleed photo behind
   a layered dark scrim, with the page's own H1 (+ lede) overlaid at the bottom-
   left — a lighter cousin of the Home hero. Pages with no photo get a solid
   charcoal panel (.page-hero-solid) so the H1 still reads as a designed banner.
   The old floating-photo `.hero` treatment is fully replaced by this. */
.page-hero {
  position: relative;
  width: 100%;
  min-height: clamp(320px, 42vw, 480px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule);
}
.page-hero > .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  filter: brightness(0.82) saturate(0.86);
  transform: scale(1.02);
}
/* Solid (photoless) variant: a warm charcoal wash + faint brass grain so the
   headline never floats on flat black. */
.page-hero-solid {
  background:
    radial-gradient(120% 140% at 12% 120%, rgba(200,169,110,0.10) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  min-height: clamp(260px, 30vw, 360px);
}
.page-hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13,13,11,0.86) 0%, rgba(13,13,11,0.42) 52%, rgba(13,13,11,0.12) 100%),
    linear-gradient(0deg, rgba(13,13,11,0.94) 0%, rgba(13,13,11,0.28) 46%, transparent 78%);
}
.page-hero-solid .page-hero-scrim { display: none; }
.page-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: var(--sp-5) 6vw var(--sp-4);
}
.page-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--sp-2);
}
.page-hero-rule { width: 30px; height: 1px; background: var(--accent); flex: none; }
.page-hero-eyebrow span:last-child {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
}
.page-hero-inner h1 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
}
.page-hero-lede {
  margin: var(--sp-2) 0 0;
  max-width: 54ch;
  color: rgba(232,228,220,0.82);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.7;
}
/* The lifted H1/lede own the hero; suppress the body's leading H1 top margin so
   the editorial column starts clean under the banner. */
.page-body > h1:first-child { margin-top: 0; }
.page-body > h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: var(--sp-4) 6vw var(--sp-5);
  color: var(--ink-faint);
  font-size: var(--fs-small);
  font-family: var(--font-sans);
  letter-spacing: 0.4px;
  background: var(--bg);
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.foot b {
  color: var(--ink-dim);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 1px;
}
.foot a { color: var(--ink-dim); }
.foot a:hover { color: var(--accent); }

/* --- Resources: CSS-only radio tabs (no JS) ------------------------------ */
/* .sr-radio: visually hidden but stays in normal focus order — NEVER
   display:none, which would remove the radios from keyboard/AT access. */
.sr-radio { position: absolute; opacity: 0; }
/* Keyboard focus on a hidden radio echoes an amber ring on its tab label. */
.tabs > .tab-radio:nth-of-type(1):focus-visible ~ .tab-labels > label:nth-of-type(1),
.tabs > .tab-radio:nth-of-type(2):focus-visible ~ .tab-labels > label:nth-of-type(2),
.tabs > .tab-radio:nth-of-type(3):focus-visible ~ .tab-labels > label:nth-of-type(3),
.tabs > .tab-radio:nth-of-type(4):focus-visible ~ .tab-labels > label:nth-of-type(4),
.tabs > .tab-radio:nth-of-type(5):focus-visible ~ .tab-labels > label:nth-of-type(5),
.tabs > .tab-radio:nth-of-type(6):focus-visible ~ .tab-labels > label:nth-of-type(6) {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}
.tab-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin: 1.5rem 0 0;
}
.tab-labels label {
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--bg-panel);
}
.tab-panels > .tab-panel { display: none; padding: 1.25rem 0; }
.tabs > .tab-radio:nth-of-type(1):checked ~ .tab-panels > .tab-panel:nth-of-type(1),
.tabs > .tab-radio:nth-of-type(2):checked ~ .tab-panels > .tab-panel:nth-of-type(2),
.tabs > .tab-radio:nth-of-type(3):checked ~ .tab-panels > .tab-panel:nth-of-type(3),
.tabs > .tab-radio:nth-of-type(4):checked ~ .tab-panels > .tab-panel:nth-of-type(4),
.tabs > .tab-radio:nth-of-type(5):checked ~ .tab-panels > .tab-panel:nth-of-type(5),
.tabs > .tab-radio:nth-of-type(6):checked ~ .tab-panels > .tab-panel:nth-of-type(6) { display: block; }
.tabs > .tab-radio:nth-of-type(1):checked ~ .tab-labels > label:nth-of-type(1),
.tabs > .tab-radio:nth-of-type(2):checked ~ .tab-labels > label:nth-of-type(2),
.tabs > .tab-radio:nth-of-type(3):checked ~ .tab-labels > label:nth-of-type(3),
.tabs > .tab-radio:nth-of-type(4):checked ~ .tab-labels > label:nth-of-type(4),
.tabs > .tab-radio:nth-of-type(5):checked ~ .tab-labels > label:nth-of-type(5),
.tabs > .tab-radio:nth-of-type(6):checked ~ .tab-labels > label:nth-of-type(6) {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background: var(--bg-deep);
}
.res-list { list-style: none; margin: 0; padding: 0; }
.res-entry {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.res-ref {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-amber);
  white-space: nowrap;
  min-width: 9.5rem;
}
.res-body b { color: var(--ink); font-family: var(--font-serif); }
.res-body p { margin: 0.25rem 0 0; color: var(--ink-dim); }
.res-note { color: var(--ink-dim); font-size: 0.85rem; margin-top: 1.5rem; }
@media (max-width: 720px) {
  .res-entry { flex-direction: column; gap: 0.25rem; }
  .res-ref { min-width: 0; }
}

/* Tools & Calculators hub (2026-07-12 merge + D3.3 polish) */
.tools-section { margin-top: var(--sp-5); }
.tools-section > h2 { font: 600 var(--fs-h2, 1.5rem)/1.1 var(--font-serif); color: var(--ink);
  margin: 0 0 var(--sp-1); padding-bottom: var(--sp-1); border-bottom: 1px solid var(--rule, var(--line)); }
.calc-trade-group { margin-top: var(--sp-3); }
.calc-trade-heading { font: 600 0.8rem/1 var(--font-sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent, var(--accent-amber)); margin: 0 0 var(--sp-1); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.tool-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; background: var(--bg-elev, transparent);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.tool-card:hover, .tool-card:focus-visible { border-color: var(--accent-amber); transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,.55); }
.tool-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-elev, #1a1a1a); }
.tool-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.tool-card:hover .tool-card-media img, .tool-card:focus-visible .tool-card-media img { transform: scale(1.05); }
.tool-card-body { padding: 14px 16px 16px; }
.tool-card h3, .tool-card h4 { margin: 0 0 6px; font-size: 1.02rem; color: var(--ink); }
.tool-card p { color: var(--ink-dim); margin: 0; font-size: 0.9rem; line-height: 1.45; }

/* Calculator page hero image + stock credit caption */
.calc-hero-media { margin: 0 0 var(--sp-3); border-radius: 10px; overflow: hidden; position: relative; }
.calc-hero-media img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; display: block; }
.calc-hero-media .media-credit { position: absolute; right: 8px; bottom: 6px; margin: 0;
  font-size: 0.7rem; color: rgba(255,255,255,.82); background: rgba(0,0,0,.42);
  padding: 2px 7px; border-radius: 4px; letter-spacing: .02em; }

@media (max-width: 720px) {
  .tool-grid { grid-template-columns: 1fr; }
  .calc-hero-media img { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-card-media img { transition: none; }
  .tool-card:hover { transform: none; }
  .tool-card:hover .tool-card-media img { transform: none; }
}
.tool-form { display: grid; gap: 6px; max-width: 26rem; margin-top: 18px; }
.tool-form label { font-size: 0.85rem; color: var(--ink-dim); margin-top: 8px; }
.tool-form input, .tool-form select {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: transparent; color: inherit;
}
.tool-form input:focus-visible, .tool-form select:focus-visible { outline: 2px solid var(--accent-amber); outline-offset: 1px; }
.tool-result { margin-top: 14px; padding: 12px; border-radius: 6px; border: 1px dashed var(--line); min-height: 1.4em; font-weight: 600; }
.tool-result:empty::before { content: "Enter values above to see a result."; font-weight: 400; color: var(--ink-dim); }
.tool-noscript, .tool-disclaimer { color: var(--ink-dim); font-size: 0.85rem; margin-top: 1.25rem; }

/* Markets page */
.market-ticker { margin: 1.5rem 0; min-height: 46px; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.market-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow: hidden; }
.market-card h2 { margin-top: 0; font-size: 1.05rem; }
.market-card iframe { border: 0; border-radius: 6px; }
.market-card[data-card="chart"] .tradingview-widget-container,
.market-card[data-card="heatmap"] .tradingview-widget-container { min-height: 400px; }
.card-caption { color: var(--ink-dim); font-size: 0.8rem; margin: 10px 0 0; }
.widget-fallback { color: var(--ink-dim); }
/* Reserve space so async widgets don't reflow the grid as they load. */
.launch-card { min-height: 96px; }
.news-card { min-height: 200px; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.news-source { color: var(--ink-dim); font-size: 0.82rem; }
.news-more {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-amber);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 14px;
  margin-top: 10px;
  cursor: pointer;
}
.news-more:hover { border-color: var(--accent-amber); }
.launch-name { font-weight: 700; margin-bottom: 4px; }
.launch-when { margin: 0 0 4px; }
.launch-countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent-amber); margin: 0; }
.padmap { height: 340px; border-radius: 6px; }
.pad-dot { width: 10px; height: 10px; border-radius: 50%; background: #4a90d9; border: 1px solid #fff; cursor: pointer; }
.pad-dot-home { width: 16px; height: 16px; background: var(--accent-amber); border: 2px solid #fff; }
.pad-counties { list-style: none; padding: 0; margin: 8px 0 0; columns: 2; font-size: 0.9rem; }
.pad-counties li { margin-bottom: 4px; }

/* ---------- Stat strip (oversized elegant serif, thin brass dividers) ----
   Rendered as `<p class="stat-strip data">A · B · C</p>`. It inherits the
   .data pill by markup; override that entirely into a Fraunces display line
   where the `·` separators read as the thin dividers from Comp C. */
.stat-strip.data,
.stat-strip {
  display: block;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: var(--sp-3) 0;
  margin: var(--sp-3) 0 var(--sp-4);
}
/* Warm the interpunct dividers toward brass without touching markup. */
.stat-strip.data { word-spacing: 0.12em; }
.card.flagship {
  position: relative;
  border-top: 2px solid var(--accent-amber);
  margin: 8px 0 10px;
  padding: 18px 20px;
}
.card.flagship h2 { margin-top: 4px; }
.badge-current {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: var(--bg-deep);
  background: var(--accent-amber);
  padding: 2px 8px;
  border-radius: 2px;
}
.terminal-card h3 { font-family: var(--font-serif); }
.terminal-card .data { display: inline-block; margin: 2px 0 6px; }
.terminal-card p { margin: 4px 0 0; color: var(--ink-dim); font-size: 0.92rem; }
.terminal-card .city { color: var(--ink); font-weight: 700; }
.badge-state {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber);
  border-radius: 2px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
}
.terminal-filter {
  display: block;
  width: 100%;
  max-width: 26rem;
  margin: 14px 0 4px;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--ink);
}
.terminal-filter:focus-visible { outline: 2px solid var(--accent-amber); outline-offset: 1px; }
.filter-empty { color: var(--ink-dim); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════════════
   HOME — "Premium Infrastructure" (Wave D3.1 Task 3, Comp C)
   Cinematic full-bleed hero + alternating image/text pillars. Home-scoped:
   every rule here is under .home-hero / .home-pillars, so no other page shifts.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The Home renderer emits its own overlay hero, so it must break out of the
   centered reading column and span the viewport. Because <main> is a centered
   720px box, we pull the hero (and pillar band) full width from inside it. */
main:has(.home-hero) { max-width: none; padding: 0; }

/* ── HOME nav: SOLID, in-flow bar (no overlay) ────────────────────────────
   The header + nav render as a solid full-width bar that reserves its own
   vertical space, exactly like interior pages. The cinematic hero and all
   page copy flow BELOW it, so the spread-out desktop tabs can never be
   overlapped by the headline. (Was an absolute overlay floating over the
   hero — the bottom-anchored headline rode up under the tabs on wide/tall
   viewports; Tyler 2026-07-13.) The hero still bleeds edge-to-edge directly
   beneath the bar via its own full-width rule, so the photo impact is kept.
   No body:has(.home-hero) positioning overrides needed — the base .brandbar
   / .sitenav rules (solid var(--bg), in flow) already do the right thing. */

/* ── Cinematic hero: photo + dual scrim + overlaid headline/stat/CTA ──────── */
.home-hero {
  position: relative;
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.home-hero > .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  transform: scale(1.03);   /* subtle bleed so the edges never gap */
}
.home-hero .hero-scrim {
  position: absolute;
  inset: 0;
  /* Left-weighted + bottom-anchored: keeps the headline legible over any crop
     without washing the whole frame (Comp C dual gradient). */
  background:
    linear-gradient(to right, rgba(13,13,11,0.88) 0%, rgba(13,13,11,0.35) 58%, transparent 100%),
    linear-gradient(to top,   rgba(13,13,11,0.92) 0%, rgba(13,13,11,0.10) 48%, transparent 100%);
  pointer-events: none;
}
.home-hero .hero-inner {
  position: relative;
  max-width: var(--maxw-home);
  width: 100%;
  margin: 0 auto;
  padding: 0 6vw var(--sp-5);
}
.home-hero .hero-inner > h1 {
  max-width: 15ch;
  margin: 0 0 var(--sp-2);
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
}
.home-hero .hero-inner > p {
  max-width: 52ch;
  color: rgba(232,228,220,0.82);
  font-weight: 300;
}
/* Intro prose stays readable but recessed; the thesis h1 leads. */
.home-hero .hero-inner > p:not(.stat-strip) { font-size: 1.0625rem; }

/* Stat strip lives inside the hero now — reads as the light band at the base
   of the frame. Keep the Fraunces divider treatment from the base rule. */
.home-hero .stat-strip,
.home-hero .stat-strip.data {
  margin: var(--sp-3) 0 var(--sp-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
/* Eyebrow rule above the headline — pure decoration, no copy. */
.home-hero .hero-inner::before {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-bottom: var(--sp-3);
}

/* ── Alternating pillars ─────────────────────────────────────────────────── */
.home-pillars {
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  background: var(--bg);
}
.pillar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  max-width: var(--maxw-home);
  margin: 0 auto;
  border-bottom: 1px solid var(--rule-faint);
  min-height: 400px;
}
/* pillar-left = text left / photo right; pillar-right = photo left / text right.
   The photo is source-ordered AFTER the text, so pillar-right reverses it. */
.pillar-right .pillar-text  { order: 2; }
.pillar-right .pillar-photo { order: 1; }

.pillar-text {
  padding: var(--sp-5) 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pillar-text h2 { margin-top: 0; }
.pillar-text h2::after { margin-top: 12px; }
.pillar-text p { color: var(--ink-dim); max-width: 46ch; }
.pillar-text p a { color: var(--accent); }

.pillar-photo {
  position: relative;
  overflow: hidden;
  min-height: 400px;
}
.pillar-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  filter: brightness(0.62) saturate(0.72);
  transition: filter 0.6s ease, transform 0.6s ease;
}
.pillar:hover .pillar-photo img { filter: brightness(0.74) saturate(0.85); transform: scale(1.02); }
.pillar-photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,13,11,0.5) 0%, transparent 55%);
}

/* ── AI-edge: full-width emphasis band (asymmetric, not a card) ───────────── */
.pillar-ai {
  display: block;
  grid-template-columns: none;
  position: relative;
  background: var(--bg-elev);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 0;
  overflow: hidden;
}
/* control-panel photo as a recessed backdrop; text stays dominant. */
.pillar-ai-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  filter: brightness(0.34) saturate(0.6);
}
.pillar-ai-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(13,13,11,0.94) 0%, rgba(13,13,11,0.72) 55%, rgba(13,13,11,0.55) 100%);
}
.pillar-ai .pillar-text {
  position: relative;
  max-width: var(--maxw-home);
  margin: 0 auto;
  padding: var(--sp-6) 6vw;
  align-items: flex-start;
}
.pillar-ai .pillar-text h2 { font-size: var(--fs-display); max-width: 18ch; }
.pillar-ai .pillar-text p { color: var(--ink); font-size: 1.125rem; max-width: 60ch; }

/* ── Full-width photo break between pillar groups ────────────────────────── */
.photo-break {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}
.photo-break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  filter: brightness(0.5) saturate(0.6);
}
.photo-break-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 22%, transparent 78%, var(--bg) 100%);
}

/* ── Home CTA band (gold-ruled) — the last pillar's link row reads as the CTA.
   The final Passion pillar closes with the story button; add a gold hairline
   above the pillar band's tail to echo the comp's ruled CTA. ─────────────── */
.home-pillars .pillar:last-child { border-bottom: 0; }
.home-pillars::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-dim) 30%, var(--accent-dim) 70%, transparent);
  opacity: 0.5;
}

/* ── Responsive: stack pillars under 720px, photo above text ─────────────── */
@media (max-width: 720px) {
  .home-hero { min-height: min(78vh, 620px); }
  .home-hero .hero-inner { padding-bottom: var(--sp-4); }
  .pillar, .pillar-right { grid-template-columns: 1fr; }
  .pillar-text { order: 2; padding: var(--sp-4) 6vw; }
  .pillar-photo, .pillar-right .pillar-photo { order: 1; min-height: 240px; }
  .pillar-right .pillar-text { order: 2; }
  .photo-break { height: 280px; }
  /* Interior page-hero: shorter banner, tighter overlay padding on phones. */
  .page-hero { min-height: clamp(240px, 52vw, 340px); }
  .page-hero-inner { padding: var(--sp-4) 6vw var(--sp-3); }
  .page-body, .page-body-wide { padding: var(--sp-4) 6vw var(--sp-5); }
}

/* ── Narrow phones: compress hero copy, stat strip wraps gracefully ───────── */
@media (max-width: 480px) {
  .home-hero { min-height: min(72vh, 560px); }
  .home-hero .hero-inner { padding: 0 5vw var(--sp-3); }
  .home-hero .hero-inner > h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .stat-strip { font-size: 0.78rem; padding: 10px 0; letter-spacing: 0.8px; }
  .pillar-text { padding: var(--sp-3) 5vw; }
  .pillar-photo, .pillar-right .pillar-photo { min-height: 200px; }
  .page-hero-inner h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .page-hero-inner, .page-body, .page-body-wide { padding-left: 5vw; padding-right: 5vw; }
}

/* ── Accessibility: visible focus ring using the brass accent ─────────────── */
/* (global :focus-visible is set earlier; this reinforces key interactive
   elements so the ring is never accidentally suppressed by a component reset) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.btn-ghost:focus-visible,
.tab-label:focus-visible,
.nav-burger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Reduced motion: disable all transitions and animations ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Freeze the subtle hero/pillar photo scale on hover */
  .home-hero > .photo,
  .page-hero > .photo,
  .pillar-photo img,
  .pillar:hover .pillar-photo img {
    transform: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Calculator hub (Trade Calculator Hub C1) ───────────────────────────────
   Informative, live-updating calculator page: the ANSWER is the hero (big, top,
   updates on every input event via aria-live), the teach block sits BELOW,
   disclaimer at the bottom. Styled on the D3 tokens; phone-friendly. */
.calc-page { max-width: var(--maxw-prose); margin: 0 auto; padding: var(--sp-4) var(--sp-2) var(--sp-5); }
.calc-hero { margin-bottom: var(--sp-4); }
.calc-eyebrow { display: flex; align-items: center; gap: var(--sp-1);
  font: 600 var(--fs-eyebrow)/1 var(--font-sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--sp-2); }
.calc-eyebrow .calc-rule { width: 2.2rem; height: 1px; background: var(--accent-dim); display: inline-block; }
.calc-hero h1 { font: 600 var(--fs-display)/1.03 var(--font-serif); color: var(--ink); margin: 0 0 var(--sp-2); }
.calc-blurb { font-size: var(--fs-body); color: var(--ink-dim); max-width: 60ch; margin: 0 0 var(--sp-3); }

/* THE ANSWER = hero. Big, top, live. */
.calc-result { min-height: 4.5rem; margin: 0 0 var(--sp-3); padding: var(--sp-3);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: var(--bg-elev); border-radius: 6px; }
.calc-result[data-state="empty"]::before { content: "Enter values to see the result."; color: var(--ink-faint); font-size: var(--fs-body); }
.calc-answer { display: flex; flex-direction: column; gap: .25rem; }
.calc-answer-val { font: 600 clamp(2.2rem, 6vw, 3.4rem)/1 var(--font-serif); color: var(--accent-lt); }
.calc-answer-lbl { font-size: var(--fs-small); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.calc-metrics { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2);
  padding-top: var(--sp-2); border-top: 1px solid var(--rule-faint); }
.calc-metric { display: flex; flex-direction: column; gap: .15rem; }
.calc-metric-val { font: 600 1.35rem/1 var(--font-mono); color: var(--ink); }
.calc-metric-lbl { font-size: var(--fs-small); color: var(--ink-faint); }

/* Inputs — touch-friendly, stacked; grid on wider screens. */
.calc-form { display: grid; grid-template-columns: 1fr; gap: var(--sp-2) var(--sp-3); }
@media (min-width: 620px) { .calc-form { grid-template-columns: 1fr 1fr; } }
.calc-form label { display: block; font-size: var(--fs-small); color: var(--ink-dim);
  letter-spacing: .04em; margin-bottom: .35rem; }
.calc-form input, .calc-form select { width: 100%; box-sizing: border-box;
  font: 400 var(--fs-body) var(--font-sans); color: var(--ink);
  background: var(--bg-elev-2); border: 1px solid var(--rule); border-radius: 5px;
  padding: .7rem .8rem; min-height: 2.9rem; }
.calc-form input:focus, .calc-form select:focus { outline: none; border-color: var(--accent); }
.calc-noscript { color: var(--ink-dim); font-size: var(--fs-small); margin-top: var(--sp-2); }

/* Teach block — BELOW the fold. */
.calc-teach { border-top: 1px solid var(--rule); padding-top: var(--sp-4); }
.calc-teach h2 { font: 600 var(--fs-h2)/1.1 var(--font-serif); color: var(--ink); margin: 0 0 var(--sp-2); }
.calc-teach h3 { font: 600 var(--fs-h3) var(--font-sans); color: var(--accent-lt);
  letter-spacing: .02em; margin: var(--sp-3) 0 var(--sp-1); }
.calc-teach p, .calc-teach li { font-size: var(--fs-body); color: var(--ink-dim); line-height: 1.65; }
.calc-formula { font-family: var(--font-mono); font-size: .95rem; color: var(--ink);
  background: var(--bg-elev); border: 1px solid var(--rule-faint); border-radius: 5px;
  padding: var(--sp-2); overflow-x: auto; }
.calc-notes, .calc-related { margin: 0; padding-left: 1.2rem; }
.calc-notes li, .calc-related li { margin-bottom: .5rem; }
.calc-related a { color: var(--accent); }
.calc-disclaimer { margin-top: var(--sp-4); padding-top: var(--sp-2); border-top: 1px solid var(--rule-faint);
  font-size: var(--fs-small); color: var(--ink-faint); }
