:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #f7f8f8;
  --muted: #8a8f98;
  --secondary: #d0d6e0;
  --accent: #7170ff;
  --accent-bg: #5e6ad2;
  --green: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: rgba(0, 0, 0, 0.45) 0 24px 90px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv01", "ss03";
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(113, 112, 255, 0.22), transparent 34rem),
    radial-gradient(circle at 80% 15%, rgba(16, 185, 129, 0.10), transparent 28rem),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 9, 10, 0.82);
  backdrop-filter: blur(18px);
}

.brand, nav, .hero-actions, .panel-header, .section-heading-row, .footer, .mode-switcher, .mode-buttons, .trust-strip {
  display: flex;
  align-items: center;
}

.brand { gap: 0.65rem; font-weight: 590; letter-spacing: -0.2px; }

.brand-mark {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(113,112,255,.20);
}

nav { gap: 1rem; color: var(--secondary); font-size: 0.88rem; }
nav a:hover { color: var(--text); }

.section-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.75fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--secondary);
  background: rgba(255,255,255,0.025);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 850px;
  margin: 1.15rem 0 1.2rem;
  font-size: clamp(3rem, 8vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
  font-weight: 510;
}
h2 {
  margin: 0.9rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 510;
}
h3 { font-size: 1.25rem; letter-spacing: -0.024em; font-weight: 590; }

.hero-copy p, .section-lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.narrow { max-width: 460px; }
.muted { color: var(--muted); line-height: 1.6; }
.small { font-size: 0.92rem; }

