/* Flare Physics AI: a science desk at night. Space Grotesk for headlines, Source Serif 4 for reading, JetBrains Mono
   for data (all OFL, self-hosted). Paper and ink by day, event-display navy behind the hero, and the colours physicists
   draw tracks in: cyan, gold and rose. Every text and background pair here is checked for contrast in light and dark
   mode (tests/design.test.ts). */

@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk-normal.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-normal.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f6f1;
  --text: #12151c;
  --muted: #4c5361;
  --line: #dad8cf;
  --card: #ffffff;
  --link: #0b5a64;
  --paper-2: #edebe3;
  --night: #0a0f1c;
  --night-2: #151d33;
  --on-night: #eef2f8;
  --on-night-muted: #aab5c9;
  --cyan: #5fe0ee;
  --gold: #ffd166;
  --rose: #ff5c8a;
  --teal-wash: #e2eff0;
  --gold-wash: #faf0d4;
  --gold-ink: #654800;
  --yes: #0d5c66;
  --yes-ink: #ffffff;
  --no: #e6e2d6;
  --no-ink: #12151c;
  --soon: #ffd166;
  --soon-ink: #2a1f00;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 6px;
  --shadow: 0 18px 40px -26px rgba(10, 15, 28, 0.5);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --text: #e9edf4;
    --muted: #a4adbf;
    --line: #263046;
    --card: #121827;
    --link: #7fe3ee;
    --paper-2: #10172a;
    --teal-wash: #0f2427;
    --gold-wash: #2a2410;
    --gold-ink: #f3cf73;
    --yes: #2aa3b0;
    --yes-ink: #04161a;
    --no: #2a3348;
    --no-ink: #e9edf4;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ base */
