:root {
  --ink: #142033;
  --muted: #637083;
  --subtle: #eef3f8;
  --paper: #fbfcfe;
  --line: #d8e1eb;
  --blue: #1f66d1;
  --blue-dark: #134a9e;
  --blue-soft: #eaf2ff;
  --green: #1f9d55;
  --green-soft: #e9f8ef;
  --orange: #e07a24;
  --orange-soft: #fff2e6;
  --red: #d64045;
  --red-soft: #fff0f1;
  --purple: #7758c4;
  --purple-soft: #f1edff;
  --shadow: 0 18px 50px rgba(26, 43, 70, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

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

img {
  max-width: 100%;
  display: block;
}

button,
select,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(251, 252, 254, 0.88);
  border-bottom: 1px solid rgba(216, 225, 235, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:hover {
  color: var(--blue);
}

.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16% 20%, rgba(31, 102, 209, 0.10), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(31, 157, 85, 0.10), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
}

.hero-background {
  position: absolute;
  inset: auto 2vw 8vh auto;
  width: min(62vw, 940px);
  opacity: 0.28;
  filter: saturate(1.08);
}

.hero-background img {
  border: 1px solid rgba(216, 225, 235, 0.85);
  box-shadow: var(--shadow);
}

.hero-inner {
  position: relative;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 940px;
  margin-bottom: 22px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 740px;
  margin-bottom: 26px;
  color: #314056;
  font-size: clamp(18px, 2.1vw, 23px);
}

.hero-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  color: #435267;
  font-weight: 650;
}

.hero-authors span {
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.hero-authors span:last-child {
  border-right: 0;
}

.hero-actions,
.resource-actions,
.frontier-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  font-weight: 800;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--blue);
  color: white;
  background: var(--blue);
}

.button.primary:hover:not(:disabled) {
  color: white;
  background: var(--blue-dark);
}

.button.small {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 13px;
}

.button.muted,
.button:disabled {
  color: #8b98a9;
  background: #f4f7fb;
  cursor: not-allowed;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  max-width: 920px;
  margin: 42px 0 0;
}

.hero-metrics div,
.ipcov-metrics div,
.scenario-stats div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
}

.hero-metrics div {
  padding: 15px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 850;
}

.section {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4.3vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.trace-workbench,
.demo-layout,
.risk-layout {
  display: grid;
  gap: 18px;
}

.trace-workbench {
  grid-template-columns: minmax(560px, 1.55fr) minmax(275px, 0.85fr) minmax(330px, 1fr);
  align-items: stretch;
}

.trace-list,
.evidence-panel,
.mini-graph,
.scenario-panel,
.graph-panel,
.result-block,
.risk-control,
.bibtex {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 10px 28px rgba(26, 43, 70, 0.06);
}

.trace-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.trace-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--subtle);
  border-radius: var(--radius);
  overflow-x: hidden;
}

