:root {
  --bg: #0b0c10;
  --surface: #12141a;
  --surface-2: #181b23;
  --line: #292d38;
  --text: #f2f0eb;
  --muted: #9a9da8;
  --orange: #e98332;
  --orange-soft: rgba(233, 131, 50, 0.12);
  --purple: #8d6be8;
  --purple-soft: rgba(141, 107, 232, 0.12);
  --green: #84b88a;
  --red: #d47b76;
  --max: 1180px;
  --radius: 18px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #ece9e2;
  --line: #d6d1c7;
  --text: #172027;
  --muted: #606972;
  --orange-soft: rgba(211, 103, 25, 0.11);
  --purple-soft: rgba(111, 76, 198, 0.1);
  --green: #337b48;
  --red: #a84f4a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 4%, rgba(141, 107, 232, 0.08), transparent 27rem),
    radial-gradient(circle at 4% 28%, rgba(233, 131, 50, 0.07), transparent 24rem),
    var(--bg);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(11, 12, 16, 0.86);
  backdrop-filter: blur(18px);
}
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 760; letter-spacing: -0.02em; }
.brand img { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.brand em { color: var(--purple); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.preference-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.language-switch button, .theme-toggle {
  min-width: 32px;
  height: 31px;
  padding: 0 8px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: 700 10px "IBM Plex Mono", monospace;
  cursor: pointer;
}
.language-switch button.active { color: #1c1108; background: var(--orange); }
.theme-toggle { min-width: 37px; border: 1px solid var(--line); font-size: 15px; }
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.nav-cta, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #18100a;
  background: var(--orange);
  text-decoration: none;
  font-weight: 760;
  cursor: pointer;
}
.button.secondary { color: var(--text); background: transparent; border-color: var(--line); }
.button.purple { color: #f7f4ff; background: var(--purple); }
.button:hover { transform: translateY(-1px); }
.nav-toggle { display: none; color: var(--text); border: 1px solid var(--line); border-radius: 9px; background: transparent; padding: 8px 10px; }

.hero { padding: clamp(88px, 12vw, 152px) 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; align-items: center; gap: 70px; }
.kicker, .section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--orange);
  font: 700 12px/1.3 "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker::before, .section-kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
h1, h2, h3 { margin-top: 0; font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -0.035em; }
h1 { margin-bottom: 24px; font-size: clamp(46px, 7vw, 78px); line-height: 0.99; }
h1 span { color: var(--orange); }
.hero-lead { max-width: 690px; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.evidence-note { margin-top: 23px; color: var(--muted); font-size: 12px; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.candidate-actions .button { min-height: 38px; padding: 10px 13px; font-size: 10px; }

.ai-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(141, 107, 232, 0.34);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(141, 107, 232, 0.13), rgba(18, 20, 26, 0.86));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}
.ai-card::after { content: ""; position: absolute; right: -55px; top: -70px; width: 190px; height: 190px; border-radius: 50%; background: var(--purple); filter: blur(85px); opacity: 0.13; }
.ai-label { color: var(--purple); font: 700 11px "IBM Plex Mono", monospace; letter-spacing: 0.12em; }
.ai-card h2 { margin: 11px 0 12px; font-size: 31px; }
.ai-card p { color: #b6b2c4; }
.pipeline-mini { display: grid; gap: 9px; margin-top: 24px; }
.pipeline-mini div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 10px; background: rgba(0, 0, 0, 0.12); }
.pipeline-mini b { display: grid; place-items: center; width: 30px; height: 30px; color: var(--purple); border-radius: 8px; background: var(--purple-soft); font: 700 11px "IBM Plex Mono", monospace; }
.pipeline-mini span { font-size: 13px; }

.stats { padding: 0 0 82px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(18, 20, 26, 0.65); }
.stat { padding: 23px; border-right: 1px solid var(--line); }
.stat:last-child { border: 0; }
.stat strong { display: block; color: var(--text); font: 650 clamp(25px, 3vw, 36px) "Space Grotesk", sans-serif; }
.stat span { color: var(--muted); font-size: 12px; }
.stat small { display: block; color: #736f78; font-size: 10px; margin-top: 6px; }

.section { padding: 96px 0; border-top: 1px solid rgba(255, 255, 255, 0.055); }
.section-head { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 55px; align-items: start; margin-bottom: 45px; }
.section-head h2 { margin-bottom: 0; font-size: clamp(34px, 5vw, 53px); line-height: 1.04; }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 20, 26, 0.75); }
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 14px; margin-bottom: 0; }
.card .number { display: inline-flex; margin-bottom: 24px; color: var(--orange); font: 700 11px "IBM Plex Mono", monospace; }
.card.purple-card { border-color: rgba(141, 107, 232, 0.28); background: linear-gradient(145deg, rgba(141, 107, 232, 0.09), rgba(18, 20, 26, 0.75)); }
.card.purple-card .number { color: var(--purple); }

