/* netherNode site. Every scene is a tall <section> whose .stage sticks to the viewport
   while its feature cards (.beat) scroll past; world.js paints the pixel art and moves
   the layers, the explorer and the monsters from the scroll position. */

@font-face { font-family: "Minecraft"; src: url("fonts/Minecraft-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Minecraft"; src: url("fonts/Minecraft-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --obsidian: #0c0814;
  --glass: rgba(16, 10, 28, 0.82);
  --rim: rgba(200, 162, 255, 0.28);
  --text: #f3edff;
  --muted: #b9acd4;
  --violet: #9b5cff;
  --violet-bright: #c8a2ff;
  --magenta: #d65cff;
  --success: #5ae3a8;
  --pixel: "Minecraft", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --beat: 92vh;       /* scroll length of one feature card; set by main.js */
}

* { box-sizing: border-box; }
html { background: var(--obsidian); } /* main.js glides the page itself */
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--violet-bright); }
code { font-family: var(--mono); font-size: 0.88em; background: rgba(155, 92, 255, 0.16); padding: 0.1em 0.35em; }
img { max-width: 100%; }

.skip { position: absolute; left: -999px; top: 0; z-index: 100; }
.skip:focus { left: 16px; top: 12px; background: var(--violet); color: #fff; padding: 8px 12px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: linear-gradient(rgba(12, 8, 20, 0.85), rgba(12, 8, 20, 0.55));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(200, 162, 255, 0.12);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 18px var(--pixel); margin-right: auto; }
.brand img { image-rendering: pixelated; }
.bar nav { display: flex; gap: 22px; }
.bar nav a { color: var(--muted); text-decoration: none; font: 15px var(--pixel); }
.bar nav a:hover, .bar nav a.on { color: var(--text); }
.gh { color: var(--muted); display: flex; }
.gh:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  --c: var(--violet);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  font: 18px var(--pixel); color: #fff; text-decoration: none;
  background: var(--c);
  border: 0;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.35), inset 4px 4px 0 rgba(255, 255, 255, 0.25), 0 6px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.35), inset 4px 4px 0 rgba(255, 255, 255, 0.25), 0 3px 0 rgba(0, 0, 0, 0.45); }
.btn-ghost { --c: rgba(30, 18, 52, 0.85); }
.btn-small { padding: 8px 14px; font-size: 15px; }

/* ---------- depth meter ---------- */
.depth {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40;
  font: 13px var(--pixel); color: var(--muted); transition: opacity 0.3s;
  text-align: right; pointer-events: none;
  background: rgba(12, 8, 20, 0.6); padding: 12px 14px 12px 16px; backdrop-filter: blur(4px);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}