.trace-label {
  flex: 0 0 auto;
  width: 54px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.arrow {
  color: #8793a4;
}

.chip {
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 34px;
  padding: 0 8px;
  border: 2px solid currentColor;
  border-radius: 7px;
  color: var(--blue);
  background: white;
  font-weight: 850;
  cursor: pointer;
}

.chip.selected {
  outline: 3px solid rgba(31, 102, 209, 0.18);
}

.chip.vpc,
.vpc-node rect {
  color: var(--purple);
  fill: var(--purple-soft);
  stroke: var(--purple);
}

.chip.vsw,
.vsw-node rect {
  color: var(--orange);
  fill: var(--orange-soft);
  stroke: var(--orange);
}

.chip.sg,
.sg-node rect {
  color: var(--green);
  fill: var(--green-soft);
  stroke: var(--green);
}

.chip.auth,
.auth-node rect {
  color: var(--blue);
  fill: var(--blue-soft);
  stroke: var(--blue);
}

.chip.ecs,
.ecs-node rect {
  color: #d62f67;
  fill: #fff0f6;
  stroke: #d62f67;
}

.evidence-panel {
  padding: 18px;
}

.panel-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.selected-pair {
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 900;
}

.evidence-bars {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.evidence-bars div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.evidence-bars i {
  grid-column: 1 / -1;
  display: block;
  height: 10px;
  width: var(--bar, 50%);
  border-radius: 999px;
  background: var(--blue);
}

.evidence-summary {
  margin-bottom: 0;
  color: #39485e;
}

.mini-graph {
  padding: 10px;
}

svg {
  width: 100%;
  height: auto;
}

.edge {
  fill: none;
  stroke: #273547;
  stroke-width: 2.3;
}

.parallel {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.4;
  stroke-dasharray: 12 10;
}

.parallel-label {
  fill: var(--green);
  font-weight: 850;
}

.node text {
  fill: #132035;
  font-size: 18px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
}

.method-section,
.results-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.method-steps article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.step-index {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.method-steps h3,
.result-block h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.method-steps p,
.result-block p {
  margin-bottom: 0;
  color: var(--muted);
}

.equation-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #c7d6ea;
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.equation-strip span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 800;
}

.equation-strip em {
  grid-column: 1 / -1;
  color: #41516a;
  font-style: normal;
}

.demo-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.scenario-panel,
.graph-panel,
.risk-control {
  padding: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  font-weight: 750;
}

#scenarioQuery {
  margin: 14px 0;
  color: #435267;
}

.scenario-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.scenario-stats div {
  padding: 10px;
}

.scenario-stats dd {
  font-size: 19px;
}

.graph-panel svg {
  min-height: 360px;
  border: 1px solid var(--subtle);
  border-radius: var(--radius);
  background:
    linear-gradient(#f5f8fc 1px, transparent 1px),
    linear-gradient(90deg, #f5f8fc 1px, transparent 1px);
  background-size: 28px 28px;
}

.graph-edge {
  fill: none;
  stroke: #8da0b6;
  stroke-width: 2.2;
}

.graph-node rect {
  fill: white;
  stroke: #9fb0c4;
  stroke-width: 2;
}

.graph-node text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
}

.graph-node.done rect {
  fill: var(--green-soft);
  stroke: var(--green);
}

.graph-node.frontier rect {
  fill: var(--blue-soft);
  stroke: var(--blue);
  stroke-width: 3;
}

.graph-node.blocked rect {
  fill: #f9fbfd;
}

.frontier-readout {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.frontier-readout span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.frontier-readout p {
  margin: 0;
  color: var(--muted);
}

.ipcov-lab {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 10px 28px rgba(26, 43, 70, 0.06);
}

.slider-panel input,
.risk-control input {
  width: 100%;
  accent-color: var(--blue);
}

.tick-row {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ipcov-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 18px 0 0;
}

.ipcov-metrics div {
  padding: 14px;
}

.ipcov-metrics dd {
  font-size: 25px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.result-block {
  padding: 20px;
  min-width: 0;
}

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-list div {
  display: grid;
  grid-template-columns: 118px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.bar-list i {
  display: block;
  height: 12px;
  width: var(--value);
  border-radius: 999px;
  background: var(--blue);
}

.bar-list div:nth-child(2) i {
  background: var(--orange);
}

.bar-list div:nth-child(3) i {
  background: var(--purple);
}

.bar-list div:nth-child(4) i {
  background: var(--green);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--subtle);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-block img {
  margin-top: 16px;
  border: 1px solid var(--subtle);
  border-radius: var(--radius);
}

.risk-layout {
  grid-template-columns: 330px minmax(0, 1fr);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 99px;
}

.legend-green {
  background: var(--green);
}

.legend-orange {
  background: var(--orange);
  border-top: 2px dashed var(--orange);
}

.legend-red {
  background: var(--red);
}

#alphaSummary {
  color: #435267;
}

#riskGraph {
  min-height: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 10px 28px rgba(26, 43, 70, 0.06);
}

.risk-edge {
  fill: none;
  stroke-width: 3;
}

.risk-edge.correct {
  stroke: var(--green);
}

.risk-edge.extra {
  stroke: var(--orange);
  stroke-dasharray: 8 8;
}

.risk-edge.missed {
  stroke: var(--red);
  stroke-dasharray: 12 7;
}

.risk-node rect {
  fill: white;
  stroke: #97a9bd;
  stroke-width: 2;
}

.risk-node text {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
}

.resources-section {
  padding-bottom: 64px;
}

.bibtex {
  margin: 18px 0 0;
  padding: 18px;
  overflow-x: auto;
  color: #263347;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.site-footer {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1020px) {
  .nav-links {
    display: none;
  }

  .hero-metrics,
  .trace-workbench,
  .demo-layout,
  .result-grid,
  .risk-layout {
    grid-template-columns: 1fr;
  }

  .method-steps,
  .ipcov-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-background {
    inset: auto 4vw 4vh 4vw;
    width: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0 18px;
  }

  .hero {
    display: block;
    min-height: auto;
  }

  .hero-inner,
  .section,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .hero-inner {
    padding: 76px 0 40px;
  }

  .hero-background {
    position: absolute;
    inset: auto 14px 26px 14px;
    width: auto;
    margin: 0;
    opacity: 0.18;
  }

  h1 {
    font-size: 34px;
    line-height: 1.02;
  }

  .section {
    padding: 64px 0;
  }

  .hero-metrics,
  .method-steps,
  .ipcov-metrics,
  .scenario-stats {
    grid-template-columns: 1fr;
  }

  .trace-row {
    padding: 10px;
    overflow-x: auto;
  }

  .bar-list div {
    grid-template-columns: 96px 1fr 40px;
  }
}
