/* ==========================================================================
   Ocean Flux — Theme B "Ocean data lab" (LOCAL PREVIEW 2026-10-08)
   Loaded LAST in <head> so it overrides styles.css and per-page <style> blocks.
   CSS / chrome only: no copy, chip semantics, gate, or structure changes.
   Contrast: all text pairs checked >= 4.5:1 (WCAG AA) on their backgrounds.
   ========================================================================== */
:root {
  /* surfaces */
  --bg: #ffffff;
  --bg2: #0b2233;          /* figure frames (dark SVG art) */
  --tint: #f3f6f8;
  --navy: #0b2233;         /* header / footer */
  --navy-2: #12324a;
  /* text */
  --ink: #0f1f2b;          /* 16.4:1 on white */
  --muted: #475a67;        /* 7.0:1 on white, 6.5:1 on --tint */
  --on-navy: #e6eef3;      /* 14:1 on navy */
  --on-navy-muted: #a9bdca;/* 8.3:1 on navy */
  /* restrained data-viz palette */
  --accent: #0a6e7a;       /* teal   5.9:1 on white */
  --accent2: #0b5a66;      /* teal-dark for links 7.6:1 */
  --kelp: #2f6b3a;         /* kelp   6.3:1 */
  --amber: #8a5300;        /* amber  6.2:1 on white */
  --amber-bg: #fdf4e3;
  --red: #a12a2a;
  --red-bg: #fbecec;
  --violet: #5b3f8f;
  --violet-bg: #f1edf8;
  --teal-bg: #e6f3f4;
  --slate-bg: #eef2f5;
  --line: #d6dfe5;
  --line-strong: #b9c7d0;
  --focus: #0a6e7a;
  /* type */
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* shape + spacing scale (4px base) */
  --radius: 4px;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --max: 1120px;
  --header-h: 3.5rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { color: var(--accent2); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

code, kbd, samp, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--slate-bg); border: 1px solid var(--line); border-radius: 2px; padding: 0 0.25em; }