.hero-actions { gap: 0.75rem; flex-wrap: wrap; margin-top: 1.45rem; }
.hero-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.hero-flow span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--secondary);
  font-size: 0.9rem;
}
.hero-flow span:not(:last-child)::after {
  content: "→";
  margin-left: 0.55rem;
  color: var(--green);
}
.hero-logo {
  width: clamp(4.5rem, 10vw, 6.5rem);
  height: clamp(4.5rem, 10vw, 6.5rem);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: 0 20px 70px rgba(0,0,0,.38), 0 0 34px rgba(113,112,255,.16);
  object-fit: cover;
}
.primary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  font-weight: 510;
  font-size: 0.92rem;
}
.primary-button { background: var(--accent-bg); color: white; }
.primary-button:hover { background: #828fff; }
.ghost-button { border: 1px solid var(--border); background: rgba(255,255,255,0.025); color: var(--secondary); }
.ghost-button:hover { background: rgba(255,255,255,0.055); color: var(--text); }

.hero-panel, .triage-card, .evidence-card, .frontier-card, .experiment-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.hero-panel { padding: 1.15rem; }
.panel-header { gap: 0.55rem; color: var(--secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.status-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 20px rgba(16,185,129,.75);
}
.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: 0.6; } }

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.metric-grid > div, .result-row, .callout, .upload-panel, .file-drop, textarea, .live-settings input, .inference-toggle {
  border: 1px solid var(--border-soft);
  border-radius: 0.85rem;
  background: rgba(0,0,0,0.18);
  padding: 0.9rem;
}
.metric-label, .metric-sub, .callout-label { display: block; color: var(--muted); font-size: 0.78rem; }
.metric-grid strong { display: block; margin: 0.35rem 0; font-size: 2.2rem; letter-spacing: -0.05em; }

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.mode-switcher {
  justify-content: space-between;
  gap: 2rem;
  padding-top: 0.75rem;
  padding-bottom: 1.75rem;
}
.mode-buttons {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  background: rgba(255,255,255,0.035);
}
.mode-button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  color: var(--secondary);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 510;
}
.mode-button.active {
  color: white;
  background: var(--accent-bg);
  box-shadow: 0 10px 30px rgba(94,106,210,0.35);
}
.judge-guide {
  padding-top: 0.75rem;
  padding-bottom: 1.75rem;
}
.judge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.35rem;
}
.guide-card {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(0,0,0,0.16);
}
.guide-card h3,
.guide-card p { margin-bottom: 0; }
.guide-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}
.guide-card a {
  width: fit-content;
  color: var(--secondary);
  font-weight: 650;
  font-size: 0.9rem;
}
.guide-card a:hover { color: white; }
.next-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}
.page-hero {
  min-height: auto;
}
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.roadmap-card,
.story-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.35rem);
}
.roadmap-card p,
.story-card p {
  color: var(--secondary);
  line-height: 1.65;
}
.story-card {
  max-width: 920px;
}
.story-card p:last-child,
.roadmap-card p:last-child { margin-bottom: 0; }
.trust-strip {
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.trust-strip span {
  display: inline-flex;
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 999px;
  color: var(--secondary);
  background: rgba(16,185,129,0.045);
  font-size: 0.82rem;
}
.hidden, .mode-section.hidden { display: none !important; }

body[data-capture="volunteer"] .hero,
body[data-capture="volunteer"] .judge-guide,
body[data-capture="volunteer"] .mode-switcher,
body[data-capture="optimization"] .hero,
body[data-capture="optimization"] .judge-guide,
body[data-capture="optimization"] .mode-switcher {
  display: none;
}

body[data-capture="volunteer"] main,
body[data-capture="optimization"] main {
  padding-top: 96px;
}

.sample-list { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.upload-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.live-inputs {
  display: grid;
  gap: 0.75rem;
}
.file-drop {
  position: relative;
  display: grid;
  gap: 0.5rem;
  color: var(--secondary);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.file-drop:hover {
  border-color: rgba(113,112,255,0.58);
  background: rgba(113,112,255,0.08);
}
.file-drop:focus-within {
  outline: 2px solid rgba(113,112,255,0.45);
  outline-offset: 3px;
}
.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-drop-copy { color: var(--text); font-weight: 590; }
.file-picker-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0 1rem;
  border-radius: 0.55rem;
  color: white;
  background: linear-gradient(135deg, var(--accent-bg), #828fff);
  box-shadow: 0 10px 26px rgba(94,106,210,0.28);
  font-weight: 590;
}
.file-name {
  color: var(--muted);
  font-size: 0.88rem;
  word-break: break-word;
}
.inference-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.inference-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--secondary);
  cursor: pointer;
}
.live-settings {
  display: grid;
  gap: 0.75rem;
}
.live-settings label {
  display: grid;
  gap: 0.35rem;
  color: var(--secondary);
  font-size: 0.86rem;
}
.live-settings input {
  width: 100%;
  color: var(--text);
  font: inherit;
}
textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  color: var(--text);
  font: inherit;
}
textarea::placeholder { color: var(--muted); }
.preview-image {
  width: 100%;
  display: block;
  max-height: 220px;
  object-fit: cover;
  border-radius: 0.75rem;
}
.simulation-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.simulation-status.complete {
  color: var(--green);
}
.simulation-status.error {
  color: var(--warning);
}
.field-error {
  color: var(--warning);
  font-weight: 650;
}
.live-settings input[aria-invalid="true"] {
  border-color: rgba(255, 184, 107, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.12);
}
.triage-card.just-updated {
  animation: triagePulse 0.9s ease-out;
}
@keyframes triagePulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.0); }
  25% { box-shadow: 0 0 0 5px rgba(88, 166, 255, 0.18); }
  100% { box-shadow: var(--shadow); }
}
.sample-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(255,255,255,0.025);
  color: var(--secondary);
  padding: 0.9rem;
  cursor: pointer;
}
.sample-button strong { display: block; color: var(--text); margin-bottom: 0.25rem; }
.sample-button.active, .sample-button:hover { border-color: rgba(113,112,255,0.7); background: rgba(113,112,255,0.12); }

