:root {
  --bg: #0a0d14;
  --bg-elev: #121724;
  --bg-soft: #161c2b;
  --fg: #e8ecf4;
  --fg-dim: #8a94ab;
  --fg-mute: #4d586e;
  --accent: #7cd4ff;
  --accent-warm: #ffb86b;
  --accent-hot: #ff6b8a;
  --grid: rgba(124, 212, 255, 0.07);
  --border: rgba(138, 148, 171, 0.16);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(124, 212, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(255, 107, 138, 0.05), transparent 55%);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}
a:hover { border-bottom-color: var(--accent); }

.mono { font-family: var(--font-mono); }

/* ---------- Layout ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(10, 13, 20, 0.7);
  border-bottom: 1px solid var(--border);
}

header.site .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.site .brand {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  border-bottom: none;
  font-size: 15px;
}
header.site .brand .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  margin-right: 10px;
  vertical-align: middle;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

header.site nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
header.site nav a {
  color: var(--fg-dim);
  border-bottom: none;
}
header.site nav a:hover { color: var(--fg); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 24px 28px;
  color: var(--fg-mute);
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  padding: 80px 0 60px;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  background: linear-gradient(180deg, #ffffff 0%, #8a94ab 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--fg-dim);
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 0 32px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid var(--border);
  color: var(--fg);
  background: var(--bg-elev);
  cursor: pointer;
  transition: all 160ms ease;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--accent);
  color: #07101a;
  border-color: var(--accent);
}
.btn.primary:hover {
  background: #a5e1ff;
  border-color: #a5e1ff;
}

/* ---------- Section ---------- */

.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.section-head .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.1em;
}
.section-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head .spacer { flex: 1; }
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  position: relative;
  display: block;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  color: var(--fg);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 212, 255, 0.08);
}
.card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 14.5px;
  line-height: 1.55;
}
.card .chev {
  position: absolute;
  right: 20px;
  bottom: 18px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform 200ms ease, color 200ms ease;
}
.card:hover .chev {
  color: var(--accent);
  transform: translateX(4px);
}

.card.placeholder {
  opacity: 0.55;
  pointer-events: none;
  border-style: dashed;
}

/* ---------- Experiment page ---------- */

.experiment-head {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.experiment-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.experiment-head h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.experiment-head p {
  color: var(--fg-dim);
  max-width: 70ch;
  margin: 0;
  line-height: 1.6;
}

.lab {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

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

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-elev);
  overflow: hidden;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 18px 18px 10px;
}
.panel h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.control {
  margin-bottom: 14px;
}
.control .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.control label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-dim);
}
.control .val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.control input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-soft);
  border-radius: 2px;
  outline: none;
}
.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(124, 212, 255, 0.5);
}
.control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(124, 212, 255, 0.5);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.btn-row .btn {
  flex: 1;
  justify-content: center;
  padding: 9px 10px;
  font-size: 12.5px;
}

.readout {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.7;
}
.readout .k { color: var(--fg-mute); }
.readout .v { color: var(--fg); }
.readout-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}
.readout-row span:first-child { color: var(--fg-mute); }
.readout-row span:last-child  { color: var(--fg); }

.notes {
  margin-top: 28px;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 72ch;
  font-size: 15px;
}
.notes h3 {
  color: var(--fg);
  margin: 24px 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.notes code {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  color: var(--accent);
}
