@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");
:root {
  --bg: #07090a;
  --panel: #101417;
  --ink: #eef6f0;
  --muted: #a8b8ae;
  --line: #2a3830;
  --green: #5dff7a;
  --amber: #e8b86a;
  --red: #ff5d5d;
  --serif: "Space Grotesk", system-ui, sans-serif;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "Space Grotesk", ui-monospace, Menlo, Consolas, monospace;
  --pad: clamp(16px, 4vw, 28px);
  --max: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  background: #0a0c0d url("/images/bg/desk.jpg") center top / cover fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,12,13,0.72), rgba(10,12,13,0.88) 40%, rgba(10,12,13,0.94)),
    linear-gradient(90deg, transparent 0 48px, rgba(93,255,122,0.12) 48px 49px, transparent 49px 96px),
    linear-gradient(transparent 0 48px, rgba(93,255,122,0.08) 48px 49px, transparent 49px 96px);
  background-size: auto, 96px 96px, 96px 96px;
}
.panel {
  position: relative; margin-top: 28px; padding: 36px 24px;
  background: center / cover no-repeat;
  border: 1px solid var(--line); overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(10,12,13,0.72);
}
.panel > * { position: relative; z-index: 1; }
.panel.desk { background-image: url("/images/bg/desk.jpg"); }
.panel.circuit { background-image: url("/images/bg/circuit.jpg"); }
.panel.candles { background-image: url("/images/bg/candles.jpg"); }
.panel.terminal { background-image: url("/images/bg/terminal.jpg"); }
a { color: inherit; text-decoration: none; }
.bar, main, footer { position: relative; z-index: 2; }

.bar {
  position: sticky; top: 0; z-index: 8;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px var(--pad);
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(10, 12, 13, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.bar nav { justify-self: center; }
.mark {
  font-family: var(--mono); letter-spacing: 0.12em; font-size: 15px;
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
}
.mark::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
}
.menu-btn {
  display: none; width: 44px; height: 44px; justify-self: end;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-family: var(--mono); font-size: 18px; cursor: pointer;
}
.bar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bar nav a {
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 8px 14px; min-height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center;
}
.bar nav a:hover, .bar nav a.on { color: var(--green); background: rgba(93,255,122,0.08); }

main { width: min(var(--max), calc(100% - 2 * var(--pad))); margin: 0 auto; }
section { padding: clamp(36px, 6vw, 72px) 0; }
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }
.kicker {
  margin: 0 0 12px; font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--green);
}
h1, h2 { margin: 0 0 16px; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
h1 { font-size: clamp(48px, 8vw, 88px); line-height: 0.92; }
h2 { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.05; }
.lede { font-size: clamp(17px, 2vw, 19px); max-width: 46ch; color: #d5e4da; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
p { color: #d5e4d7; max-width: 62ch; }
.lede { font-size: clamp(17px, 2.1vw, 20px); }

.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 28px; align-items: center; padding-top: 36px;
}
.hero-copy { text-align: left; }
.hero-copy p { margin-left: 0; }
.bust-wrap { position: relative; margin: 0; }
.bust-wrap img { width: 100%; height: auto; }
.bust-wrap .lamp {
  position: absolute; width: 28%; right: -4%; top: 8%;
  filter: drop-shadow(0 0 18px rgba(255,220,160,0.25));
}
.term-device { width: min(720px, 100%); margin: 12px auto 0; aspect-ratio: 1168 / 784; }
.page-device { width: min(420px, 100%); margin: 18px auto 0; aspect-ratio: 1168 / 784; }
.term-cut { left: 16%; top: 26%; width: 68%; height: 54%; border-radius: 6px; }
.module.part {
  text-align: left; transition: transform .18s ease, border-color .18s ease;
}
.module.part img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 10px; }
.module.part:hover { transform: translateY(-3px); border-color: var(--green); }
.module.part:active { transform: translateY(0); }
.stills {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 18px;
}
.stills figure { margin: 0; }
.stills img { width: 100%; height: 220px; object-fit: cover; border: 1px solid var(--line); }
.stills figcaption {
  margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.nitrous-block {
  background: #05070a;
  border: 1px solid #1c2420;
  border-radius: 14px;
  padding: 36px 24px;
  margin-top: 28px;
}
.nitrous-btn:hover { box-shadow: 0 8px 24px rgba(51,201,255,0.28); }
.nitrous-shot { margin: 0; }
.nitrous-shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; }
.nitrous-logo { width: 96px; height: auto; display: block; margin: 0 auto 16px; }
.nitrous-actions { justify-content: center; }
.job {
  display: inline-block; margin-top: 10px;
  font-family: var(--mono); font-size: 12px; color: var(--green);
}
.device { position: relative; margin: 0; overflow: hidden; isolation: isolate; }
.shell { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
.cut { position: absolute; overflow: hidden; background: #020403; z-index: 2; }
.cut canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.crt-cut { left: 14.2%; top: 12%; width: 71.5%; height: 72%; border-radius: 6px; }
.laptop-cut { left: 23.5%; top: 17.5%; width: 53%; height: 50%; border-radius: 3px; }
.page-device { width: min(420px, 100%); margin: 18px auto 0; aspect-ratio: 1168 / 784; }
.mod-art { width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; }
.parts { display: grid; grid-template-columns: 1.4fr 0.7fr 1.2fr; gap: 16px; align-items: center; margin-top: 12px; }
.parts img { width: 100%; height: auto; }
.floaters { position: relative; }
.floater {
  position: absolute; pointer-events: none; opacity: 0.9;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.45));
  background: transparent;
}
.floater.chip { width: 72px; top: -6px; left: 2%; }
.floater.diode { width: 34px; top: 18px; right: 6%; }
.floater.bracket { width: 84px; bottom: -18px; left: 1%; }
@media (max-width: 860px) { .floater { display: none; } }

/* hardware modules */
.modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.module {
  position: relative;
  background: linear-gradient(180deg, #14181b, #0d1012);
  border: 1px solid #2a3330;
  padding: 18px 18px 18px 22px;
  min-height: 140px;
  box-shadow: inset 0 0 0 1px rgba(93,255,122,0.04);
}
.module::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  background: repeating-linear-gradient(#5dff7a 0 6px, transparent 6px 10px);
  opacity: 0.7;
}
.module .leds { display: flex; gap: 6px; margin-bottom: 10px; }
.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #223028; box-shadow: inset 0 0 0 1px #0a0c0d;
}
.led.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.led.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.module h3 { margin: 0 0 8px; font-family: var(--sans); font-size: 24px; font-weight: 600; }
.module p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.module { border-radius: 14px; padding: 20px; }
.chip-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: 18px 0 0;
}
.chip-row img { height: auto; width: auto; max-height: 64px; background: transparent; }
.chip, .diode, .plate {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); padding: 8px 10px; background: #0d1113;
}
.chip svg, .diode svg, .plate svg { display: block; }