.triage-card { padding: clamp(1rem, 3vw, 1.4rem); position: sticky; top: 5.5rem; }
.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin-bottom: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background:
    linear-gradient(135deg, rgba(113,112,255,.16), rgba(16,185,129,.08)),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.04) 0 1px, transparent 1px 14px);
  color: var(--secondary);
  text-align: center;
  padding: 1rem;
}
.result-stack { display: grid; gap: 0.65rem; margin: 1rem 0; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; }
.result-row span { color: var(--muted); }
.result-row strong { text-align: right; }
.callout {
  border-color: rgba(16,185,129,0.24);
  margin-top: 0.75rem;
}
.callout p { margin-bottom: 0; }
.insight-callout {
  border-color: rgba(113,112,255,0.24);
  background:
    linear-gradient(135deg, rgba(113,112,255,0.10), rgba(16,185,129,0.035)),
    rgba(0,0,0,0.18);
}
.insight-callout p {
  color: var(--secondary);
  line-height: 1.55;
}

.section-heading-row { justify-content: space-between; gap: 2rem; align-items: start; }
.optimization-heading-copy {
  display: grid;
  gap: 0.85rem;
  max-width: 850px;
}
.optimization-heading-copy .narrow {
  max-width: 780px;
}
.loop-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.loop-steps span {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 0.8rem;
  background: rgba(16,185,129,0.055);
  color: var(--secondary);
  font-size: 0.82rem;
  line-height: 1.25;
}
.research-loop {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.1rem;
}
.research-loop span {
  min-height: 3.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid rgba(113,112,255,0.24);
  border-radius: 0.75rem;
  background: rgba(113,112,255,0.06);
  color: var(--secondary);
  font-size: 0.78rem;
  line-height: 1.25;
}
.frontier-grid, .experiment-board, .evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.evidence-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.limitation-card {
  border-color: rgba(245,158,11,0.22);
  background:
    linear-gradient(180deg, rgba(245,158,11,0.075), rgba(255,255,255,0.02)),
    rgba(0,0,0,0.16);
}
.experiment-intro {
  display: grid;
  grid-template-columns: minmax(240px, 0.52fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.1rem;
  border: 1px solid rgba(113,112,255,0.25);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(113,112,255,0.12), rgba(16,185,129,0.04)),
    rgba(0,0,0,0.18);
}
.experiment-intro h3,
.experiment-intro p {
  margin-bottom: 0;
}
.experiment-intro p {
  color: var(--secondary);
  line-height: 1.6;
}
.frontier-card, .experiment-card, .evidence-card { padding: 1rem; }
.evidence-section {
  display: grid;
  gap: 1.5rem;
}
.evidence-heading-copy {
  display: grid;
  gap: 0.85rem;
  max-width: 860px;
}
.evidence-heading-copy .narrow {
  max-width: 780px;
}
.evidence-card code {
  color: var(--secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
}
.source-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
.source-card {
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  background: rgba(255,255,255,0.035);
  padding: 1rem;
}
.source-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}
.source-card summary::-webkit-details-marker { display: none; }
.source-card summary strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}
.source-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--secondary);
  padding: 0.4rem 0.7rem;
  font-size: 0.84rem;
  white-space: nowrap;
}
.source-card[open] .source-action {
  color: white;
  background: var(--accent-bg);
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.92rem;
}
th, td {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.65rem;
  text-align: left;
}
pre {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 0.85rem;
  background: rgba(3, 8, 20, 0.65);
  padding: 1rem;
}
.card-kicker { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 0.76rem; }
.big-number { display: block; margin: 0.55rem 0; font-size: 2.5rem; letter-spacing: -0.06em; }
.bar {
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin: 0.75rem 0;
}
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }
.decision { color: var(--secondary); font-weight: 510; }

.footer {
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
  font-size: 0.86rem;
}

@media (max-width: 860px) {
  nav { display: none; }
  .topbar .ghost-button { display: none; }
  .hero, .two-column { grid-template-columns: 1fr; }
  .mode-switcher { flex-direction: column; align-items: flex-start; }
  .mode-buttons { width: 100%; }
  .mode-button { flex: 1; }
  .triage-card { position: static; }
  .frontier-grid, .experiment-board, .evidence-grid, .judge-grid, .research-loop, .roadmap-grid, .next-pages { grid-template-columns: 1fr; }
  .section-heading-row { display: block; }
  .footer { flex-direction: column; align-items: flex-start; }
}
