/* identity.css: this site's own sheet and red-letter tokens (rubric red is
   the only accent, used only on dates). kit/base.css stays on disk, unlinked. */

:root {
  color-scheme: light;
  --paper: #e8edf2;
  --panel: #ffffff;
  --ink: #141b26;
  --ink-soft: #4b5768;
  --line: #d7deE6;
  --line-strong: #aeb9c6;
  --accent: #141b26;
  --accent-soft: #e4eaf0;
  --focus: #141b26;
  --pass: #1b7a43;
  --pass-soft: #e1f2e7;
  --fail: #c81d3a;
  --fail-soft: #fbe4e8;
  --warn: #8a5a00;
  --weekend: #d8e1ea;
  --weekend-hol: #eef2f6; /* rubric-on-weekend is 4.3:1 (plan's own caveat); this lighter wash under a holiday numeral is 5.1:1 */
  --brass: #9c7a1f;
  --readout-bg: #141b26;
  --readout-ink: #f3f5f7;
  --readout-dim: #8b96a3;

  --sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 3px;
  --maxw: 62rem;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0d131c;
    --panel: #151e2b;
    --ink: #e7ecf2;
    --ink-soft: #9facbb;
    --line: #263244;
    --line-strong: #3b4a5e;
    --accent: #e7ecf2;
    --accent-soft: #1c2636;
    --focus: #e7ecf2;
    --pass: #4ade80;
    --pass-soft: #163322;
    --fail: #ff5c73;
    --fail-soft: #3a1620;
    --warn: #e3b341;
    --weekend: #22303f;
    --weekend-hol: #151e2b; /* --panel; --weekend itself is a rounding-edge 4.5:1 here */
    --brass: #d9b45a;
    --readout-bg: #0a0f16;
    --readout-ink: #e7ecf2;
    --readout-dim: #7e8ca0;
  }
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  /* caps+digits only; always paired with text-transform:uppercase (dates.css) */
  unicode-range: U+0020-0022,U+0027-002F,U+0030-003A,U+0041-005A,U+00B7,U+2013-2014;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.05rem;
}

.brand .brand-mark { vertical-align: -0.19em; }

.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--fail); border-bottom-color: var(--fail); }

/* ---------- Layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
main.wrap { padding-top: 1.5rem; padding-bottom: 3rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.015em; font-weight: 780; margin: 0 0 0.5rem; }
.lede { color: var(--ink-soft); max-width: 46rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 2.25rem 0 0.6rem; }
h3 { font-size: 1.02rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0.6rem 0; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* ---------- Tool panel ---------- */

.tool-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }

/* ---------- Readout strip (house signature, folded since PR1) ---------- */

.readout {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; align-items: baseline;
  background: var(--readout-bg); color: var(--readout-ink); font-family: var(--mono);
  font-size: 0.85rem; border-radius: var(--radius); padding: 0.6rem 0.85rem; margin: 0 0 1rem; min-height: 2.4rem;
}
.readout .r-item { white-space: normal; }
.readout .r-label { white-space: nowrap; color: var(--readout-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; margin-right: 0.45rem; }
.readout .r-value { font-weight: 600; overflow-wrap: anywhere; }
.readout .r-value.pass { color: var(--pass); }
.readout .r-value.fail { color: var(--fail); }

/* ---------- Buttons & controls ---------- */

.btn {
  appearance: none; font: inherit; font-weight: 600; font-size: 1rem; color: var(--panel);
  background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius); padding: 0.6rem 1rem; cursor: pointer;
}
.btn:hover { filter: brightness(1.2); }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink-soft); filter: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.75rem 0; }
.site-nav a, .site-footer a, .related li a { display: inline-flex; align-items: center; min-height: var(--tap); }
select, input[type="text"], input[type="number"] {
  font: inherit; font-size: 1rem; padding: 0.45rem 0.6rem; min-height: var(--tap);
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); color: var(--ink); max-width: 100%;
}
label.inline { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Status notes ---------- */

.note { border: 1px solid var(--line); border-left: 3px solid var(--ink); background: var(--panel); border-radius: var(--radius); padding: 0.6rem 0.85rem; font-size: 0.9rem; color: var(--ink-soft); margin: 0.75rem 0; }
.note.error { border-left-color: var(--fail); background: var(--fail-soft); color: var(--ink); }
.note.warn { border-left-color: var(--warn); }

/* ---------- Prose ---------- */

.prose { max-width: 46rem; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--accent-soft); padding: 0.08em 0.3em; border-radius: 2px; }

.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 0.5rem 0; max-width: 46rem; }
.faq summary { cursor: pointer; font-weight: 620; padding: 0.65rem 0.9rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; font-family: var(--mono); color: var(--ink); margin-right: 0.6rem; }
.faq details[open] summary::before { content: "\2013"; }
.faq details > div { padding: 0 0.9rem 0.8rem; color: var(--ink-soft); font-size: 0.94rem; }

.table-wrap { overflow-x: auto; margin: 1rem 0; max-width: 46rem; }
.prose table { border-collapse: collapse; width: 100%; min-width: 34rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.88rem; }
.prose th, .prose td { border-top: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.prose thead th { border-top: 0; font-family: var(--mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); }

.related { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.related li a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.9rem; color: var(--ink); text-decoration: none; background: var(--panel); }
.related li a:hover { border-color: var(--fail); color: var(--fail); }

/* ---------- Ad slots (inert; see dates.css / revenue-model) ---------- */

.ad-slot { display: none; }
.ad-slot.active { display: flex; align-items: center; justify-content: center; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); margin: 1.25rem auto; }
.ad-slot.leaderboard { min-height: 90px; max-width: 728px; }
.ad-slot.rectangle { min-height: 250px; max-width: 336px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; background: var(--panel); }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 1rem 1.4rem; font-size: 0.83rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-items: baseline; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }
.site-footer .promise { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Motion & accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Print: ink on white whatever the screen theme. */
@media print {
  :root { color-scheme: light; --paper: #fff; --panel: #fff; --ink: #000; --ink-soft: #333; --accent: #000; --accent-soft: #e4eaf0; --line: #bbb; --line-strong: #888;
    --fail: #c81d3a; --pass: #1b7a43; --warn: #8a5a00; --weekend: #d8e1ea; --weekend-hol: #eef2f6; --brass: #9c7a1f; --readout-bg: #141b26; --readout-ink: #f3f5f7; }
  /* Backgrounds do not print by default. */
  .readout { background: none; color: var(--ink); border: 1px solid var(--line); }
  .readout .r-label { color: var(--ink-soft); }
}
