/* Black Quantum — site design system (dark, editorial) */

:root {
  --bg: #000000;
  --bg-soft: #0b0d10;
  --bg-tint: #101a2b;
  --surface: #0e1115;
  --ink: #f3f5f8;
  --ink-2: #c4cad2;
  --muted: #99a1ac;
  --faint: #6d7480;
  --line: #23272e;
  --blue: #8ab4f8;
  --blue-bright: #a8c7fa;
  --blue-soft: #1b2b47;
  --orange: #f2a15c;
  --grad-hero: radial-gradient(1200px 620px at 84% -12%, #12305c 0%, rgba(18,48,92,0) 62%),
               radial-gradient(900px 520px at -8% 108%, #0f2444 0%, rgba(15,36,68,0) 58%);
  --max: 1200px;
  --radius: 20px;
  font-size: 17px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--blue-soft); color: var(--ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ---------- nav ---------- */
nav.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0,0,0,0.72);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
nav.site.scrolled { border-bottom-color: var(--line); }
nav.site .bar {
  max-width: var(--max); margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
nav.site .logo {
  font-weight: 650; letter-spacing: -0.015em; font-size: 1.06rem; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
nav.site .logo:hover { text-decoration: none; }
nav.site .logo .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-bright), #7cacf8);
  flex: none;
}
nav.site ul { display: flex; gap: 28px; list-style: none; flex-wrap: wrap; }
nav.site ul a { color: var(--ink-2); font-size: 0.92rem; font-weight: 500; }
nav.site ul a:hover { color: var(--blue); text-decoration: none; }
@media (max-width: 760px) { nav.site ul { display: none; } }

/* ---------- type ---------- */
.kicker {
  font-size: 0.78rem; font-weight: 650; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--blue);
  margin-bottom: 18px;
}
h1.display {
  font-size: clamp(2.7rem, 6.2vw, 5rem);
  line-height: 1.04; letter-spacing: -0.032em; font-weight: 560;
  max-width: 21ch;
}
h2.section {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 560;
  max-width: 26ch;
}
p.lede {
  font-size: 1.22rem; line-height: 1.6; color: var(--muted);
  max-width: 62ch; margin-top: 22px;
}
section.block { padding: 108px 0; }
section.block.tint { background: var(--bg-soft); }

/* ---------- hero ---------- */
header.hero {
  background: var(--grad-hero);
  padding: 110px 0 84px;
  position: relative;
  overflow: hidden;
}
header.hero .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
  opacity: 0.75; z-index: 0;
}
header.hero .blob.b1 {
  width: 520px; height: 520px; right: -120px; top: -160px;
  background: radial-gradient(circle at 35% 35%, #1d4a8f, #0a1e3a 70%);
  animation: drift1 26s ease-in-out infinite alternate;
}
header.hero .blob.b2 {
  width: 420px; height: 420px; right: 260px; top: 120px;
  background: radial-gradient(circle at 60% 40%, #163a70, #08182e 70%);
  animation: drift2 32s ease-in-out infinite alternate;
}
header.hero .wrap { position: relative; z-index: 1; }
canvas.constellation {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(-60px,50px) scale(1.12); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(70px,-40px) scale(0.94); } }
@media (prefers-reduced-motion: reduce) { header.hero .blob { animation: none; } }
header.hero .sub {
  font-size: 1.28rem; color: var(--muted); max-width: 56ch;
  margin-top: 28px; line-height: 1.6;
}
.cta-row { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-size: 0.98rem; font-weight: 560; transition: all .18s ease;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--ink); color: #000; }
.btn.primary:hover { background: var(--blue-bright); color: #06121f; }
.btn.ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.hero-figure { margin-top: 72px; }
.hero-figure svg { width: 100%; height: auto; display: block; }

/* ---------- big statement ---------- */
.statement {
  font-size: clamp(1.5rem, 2.9vw, 2.35rem);
  line-height: 1.32; letter-spacing: -0.018em; font-weight: 480;
  max-width: 34ch; color: var(--ink);
}
.statement .hl { color: var(--blue); }

/* ---------- problem cards ---------- */
.problem-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 28px; margin-top: 56px;
}
@media (max-width: 760px) { .problem-grid { grid-template-columns: 1fr; } }
.problem-card .art { height: 220px; }
a.problem-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); color: var(--ink);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
a.problem-card:hover {
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  transform: translateY(-3px);
  border-color: transparent;
}
.problem-card .art { height: 190px; }
.problem-card .art svg { width: 100%; height: 100%; display: block; }
.problem-card .body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.problem-card .tag {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 10px;
}
.problem-card h3 { font-size: 1.28rem; letter-spacing: -0.015em; line-height: 1.25; font-weight: 600; }
.problem-card p { color: var(--muted); font-size: 0.97rem; margin-top: 10px; flex: 1; }
.problem-card .go { margin-top: 18px; font-weight: 560; color: var(--blue); font-size: 0.95rem; }
.problem-card .go.soon { color: var(--faint); }

