:root {
  color-scheme: light;
  --ink: #172127;
  --muted: #5d6768;
  --paper: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --line: #d6ddd8;
  --teal: #268d7c;
  --teal-dark: #176557;
  --coral: #d95c54;
  --amber: #e5a542;
  --violet: #7f6baa;
  --shadow: 0 18px 48px rgba(23, 33, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  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;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  background: rgba(23, 33, 39, 0.62);
  backdrop-filter: blur(18px);
}

.brand {
  font-weight: 800;
  font-size: 18px;
}

nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 650;
}

nav a {
  color: rgba(255, 255, 255, 0.82);
}

nav a:hover,
nav a:focus-visible {
  color: #fff;
}

.hero {
  position: relative;
  min-height: 56svh;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 96px 32px 52px;
  background:
    radial-gradient(circle at 72% 26%, rgba(53, 182, 157, 0.14), transparent 34%),
    linear-gradient(90deg, #0d1719 0%, #111d20 48%, #17282a 100%);
  color: #fff;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.52;
  background-image:
    linear-gradient(rgba(246, 247, 244, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 247, 244, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}

.hero-shade {
  position: absolute;
  inset: 0;
}

.animation-frame video,
.animation-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.animation-frame canvas {
  display: none;
}

.animation-frame.show-canvas canvas {
  display: block;
}

.animation-frame.show-canvas video {
  display: none;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 18, 20, 0.92), rgba(12, 18, 20, 0.54) 58%, rgba(12, 18, 20, 0.22)),
    linear-gradient(0deg, rgba(12, 18, 20, 0.56), rgba(12, 18, 20, 0.02) 48%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  margin: 0 auto;
}

.venue,
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .venue {
  color: #95f1d5;
}

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

h1 {
  margin-bottom: 12px;
  font-size: 88px;
  line-height: 0.92;
  letter-spacing: 0;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 720;
}

.authors,
.affiliation {
  max-width: 860px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.authors a {
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(149, 241, 213, 0.54);
}

.authors a:hover,
.authors a:focus-visible {
  color: #95f1d5;
  border-bottom-color: #95f1d5;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 760;
  background: rgba(255, 255, 255, 0.12);
}

.button.primary {
  color: #12201d;
  border-color: #95f1d5;
  background: #95f1d5;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.section {
  padding: 86px 32px;
  background: var(--paper);
}

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.intro-band,
.cite-band {
  background: var(--surface);
}

.results-band {
  background: #edf2ef;
}

.intro-grid,
.cite-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 56px;
  align-items: start;
}

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

h2 {
  margin-bottom: 0;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: 0;
}

.tldr-copy {
  color: var(--muted);
  font-size: 18px;
}

.tldr-copy p:last-child {
  margin-bottom: 0;
}

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

.mechanic,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mechanic {
  overflow: hidden;
}

.mechanic .animation-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #102124;
}

.mechanic .animation-frame video {
  object-fit: contain;
}

.mechanic h3,
.mechanic p {
  padding-left: 20px;
  padding-right: 20px;
}

.mechanic h3 {
  margin-top: 20px;
}

.mechanic p {
  margin-bottom: 22px;
  color: var(--muted);
}

.mechanic code {
  color: var(--teal-dark);
  font-weight: 700;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics-strip > div {
  min-height: 136px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-value,
.metric-label {
  display: block;
}

.metric-value {
  color: var(--coral);
  font-size: 40px;
  line-height: 1;
  font-weight: 840;
}

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

.results-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 18px;
}

.result-panel {
  padding: 22px;
  overflow: hidden;
}

.result-panel.wide {
  grid-row: span 2;
}

.panel-note {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.drift-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.drift-row {
  display: grid;
  grid-template-columns: 160px minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.drift-row:last-child {
  border-bottom: 0;
}

.drift-row span {
  font-weight: 740;
}

.drift-row i {
  position: relative;
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e2;
}

.drift-row i::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(var(--bar-scale, 0.18));
  transition: transform 800ms ease;
}

.drift-row i.fedhera::after {
  width: calc((var(--fedhera) / var(--max)) * 100%);
  background: var(--teal);
}

.drift-row i.baseline::after {
  width: calc((var(--baseline) / var(--max)) * 100%);
  background: var(--coral);
}

.drift-row strong {
  grid-column: 2 / 4;
  color: var(--teal-dark);
  font-size: 13px;
}

.drift-list.is-visible {
  --bar-scale: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.legend i.fedhera {
  background: var(--teal);
}

.legend i.baseline {
  background: var(--coral);
}

.bar-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.bar-row {
  display: grid;
  grid-template-columns: 112px minmax(120px, 1fr) 54px;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  font-size: 14px;
}

.bar-row span {
  font-weight: 720;
}

.bar-row i {
  position: relative;
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e2;
}

.bar-row i::after {
  position: absolute;
  inset: 0;
  width: calc((var(--value) / var(--max)) * 100%);
  content: "";
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transform-origin: left center;
  transform: scaleX(var(--bar-scale, 0.14));
  transition: transform 800ms ease;
}

.bar-row strong {
  color: var(--teal-dark);
  text-align: right;
}

.bar-list.is-visible {
  --bar-scale: 1;
}

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

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

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

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

tbody tr:first-child td {
  color: var(--teal-dark);
  font-weight: 760;
}

.code-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.code-map a {
  min-height: 164px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.code-map a:hover,
.code-map a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(38, 141, 124, 0.5);
  box-shadow: var(--shadow);
}

.code-map span,
.code-map strong {
  display: block;
}

.code-map span {
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
}

.code-map strong {
  margin-top: 32px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111a1d;
  color: #d7f7ee;
  font-size: 13px;
  line-height: 1.55;
}

footer {
  padding: 28px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 13px;
}

:focus-visible {
  outline: 3px solid rgba(229, 165, 66, 0.65);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .hero {
    min-height: 58svh;
  }

  h1 {
    font-size: 68px;
  }

  .subtitle {
    font-size: 23px;
  }

  .intro-grid,
  .cite-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .mechanic-grid,
  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel.wide {
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 58px;
    padding: 0 18px;
  }

  nav {
    gap: 12px;
    font-size: 12px;
  }

  .hero {
    min-height: 62svh;
    padding: 86px 20px 42px;
  }

  h1 {
    font-size: 54px;
  }

  h2 {
    font-size: 29px;
  }

  .subtitle {
    font-size: 20px;
  }

  .section {
    padding: 64px 20px;
  }

  .mechanic-grid,
  .metrics-strip,
  .code-map {
    grid-template-columns: 1fr;
  }

  .mechanic .animation-frame {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .bar-row {
    grid-template-columns: 92px minmax(80px, 1fr) 48px;
    gap: 8px;
    font-size: 13px;
  }

  .drift-row {
    grid-template-columns: 1fr;
  }

  .drift-row strong {
    grid-column: auto;
  }
}
