:root {
  color-scheme: dark;
  --bg: #070816;
  --panel: rgba(15, 20, 42, 0.88);
  --panel-2: rgba(23, 30, 58, 0.76);
  --ink: #f7f8ff;
  --muted: #aeb7d4;
  --line: rgba(186, 205, 255, 0.17);
  --cyan: #7be7ff;
  --violet: #b99cff;
  --amber: #ffd06f;
  --green: #a9ffca;
  --pink: #ff90d0;
  --red: #ff8a75;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgba(123, 231, 255, 0.2), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(185, 156, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 50% 105%, rgba(255, 208, 111, 0.11), transparent 30rem),
    linear-gradient(135deg, #070816 0%, #0b1026 54%, #10142a 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 90px;
}

.hero, .thesis-grid article, .workbench, .matrix, .experiment, .mixer, .pipeline, .frontier {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(17, 23, 48, 0.92), rgba(9, 13, 29, 0.78));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 410px;
  gap: 24px;
  min-height: 560px;
  padding: clamp(22px, 4vw, 52px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(123, 231, 255, 0.09), transparent 45%, rgba(255, 208, 111, 0.1));
  pointer-events: none;
}
.hero-copy, .hero-orbit { position: relative; z-index: 1; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 850;
}
h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(42px, 6.5vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
}
.lede {
  margin: 24px 0 0;
  max-width: 790px;
  color: #dbe3ff;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.primary, .secondary, .method-tabs button, .slider-board input, .copy-status {
  -webkit-tap-highlight-color: transparent;
}
.primary, .secondary {
  min-height: 44px;
  border-radius: 999px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid var(--line);
  font-weight: 850;
}
.primary { color: #061322; background: linear-gradient(135deg, var(--cyan), var(--green)); border-color: transparent; }
.secondary { color: var(--ink); background: rgba(255, 255, 255, 0.055); }
.secondary:hover, .method-tabs button:hover { border-color: rgba(123, 231, 255, 0.42); }

.hero-orbit {
  min-height: 440px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 42%, rgba(123, 231, 255, 0.11), rgba(10, 13, 30, 0.84) 58%);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.orbit-ring {
  position: absolute;
  border: 1px dashed rgba(186, 205, 255, 0.25);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.ring-a { width: 78%; height: 62%; }
.ring-b { width: 54%; height: 42%; transform: rotate(22deg); }
.mass {
  position: absolute;
  min-width: 110px;
  min-height: 72px;
  padding: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(7, 10, 24, 0.72);
  color: #ecf3ff;
  font-weight: 850;
  line-height: 1.3;
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.04);
}
.mass-start { left: 34%; top: 38%; background: rgba(123, 231, 255, 0.14); border-color: rgba(123, 231, 255, 0.5); }
.mass-data { left: 8%; top: 10%; background: rgba(255, 138, 117, 0.13); border-color: rgba(255, 138, 117, 0.45); }
.mass-reward { right: 8%; top: 16%; background: rgba(169, 255, 202, 0.12); border-color: rgba(169, 255, 202, 0.46); }
.mass-teacher { right: 12%; bottom: 18%; background: rgba(185, 156, 255, 0.14); border-color: rgba(185, 156, 255, 0.5); }
.hero-orbit p {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.thesis-grid article { padding: 24px; }
.thesis-grid span, .pipeline-row span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #061322;
  background: linear-gradient(135deg, var(--amber), var(--green));
  font-weight: 950;
}
.thesis-grid h2, .section-head h2, .frontier h2 {
  margin: 16px 0 10px;
  font-size: clamp(24px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.thesis-grid p, .section-head p, .method-card p, .surprise-card p, .pipeline-row p, .frontier p, .score-panel p {
  color: #d3dcf6;
  line-height: 1.72;
}

.workbench, .matrix, .experiment, .mixer, .pipeline, .frontier { margin-top: 18px; padding: clamp(22px, 4vw, 34px); }
.section-head { max-width: 860px; margin-bottom: 18px; }
.section-head.compact { max-width: 980px; }
.section-head h2 { margin-top: 0; }
.section-head p { margin: 0; }
.section-head .eyebrow { margin-bottom: 12px; }

.method-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}
.method-tabs button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}
.method-tabs button.is-active {
  color: #061322;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}
.workbench-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}
.method-card, .canvas-card, .surprise-card, .flow, .score-panel, .pipeline-row article {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.035);
}
.method-card { padding: 24px; }
.method-card h3, .surprise-card h3, .score-panel h3, .pipeline-row h3 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.metric-stack { display: grid; gap: 12px; margin-top: 22px; }
.metric-line { display: grid; gap: 7px; }
.metric-line header { display: flex; justify-content: space-between; color: #eef4ff; font-size: 13px; font-weight: 850; }
.metric-line div { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.09); }
.metric-line i { display: block; width: var(--value); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.canvas-card { padding: 14px; overflow: hidden; }
#distributionCanvas {
  display: block;
  width: 100%;
  min-height: 420px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 44%, rgba(123, 231, 255, 0.1), rgba(3, 6, 17, 0.64));
}
.canvas-fallback { margin: 12px 8px 4px; color: var(--muted); line-height: 1.6; }

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.matrix-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
}
.matrix-card h3 { margin: 0 0 14px; font-size: 24px; }
.matrix-card dl { display: grid; gap: 12px; margin: 0; }
.matrix-card div { padding-top: 12px; border-top: 1px solid rgba(186, 205, 255, 0.12); }
.matrix-card dt { color: var(--cyan); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 850; }
.matrix-card dd { margin: 5px 0 0; color: #d8e1fb; line-height: 1.55; }

.experiment-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}
.surprise-card { padding: 26px; }
.surprise-card > span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 18px;
  color: #17060f;
  background: linear-gradient(135deg, var(--pink), var(--amber));
  font-weight: 950;
  font-size: 28px;
}
.flow { padding: 18px; display: grid; gap: 12px; }
.flow div {
  min-height: 96px;
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.045);
}
.flow b { font-size: 22px; }
.flow small { color: var(--muted); line-height: 1.5; }
.flow i {
  justify-self: center;
  width: 2px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(var(--cyan), transparent);
}