.card {
  position: relative;
  background: linear-gradient(180deg, #14181b, #0d1012);
  border: 1px solid #2a3330;
  padding: 18px;
  min-height: 120px;
}
.card:hover, .module:hover { border-color: var(--green); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 10px;
  border: 1px solid var(--green); color: #041208; background: var(--green);
  font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(93,255,122,0.22); }
.btn.ghost { background: rgba(10,12,13,0.55); color: var(--ink); border-color: #3d5c48; }
.btn.ghost:hover { background: rgba(93,255,122,0.08); box-shadow: none; }
.btn:focus-visible, .bar nav a:focus-visible, .menu-btn:focus-visible {
  outline: 2px solid var(--green); outline-offset: 3px;
}

footer {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin: 0 auto;
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; align-items: center; gap: 20px;
  flex-wrap: nowrap;
  font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center;
}
footer a { min-height: 0; display: inline-flex; align-items: center; }

.levels { display: grid; gap: 10px; margin-top: 24px; }
.level {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); padding: 14px 16px; min-height: 56px;
  font-family: var(--mono); font-size: 14px; background: #0d1113;
}
.level.locked { opacity: 0.45; pointer-events: none; }
.level .markdone { color: var(--green); }
.play {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 28px; padding-top: 28px; align-items: start;
}
.term {
  background: #020403; border: 1px solid var(--line); padding: 16px;
  font-family: var(--mono); font-size: 14px; white-space: pre-wrap; overflow-x: auto; color: #c8f5cf;
}
.choices { display: grid; gap: 8px; margin-top: 16px; }
.choices button, .field input, .field textarea, .field select {
  width: 100%; text-align: left; background: #0d1113; color: var(--ink);
  border: 1px solid var(--line); padding: 14px; min-height: 48px;
  font-family: var(--mono); font-size: 16px;
}
.field { display: grid; gap: 10px; margin-top: 16px; }
.msg { margin-top: 14px; font-family: var(--mono); font-size: 14px; }
.msg.ok { color: var(--green); }
.msg.bad { color: var(--amber); }
.lesson { margin-top: 16px; color: var(--muted); }
.checks label {
  display: flex; gap: 12px; align-items: center; margin: 6px 0; min-height: 44px;
  font-family: var(--mono); font-size: 15px;
}
.drop { opacity: 0; transform: translateY(-12px); animation: drop 0.6s ease forwards; }
.drop.d1 { animation-delay: .06s; } .drop.d2 { animation-delay: .12s; }
.drop.d3 { animation-delay: .18s; } .drop.d4 { animation-delay: .24s; }
@keyframes drop { to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .hero, .desk, .modules, .play, .parts, .stills { grid-template-columns: 1fr; }
  .stills img { height: 180px; }
  .hero-copy { text-align: center; }
  .hero-copy p { margin-left: auto; margin-right: auto; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .bar nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(10,12,13,0.98); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 16px;
  }
  .bar nav.open { display: flex; }
  .bar nav a { width: 100%; font-size: 16px; }
}
@media (max-width: 480px) {
  .actions, .btn { width: 100%; }
  .actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .drop { animation: none; opacity: 1; transform: none; }
  .screen-canvas { display: none; }
}
