:root {
  --charcoal: #111827;
  --charcoal-2: #172033;
  --off-white: #f8fafc;
  --paper: #ffffff;
  --cyan: #38bdf8;
  --violet: #7c3aed;
  --lime: #a3e635;
  --amber: #f59e0b;
  --muted: #64748b;
  --ink: #0f172a;
  --rule: rgba(15, 23, 42, 0.12);
  --dark-rule: rgba(248, 250, 252, 0.14);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--off-white);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--dark-rule);
  background: rgba(17, 24, 39, 0.92);
  color: var(--off-white);
  backdrop-filter: blur(16px);
}

.brand {
  font-family: "Source Serif 4", serif;
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.72);
}

.nav a {
  text-decoration: none;
  white-space: nowrap;
}

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

.hero {
  min-height: 640px;
  padding: clamp(70px, 10vw, 132px) clamp(22px, 6vw, 84px);
  background:
    radial-gradient(circle at 12% 18%, rgba(124, 58, 237, 0.4), transparent 27%),
    radial-gradient(circle at 88% 24%, rgba(56, 189, 248, 0.28), transparent 25%),
    linear-gradient(135deg, var(--charcoal), #0b1021 58%, #11182d);
  color: var(--off-white);
}

.hero__content {
  max-width: 1180px;
  margin: 0 auto;
}

.hero__content .eyebrow a,
.footer a,
.section--team a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero__content .eyebrow a:hover,
.footer a:hover,
.section--team a:hover {
  color: var(--lime);
}

.hero h1 {
  margin: 14px 0 0;
  max-width: 980px;
  font-family: "Source Serif 4", serif;
  font-size: clamp(54px, 9vw, 122px);
  font-weight: 750;
  line-height: 0.96;
}

.hero__question {
  max-width: 900px;
  margin: 28px 0 0;
  font-family: "Source Serif 4", serif;
  font-size: clamp(26px, 4vw, 45px);
  line-height: 1.1;
  color: rgba(248, 250, 252, 0.84);
}

.hero__summary {
  max-width: 900px;
  margin: 24px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(248, 250, 252, 0.68);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  max-width: 100%;
  margin-top: 48px;
  overflow: hidden;
  border: 1px solid var(--dark-rule);
  border-radius: 14px;
  background: var(--dark-rule);
}

.hero__stats div {
  padding: 22px;
  background: rgba(255, 255, 255, 0.05);
}

.hero__stats strong {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(26px, 4vw, 44px);
  color: var(--lime);
}

.hero__stats span {
  display: block;
  margin-top: 6px;
  color: rgba(248, 250, 252, 0.66);
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section {
  padding: clamp(64px, 8vw, 110px) clamp(22px, 6vw, 84px);
}

.section--light {
  background: var(--off-white);
}

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 72px);
  border-top: 1px solid var(--rule);
}

.section__intro {
  max-width: 830px;
}

.section--light > .section__intro {
  margin: 0 auto;
  text-align: center;
}

.section__intro a {
  color: var(--violet);
  font-weight: 600;
  text-underline-offset: 4px;
}

.section__intro h2,
.visual-lab h2,
.section--team h2 {
  margin: 10px 0 0;
  font-family: "Source Serif 4", serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
}

.section__intro p:not(.eyebrow),
.section--team p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.concept-grid,
.finding-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.data-map {
  max-width: 1060px;
  margin: 42px auto 0;
}

.corpus-codes {
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.corpus-codes {
  padding: 24px;
}

.corpus-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.corpus-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.corpus-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-original::before {
  background: var(--amber);
}

.legend-translation::before {
  background: var(--cyan);
}

.corpus-codes > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.corpus-codes button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.corpus-codes .corpus-original {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.16);
  color: #7c2d12;
  font-weight: 600;
}

.corpus-codes .corpus-translation {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(56, 189, 248, 0.12);
  color: #0f3b57;
}

.corpus-codes button:hover,
.corpus-codes button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--violet);
  background: var(--charcoal);
  color: var(--lime);
  outline: none;
}

.code-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.concept-grid article,
.finding-grid article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.concept-grid h3,
.finding-grid h3 {
  margin: 0;
  font-size: 18px;
}

.concept-grid p,
.finding-grid p {
  color: var(--muted);
  line-height: 1.65;
}

.finding-grid span {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--violet);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.visual-lab {
  position: relative;
  padding: clamp(64px, 8vw, 112px) clamp(18px, 4vw, 56px);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(124, 58, 237, 0.28), transparent 28%),
    linear-gradient(220deg, rgba(163, 230, 53, 0.16), transparent 30%),
    var(--charcoal);
  color: var(--off-white);
}