body { font-family: var(--serif); font-size: 18.5px; line-height: 1.62; background: var(--bg); color: var(--text); font-optical-sizing: auto; }
h1, h2, h3, .wordmark, .toc-title, .footer-col h2, .kicker, .main-nav, .btn, .crumbs, .byline, .stat b, .tl-date, th, .badge, .signup label, .signup button {
  font-family: var(--display);
}
h1, h2 { text-wrap: balance; }
h1 { font-weight: 650; font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.04; letter-spacing: -0.03em; }
h2 { font-weight: 620; font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.15; letter-spacing: -0.02em; margin-top: 2.1em; }
h3 { font-weight: 600; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono, td.num { font-family: var(--mono); font-size: 0.86em; }
.wrap { max-width: 1160px; padding: 0 20px; }
.muted { color: var(--muted); }
.page-head .lede, .lede { color: var(--muted); font-size: 1.16rem; font-style: italic; }

/* ------------------------------------------------------------ header: a strip of night sky */
.site-header { background: var(--night); border-bottom: 1px solid #24304d; }
.site-header .brand, .site-footer .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-night); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.wordmark { font-size: 1.25rem; font-weight: 400; letter-spacing: -0.02em; }
.wordmark b { font-weight: 700; }
.wordmark i { font-style: normal; font-weight: 500; color: var(--gold); margin-left: 1px; }
.lm-ring, .lm-ring-in { stroke: #4f6fa6; }
.lm-track { stroke: var(--cyan); }
.lm-spark { fill: var(--gold); }
.main-nav a { color: var(--on-night-muted); }
.main-nav a[aria-current="page"], .main-nav a:hover { color: var(--on-night); background: var(--night-2); }
.main-nav .nav-cta { background: var(--gold); color: #1d1500; font-weight: 600; }
.main-nav .nav-cta:hover, .main-nav .nav-cta[aria-current="page"] { background: #ffdd8a; color: #1d1500; }

/* ------------------------------------------------------------ buttons */
.btn { background: var(--yes); color: var(--yes-ink); border-radius: var(--radius); font-weight: 600; }
.btn:hover { background: #08434b; color: #ffffff; }
@media (prefers-color-scheme: dark) {
  .btn { background: var(--gold); color: #1d1500; }
  .btn:hover { background: #ffdd8a; color: #1d1500; }
}

/* ------------------------------------------------------------ badges: known, not known, expected */
.badge { display: inline-block; padding: 2px 9px 3px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; line-height: 1.5; }
.badge.yes { background: var(--yes); color: var(--yes-ink); }
.badge.no { background: var(--no); color: var(--no-ink); }
.badge.soon { background: var(--soon); color: var(--soon-ink); }

/* ------------------------------------------------------------ home hero */
.hero { position: relative; background: var(--night); color: var(--on-night); overflow: hidden; }
.hero-img { position: absolute; top: 0; bottom: 0; left: 34%; width: 66%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 7, 14, 0.96) 0%, rgba(4, 7, 14, 0.9) 36%, rgba(4, 7, 14, 0.55) 52%, rgba(4, 7, 14, 0) 64%); }
.hero-inner { position: relative; z-index: 1; padding: 76px 20px 84px; min-height: 600px; }
.hero-copy { max-width: 520px; }
.hero h1 { color: #ffffff; margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero-sub { font-size: 1.16rem; color: #d9e1ee; margin: 0 0 24px; max-width: 34em; }
.hero .hero-links a { color: var(--cyan); }
.kicker { font-weight: 600; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.status-card { background: rgba(21, 29, 51, 0.92); border: 1px solid #2c3a5e; border-radius: 10px; padding: 16px 18px; max-width: 520px; }
.status-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.status-card dt { font-family: var(--display); color: var(--on-night-muted); font-size: 0.86rem; padding-top: 2px; }
.status-card dd { margin: 0; color: var(--on-night); font-size: 0.98rem; }
.status-card p { margin: 10px 0 0; font-size: 0.9rem; color: var(--on-night-muted); }
@media (max-width: 760px) {
  .hero-img { position: relative; left: 0; width: 100%; height: 240px; object-position: 66% 50%; }
  .hero::after { display: none; }
  .hero-inner { padding: 24px 16px 36px; min-height: 0; }
  .status-card dl { grid-template-columns: 1fr; gap: 0 0; }
  .status-card dd { margin-bottom: 8px; }
}

/* ------------------------------------------------------------ home sections */
.band { padding: 56px 0; }
.band-paper { background: var(--paper-2); }
.band h2 { margin-top: 0; }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 22px; } }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.guide-grid a { display: block; background: var(--card); border-radius: 8px; padding: 18px; text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.guide-grid a:hover { border-color: var(--link); }
.guide-grid h3 { margin: 0 0 6px; color: var(--link); }
.guide-grid p { margin: 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 860px) { .guide-grid { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.stat { background: var(--card); border-radius: 8px; padding: 16px; border: 1px solid var(--line); border-top: 4px solid var(--yes); }
.stat b { display: block; font-size: 2rem; line-height: 1.05; font-weight: 650; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 0.93rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ the known / not known table */
.known { width: 100%; border-collapse: collapse; margin: 18px 0; }
.known th, .known td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.known thead th { font-size: 0.84rem; color: var(--muted); font-weight: 600; }
.known tbody th { font-weight: 600; font-size: 1rem; width: 30%; }
.known td.state { width: 8.5em; }

/* ------------------------------------------------------------ the timeline */
.timeline { list-style: none; padding: 0; margin: 22px 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--link); }
.timeline li.tl-flare::before { background: var(--gold); border-color: var(--gold-ink); }
.timeline li.tl-ahead::before { background: var(--bg); border-style: dashed; }
.tl-date { display: block; font-size: 0.86rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.timeline h3 { margin: 2px 0 4px; }
.timeline p { margin: 0 0 4px; }
.tl-source { font-size: 0.92rem; }

/* ------------------------------------------------------------ the models table */
.table-wrap { overflow-x: auto; margin: 18px 0; }
.models { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.models th, .models td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.models thead th { font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.models tbody th { font-weight: 600; font-family: var(--display); }
.models tr.is-flare { background: var(--gold-wash); }
/* phones: each model becomes a small card, labels beside the values */
@media (max-width: 700px) {
  .models thead { display: none; }
  .models, .models tbody, .models tr, .models th, .models td { display: block; width: auto; }
  .models tr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--card); }
  .models tr.is-flare { background: var(--gold-wash); }
  .models th, .models td { border: 0; padding: 3px 0; }
  .models tbody th { font-size: 1.05rem; padding-bottom: 6px; background: none; }
  .models td::before { content: attr(data-label); display: block; font-family: var(--display); font-size: 0.76rem; color: var(--muted); }
}
.field-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; }
.field-filter button { font: inherit; font-family: var(--display); font-size: 0.88rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.field-filter button[aria-pressed="true"] { background: var(--yes); color: var(--yes-ink); border-color: var(--yes); }

/* ------------------------------------------------------------ facts list on a model's page */
.facts { margin: 0 0 1.4em; display: grid; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 12em 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--display); color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

/* ------------------------------------------------------------ papers */
.papers { list-style: none; padding: 0; margin: 16px 0; }
.papers li { border-bottom: 1px solid var(--line); padding: 14px 0; }
.papers h3 { margin: 0 0 4px; font-size: 1.08rem; }
.papers .meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 4px; }
.papers p { margin: 0; }
.empty-state { background: var(--gold-wash); border-left: 5px solid var(--gold); padding: 14px 18px; border-radius: 0 8px 8px 0; }
.empty-state strong { color: var(--gold-ink); }

/* ------------------------------------------------------------ the reconstruction chain (HTML, so it reads on phones) */
.flow-figure { margin: 22px 0; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.flow-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.flow-col-hot { background: var(--teal-wash); border-color: var(--link); }
.flow-title { font-family: var(--display); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.flow-chain { list-style: none; padding: 0; margin: 0; }
.flow-chain li { font-family: var(--display); font-size: 0.92rem; background: var(--paper-2); color: var(--text); border-radius: 6px; padding: 6px 10px; position: relative; margin-bottom: 18px; }
.flow-chain li:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--muted); transform: translateX(-50%); }
.flow-chain li.flow-model { background: var(--yes); color: var(--yes-ink); font-weight: 600; padding: 12px; }
.flow-one li:last-child { margin-bottom: 12px; }
.flow-jobs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.flow-jobs li { font-family: var(--display); font-size: 0.85rem; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.flow-note { margin: 10px 0 0; font-size: 0.88rem; color: var(--muted); }
.flow-figure figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } }
.ptitle { font-weight: 600; }
.ptitle cite { font-style: normal; }

/* ------------------------------------------------------------ figures, notes, quotes */
.figure { margin: 22px 0; }
.figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.note { background: var(--paper-2); border-radius: 8px; padding: 14px 16px; }
blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-style: italic; }
blockquote footer { font-style: normal; font-family: var(--display); font-size: 0.88rem; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------ sign-up */
.signup-block { background: var(--teal-wash); border-radius: 10px; padding: 20px 22px; margin: 2.2em 0; }
.signup-block h2 { margin: 0 0 8px; font-size: 1.4rem; }
.band .signup-block { margin: 0; }

/* ------------------------------------------------------------ footer */
.site-footer { background: var(--night); color: var(--on-night-muted); }
.site-footer a { color: var(--on-night); }
.footer-col h2 { color: var(--gold); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
