:root {
  --bg-0: #020407;
  --bg-1: #060b13;
  --bg-2: #0b1421;
  --ink: #e3eeff;
  --ink-soft: rgba(196, 216, 244, 0.72);
  --accent-cool: #67ddff;
  --accent-calm: #7df4cb;
  --accent-warm: #ff9a63;
}

* {
  box-sizing: border-box;
}

html,
body,
.app {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  background: #000;
}

.screen {
  position: fixed;
  inset: 0;
}

.hidden {
  display: none !important;
}

.screen--menu {
  display: grid;
  place-items: center;
  background: #000;
}

.menu-backdrop {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(128% 96% at 50% 104%, rgba(27, 49, 80, 0.2) 0%, rgba(7, 17, 31, 0) 68%),
    radial-gradient(120% 90% at 14% 10%, rgba(20, 38, 58, 0.26) 0%, rgba(13, 27, 42, 0) 62%),
    linear-gradient(180deg, #03060c 0%, #07111f 36%, #0d1b2a 100%);
}

.menu-content {
  position: relative;
  z-index: 1;
  width: min(650px, 90vw);
  text-align: center;
  padding: 32px 24px;
}

.menu-kicker {
  margin: 0 0 12px;
  color: rgba(186, 209, 238, 0.66);
  font-size: 0.68rem;
  letter-spacing: 3.2px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  letter-spacing: 0.6px;
  font-weight: 500;
  font-family: "Bodoni MT", "Didot", "Palatino Linotype", serif;
  text-shadow: 0 0 24px rgba(103, 221, 255, 0.22);
}

.menu-subtitle {
  margin: 16px auto 28px;
  width: min(560px, 100%);
  color: rgba(204, 223, 247, 0.74);
  line-height: 1.55;
  font-size: 0.98rem;
}

.enter-btn {
  border: 1px solid rgba(131, 177, 225, 0.42);
  background: rgba(8, 16, 28, 0.45);
  color: var(--ink);
  min-width: 132px;
  padding: 10px 20px;
  font-size: 0.86rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 0 12px rgba(108, 158, 207, 0.12);
}

.enter-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(171, 211, 245, 0.62);
  background: rgba(10, 20, 35, 0.58);
  box-shadow: 0 0 16px rgba(125, 244, 203, 0.13);
}

.enter-btn:disabled {
  cursor: default;
  opacity: 0.65;
}

.menu-status {
  margin: 14px 0 0;
  min-height: 18px;
  font-size: 0.8rem;
  color: rgba(191, 212, 240, 0.78);
}

.screen--experience {
  background: #000;
}