.visual-lab::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(248, 250, 252, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 252, 0.12) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

.visual-lab > * {
  position: relative;
  z-index: 1;
}

.visual-lab__header {
  max-width: 980px;
}

.visual-lab__header p:not(.eyebrow) {
  max-width: 760px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 18px;
  line-height: 1.7;
}

.preset-bar,
.control-panel,
.helper-strip,
.heatmap-comparison,
.legend-row {
  max-width: 1420px;
  margin-left: auto;
  margin-right: auto;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

button,
select {
  font: inherit;
}

.preset {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(248, 250, 252, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.07);
  color: var(--off-white);
  cursor: pointer;
}

.preset:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: var(--shadow);
}

.control-panel label {
  display: grid;
  gap: 8px;
}

.control-panel span {
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.control-panel select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(248, 250, 252, 0.2);
  border-radius: 10px;
  background: #0b1222;
  color: var(--off-white);
  outline: none;
}

.control-panel select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
}

.helper-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: rgba(248, 250, 252, 0.66);
  font-size: 13px;
}

.helper-strip span {
  padding: 8px 10px;
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.06);
}

.helper-strip strong {
  color: var(--lime);
}

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

.heatmap-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.08);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.3);
}

.chart-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-heading h3 {
  margin: 6px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
}

.chart-heading output {
  color: var(--lime);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-align: right;
}

.heatmap {
  display: grid;
  grid-template-columns: 86px 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
  min-height: 520px;
  overflow-x: auto;
}

.axis-corner {
  grid-column: 1;
  grid-row: 1;
}

.x-axis {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 3px;
  min-width: 620px;
}

.y-axis {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  gap: 3px;
}

.matrix {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 3px;
  min-width: 620px;
}

.axis-label,
.y-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  color: rgba(248, 250, 252, 0.58);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.y-label {
  justify-content: flex-end;
  padding-right: 8px;
}

.cell {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: crosshair;
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.cell:hover {
  transform: scale(1.04);
  border-color: var(--lime);
  filter: saturate(1.18);
  z-index: 2;
}

.cell--empty {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(248, 250, 252, 0.06),
      rgba(248, 250, 252, 0.06) 6px,
      rgba(248, 250, 252, 0.025) 6px,
      rgba(248, 250, 252, 0.025) 12px
    );
  cursor: help;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  color: rgba(248, 250, 252, 0.62);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.legend {
  width: min(320px, 42vw);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #312e81, #2563eb, #0891b2, #0d9488, #f59e0b);
}

.tooltip {
  position: fixed;
  z-index: 20;
  display: none;
  max-width: 260px;
  padding: 12px;
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 12px;
  background: #030712;
  color: var(--off-white);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  pointer-events: none;
}

.tooltip strong {
  color: var(--lime);
}

.method-list {
  margin: 0;
}

.method-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.method-list dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--violet);
  text-transform: uppercase;
}

.method-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section--team {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 72px);
  background: var(--charcoal);
  color: var(--off-white);
}

.section--team p {
  color: rgba(248, 250, 252, 0.72);
}

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

.contributor-list article {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--dark-rule);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.06);
}

.contributor-list h3 {
  margin: 0;
  font-size: 18px;
}

.contributor-list p {
  margin: 7px 0 0;
  color: rgba(248, 250, 252, 0.7);
}

.contributor-list a {
  display: inline-block;
  margin-top: 12px;
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.reference-grid article {
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.reference-grid article:first-child {
  grid-column: 1 / -1;
}

.reference-grid h3 {
  margin: 0;
}

.reference-grid p,
.reference-grid ul {
  color: var(--muted);
  line-height: 1.7;
}

.reference-grid a {
  color: var(--violet);
  font-weight: 600;
  text-underline-offset: 4px;
}

.references > ul {
  max-width: 900px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(22px, 6vw, 84px);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

.footer p {
  margin: 0;
}

@media (max-width: 1080px) {
  .concept-grid,
  .finding-grid,
  .control-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .heatmap-comparison,
  .data-map,
  .section--split,
  .section--team {
    grid-template-columns: 1fr;
  }
}

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

  .hero__stats,
  .concept-grid,
  .finding-grid,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .corpus-codes > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }

  .reference-grid article:first-child {
    grid-column: auto;
  }

  .heatmap-card {
    padding: 12px;
  }

  .heatmap {
    grid-template-columns: 74px 1fr;
  }

  .cell {
    min-height: 44px;
  }

  .method-list div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer {
    flex-direction: column;
  }
}
