/* ══════════════════════════════════════════════════════════
   Pixel Sanctuary — style.css
   Dark, warm, pixel-art dreamy
══════════════════════════════════════════════════════════ */

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
button { border: none; cursor: pointer; }

/* ─── Vars ─── */
:root {
  --bg:    #06050f;
  --warm:  #f0b865;
  --dim:   #7a6a4a;
  --white: #ede8d8;
  --px:    'Press Start 2P', monospace;
  --vt:    'VT323', monospace;
}

html {
  background: var(--bg);
  color: var(--white);
  scroll-behavior: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-font-smoothing: none;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

/* ══════════════════════════════════════════════════════════
   CANVAS  — fixed, fills viewport, pixelated
══════════════════════════════════════════════════════════ */
#world-canvas {
  position: fixed;
  top: 0; left: 0;
  /* width/height set by JS */
  z-index: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;  /* Firefox */
}

/* ══════════════════════════════════════════════════════════
   VIGNETTE
══════════════════════════════════════════════════════════ */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(6,5,15,0.65) 100%
  );
}

/* CRT scanlines on top of everything */
#vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   ENTER OVERLAY
══════════════════════════════════════════════════════════ */
#enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(6,5,15,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.4s ease, visibility 1.4s ease;
}
#enter-overlay.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animated grid background */
.eo-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240,184,101,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,184,101,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-pan 25s linear infinite;
}
@keyframes grid-pan {
  to { background-position: 40px 40px; }
}

.eo-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0,0,0,0.1) 3px,
    rgba(0,0,0,0.1) 4px
  );
}

.eo-center {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.eo-badge {
  font-family: var(--px);
  font-size: 0.45rem;
  letter-spacing: 0.22em;
  color: var(--dim);
}

.eo-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.eo-diamond {
  font-size: 2.4rem;
  color: var(--warm);
  animation: diamond-pulse 3.5s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(240,184,101,0.6), 0 0 60px rgba(240,184,101,0.3);
}
@keyframes diamond-pulse {
  0%,100% { transform: scale(1) rotate(0deg);   opacity: 0.8; }
  50%      { transform: scale(1.1) rotate(5deg); opacity: 1;   }
}

.eo-title {
  font-family: var(--px);
  font-size: clamp(1.1rem, 3vw, 2.1rem);
  line-height: 1.9;
  color: var(--warm);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.8), 0 0 40px rgba(240,184,101,0.4);
}

.eo-sub {
  font-family: var(--vt);
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.eo-btn {
  font-family: var(--px);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--warm);
  padding: 16px 36px;
  border: 3px solid #fff;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.7), 0 0 30px rgba(240,184,101,0.5);
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  animation: btn-glow 2s ease-in-out infinite alternate;
}
@keyframes btn-glow {
  from { box-shadow: 5px 5px 0 rgba(0,0,0,.7), 0 0 20px rgba(240,184,101,.4); }
  to   { box-shadow: 5px 5px 0 rgba(0,0,0,.7), 0 0 50px rgba(240,184,101,.7); }
}
.eo-btn:hover {
  background: #ffd08a;
  transform: translate(-2px,-2px);
  box-shadow: 7px 7px 0 rgba(0,0,0,.7), 0 0 50px rgba(240,184,101,.8);
}
.eo-btn:active {
  transform: translate(3px,3px);
  box-shadow: 2px 2px 0 rgba(0,0,0,.7);
}

.eo-hint {
  font-family: var(--px);
  font-size: 0.7rem;
  color: var(--dim);
  animation: hint-blink 1.5s step-end infinite;
  opacity: 0.5;
}
@keyframes hint-blink {
  0%,100% { opacity: 0.5; }
  50%     { opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   HUD — audio button only
══════════════════════════════════════════════════════════ */
#hud {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.5s;
}
#hud.is-hidden { opacity: 0; pointer-events: none; }

.hud-audio {
  pointer-events: auto;
  font-family: var(--px);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  background: rgba(6,5,15,0.75);
  border: 1px solid rgba(240,184,101,0.2);
  padding: 8px 14px;
  transition: color 0.3s, border-color 0.3s;
}
.hud-audio:hover {
  color: var(--warm);
  border-color: rgba(240,184,101,0.5);
}
.hud-audio.is-muted { opacity: 0.4; }

/* ══════════════════════════════════════════════════════════
   SCROLL ROOT
══════════════════════════════════════════════════════════ */
#scroll-root {
  position: relative;
  z-index: 10;
  pointer-events: none;
}
#scroll-space { height: 2800vh; }

/* ══════════════════════════════════════════════════════════
   BREATH SCREEN — end of journey
══════════════════════════════════════════════════════════ */
#breath-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
}

.breath-eyebrow {
  font-family: var(--px);
  font-size: clamp(0.38rem, 1vw, 0.55rem);
  letter-spacing: 0.35em;
  color: var(--warm);
  opacity: 0.55;
}

.breath-orb {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,184,101,0.55) 0%, rgba(240,184,101,0.12) 55%, transparent 100%);
  box-shadow: 0 0 40px rgba(240,184,101,0.35), 0 0 80px rgba(240,184,101,0.15);
  animation: breath-pulse 4s ease-in-out infinite;
}

@keyframes breath-pulse {
  0%, 100% {
    transform: scale(0.65);
    box-shadow: 0 0 22px rgba(240,184,101,0.25), 0 0 44px rgba(240,184,101,0.1);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 70px rgba(240,184,101,0.6), 0 0 140px rgba(240,184,101,0.25);
  }
}

.breath-label {
  font-family: var(--px);
  font-size: clamp(0.45rem, 1.2vw, 0.7rem);
  letter-spacing: 0.4em;
  color: var(--white);
  opacity: 0.75;
  min-width: 10ch;
  text-align: center;
  transition: opacity 0.8s ease;
}

.breath-sub {
  font-family: var(--vt);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.12em;
  color: var(--dim);
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .eo-title { font-size: 1rem; }
  .eo-btn   { font-size: 0.55rem; padding: 14px 24px; }
}
