:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #0f2a43;
  --primary-light: #1e3a5f;
  --accent: #0e7490;
  --accent-soft: #e0f2fe;
  --success: #166534;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
}

code,
.numeric,
.run-id,
.metric-number,
.result-number {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text-main);
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: 56px;
  font-weight: 750;
  line-height: 1.05;
}

h2 {
  margin-bottom: 14px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
}

p {
  margin-bottom: 0;
}

table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  background: var(--surface);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  color: #334155;
  font-size: 15px;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 860px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  color: var(--text-main);
  font-weight: 750;
  text-decoration: none;
}

.nav-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a,
.footer-links a {
  text-decoration: none;
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: center;
  min-width: 188px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-muted);
}

.switch-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.switch-option.is-active {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(15, 42, 67, 0.14);
  color: #ffffff;
}

.hero,
.page-hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.hero {
  padding: 88px 0 72px;
}

.page-hero {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.78fr);
  gap: 40px;
  align-items: center;
}

.hero-subtitle {
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.75;
}

.hero-support {
  max-width: 720px;
  margin-top: 18px;
  color: var(--text-muted);
}

.badge,
.card-label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.badge {
  margin-bottom: 22px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.eyebrow {
  margin-bottom: 8px;
  text-transform: uppercase;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.action-rail {
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin-top: 30px;
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 0 10px 14px;
}

.action-rail-title {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-link {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.action-link:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.action-link span {
  color: var(--text-main);
  font-weight: 800;
}

.action-link small {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.action-link.is-primary {
  border-color: var(--primary);
  background: var(--primary);
}

.action-link.is-primary span,
.action-link.is-primary small {
  color: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.btn-result {
  min-height: 56px;
  padding: 14px 24px;
  border: 1px solid var(--primary);
  background: var(--primary);
  box-shadow: 0 12px 30px rgba(15, 42, 67, 0.18);
  color: #ffffff;
  font-size: 17px;
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--primary);
}

.hero-panel,
.finding-card,
.metric-card,
.control-card,
.contribution-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 26px;
}

.run-id {
  margin-bottom: 24px;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mini-chart {
  display: grid;
  gap: 14px;
}

.mini-row {
  display: grid;
  grid-template-columns: 106px minmax(72px, 1fr) 64px;
  gap: 10px;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

.mini-row strong {
  color: var(--text-main);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  text-align: right;
}

.bar {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width);
  border-radius: inherit;
  background: var(--accent);
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 24px;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.section {
  padding: 72px 0;
}

.muted {
  background: var(--surface-muted);
}

.section-header {
  max-width: 720px;
  margin-bottom: 32px;
}

.section-note {
  max-width: 820px;
  margin-top: 18px;
  color: var(--text-muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  min-height: 132px;
  padding: 22px;
}

.metric-number {
  color: var(--text-main);
  font-size: 34px;
  font-weight: 750;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.metric-label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.finding-layout,
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: start;
}

.finding-card {
  border-color: #bfdbfe;
  border-left: 5px solid var(--accent);
  padding: 28px;
}

.exploratory-card {
  overflow-x: auto;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: var(--bg);
  padding: 24px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0 18px;
}

.result-label {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.result-number {
  display: block;
  margin-top: 4px;
  color: var(--text-main);
  font-size: 32px;
  font-weight: 750;
  line-height: 1.1;
}

.small-note {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.pipeline-step {
  min-height: 174px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
}

.pipeline-step strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--text-main);
}

.pipeline-step p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

.control-grid,
.contribution-grid,
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.control-card,
.contribution-card {
  padding: 22px;
}

.control-marker {
  display: block;
  width: 32px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.artifact-list {
  display: grid;
  gap: 12px;
}

.artifact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
}

.artifact-card:hover {
  border-color: var(--accent);
}

.artifact-card span:first-child {
  color: var(--text-main);
  font-weight: 700;
}

.artifact-card span:last-child {
  color: var(--text-muted);
  font-size: 14px;
  text-align: right;
}

.code-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.code-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.65;
}

.code-card a {
  color: var(--accent);
  font-weight: 700;
}

.method-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.flow-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.flow-node strong {
  color: var(--text-main);
  font-size: 16px;
}

.flow-node span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.waterfall-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.compact-chart {
  margin-top: 22px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 128px minmax(120px, 1fr) 72px;
  gap: 14px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.waterfall-track {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f6;
}

.waterfall-track span {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.waterfall-row strong {
  color: var(--text-main);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  text-align: right;
}

.model-chart-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.rank-chart-row {
  display: grid;
  grid-template-columns: 150px minmax(130px, 1fr) 72px;
  gap: 14px;
  align-items: center;
}

.rank-chart-row strong {
  display: block;
  color: var(--text-main);
  font-size: 15px;
}

.rank-chart-row span {
  color: var(--text-muted);
  font-size: 13px;
}

.rank-track {
  position: relative;
  display: block;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f6;
}

.rank-track span {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.rank-chart-row.is-primary .rank-track span {
  background: var(--primary);
}

.rank-chart-row.is-exploratory .rank-track span {
  background: #0891b2;
}

.rank-chart-row.is-negative .rank-track span {
  background: var(--warning);
}

.rank-chart-row code {
  color: var(--text-main);
  font-weight: 800;
  text-align: right;
}

.audit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.audit-summary span {
  display: inline-flex;
  gap: 6px;
  border-radius: 999px;
  background: #ecfdf5;
  padding: 6px 10px;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.boundary-box {
  border: 1px solid #fde68a;
  border-left: 5px solid var(--warning);
  border-radius: 18px;
  background: var(--warning-soft);
  padding: 24px;
  color: #78350f;
}

.boundary-box h2 {
  color: #78350f;
}

.boundary-box p + p {
  margin-top: 14px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  min-height: 92px;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

@media (max-width: 980px) {
  .hero-grid,
  .finding-layout,
  .split-section {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .metric-grid.compact,
  .pipeline,
  .method-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-arrow {
    display: none;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  .hero,
  .page-hero,
  .section {
    padding: 52px 0;
  }

  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 24px;
  }

  .metric-grid,
  .metric-grid.compact,
  .pipeline,
  .method-flow,
  .control-grid,
  .contribution-grid,
  .artifact-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .metric-number {
    font-size: 30px;
  }

  .mini-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .action-rail {
    border-left-width: 3px;
    padding-left: 12px;
  }

  .action-link {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .waterfall-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .rank-chart-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .mini-row strong {
    text-align: left;
  }

  .waterfall-row strong,
  .rank-chart-row code {
    text-align: left;
  }

  .artifact-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .artifact-card span:last-child {
    text-align: left;
  }

  .button-row,
  .btn {
    width: 100%;
  }
}
