:root {
  color-scheme: dark;
  --bg: #030204;
  --fg: #cfc6e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* the neon's glow hanging in the air: a soft violet-pink haze that spills in
   from the bottom-left corner over the dark space around the book */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 75% 85% at -6% 108%,
      rgba(176, 40, 255, 0.55) 0%,
      rgba(236, 50, 210, 0.36) 28%,
      rgba(255, 70, 150, 0.16) 52%,
      rgba(255, 150, 90, 0.05) 70%,
      rgba(0, 0, 0, 0) 85%);
}
.scene[data-lamp="sunset"]::after {
  background:
    radial-gradient(ellipse 75% 85% at -6% 108%,
      rgba(255, 170, 60, 0.66) 0%,
      rgba(255, 115, 25, 0.46) 28%,
      rgba(230, 70, 20, 0.22) 52%,
      rgba(160, 40, 10, 0.08) 70%,
      rgba(0, 0, 0, 0) 85%);
}
.scene[data-lamp="aura"]::after {
  background:
    radial-gradient(ellipse 75% 85% at -6% 108%,
      rgba(255, 80, 190, 0.58) 0%,
      rgba(200, 150, 245, 0.38) 26%,
      rgba(100, 220, 255, 0.24) 48%,
      rgba(120, 200, 255, 0.1) 66%,
      rgba(0, 0, 0, 0) 85%);
}
.scene:focus-visible { outline: 2px solid #8470ff; outline-offset: -4px; }

.fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
  font: 16px/1.5 "EB Garamond", Garamond, serif;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] { display: none !important; }

/* lamp switcher: three glowing swatches in the corner */
.lamps {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(10, 6, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.lamp {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}
.lamp:hover { opacity: 0.9; transform: scale(1.08); }
.lamp[aria-checked="true"] {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 14px 2px rgba(255, 200, 255, 0.45);
}
.lamp:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* "click to turn", floating below the book */
.turn-hint {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  margin: 0;
  font: italic 400 15px/1 "EB Garamond", Garamond, "Times New Roman", serif;
  letter-spacing: 0.04em;
  color: #d8d0ff;
  text-shadow: 0 0 6px rgba(150, 140, 255, 0.9), 0 0 16px rgba(150, 140, 255, 0.55);
  pointer-events: none;
  z-index: 2;
  transition: opacity 1.2s ease;
}
.turn-hint.done { opacity: 0; }