.cockpit { display: grid; grid-template-columns: 0.88fr 1.12fr; gap: 38px; align-items: center; }
.cockpit-copy h2 { font-size: clamp(34px, 5vw, 52px); }
.cockpit-copy p { color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 24px 0 0; }
.check-list li { position: relative; padding: 9px 0 9px 28px; color: #cacbd1; font-size: 14px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); }
.screen-frame { padding: 9px; border: 1px solid var(--line); border-radius: 20px; background: #080a0d; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35); }
.screen-frame img { border-radius: 12px; }
.screen-caption { display: flex; justify-content: space-between; gap: 18px; padding: 10px 5px 1px; color: var(--muted); font-size: 10px; }

.candidate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.candidate-card { position: relative; padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.candidate-card:hover { transform: translateY(-2px); border-color: rgba(233, 131, 50, 0.52); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14); }
.candidate-record { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 13px; color: var(--muted); font: 700 9px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.candidate-head { display: flex; justify-content: space-between; gap: 12px; }
.candidate-head h3 { margin: 0; font: 700 22px "IBM Plex Mono", monospace; }
.candidate-kind { color: var(--orange); font: 700 10px "IBM Plex Mono", monospace; text-transform: uppercase; }
.candidate-card code { display: block; color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }
.exact-identity { display: grid; grid-template-columns: 112px 1fr; gap: 5px 10px; margin: 13px 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface-2) 72%, transparent); }
.exact-identity span { color: var(--orange); font: 700 8px "IBM Plex Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.formula-context { margin: 16px 0 0; padding: 11px; color: var(--text); background: color-mix(in srgb, var(--orange) 7%, transparent); border-left: 2px solid var(--orange); border-radius: 0 8px 8px 0; font-size: 11px; line-height: 1.55; }
.registry-comparison { display: grid; gap: 4px; margin-top: 9px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--orange) 28%, var(--line)); border-radius: 8px; background: var(--surface-2); font-size: 9px; }
.registry-comparison strong { color: var(--text); }
.registry-comparison a { color: var(--orange); overflow-wrap: anywhere; text-decoration: none; font-family: "IBM Plex Mono", monospace; }
.registry-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.registry-links a { color: var(--orange); font: 700 9px "IBM Plex Mono", monospace; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.registry-links a:hover { border-bottom-color: var(--orange); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { padding: 5px 7px; color: #b6b8c0; background: var(--surface-2); border-radius: 6px; font: 700 9px "IBM Plex Mono", monospace; text-transform: uppercase; }
.badge.ok, .badge.green { color: var(--green); }
.badge.warn, .badge.orange { color: #d8a76b; }
.badge.purple { color: #b8a4f5; background: var(--purple-soft); }
.purple-star { display: inline-block; animation: pulse-glow 2s infinite ease-in-out; text-shadow: 0 0 8px var(--purple); }
@keyframes pulse-glow { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.15); opacity: 1; } }
.candidate-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 18px; }
.candidate-metrics div { padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.candidate-metrics strong { display: block; font: 650 13px "IBM Plex Mono", monospace; }
.candidate-metrics span { color: var(--muted); font-size: 9px; }
.empty-data { grid-column: 1 / -1; padding: 30px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.candidate-group + .candidate-group { margin-top: 76px; padding-top: 64px; border-top: 1px solid var(--line); }
.candidate-group-head { display: grid; grid-template-columns: .82fr 1.18fr; gap: 50px; align-items: end; margin: 0 0 28px; }
.candidate-group-head h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.candidate-group-head p:last-child { margin: 0; color: var(--muted); }
.evidence-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 7px 10px; color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--green) 8%, transparent); font: 700 10px "IBM Plex Mono", monospace; text-transform: uppercase; }
.evidence-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 12%, transparent); }
.proof-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 38px; }
.proof-strip > div { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 84%, transparent); }
.proof-strip > div > b { color: var(--orange); font: 700 21px "IBM Plex Mono", monospace; }
.proof-strip span { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.proof-strip strong { color: var(--text); font-size: 12px; }

.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; counter-reset: ladder; }
.ladder article { min-height: 180px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); counter-increment: ladder; }
.ladder article::before { content: "0" counter(ladder); color: var(--orange); font: 700 10px "IBM Plex Mono", monospace; }
.ladder h3 { margin: 20px 0 8px; font-size: 16px; }
.ladder p { color: var(--muted); font-size: 12px; }