/* ---------- domain tiles ---------- */
.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px; margin-top: 52px;
}
.tile {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 22px 22px 24px;
}
.tile .spot { height: 62px; margin-bottom: 14px; }
.tile .spot svg { width: 100%; height: 100%; display: block; }
.tile .field {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); display: block; margin-bottom: 8px;
}
.tile h3 { font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em; }
.tile p { font-size: 0.9rem; color: var(--muted); margin-top: 7px; line-height: 1.55; }
.tile .fails { font-size: 0.84rem; color: var(--ink-2); margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ---------- figure card (charts) ---------- */
.figure-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 28px; margin-top: 48px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
}
.figure-card .fig-title { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.figure-card .fig-sub { color: var(--muted); font-size: 0.9rem; margin-top: 3px; }
.chip-row { display: flex; gap: 8px; margin: 18px 0 14px; flex-wrap: wrap; }
button.chip {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-size: 0.88rem; font-weight: 550;
  cursor: pointer; font-family: inherit; transition: all .15s ease;
}
button.chip.on { border-color: var(--blue); color: var(--blue); background: var(--bg-tint); }
.legend { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.legend .item { display: flex; gap: 8px; align-items: center; font-size: 0.86rem; color: var(--ink-2); }
.legend .swatch { width: 14px; height: 4px; border-radius: 2px; }
.fig-note {
  margin-top: 16px; font-size: 0.85rem; color: var(--muted); line-height: 1.55;
}
.stat-line {
  margin-top: 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84rem; color: var(--ink-2);
  background: var(--bg-soft); border-radius: 10px; padding: 10px 14px;
}
input[type="range"].slider { flex: 1; min-width: 180px; accent-color: var(--blue); }

/* ---------- prose (problem pages) ---------- */
.prose { max-width: 68ch; }
.prose h2 {
  font-size: 1.65rem; letter-spacing: -0.02em; font-weight: 600;
  margin-top: 64px; margin-bottom: 16px; line-height: 1.2;
}
.prose p { margin-top: 18px; color: var(--ink-2); font-size: 1.06rem; line-height: 1.72; }
.prose p.first { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.pull {
  margin: 40px 0; padding: 26px 30px; border-left: 3px solid var(--blue);
  background: var(--bg-tint); border-radius: 0 14px 14px 0;
  font-size: 1.14rem; line-height: 1.55; color: var(--ink); max-width: 60ch;
}

/* ---------- principles ---------- */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px 34px; margin-top: 56px; }
.principle h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; }
.principle .icon {
  width: 44px; height: 44px; margin-bottom: 16px;
  border-radius: 12px; background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
}
.principle .icon svg { width: 26px; height: 26px; display: block; }
.principle p { color: var(--muted); font-size: 0.94rem; margin-top: 9px; }

/* ---------- pubs / news ---------- */
ul.pubs { list-style: none; margin-top: 44px; }
ul.pubs li { padding: 24px 0; border-top: 1px solid var(--line); }
ul.pubs li:last-child { border-bottom: 1px solid var(--line); }
ul.pubs .title { display: block; font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
ul.pubs .venue { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 5px; }

/* ---------- contact / footer ---------- */
.contact-links { display: flex; gap: 26px; margin-top: 32px; flex-wrap: wrap; }
.contact-links a { font-weight: 560; }
footer.site {
  border-top: 1px solid var(--line); padding: 44px 0 60px; margin-top: 40px;
  color: var(--faint); font-size: 0.88rem;
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- reveal ---------- */
.reveal, .reveal-group > * { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in, .reveal-group.in > * { opacity: 1; transform: none; }
.reveal-group.in > *:nth-child(2) { transition-delay: .07s; }
.reveal-group.in > *:nth-child(3) { transition-delay: .14s; }
.reveal-group.in > *:nth-child(4) { transition-delay: .21s; }
.reveal-group.in > *:nth-child(5) { transition-delay: .28s; }
.reveal-group.in > *:nth-child(6) { transition-delay: .35s; }
.reveal-group.in > *:nth-child(7) { transition-delay: .42s; }
.reveal-group.in > *:nth-child(8) { transition-delay: .49s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-group > * { opacity: 1; transform: none; transition: none; }
}

/* ---------- diagrams (problem pages) ---------- */
figure.diagram {
  margin: 44px 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 26px 26px 20px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.45);
}
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption {
  margin-top: 14px; font-size: 0.88rem; color: var(--muted); line-height: 1.55;
  max-width: 66ch;
}

/* ---------- featured origin (story) ---------- */
.origin { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(320px, 6fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .origin { grid-template-columns: 1fr; } }
.origin h2.section { max-width: 16ch; }
.paper-scene { position: relative; min-height: 480px; }
.paper-scene .sketch { position: absolute; inset: 0; }
.paper-scene .sketch svg { width: 100%; height: 100%; }
.paper-card {
  position: absolute; left: 6%; top: 26%; width: 76%;
  background: linear-gradient(178deg, #fdfdfc 0%, #f4f3ef 49.6%, #e9e7e1 50.4%, #fbfaf8 100%);
  border-radius: 6px; padding: 34px 36px 30px;
  transform: rotate(-6deg);
  box-shadow: 0 26px 60px rgba(0,0,0,0.75), 0 4px 14px rgba(0,0,0,0.5);
}
.paper-card .ptitle {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.9vw, 1.45rem); line-height: 1.3; font-weight: 600;
  color: #1c1e21; letter-spacing: 0;
}
.paper-card .pauthor {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem; color: #3c4043; margin-top: 14px;
}
.paper-card .pdept {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem; color: #5f6368; margin-top: 4px;
}
.paper-card .prule { height: 1px; background: #d8d5cd; margin: 18px 0 12px; }
.paper-card .pfoot {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem; color: #5f6368; font-style: italic;
}
.paper-scene .accent-dot {
  position: absolute; left: 2%; bottom: 12%; width: 56px; height: 56px;
  border-radius: 50%; background: var(--blue-bright); opacity: 0.9;
}
.paper-scene .mini-chart {
  position: absolute; right: -2%; bottom: 0; width: 38%;
  background: #0f2350; border-radius: 14px; padding: 16px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.6);
}
.paper-scene .mini-chart svg { width: 100%; height: auto; display: block; }

/* ---------- story timeline ---------- */
.timeline { position: relative; margin-top: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.era { position: relative; padding: 0 0 72px 46px; }
.era:last-child { padding-bottom: 8px; }
.era::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--blue);
}
.era .when {
  font-size: 0.8rem; font-weight: 650; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 10px;
}
.era h2 {
  font-size: 1.55rem; letter-spacing: -0.02em; font-weight: 600;
  line-height: 1.22; margin-bottom: 12px; max-width: 30ch;
}
.era p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.7; max-width: 62ch; margin-top: 12px; }
.era .vignette {
  margin: 22px 0 4px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); padding: 18px; max-width: 560px;
}
.era .vignette svg { width: 100%; height: auto; display: block; }

/* ---------- problem page hero ---------- */
header.page-hero {
  background: var(--grad-hero); padding: 96px 0 70px;
  position: relative; overflow: hidden;
}
header.page-hero .wrap { position: relative; z-index: 1; }
header.page-hero .crumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 26px; }
header.page-hero .crumb a { color: var(--muted); }
header.page-hero .crumb a:hover { color: var(--blue); }
header.page-hero h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.07; letter-spacing: -0.03em; font-weight: 560; max-width: 24ch;
}
header.page-hero .sub { font-size: 1.22rem; color: var(--muted); max-width: 58ch; margin-top: 24px; line-height: 1.6; }