/* ---------- header (dark navy instrument bar) ---------- */
.site-header {
  background: var(--navy);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 3px solid var(--accent);
}
.bar { padding: var(--s2) 0; min-height: var(--header-h); }
.logo { white-space: nowrap; color: #fff; font-weight: 600; letter-spacing: 0.01em; font-size: 1rem; }
.logo:hover { color: #fff; }
.logo-mark { border-radius: 2px; }
#site-nav { gap: 0; }
#site-nav a {
  color: var(--on-navy-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
#site-nav a:hover { color: #fff; background: transparent; border-bottom-color: #5fb8c2; }
#site-nav a:focus-visible { outline-color: #fff; }
.nav-toggle { border-color: rgba(255,255,255,0.25); border-radius: var(--radius); color: #fff; background: transparent; }
.nav-toggle:hover { background: var(--navy-2); border-color: #5fb8c2; }
.skip { background: var(--navy); }

/* ---------- typography ---------- */
h1, h2, h3, .page-title { font-family: var(--font); color: var(--ink); }
h1 {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
.page-title { font-size: clamp(1.75rem, 2.6vw, 2.15rem); font-weight: 600; letter-spacing: -0.01em; }
h2 {
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  margin-bottom: var(--s3);
}
h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: 0; }
.eyebrow, .section-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.lede { color: var(--muted); font-size: 1.12rem; max-width: 64ch; }
p, li { max-width: 72ch; }
.fine { color: var(--muted); font-size: 0.875rem; }
.section-intro { color: var(--muted); max-width: 68ch; }

/* ---------- layout chrome ---------- */
.hero { padding: var(--s8) 0 var(--s7); border-bottom: 1px solid var(--line); }
.hero::after { display: none; }
.block { padding: var(--s7) 0; }
.block + .block { border-top: 1px solid var(--line); }
.block.tint { background: var(--tint); border-block: 1px solid var(--line); }
.block.cta { padding-bottom: var(--s8); }
.block.cta p { color: var(--muted); }
.grid-2 { gap: var(--s6); }
.grid-2 p { color: var(--muted); }

/* buttons: square-ish, flat */
.btn {
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  letter-spacing: 0.005em;
}
.btn.primary, .login-actions button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #075761; color: #fff; }
.btn.ghost { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent2); background: #fff; }

/* cards → flat panels with a data-strip top rule */
.cards { gap: var(--s4); }
.cards li {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s5) var(--s5) var(--s5);
  box-shadow: none;
}
.cards li:nth-child(3n+2) { border-top-color: var(--kelp); }
.cards li:nth-child(3n+3) { border-top-color: #b07a1a; }
.cards li:hover { border-color: var(--line-strong); box-shadow: none; }
.cards p { color: var(--muted); font-size: 0.95rem; }

.steps { color: var(--muted); }
.steps strong { color: var(--ink); }
.steps li::marker { color: var(--accent); font-family: var(--mono); font-weight: 600; }

/* figures: dark SVG art sits in a navy instrument frame */
.lead-figure img { border-radius: var(--radius); border: 1px solid var(--navy); background: var(--bg2); }
.lead-figure figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: var(--s2);
}

/* panels used on content pages */
.disclaimer-strip, .stoich-box, .callout, .myth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: none;
}
.disclaimer-strip { border-left-color: var(--amber); background: var(--amber-bg); border-color: #ecd9b3; }
.disclaimer-strip p, .stoich-box p, .callout p { color: var(--muted); }
.disclaimer-strip p:first-child, .stoich-box p:first-child, .callout p:first-child { color: var(--ink); }
.block.tint .myth-card, .block.tint .cards li { background: #fff; }
.myth-id { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.myth-lede { color: var(--ink); }
.myth-meta { color: var(--muted); }
.myth-meta strong, .posture-list strong { color: var(--ink); }
.posture-list, .cite-list { color: var(--muted); }
.cite-list li { font-size: 0.93rem; }

/* ---------- crisp data tables ---------- */
.teach-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.teach-table { font-size: 0.9rem; }
.teach-table thead th, .teach-table th {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--slate-bg);
  border-bottom: 2px solid var(--navy);
}
.teach-table th, .teach-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.teach-table td { color: var(--muted); }
.teach-table td:first-child, .teach-table td:nth-child(2) { color: var(--ink); }
.teach-table tbody tr:nth-child(even) td { background: #f8fafb; }
.teach-table tbody tr:hover td { background: var(--teal-bg); }

/* ---------- claim chips (Source tag stays the doi.org link) ---------- */
.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.08rem 0.4rem;
  border-radius: 2px;
  border: 1px solid currentColor;
  line-height: 1.45;
  vertical-align: 0.08em;
}
/* Source tag = solid teal, underlined because it IS a hyperlink to the paper; citation keeps normal case */
.tag-fact, a.tag-fact { background: var(--teal-bg); color: #075761; border-color: #075761; }
a.tag.tag-fact { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.tag.tag-fact { text-transform: none; letter-spacing: 0; }
a.tag-fact:hover, a.tag.tag-fact:hover { background: #075761; color: #fff; filter: none; }
/* Assumption = dashed slate border, no fill: visibly "not a citation" */
.tag-assumption { background: #fff; color: #3a4b57; border: 1px dashed #3a4b57; }
.tag-unknown { background: var(--violet-bg); color: var(--violet); }
.tag-founder { background: var(--violet-bg); color: var(--violet); }
.tag-rule { background: var(--amber-bg); color: var(--amber); }
.tag-stop { background: var(--red-bg); color: var(--red); }
a.tag:hover { filter: none; }
a.fact-doi { color: var(--accent2); font-family: var(--mono); font-size: 0.75em; }
a.fact-doi:hover { color: var(--ink); }

/* ---------- Flux login ---------- */
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: none;
}
.login-field label { color: var(--ink); font-size: 0.85rem; font-weight: 600; }
.login-field input {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.95rem;
}
.login-field input::placeholder { color: #5f717d; }
.login-field input:focus-visible { outline: 2px solid var(--focus); border-color: var(--accent); }
.login-alert { background: var(--red-bg); border: 1px solid #e3b5b5; border-left: 3px solid var(--red); color: var(--red); border-radius: var(--radius); }

/* ---------- footer (dark navy) ---------- */
.site-footer {
  background: var(--navy);
  color: var(--on-navy-muted);
  border-top: 3px solid var(--accent);
  padding: var(--s6) 0 var(--s7);
  font-size: 0.86rem;
}
.site-footer .fine { color: var(--on-navy-muted); }
.site-footer a { color: var(--on-navy); }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #fff; }

@media (max-width: 640px) {
  #site-nav { background: var(--navy); box-shadow: none; border-bottom: 3px solid var(--accent); }
  #site-nav a { border-radius: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .hero { padding: var(--s7) 0 var(--s6); }
  .block { padding: var(--s6) 0; }
}

/* 404 (bare page) */
body > p:only-child { padding: var(--s7); font-family: var(--mono); }

/* ---------- On this page TOC (2026-10-09): Plex Mono labels, teal rule ---------- */
.page-toc { padding: var(--s4) 0 var(--s2); }
.page-toc .wrap { border-left: 3px solid var(--accent); padding-left: var(--s4); }
.page-toc-label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s2); }
.page-toc ol { font-family: var(--mono); font-size: 0.82rem; gap: var(--s1) var(--s5); }
.page-toc a { color: var(--accent2); }
.page-toc a:hover { color: var(--ink); }
