:root {
  --bg: #0e1116;
  --bg-soft: #141920;
  --panel: rgba(255, 255, 255, 0.05);
  --cream: #f7f2e7;
  --mist: #e2ebe4;
  --sand: #efce8a;
  --moss: #2b5a43;
  --moss-deep: #173326;
  --ink: #16211a;
  --text: #edf1ec;
  --muted: #afbbb3;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max: 1240px;

  --hilbert: #1e40af;
  --zorder: #d97706;
  --rowmajor: #a3a3a3;
  --rtree: #16a34a;

  --query: #16a34a;
  --visit: #efce8a;
  --hub: #d97706;
  --layer-top: #c46b6b;
  --layer-mid: #6e8db4;
  --layer-bot: #1e40af;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(239, 206, 138, 0.13), transparent 22%),
    radial-gradient(circle at 88% 4%, rgba(30, 64, 175, 0.18), transparent 22%),
    linear-gradient(180deg, #0e1116 0%, #090c10 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 95%);
  pointer-events: none;
}

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

button,
input,
textarea {
  font: inherit;
}

.ix-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.ix-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 17, 22, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.ix-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #6e8db4);
  color: var(--cream);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.brand-copy span {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.ix-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.ix-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.ix-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sand);
  margin: 0 0 10px;
}

h1, h2, h3 {
  font-family: "Fraunces", serif;
  letter-spacing: -0.005em;
  margin: 0 0 12px;
  font-weight: 600;
}

h1 {
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.18;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 36px;
  padding: 36px;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, rgba(30, 64, 175, 0.18), rgba(110, 141, 180, 0.05) 50%, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 15.5px;
}

.hero-lead {
  font-size: 17px;
  color: var(--mist);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.button-primary {
  background: linear-gradient(135deg, #1e40af, #6e8db4);
  color: var(--cream);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--line);
}

.button:hover {
  transform: translateY(-1px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.metric-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.metric-value {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--sand);
}

.metric-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.hero-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.signal-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.signal-card-dark {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.32), rgba(30, 64, 175, 0.05));
  color: var(--cream);
}

.signal-card-light {
  background: linear-gradient(180deg, rgba(239, 206, 138, 0.18), rgba(239, 206, 138, 0.02));
  color: var(--cream);
}

.signal-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand);
  margin: 0 0 8px;
}

.signal-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.signal-card p {
  color: var(--mist);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.section-block {
  margin: 56px 0 0;
  padding: 36px;
  border-radius: var(--radius-xl);
  background: rgba(20, 25, 32, 0.66);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.section-heading {
  max-width: 64ch;
  margin-bottom: 28px;
}

.section-heading p {
  color: var(--muted);
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.lab-canvas-panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid var(--line);
}

.lab-canvas-panel svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.45);
}

.canvas-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

#curve-status,
#race-status,
#hnsw-status {
  color: var(--sand);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lab-control-panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(20, 25, 32, 0.85);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="range"] {
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--ink);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--ink);
  cursor: pointer;
}

.scale-readout {
  font-size: 12.5px;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.chip-active {
  background: linear-gradient(135deg, #1e40af, #6e8db4);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--cream);
}

.readout-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.readout-label {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.readout-value {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--cream);
}

.readout-emphasis .readout-value {
  color: var(--sand);
  font-size: 19px;
}

.signal-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

#race-chart {
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.path-card {
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.path-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.28);
  color: var(--cream);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  width: max-content;
}

.path-card h3 {
  margin: 0;
}

.path-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

.ix-footer {
  margin-top: 56px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.66);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.ix-footer a {
  color: var(--sand);
  font-weight: 600;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 940px) {
  .hero-grid,
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ix-shell {
    padding: 18px 0 56px;
  }
  .hero-grid,
  .section-block {
    padding: 24px;
  }
  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
