/* ─────────────────────────────────────────────
   AMPACITIES · cable-sizing variants (wave II)
   shared tokens, grain, topbar, theme toggle
   ───────────────────────────────────────────── */

/* ── Ampacities brand tokens (design-polish plan §2.1, Phase 1b 2026-07-02) ──
   ONE source for the values triplicated across calc-grouped / glass-skin /
   platform. Consumers read them via var(--amp-*, <old literal>) fallbacks, so
   these declarations are purely additive — pages that never reference them
   (landing, email) are untouched. Print is isolated: calc-report-bw.css scopes
   its own tokens under .cahier-print. */
/* Values migrated 2026-07-03 to the landing's Anthropic matte language
   (LANDING_REIMAGINE_PLAN §1.1; night values = the landing's night block).
   ⚠️ Clay-as-text rules: raw #d97757 fails AA on ivory (2.96:1) — text
   uses --amp-clay-text (large) / --amp-clay-small (small); on the night
   ink ground raw clay passes (5.9:1). */
:root {
  --amp-copper: #d97757;   --amp-copper-night: #e08a66;
  --amp-pass:   #5b7046;   --amp-pass-night:   #93a877;
  --amp-fail:   #d23b2e;   --amp-fail-night:   #ff5b50;
  --amp-clay-text:  #cc6a47;  --amp-clay-text-night:  #d97757; /* clay as LARGE text */
  --amp-clay-small: #b0512f;  --amp-clay-small-night: #eb9d7e; /* clay as small text — AA 4.5:1 */
  --amp-cream:  #f0eee6;
  --amp-suite-max: 1920px; /* D1: global app max content width */
}

:root,
[data-theme="night"] {
  --bg:           #141413;
  --bg-deep:      #1c1b1a;
  --bg-card:      #201f1d;
  --bg-deepest:   #262523;
  --ink:          #faf9f5;
  --ink-soft:     #d5d3cb;
  --ink-mute:     #a09d94;
  --accent:       #d97757;
  --accent-bright:#e08a66;
  --voltage:      #8ab4e8;
  --rule:         #faf9f51a;
  --rule-strong:  #faf9f533;
  --grain:        0.05;
}

[data-theme="day"] {
  --bg:           #faf9f5;
  --bg-deep:      #f0eee6;
  --bg-card:      #ffffff;
  --bg-deepest:   #e8e6dc;
  --ink:          #141413;
  --ink-soft:     #3d3d3a;
  --ink-mute:     #5e5d59;
  --accent:       #cc6a47;   /* clay tuned for text on ivory; #d97757 is decoration-only */
  --accent-bright:#d97757;
  --voltage:      #6a9bcc;
  --rule:         #1414131a;
  --rule-strong:  #14141333;
  --grain:        0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "kern";
  transition: background 0.5s ease, color 0.5s ease;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* film grain (same as landing) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* topbar / header chrome — REMOVED.
   The site header (.topbar + megamenu + mobile drawer) is the single-source
   chrome injected by /shared/site-chrome.js and styled by /shared/site-chrome.css.
   This file used to carry a legacy compact .topbar (a different flex layout with
   .brand .mark / a.back / button.theme); it had no live consumers and was fully
   overridden by site-chrome.css, so it was deleted to avoid a latent cascade
   conflict. Do not re-add header rules here — edit site-chrome.css instead. */

/* footer strip (one-line) */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 40px;
  border-top: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-deepest);
}
.foot em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}
.foot .exports {
  display: inline-flex;
  gap: 14px;
}
.foot .exports a {
  border-bottom: 1px solid transparent;
  transition: color 0.4s, border-color 0.4s;
  padding-bottom: 1px;
}
.foot .exports a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* shared type primitives */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.it {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
  letter-spacing: -0.005em;
}
.mono { font-family: 'IBM Plex Mono', monospace; }

/* focus rings (accessibility) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* draft / issued / superseded stamps */
.stamp {
  display: inline-block;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 3px 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  opacity: 0.85;
}
.stamp[data-status="issued"] { border-color: var(--voltage); color: var(--voltage); }
.stamp[data-status="superseded"] { border-color: var(--ink-mute); color: var(--ink-mute); }

/* warning callout (when calc combo isn't in our table) */
.warn {
  border-left: 2px solid var(--accent);
  padding: 8px 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
}