/* Permanent atmospheric night base; this remains visible at all times. */
.bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-layer--night {
  z-index: 0;
  background:
    radial-gradient(142% 110% at 14% 10%, rgba(27, 49, 80, 0.4) 0%, rgba(7, 17, 31, 0) 56%),
    radial-gradient(130% 112% at 84% 12%, rgba(20, 38, 58, 0.38) 0%, rgba(13, 27, 42, 0) 58%),
    radial-gradient(110% 78% at 50% 105%, rgba(27, 49, 80, 0.28) 0%, rgba(7, 17, 31, 0) 64%),
    linear-gradient(180deg, #07111f 0%, #0d1b2a 34%, #14263a 68%, #1b3150 100%);
}

/* Warm dawn layer that emerges from the bottom and is driven by audio. */
.bg-layer--sunrise {
  --sunrise-opacity: 0;
  --sunrise-rise: 16%;
  --sunrise-scale: 0.62;
  --sunrise-brightness: 0.72;
  z-index: 1;
  opacity: var(--sunrise-opacity);
  transform: translateY(var(--sunrise-rise)) scaleY(var(--sunrise-scale));
  transform-origin: center bottom;
  mix-blend-mode: screen;
  filter: blur(13px) saturate(1.06) brightness(var(--sunrise-brightness));
  background:
    radial-gradient(136% 86% at 50% 118%, rgba(244, 211, 94, 0.72) 0%, rgba(242, 166, 90, 0.54) 24%, rgba(231, 111, 81, 0.38) 44%, rgba(216, 140, 154, 0.24) 58%, rgba(216, 140, 154, 0) 78%),
    linear-gradient(0deg, rgba(247, 197, 159, 0.34) 0%, rgba(242, 166, 90, 0.22) 18%, rgba(231, 111, 81, 0.16) 33%, rgba(216, 140, 154, 0.12) 45%, rgba(216, 140, 154, 0) 66%);
  transition: opacity 0.14s linear, transform 0.14s linear, filter 0.14s linear;
}

#visual-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Keep blooms as the visual hero above background/overlay layers. */
.bloom-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.idle-tooltip {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 6;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(150, 183, 218, 0.26);
  background: rgba(8, 17, 30, 0.36);
  color: rgba(220, 233, 249, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.7px;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.idle-tooltip.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bloom-sequence-canvas {
  position: absolute;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  opacity: 0;
  transform-origin: center bottom;
  will-change: opacity;
  transition: opacity 0.18s linear;
}

.experience-hud {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  z-index: 5;
  display: block;
  pointer-events: none;
  width: 60px;
  padding: 0;
  background: none;
  border: 0;
  backdrop-filter: none;
}

.mic-line {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(107, 219, 156, 0.72);
  box-shadow: 0 0 10px rgba(107, 219, 156, 0.42);
  transform-origin: center center;
}

.mic-label {
  font-size: 0.58rem;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(210, 233, 220, 0.62);
}

/* Organic side-vine audio indicator: thin stem + staggered leaves (not a bar fill). */
.vine-meter {
  --vine-height: 140px;
  --vine-sway: 0deg;
  --vine-glow: 0.12;
  --vine-growth: 0;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  height: auto;
  margin-left: 2px;
  transform-origin: center bottom;
  transform: rotate(var(--vine-sway));
}

.vine-stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3.4px;
  height: var(--vine-height);
  border-radius: 999px;
  transform: translateX(-50%) rotate(2deg);
  transform-origin: center bottom;
  background: linear-gradient(
    180deg,
    rgba(158, 233, 179, calc(0.16 + (var(--vine-glow) * 0.34))) 0%,
    rgba(81, 166, 106, calc(0.34 + (var(--vine-glow) * 0.3))) 44%,
    rgba(33, 82, 52, 0.84) 100%
  );
  box-shadow:
    0 0 10px rgba(108, 201, 139, calc(var(--vine-glow) * 0.34)),
    inset 0 0 4px rgba(220, 255, 232, calc(var(--vine-glow) * 0.2));
  transition: height 0.24s ease-out;
}

.vine-leaf {
  --leaf-scale: 1;
  --leaf-glow: 0.1;
  --leaf-nudge: 0px;
  --leaf-tilt: 0deg;
  position: absolute;
  left: 50%;
  width: 22px;
  height: 13px;
  border-radius: 75% 18% 70% 32%;
  transform-origin: center;
  transform: translate(calc(-50% + var(--leaf-nudge)), -50%) rotate(var(--leaf-tilt)) scale(var(--leaf-scale));
  background: radial-gradient(circle at 30% 30%, rgba(206, 255, 224, 0.74), rgba(104, 188, 134, 0.76) 52%, rgba(32, 79, 51, 0.88) 100%);
  box-shadow: 0 0 8px rgba(138, 255, 190, var(--leaf-glow));
  opacity: 0.78;
  transition: opacity 0.2s ease-out;
}

.vine-leaf--left {
  --leaf-tilt: -34deg;
}

.vine-leaf--right {
  --leaf-tilt: 34deg;
  border-radius: 18% 75% 32% 70%;
}

.vine-leaf--1 {
  bottom: calc((var(--vine-height) * 0.16));
}

.vine-leaf--2 {
  bottom: calc((var(--vine-height) * 0.3));
}

.vine-leaf--3 {
  bottom: calc((var(--vine-height) * 0.44));
}

.vine-leaf--4 {
  bottom: calc((var(--vine-height) * 0.58));
}

.vine-leaf--5 {
  bottom: calc((var(--vine-height) * 0.72));
}

.vine-leaf--6 {
  bottom: calc((var(--vine-height) * 0.86));
}

.vine-meter::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 10px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(118, 188, 136, calc(0.06 + (var(--vine-growth) * 0.14))), transparent 72%);
}

@media (max-width: 680px) {
  .menu-content {
    padding: 24px 14px;
  }

  .menu-kicker {
    letter-spacing: 2.4px;
  }

  .menu-subtitle {
    font-size: 0.92rem;
  }

  .idle-tooltip {
    bottom: 16px;
    font-size: 0.68rem;
  }

  .experience-hud {
    left: 10px;
    top: 0;
    bottom: 0;
    width: 54px;
  }

  .vine-meter {
    width: 50px;
    bottom: 0;
  }

}
