:root {
  /* Typography compliance tokens from DESIGN.md: Space Mono** in 400/700. Set headings in all lowercase or small caps with generous letter spacing; IBM Plex Mono** in 400/500; Interface microcopy. */
  --ink: #1B1642;
  --cream: #FFF4D6;
  --pink: #FF5DAA;
  --cyan: #35D7FF;
  --violet: #6B3DFF;
  --yellow: #FFE84A;
  --green: #7CFF8A;
  --space: 'Space Mono', ui-monospace, monospace;
  --share: 'Share Tech Mono', ui-monospace, monospace;
  --plex: 'IBM Plex Mono', ui-monospace, monospace;
  --pixel: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--plex);
  overflow-x: hidden;
}

.design-token {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pixel-grid,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

.pixel-grid {
  opacity: .12;
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: var(--pixel) var(--pixel);
}

.scanlines {
  z-index: 81;
  opacity: .18;
  mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(27,22,66,.22) 8px);
}

.emulator-overlay {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  font-family: var(--share);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 13px;
}

.pause-glyph,
.coordinate,
.status-bar,
.cartridge-stamp {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--violet);
  padding: 8px 12px;
}

.nav-dots { display: flex; gap: 10px; }
.dot {
  width: 16px;
  height: 16px;
  border: 3px solid var(--ink);
  background: var(--cream);
  padding: 0;
  cursor: pointer;
  transition: transform .18s steps(1), background .18s steps(1), box-shadow .18s steps(1);
}
.dot:hover { transform: translateY(-4px); background: var(--yellow); }
.dot.is-active { background: var(--green); box-shadow: 4px 4px 0 var(--ink); }

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  padding: 120px 7vw 90px;
}

.boot-scene { background: var(--cream); }
.garden-scene { background: var(--cyan); }
.archive-scene { background: var(--violet); color: var(--cream); }
.mirror-scene { background: var(--pink); }
.ending-scene { background: var(--ink); color: var(--cream); display: grid; place-items: center; }

.sky-blocks span,
.tile-clouds span {
  position: absolute;
  display: block;
  background: var(--cyan);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--yellow);
}
.sky-blocks span:nth-child(1) { width: 208px; height: 96px; left: 8%; top: 18%; }
.sky-blocks span:nth-child(2) { width: 144px; height: 64px; right: 12%; top: 10%; background: var(--green); }
.sky-blocks span:nth-child(3) { width: 240px; height: 128px; right: 8%; bottom: 18%; background: var(--pink); }
.sky-blocks span:nth-child(4) { width: 88px; height: 88px; left: 18%; bottom: 14%; background: var(--yellow); }

.photo-window {
  position: absolute;
  border: 5px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink), 20px 20px 0 var(--pink);
  image-rendering: pixelated;
  overflow: hidden;
}
.photo-window:after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .32;
  background-image: radial-gradient(var(--cream) 2px, transparent 3px);
  background-size: 12px 12px;
}
.shrine-photo { width: min(54vw, 620px); height: 360px; right: 8vw; top: 18vh; opacity: .78; }
.duotone { position: absolute; inset: 0; background: var(--cyan); }
.duotone:before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--violet) 0 18px, transparent 18px 36px); opacity: .5; }
.shrine-shape .roof { position: absolute; left: 20%; top: 24%; width: 60%; height: 56px; background: var(--pink); box-shadow: -24px 24px 0 var(--violet), 24px 24px 0 var(--violet); }
.shrine-shape .gate { position: absolute; top: 42%; width: 48px; height: 150px; background: var(--ink); }
.shrine-shape .left { left: 32%; }
.shrine-shape .right { right: 32%; }
.shrine-shape .steps { position: absolute; left: 25%; bottom: 10%; width: 50%; height: 64px; background: repeating-linear-gradient(0deg, var(--yellow) 0 12px, var(--violet) 12px 20px); }