.depth-y { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.depth-y b { font-weight: 400; display: inline-block; min-width: 3ch; }
.depth ol { list-style: none; margin: 0; padding: 0; border-right: 3px solid rgba(200, 162, 255, 0.25); }
.depth li { padding: 5px 12px 5px 0; position: relative; opacity: 0.55; transition: opacity 0.3s, color 0.3s; }
.depth li::after { content: ""; position: absolute; right: -7px; top: 50%; width: 9px; height: 9px; margin-top: -5px; background: #3a2b55; }
.depth li.on { opacity: 1; color: var(--text); }
.depth li.on::after { background: var(--violet-bright); box-shadow: 0 0 10px var(--violet); }

/* ---------- scenes ---------- */
.scene { position: relative; height: calc((var(--beats, 3) + 1) * var(--beat)); }

.beats { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.beat { height: var(--beat); display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(16px, 12vw, 200px) 0 16px; }
.beat:first-child { margin-top: 55vh; }
.beat.intro { margin-top: 0; height: 100vh; height: 100svh; justify-content: flex-end; position: relative; }
.card, .intro-card { pointer-events: auto; }

.card {
  width: min(500px, 100%);
  background: var(--glass);
  border: 2px solid var(--rim);
  padding: 26px 28px 24px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  opacity: 0.12; transform: translateY(24px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.beat.on .card { opacity: 1; transform: none; }
.card h2 { font: 26px/1.25 var(--pixel); margin: 6px 0 12px; letter-spacing: 0.01em; text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); }
.card p { margin: 0 0 12px; color: #e4dcf5; }
.kicker { font: 13px var(--pixel); text-transform: uppercase; letter-spacing: 0.08em; color: var(--violet-bright); margin: 0; }
.aside { font: 15px var(--pixel); color: var(--muted) !important; margin-top: 16px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 14px; }
.chips li { font: 14px var(--pixel); padding: 4px 10px; background: rgba(155, 92, 255, 0.18); border: 2px solid rgba(155, 92, 255, 0.45); }
.shot { display: block; width: 100%; padding: 0; margin-top: 6px; border: 2px solid rgba(0, 0, 0, 0.55); background: none; cursor: zoom-in; box-shadow: 0 0 0 2px var(--rim); }
.shot img { display: block; width: 100%; aspect-ratio: 1475 / 950; object-fit: cover; }
.shot:hover { box-shadow: 0 0 0 2px var(--violet-bright); }

.code-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px !important; }
.code-words span {
  font: 20px var(--pixel); padding: 6px 12px; color: #fff;
  background: linear-gradient(#7b3dff, #5a2fd0);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), inset 3px 3px 0 rgba(255, 255, 255, 0.2);
  animation: word 2.4s ease-in-out infinite;
}
.code-words span:nth-child(2) { animation-delay: 0.15s; }
.code-words span:nth-child(3) { animation-delay: 0.3s; }
.code-words span:nth-child(4) { animation-delay: 0.45s; }
@keyframes word { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-5px); } }

.term { margin: 6px 0 0; padding: 12px 14px; background: #07050c; border: 2px solid rgba(200, 162, 255, 0.18); overflow-x: auto; font: 12.5px/1.7 var(--mono); color: #d9cff0; }
.term code { background: none; padding: 0; font-size: inherit; }
.term span { color: var(--success); user-select: none; }

/* ---------- intro ---------- */
.intro-card { width: min(600px, 100%); padding: 28px 30px; background: rgba(16, 10, 30, 0.58); border: 2px solid rgba(200, 162, 255, 0.2); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); text-shadow: 0 2px 12px rgba(20, 8, 40, 0.5); }
.logo {
  font: 700 clamp(40px, 6vw, 80px)/1 var(--pixel); margin: 10px 0 18px; color: #fff;
  text-shadow: 0.06em 0.06em 0 #3b1d86, 0.12em 0.12em 0 rgba(0, 0, 0, 0.35);
  letter-spacing: 0.01em;
}
.logo.small { font-size: clamp(30px, 5vw, 52px); }
.intro .kicker { color: #fff; opacity: 0.9; }
.lede { font-size: 19px; line-height: 1.55; color: #fff; margin: 0 0 26px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.fine { font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-top: 18px; }
.scroll-hint { position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%); margin: 0; font: 15px var(--pixel); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); white-space: nowrap; }
.scroll-hint span { display: inline-block; animation: hint 1.4s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(5px); } }

/* ---------- the 3D world and its overlays ---------- */
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; image-rendering: pixelated; background: #0c0814; }
.no-webgl #world { background: linear-gradient(#251a55, #5a3e9c 40%, #c77ca3 70%, #2a0f4f); }
main { position: relative; z-index: 2; }
#wash { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: #000; }
#wash.portal { background: radial-gradient(circle at 50% 55%, #e6a8ff, #9b3cff 35%, #4b0f9e 75%, #22064a); }
#wash.void { background: radial-gradient(circle at 50% 50%, #3b1a5c, #12081d 60%, #030106); }
#progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 55; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--violet), var(--magenta)); box-shadow: 0 0 10px rgba(155, 92, 255, 0.7); pointer-events: none; }
#washText { position: fixed; left: 0; right: 0; top: 46%; z-index: 1; margin: 0; text-align: center; pointer-events: none; opacity: 0; font: clamp(24px, 4vw, 44px) var(--pixel); color: #fff; text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); }
#loading { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3; margin: 0; font: 14px var(--pixel); color: var(--muted); background: rgba(12, 8, 20, 0.7); padding: 6px 12px; }
#loading::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; background: var(--violet-bright); animation: blink 0.8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dropzone { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; background: rgba(12, 8, 20, 0.75); border: 4px dashed var(--violet-bright); }
.dropzone p { font: 28px var(--pixel); color: #fff; }
.dropping .dropzone { display: grid; }
.linkish { color: var(--violet-bright); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.skin-try { margin-top: 6px !important; }

/* ---------- finale ---------- */
.finale { position: relative; z-index: 25; background: linear-gradient(#040208, #0c0814 30%, #120a20); padding: 18vh 16px 0; text-align: center; }
.finale-inner { max-width: 880px; margin: 0 auto; }
.finale-icon { image-rendering: pixelated; filter: drop-shadow(0 0 30px rgba(155, 92, 255, 0.6)); }
.finale .lede { color: var(--muted); }
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 34px 0 26px; }
.platform {
  display: flex; flex-direction: column; gap: 6px; padding: 24px 18px; text-decoration: none; color: var(--text);
  background: var(--glass); border: 2px solid var(--rim); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, border-color 0.15s;
}
.platform:hover { transform: translateY(-4px); border-color: var(--violet-bright); }
.platform b { font: 24px var(--pixel); }
.platform span { color: var(--muted); font-size: 15px; }
.platform em { font: normal 13px var(--mono); color: var(--violet-bright); }
.platform.mine { border-color: var(--violet); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5), 0 0 40px rgba(155, 92, 255, 0.35); }
.platform.mine::before { content: "Your computer"; font: 12px var(--pixel); color: var(--success); }
.unsigned { text-align: left; max-width: 680px; margin: 0 auto 30px; background: rgba(255, 255, 255, 0.03); border: 2px solid rgba(200, 162, 255, 0.14); padding: 12px 18px; }
.unsigned summary { cursor: pointer; font: 15px var(--pixel); color: var(--muted); }
.unsigned li { margin: 8px 0; color: #ddd3f0; font-size: 15px; }
.source { max-width: 560px; margin: 0 auto; text-align: left; }
.source p { color: var(--muted); margin-bottom: 4px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin: 36px 0 0; font: 15px var(--pixel); }
.finale footer { margin-top: 90px; padding: 28px 0 36px; border-top: 1px solid rgba(200, 162, 255, 0.12); color: #8a7ea3; font-size: 13.5px; }
.finale footer p { margin: 4px 0; }

/* ---------- lightbox ---------- */
#lightbox { padding: 0; border: 2px solid var(--rim); background: #07050c; max-width: min(1200px, 94vw); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
#lightbox::backdrop { background: rgba(4, 2, 8, 0.82); backdrop-filter: blur(4px); }
#lightbox img { display: block; width: 100%; height: auto; }
#lightbox .close { position: absolute; right: 8px; top: 6px; width: 38px; height: 38px; font: 28px/1 var(--pixel); color: #fff; background: rgba(0, 0, 0, 0.6); border: 0; cursor: pointer; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .depth { display: none; }
  .beat { padding-right: clamp(16px, 6vw, 80px); }
}
@media (max-width: 900px) {
  .bar nav { display: none; }
  .platforms { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .bar { padding: 8px 16px; gap: 14px; }
  .beat { justify-content: center; align-items: flex-start; padding: 70px 16px 0; }
  .beat.intro { align-items: flex-start; padding-top: 84px; }
  .card { padding: 18px 18px 16px; }
  .card h2 { font-size: 21px; }
  .lede { font-size: 17px; }
  .shot { display: none; }
}

/* ---------- reduced motion: a still picture book ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
}