.funding { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 42px; border: 1px solid rgba(141, 107, 232, 0.28); border-radius: 23px; background: linear-gradient(125deg, rgba(141, 107, 232, 0.11), rgba(233, 131, 50, 0.05)); }
.funding h2 { font-size: clamp(32px, 5vw, 50px); margin-bottom: 18px; }
.funding p { color: var(--muted); }
.allocation { display: grid; gap: 10px; }
.allocation div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; padding: 12px; background: rgba(0, 0, 0, 0.14); border-radius: 10px; }
.allocation b { color: var(--purple); font: 700 12px "IBM Plex Mono", monospace; }
.allocation span { font-size: 13px; }

.page-hero { padding: 105px 0 58px; }
.page-hero h1 { max-width: 900px; font-size: clamp(42px, 6vw, 68px); }
.page-hero p { max-width: 760px; color: var(--muted); font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 25px; }
.filter-button { padding: 9px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.filter-button.active { color: #17100b; background: var(--orange); border-color: var(--orange); }

.paper-layout { display: grid; grid-template-columns: 240px 1fr; gap: 55px; align-items: start; }
.paper-toc { position: sticky; top: 100px; display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.paper-toc a { color: var(--muted); text-decoration: none; font-size: 12px; }
.paper-toc a:hover { color: var(--orange); }
.paper { max-width: 810px; }
.paper h2 { margin: 70px 0 18px; font-size: 34px; }
.paper h2:first-child { margin-top: 0; }
.paper h3 { margin: 35px 0 12px; font-size: 21px; }
.paper p, .paper li { color: #bbbcc3; }
.paper table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 13px; }
.paper th, .paper td { padding: 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.paper th { color: var(--text); background: var(--surface-2); }
.callout { padding: 18px; border-left: 3px solid var(--orange); background: var(--orange-soft); color: #d4c7ba !important; }

.contact-grid { display: grid; grid-template-columns: 0.78fr 1.22fr; gap: 50px; }
.contact-card, .contact-form { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact-form { display: grid; gap: 14px; }
.contact-form label { color: var(--muted); font-size: 12px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; margin-top: 6px; padding: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; outline: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--orange); }
.form-status { min-height: 22px; color: var(--green); font-size: 12px; }

.site-footer { padding: 55px 0; border-top: 1px solid var(--line); background: #08090c; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr; gap: 35px; }
.site-footer p, .site-footer a { color: var(--muted); font-size: 13px; }
.site-footer a { display: block; text-decoration: none; margin: 7px 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); color: #696c74; font-size: 11px; }

html[data-theme="light"] .site-header { border-bottom-color: rgba(28, 34, 39, 0.1); background: rgba(243, 241, 236, 0.88); }
html[data-theme="light"] .ai-card { background: linear-gradient(145deg, rgba(141, 107, 232, 0.1), rgba(255, 255, 255, 0.9)); box-shadow: 0 28px 80px rgba(42, 35, 24, 0.12); }
html[data-theme="light"] .ai-card p, html[data-theme="light"] .paper p, html[data-theme="light"] .paper li { color: var(--muted); }
html[data-theme="light"] .pipeline-mini div, html[data-theme="light"] .allocation div { background: rgba(255, 255, 255, 0.62); }
html[data-theme="light"] .stats-grid, html[data-theme="light"] .card { background: rgba(255, 255, 255, 0.72); }
html[data-theme="light"] .section { border-top-color: rgba(28, 34, 39, 0.08); }
html[data-theme="light"] .check-list li { color: var(--text); }
html[data-theme="light"] .screen-frame { background: #24282c; box-shadow: 0 30px 70px rgba(42, 35, 24, 0.14); }
html[data-theme="light"] .callout { color: #654a33 !important; }
html[data-theme="light"] .site-footer { background: #e9e5dd; }
html[data-theme="light"] .footer-bottom { color: var(--muted); }

.reveal { opacity: 1; transform: translateY(0); transition: opacity .7s ease, transform .7s ease; }
.reveal.reveal-ready { opacity: 0; transform: translateY(24px); }
.reveal.reveal-ready.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero-grid, .section-head, .cockpit, .funding, .contact-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ladder { grid-template-columns: 1fr 1fr; }
  .paper-layout { grid-template-columns: 1fr; }
  .paper-toc { position: static; }
  .candidate-group-head { grid-template-columns: 1fr; gap: 12px; }
  .proof-strip { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav-links { gap: 16px; }
  .nav-cta { display: none; }
}

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 72px; left: 20px; right: 20px; padding: 18px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .nav-links.open { display: flex; }
  .preference-controls { margin-left: auto; }
  .cards, .candidate-grid, .footer-grid { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: 1fr; }
  .candidate-metrics { grid-template-columns: 1fr 1fr; }
  .funding { padding: 25px; }
}

@media print {
  .site-header, .site-footer, .paper-toc, .button { display: none !important; }
  body { color: #111; background: #fff; }
  .paper-layout { display: block; }
  .paper { max-width: none; }
  .paper p, .paper li { color: #222; }
  .paper th, .paper td { border-color: #aaa; }
}
