/* Hyperacute Stroke Decision Engine: shared site theme
   Palette from CodeStrokeApp/Theme/AppColors.swift. Typography matches
   the vendored TypeSafeStroke engine page (IBM Plex family) for one
   consistent system across / , /engine/ , /cases/ . */

:root {
  --bg: #0d0d0d;
  --surface-1: #1a1a1a;
  --surface-2: #2a2a2a;
  --surface-3: #3a3a3a;
  --accent: #007aff;
  --green: #34c759;
  --yellow: #ffd60a;
  --red: #ff3b30;
  --code-red: #cc0000;
  --text-1: #ffffff;
  --text-2: #aaaaaa;
  --text-3: #666666;
  --rule: #2a2a2a;
  --hero-grad-1: #0b1330;
  --hero-grad-2: #1c1440;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--cond); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }

/* Top navigation */
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px max(20px, calc((100vw - var(--maxw)) / 2));
  background: rgba(13, 13, 13, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topnav__mark { width: 28px; height: 28px; border-radius: 7px; }
.topnav__title { font: 600 14px/1 var(--cond); letter-spacing: .01em; color: var(--text-1); text-decoration: none; }
.topnav__links { margin-left: auto; display: flex; gap: 22px; font: 600 13px/1 var(--cond); letter-spacing: .02em; }
.topnav__links a { color: var(--text-2); text-decoration: none; }
.topnav__links a:hover, .topnav__links a[aria-current="page"] { color: var(--text-1); }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section--tight { padding: 40px 0; }
.eyebrow {
  display: inline-block; font: 600 11px/1 var(--cond); letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.lede { color: var(--text-2); max-width: 68ch; font-size: 16px; margin-top: 14px; }

/* Hero */
.hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(1100px 520px at 15% -10%, var(--hero-grad-2), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, var(--hero-grad-1), transparent 55%),
    var(--bg);
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); max-width: 16ch; }
.hero__row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero__mark { width: 44px; height: 44px; border-radius: 10px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.badge--disclaimer {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 11px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase;
  color: var(--yellow); border: 1px solid currentColor; border-radius: 999px;
  padding: 7px 12px; margin-top: 28px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--cond); letter-spacing: .02em;
  padding: 13px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #1a86ff; }
.btn--ghost { background: var(--surface-1); color: var(--text-1); border-color: var(--surface-3); }
.btn--ghost:hover { border-color: var(--text-2); }
.btn svg { width: 16px; height: 16px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 18px; margin-top: 8px; }
.stat { background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font: 700 30px/1 var(--cond); color: var(--text-1); }
.stat span { display: block; margin-top: 6px; font: 500 12px/1.3 var(--sans); color: var(--text-2); }

/* Step grid ("how it works") */
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 32px; }
.step { background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.step__icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 16px;
}
.step__icon svg { width: 20px; height: 20px; }
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 13.5px; }

/* Card grid (explore cards, case scenario cards) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.card {
  display: block; background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s ease;
}
.card:hover { border-color: var(--accent); }
.card h3 { font-size: 16px; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 13.5px; }
.card__meta { display: block; font: 600 11px/1 var(--mono); letter-spacing: .04em; color: var(--accent); margin-bottom: 10px; text-transform: uppercase; }

/* Footer */
.site-footer { padding: 48px 0 64px; border-top: 1px solid var(--rule); color: var(--text-2); font-size: 13px; }
.site-footer .disclaimer { color: var(--yellow); font-weight: 600; max-width: 70ch; margin-bottom: 16px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font: 600 12px/1 var(--cond); }
.site-footer .links a { color: var(--text-2); text-decoration: none; }
.site-footer .links a:hover { color: var(--text-1); }

.footer-callout { font: 700 13px/1.5 var(--sans); color: var(--red); margin: 0 0 14px; }

.prose { max-width: 74ch; color: var(--text-1); font-size: 14.5px; line-height: 1.7; }
.prose h2 { font-size: 18px; margin: 32px 0 4px; color: var(--text-1); }
.prose p { margin: 0 0 14px; }
.prose a { color: var(--accent); }

/* Jev eval pages */
.kind-badge {
  display: inline-flex; align-items: center; font: 600 11px/1 var(--cond); letter-spacing: .03em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 4px; white-space: nowrap;
}
.kind-badge.k-recommended, .kind-badge.k-reasonable, .kind-badge.k-may_consider { background: rgba(52, 199, 89, .15); color: var(--green); }
.kind-badge.k-individualize { background: rgba(255, 214, 10, .15); color: var(--yellow); }
.kind-badge.k-not_recommended, .kind-badge.k-harm { background: rgba(255, 59, 48, .15); color: var(--red); }
.kind-badge.k-action { background: rgba(0, 122, 255, .15); color: var(--accent); }

.verdict { display: inline-flex; align-items: center; gap: 6px; font: 700 13px/1 var(--sans); }
.verdict.v-correct { color: var(--green); }
.verdict.v-incorrect { color: var(--red); }

.compare-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.compare-table th, .compare-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.compare-table th { color: var(--text-2); font: 600 11px/1 var(--cond); text-transform: uppercase; letter-spacing: .04em; }
.compare-table td b { font: 700 16px/1 var(--cond); }
.compare-table tr:last-child td { border-bottom: 0; }

.jev-group { margin-top: 28px; }
.jev-case {
  background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 10px;
}
.jev-case.is-miss { border-color: var(--red); }
.jev-case summary { cursor: pointer; list-style: none; }
.jev-case summary::-webkit-details-marker { display: none; }
.jev-case__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jev-case__id { font: 600 11px/1 var(--mono); color: var(--accent); text-transform: uppercase; }
.jev-case__title { font: 600 14px/1.3 var(--sans); flex: 1 1 auto; min-width: 200px; }
.jev-case__verdicts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.jev-q { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.jev-sources { font: 500 11px var(--mono); color: var(--text-2); }
.jev-divergence { margin-top: 4px; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.jev-divergence b { color: var(--text-1); }
.jev-sub {
  display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule);
}
.jev-sub-q { font: 600 12px/1 var(--cond); letter-spacing: .02em; color: var(--text-2); text-transform: uppercase; margin-bottom: 2px; }
.jev-sub-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.jev-sub-row b { font-weight: 600; }
.jev-sub-row span { color: var(--text-2); font: 500 12px var(--mono); }

@media (max-width: 640px) {
  .topnav__links { gap: 14px; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 48px 0; }
}
