/* HAIpothesis design system. */

html[data-theme], html {
  --bg: #f7f6f1; --surface: #ffffff; --surface-2: #efede6; --ink: #141413; --muted: #5f5e57; --ink-soft: #4a4944;
  --line: #e4e1d8; --line-soft: #edeae2; --line-strong: #d3cfc3;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-wash: rgba(15,118,110,.07);
  --ok: #15803d; --warn: #9a6a12; --warn-wash: rgba(154,106,18,.09); --stop: #b42318;
  /* Verdicts */
  --v-supported: #0f766e; --v-partly: #9a6a12; --v-not: #b42318; --v-untested: #6e6d66;
  /* Studio modules (Phase D+) */
  --intake: #8a5a12; --design: #0f766e; --analysis: #3d5a80; --report: #2f7d4f; --registry: #5b4b8a;
  --hero: #141413; --hero-ink: #f5f4ef; --glow: rgba(94,234,212,.16);
  --shadow: 0 1px 2px rgba(20,20,19,.05);
  --shadow-md: 0 14px 32px -16px rgba(20,20,19,.22), 0 2px 6px -2px rgba(20,20,19,.06);
  --radius: 14px; --r-sm: 10px; --r-lg: 18px;
  --display: Newsreader, Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --measure: 68ch; --wrap: 1120px;
  color-scheme: light;
}
html[data-theme='dark'] {
  --bg: #0f0f0e; --surface: #181817; --surface-2: #1f1f1d; --ink: #f5f4ef; --muted: #9a988f; --ink-soft: #c9c7bf;
  --line: #2a2a27; --line-soft: #222220; --line-strong: #3a3935;
  --accent: #5eead4; --accent-ink: #062320; --accent-wash: rgba(94,234,212,.09);
  --warn: #e0a83a; --warn-wash: rgba(224,168,58,.12); --stop: #f87171;
  --v-supported: #5eead4; --v-partly: #e0a83a; --v-not: #f87171; --v-untested: #9a988f;
  --hero: #0a0a09;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 10px 28px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv02','cv03','cv04','cv11'; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(36px, 6vw, 64px); } h2 { font-size: clamp(26px, 3.4vw, 38px); } h3 { font-size: 22px; }
p { max-width: var(--measure); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark .ai { color: var(--accent); font-style: italic; }
.eyebrow { font: 500 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ''; display: inline-block; width: 7px; height: 7px; border-inline-start: 2px solid currentColor; border-top: 2px solid currentColor; margin-inline-end: 8px; vertical-align: 1px; }
.mono, code, .ref { font-family: var(--mono); }
.num, td, .stat .v { font-variant-numeric: tabular-nums; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.attn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: 0 0 0 3px var(--warn-wash); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat .k { font: 500 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--display); font-size: 34px; }
.hero { background: var(--hero); color: var(--hero-ink); border-radius: var(--r-lg); padding: clamp(32px, 6vw, 72px); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto -10% -60% auto; width: 60%; height: 140%; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero em { color: #5eead4; }

/* Buttons */
.btn, button { display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--sans); padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover, button:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover, button.ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.hero .btn { background: #5eead4; border-color: #5eead4; color: #062320; }
.hero .btn:hover { background: #f5f4ef; border-color: #f5f4ef; color: #141413; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

/* Banners: amber for attention, red only when it blocks */
.banner { border-radius: 12px; border: 1px solid var(--line); border-inline-start-width: 4px; padding: 12px 16px; }
.banner.warn, .banner.demo { background: var(--warn-wash); border-color: var(--warn); }
.banner.pass { background: var(--accent-wash); border-color: var(--accent); }
.banner.stop { background: color-mix(in srgb, var(--stop) 9%, var(--surface)); border-color: var(--stop); }

/* ===== HAIpothesis components ===== */
/* Verdict chip: Supported / Partly supported / Not supported / Untested */
.verdict { --c: var(--v-untested); display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--sans); padding: 4px 12px 4px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, var(--surface)); color: var(--ink); }
.verdict::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.verdict.supported { --c: var(--v-supported); } .verdict.partly { --c: var(--v-partly); }
.verdict.not-supported { --c: var(--v-not); } .verdict.untested { --c: var(--v-untested); }
.verdict.untested::before { background: transparent; border: 1.5px dashed var(--c); }

/* Evidence level ladder 0-4 */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; list-style: none; padding: 0; margin: 0; }
.ladder li { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface); font-size: 13px; color: var(--muted); }
.ladder li b { display: block; font: 500 20px var(--mono); color: var(--ink-soft); }
.ladder li.reached { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
.ladder li.reached b { color: var(--accent); }
.ladder li.current { box-shadow: 0 0 0 2px var(--accent); }

/* Claimed vs Verified */
.cv { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cv > div { padding: 18px 20px; }
.cv > .claimed { background: var(--surface-2); }
.cv > .verified { border-inline-start: 3px solid var(--accent); }
.cv h4, .cv .cv-h { margin: 0 0 6px; font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Status flag */
.flag { font: 500 12px var(--mono); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink-soft); }
.flag.stale { border-color: var(--warn); background: var(--warn-wash); color: var(--ink); }
.flag.disputed { border-color: var(--stop); color: var(--ink); }

/* Site chrome */
.site-head { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 10; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.site-head nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-head nav a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.theme-toggle { padding: 6px 10px; font-size: 13px; background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.site-foot { border-top: 1px solid var(--line); margin-top: 96px; padding-block: 32px; color: var(--muted); font-size: 14px; }
section { padding-block: 56px; }

@media (max-width: 700px) {
  .ladder { grid-template-columns: 1fr; }
  .cv { grid-template-columns: 1fr; }
  .cv > .verified { border-inline-start: 0; border-top: 3px solid var(--accent); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-head, .theme-toggle { display: none; } }
.ladder li.reached[data-step="2"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.ladder li.reached[data-step="3"], .ladder li.reached[data-step="4"], .ladder li.reached[data-step="5"] { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.mt { margin-top: 20px; }

/* Logo (outlined SVGs from brand/final): one per theme */
.wordmark { display: inline-flex; align-items: center; line-height: 0; }
.logo-img { height: 34px; width: auto; }
.logo-img.on-dark { display: none; }
html[data-theme='dark'] .logo-img.on-light { display: none; }
html[data-theme='dark'] .logo-img.on-dark { display: block; }
.site-foot .logo-img { height: 30px; }