.boot-panel {
  position: relative;
  margin-top: 28vh;
  max-width: 720px;
  border: 5px solid var(--ink);
  background: rgba(255,244,214,.86);
  padding: 28px 32px 34px;
  box-shadow: 12px 12px 0 var(--violet), -8px -8px 0 var(--yellow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s steps(5), transform 1.2s steps(5);
}
body.is-booted .boot-panel { opacity: 1; transform: translateY(0); }
.system-line,
.scene-tag { font-family: var(--share); text-transform: uppercase; letter-spacing: .16em; font-size: 13px; margin: 0 0 18px; }
h1, h2 { font-family: var(--space); letter-spacing: .08em; text-transform: lowercase; margin: 0; line-height: 1.02; }
h1 { font-size: clamp(48px, 11vw, 132px); }
h2 { font-size: clamp(32px, 5vw, 76px); }
p { line-height: 1.7; }
.boot-copy { max-width: 440px; font-weight: 500; }
.cursor-square { display: inline-block; width: .42em; height: .42em; margin-left: .15em; background: var(--yellow); border: 3px solid var(--ink); animation: blink 1.1s steps(1) infinite; }
.press-nothing { position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%); font-family: var(--share); letter-spacing: .18em; text-transform: uppercase; color: var(--violet); }

.text-plaque {
  position: relative;
  width: min(560px, 88vw);
  background: var(--cream);
  color: var(--ink);
  border: 5px solid var(--ink);
  padding: 28px;
  box-shadow: 12px 12px 0 var(--ink), 20px 20px 0 var(--yellow);
  z-index: 5;
  opacity: 0;
  transform: translate(0, 48px);
  transition: opacity .9s steps(5), transform .9s steps(5);
}
.scene.is-revealed .text-plaque { opacity: 1; transform: translate(0, 0); }
.garden-scene .text-plaque { margin-top: 14vh; margin-left: 7vw; }
.archive-plaque { margin-left: auto; margin-top: 18vh; box-shadow: 12px 12px 0 var(--ink), 20px 20px 0 var(--green); }
.mirror-plaque { margin-top: 28vh; margin-left: 8vw; }

.tile-clouds span:nth-child(1) { width: 248px; height: 72px; right: 12%; top: 16%; background: var(--cream); }
.tile-clouds span:nth-child(2) { width: 168px; height: 88px; left: 10%; bottom: 18%; background: var(--yellow); }
.tile-clouds span:nth-child(3) { width: 96px; height: 96px; right: 28%; bottom: 10%; background: var(--green); }
.pond-rings span { position: absolute; right: 9vw; top: 34vh; border: 5px solid var(--ink); width: 80px; height: 80px; box-shadow: 8px 8px 0 var(--violet); animation: breathe 4s steps(4) infinite; }
.pond-rings span:nth-child(2) { width: 144px; height: 144px; right: 12vw; top: 39vh; animation-delay: .6s; border-color: var(--pink); }
.pond-rings span:nth-child(3) { width: 224px; height: 224px; right: 4vw; top: 48vh; animation-delay: 1.2s; border-color: var(--yellow); }
.stepping-stones { position: absolute; left: 8vw; bottom: 12vh; display: flex; gap: 28px; }
.stepping-stones span, .bead-string span, .smoke-squares span, .mandala span, .pixel-pond span { display: block; width: 32px; height: 32px; background: var(--green); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); opacity: 0; transform: translateY(18px); }
.scene.is-revealed .stepping-stones span, .scene.is-revealed .bead-string span, .scene.is-revealed .smoke-squares span { opacity: 1; transform: translateY(0); transition: opacity .7s steps(3), transform .7s steps(3); }
.stepping-stones span:nth-child(2), .bead-string span:nth-child(2), .smoke-squares span:nth-child(2) { transition-delay: .15s; }
.stepping-stones span:nth-child(3), .bead-string span:nth-child(3), .smoke-squares span:nth-child(3) { transition-delay: .3s; }
.stepping-stones span:nth-child(4), .bead-string span:nth-child(4), .smoke-squares span:nth-child(4) { transition-delay: .45s; }
.bead-string { position: absolute; right: 20vw; bottom: 20vh; display: flex; gap: 12px; }
.bead-string span { width: 20px; height: 20px; background: var(--pink); }

