:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #5f6f7e;
  --line: #d8dee6;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --blue: #244f7a;
  --teal: #26756f;
  --rust: #9a654d;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 36px;
  border-bottom: 1px solid rgba(216, 222, 230, 0.9);
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

nav a:hover,
.brand:hover,
footer a:hover {
  color: var(--blue);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: 44px;
  align-items: center;
  min-height: 720px;
  padding: 72px 0 42px;
}

.hero-copy {
  max-width: 640px;
}

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

h1,
h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  font-size: 68px;
  max-width: 760px;
}

h2 {
  font-size: 42px;
  max-width: 900px;
}

p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.math {
  font-family: "Times New Roman", Times, serif;
  color: var(--ink);
  font-style: italic;
}

.lead {
  max-width: 680px;
  color: #3d4a57;
  font-size: 21px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

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

.hero-figure,
.split figure,
.result-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  padding: 13px 16px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  background: #fff;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary > div {
  min-height: 148px;
  padding: 24px;
  background: var(--panel);
}

.metric {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 30px;
  font-weight: 800;
}

.summary p {
  margin: 0;
  font-size: 15px;
}

.split,
.demo-section,
.results,
.benchmark,
.code,
.citation {
  padding: 84px 0 0;
}

.split {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 42px;
  align-items: center;
}

.split p {
  max-width: 620px;
}

.section-heading {
  max-width: 860px;
}

.section-heading p:last-child {
  max-width: 760px;
}

.demo-panel {
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--blue);
  color: #fff;
}

.slider-label {
  display: grid;
  grid-template-columns: auto minmax(160px, 240px) 34px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.slider-label input {
  width: 100%;
  accent-color: var(--teal);
}

.slider-label strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

#driftDemo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fbfcfe;
}

.demo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}

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

.demo-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.demo-legend .target {
  background: #aab4bf;
}

.demo-legend .fiber-a {
  background: var(--blue);
}

.demo-legend .fiber-b {
  background: var(--rust);
}

.result-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.table-stack {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.table-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-panel header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.table-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.table-panel p {
  max-width: 900px;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

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

.data-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.table-panel.compact .data-table {
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.data-table thead th {
  background: #edf3f7;
  color: var(--ink);
  font-weight: 800;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table tbody th {
  color: var(--ink);
  font-weight: 750;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .group-row th {
  padding-top: 9px;
  padding-bottom: 9px;
  background: #f7fafc;
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.code {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 28px;
  align-items: start;
}

pre {
  margin: 0;
  overflow-x: auto;
  border: 1px solid #24384f;
  border-radius: 8px;
  background: #132033;
  color: #eef5ff;
  box-shadow: var(--shadow);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.65;
}

pre code {
  display: block;
  padding: 20px;
}

.citation {
  padding-bottom: 84px;
}

.citation pre {
  margin-top: 24px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer a {
  text-decoration: none;
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 16px 20px;
  }

  nav {
    display: none;
  }

  main {
    width: min(100% - 28px, 720px);
  }

  .hero,
  .split,
  .code,
  .result-grid,
  .summary {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 42px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 32px;
  }

  .lead {
    font-size: 19px;
  }

  .split,
  .demo-section,
  .results,
  .benchmark,
  .code,
  .citation {
    padding-top: 60px;
  }

  .demo-toolbar,
  .slider-label {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .demo-toolbar {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    min-width: 0;
  }

  .slider-label {
    width: 100%;
    gap: 8px;
  }

  .slider-label strong {
    text-align: left;
  }
}