.slider-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.slider-board label {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  color: #f0f5ff;
  font-weight: 850;
}
.slider-board input { width: 100%; accent-color: var(--cyan); }
.score-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
}
.score-ring {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, #0b1026 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--score) * 1%), rgba(255, 255, 255, 0.11) 0);
  box-shadow: inset 0 0 40px rgba(123, 231, 255, 0.12);
}
.score-ring span { font-size: 48px; font-weight: 950; letter-spacing: -0.06em; }
.copy-status { margin-left: 10px; color: var(--green); font-size: 13px; }

.pipeline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.pipeline-row article { padding: 20px; }
.pipeline-row h3 { margin-top: 18px; }
.frontier {
  background:
    radial-gradient(circle at 94% 10%, rgba(255, 208, 111, 0.14), transparent 26rem),
    linear-gradient(145deg, rgba(17, 23, 48, 0.92), rgba(9, 13, 29, 0.78));
}
.frontier h2 { max-width: 920px; margin-top: 0; }
.frontier p { max-width: 920px; font-size: 18px; }

@media (max-width: 1020px) {
  .hero, .workbench-grid, .experiment-layout, .score-panel { grid-template-columns: 1fr; }
  .hero-orbit { min-height: 360px; }
  .thesis-grid, .matrix-grid, .slider-board, .pipeline-row { grid-template-columns: 1fr 1fr; }
  .score-ring { width: 150px; height: 150px; }
}

@media (max-width: 720px) {
  .page-shell { width: 100%; padding: 10px 8px 76px; }
  .hero, .thesis-grid article, .workbench, .matrix, .experiment, .mixer, .pipeline, .frontier { border-radius: 24px; }
  .hero { padding: 20px; min-height: auto; }
  h1 { font-size: clamp(34px, 12vw, 52px); letter-spacing: -0.058em; }
  .lede { font-size: 16px; }
  .hero-actions > * { width: 100%; }
  .hero-orbit { min-height: 310px; margin-top: 6px; }
  .mass { min-width: 92px; min-height: 58px; padding: 8px; font-size: 12px; border-radius: 18px; }
  .mass-data { left: 4%; top: 10%; }
  .mass-reward { right: 4%; top: 13%; }
  .mass-teacher { right: 8%; bottom: 22%; }
  .mass-start { left: 31%; top: 38%; }
  .hero-orbit p { font-size: 13px; }
  .thesis-grid, .matrix-grid, .slider-board, .pipeline-row { grid-template-columns: 1fr; }
  .method-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .method-tabs button { padding-inline: 10px; }
  #distributionCanvas { min-height: 320px; }
  .score-panel { padding: 18px; }
  .score-ring { width: 132px; height: 132px; }
  .score-ring span { font-size: 38px; }
}