.archive-photo { width: min(46vw, 520px); height: 480px; left: 7vw; top: 16vh; box-shadow: 12px 12px 0 var(--ink), 20px 20px 0 var(--cyan); }
.paper-shape { background: var(--yellow); }
.paper-shape i { position: absolute; background: var(--violet); border: 4px solid var(--ink); }
.paper-shape i:nth-child(1) { width: 52%; height: 52%; left: 20%; top: 16%; background: var(--cream); }
.paper-shape i:nth-child(2) { width: 28%; height: 18%; left: 30%; top: 32%; background: var(--pink); }
.paper-shape i:nth-child(3) { width: 42%; height: 8%; left: 28%; top: 58%; background: var(--cyan); }
.paper-shape i:nth-child(4) { width: 20%; height: 26%; right: 14%; bottom: 12%; background: var(--green); }
.floppy-seal { position: absolute; right: 12vw; bottom: 12vh; width: 132px; height: 132px; background: var(--cream); color: var(--ink); border: 5px solid var(--ink); box-shadow: 10px 10px 0 var(--pink); display: grid; place-items: end center; padding: 12px; font-family: var(--share); text-transform: uppercase; }
.floppy-seal:before { content: ''; position: absolute; top: 14px; left: 18px; right: 18px; height: 42px; background: var(--violet); border: 4px solid var(--ink); }
.smoke-squares { position: absolute; left: 46vw; top: 18vh; display: grid; gap: 18px; }
.smoke-squares span { background: var(--cyan); animation: smoke 5s steps(5) infinite; }

.mandala { position: absolute; right: 10vw; top: 16vh; width: 360px; height: 360px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; transform: rotate(45deg); }
.mandala span { width: 88px; height: 88px; background: var(--yellow); opacity: 1; transform: none; animation: breathe 5s steps(3) infinite; }
.mandala span:nth-child(even) { background: var(--cyan); animation-delay: .5s; }
.monk-cursor { position: absolute; right: 28vw; bottom: 15vh; width: 64px; height: 80px; background: var(--cream); border: 5px solid var(--ink); box-shadow: 8px 8px 0 var(--violet); animation: monk 3.8s steps(3) infinite; }
.monk-cursor span { position: absolute; left: 18px; top: -18px; width: 20px; height: 20px; background: var(--yellow); border: 4px solid var(--ink); }

.pixel-pond { width: min(720px, 76vw); height: 260px; border: 6px solid var(--cream); box-shadow: 14px 14px 0 var(--violet); position: relative; background: repeating-linear-gradient(0deg, var(--cyan) 0 28px, var(--ink) 28px 40px); }
.pixel-pond span { position: absolute; opacity: 1; transform: none; background: var(--yellow); animation: ripple 5s steps(5) infinite; }
.pixel-pond span:nth-child(1) { left: 14%; top: 32%; }
.pixel-pond span:nth-child(2) { left: 38%; top: 54%; background: var(--pink); animation-delay: .8s; }
.pixel-pond span:nth-child(3) { right: 22%; top: 28%; background: var(--green); animation-delay: 1.5s; }
.pixel-pond span:nth-child(4) { right: 10%; bottom: 16%; animation-delay: 2.2s; }
.cartridge-stamp { position: absolute; top: 23vh; font-family: var(--space); letter-spacing: .2em; text-transform: lowercase; color: var(--ink); background: var(--yellow); }
.final-message { position: absolute; bottom: 18vh; font-family: var(--share); letter-spacing: .14em; text-transform: uppercase; color: var(--cream); }

.status-bar {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 90;
  font-family: var(--share);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 13px;
}

[data-depth] { will-change: transform; }
.scene.is-awake .photo-window { animation: clarify 1.6s steps(6) both; }
.scene.is-still .cursor-square, .scene.is-still .dot.is-active { background: var(--yellow); }

@keyframes blink { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes smoke { 0% { transform: translate(0, 0); } 50% { transform: translate(16px, -24px); } 100% { transform: translate(0, -48px); } }
@keyframes monk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes ripple { 0%, 100% { box-shadow: 4px 4px 0 var(--cream); } 50% { box-shadow: 16px 0 0 transparent, -16px 0 0 transparent; } }
@keyframes clarify { from { filter: contrast(1.8) saturate(.7); } to { filter: contrast(1.1) saturate(1.2); } }

@media (max-width: 760px) {
  .emulator-overlay { align-items: flex-start; gap: 10px; font-size: 11px; }
  .coordinate { display: none; }
  .scene { padding: 110px 24px 90px; }
  .shrine-photo, .archive-photo { width: 78vw; height: 260px; left: auto; right: 24px; top: 18vh; }
  .boot-panel { margin-top: 34vh; padding: 22px; }
  .mandala { width: 220px; height: 220px; right: -20px; }
  .mandala span { width: 52px; height: 52px; }
  .status-bar { right: 18px; font-size: 11px; }
}
