:root {
  /* Inline SVG sparkle cursor (gold 4-point star, soft glow), hotspot at center */
  --sparkle-cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22g%22%20x%3D%22-60%25%22%20y%3D%22-60%25%22%20width%3D%22220%25%22%20height%3D%22220%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%220.8%22%20result%3D%22b%22%2F%3E%3CfeMerge%3E%3CfeMergeNode%20in%3D%22b%22%2F%3E%3CfeMergeNode%20in%3D%22SourceGraphic%22%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20filter%3D%22url(%23g)%22%20fill%3D%22%23ffd54f%22%20d%3D%22M11%2C2%20Q12.1%2C9.9%2020%2C11%20Q12.1%2C12.1%2011%2C20%20Q9.9%2C12.1%202%2C11%20Q9.9%2C9.9%2011%2C2%20Z%22%2F%3E%3C%2Fsvg%3E") 11 11, auto;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #06060f;
  cursor: var(--sparkle-cursor);
}

/* Keep the sparkle cursor everywhere, including over the counter text */
#wrapper, #bgwrap, #bg, #fx, #counter, #counter * {
  cursor: var(--sparkle-cursor);
}

#wrapper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 2.5s ease-out;
}

#wrapper.revealed {
  opacity: 1;
}

/* Parallax layer for the background image (scaled so edges never show) */
#bgwrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.05);
  will-change: transform;
  backface-visibility: hidden;
}

#bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('bg.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: scale(1.06);
  transition: transform 2.5s ease-out;
}

#wrapper.revealed #bg {
  transform: scale(1.0);
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ---------- Counter block ---------- */
#counter {
  position: fixed;
  left: 6vw;
  top: 56vh;
  max-width: 40vw;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(255, 180, 220, 0.35);
  opacity: 0;
  transform: translateY(20px);
  animation: counterIn 1.2s ease-out 1s forwards;
}

@keyframes counterIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Line 1: animated heading */
.heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 15px;
  color: #d9d9e8;
  white-space: nowrap;
}

.word-roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
}

.word-sizer {
  visibility: hidden;
}

.word {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
}

/* Line 2: live count-up */
.countup {
  display: flex;
  align-items: flex-start;
  margin-top: 18px;
}

.group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 82px;
}

.num {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 56px;
  line-height: 1;
  color: #ffb3d1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.num.tick {
  animation: numTick 150ms ease;
}

@keyframes numTick {
  from {
    opacity: 0.35;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #9a9ab0;
  text-align: center;
  margin-top: 8px;
}

.sep {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  margin: 6px 14px 0;
}

/* Line 3: next-birthday countdown */
.countdown {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: #b9b9d0;
  margin-top: 22px;
}

.countdown.today {
  color: #ffd54f;
  display: inline-block;
  transform-origin: left center;
  animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* ---------- Birthday mode (Piece 4a) ---------- */

/* Normal-day teaser line under the countdown */
.teaser {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: #8a8aa6;
  margin-top: 14px;
  animation: teaserPulse 4s ease-in-out infinite;
}

@keyframes teaserPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

/* Birthday-mode invitation (replaces the teaser) */
.invitation {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 26px;
  color: #ffd54f;
  text-shadow: 0 0 14px rgba(255, 213, 79, 0.5);
  margin-top: 16px;
  display: inline-block;
  transform-origin: left center;
  pointer-events: auto; /* the only clickable element in the counter block */
  cursor: var(--sparkle-cursor);
  animation: invitePulse 2.5s ease-in-out infinite;
}

@keyframes invitePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Full-screen black overlay for the camera-zoom fade */
#black-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
}

/* Warm grade laid over the code-drawn sky gradient once the sky scene is revealed */
#warm-grade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 80%, rgba(255, 180, 120, 0.10), rgba(0, 0, 0, 0) 60%);
  opacity: 0;
  pointer-events: none;
}

/* Sky-scene backdrop grade to match the warm main-scene palette */
#bg.sky {
  filter: brightness(1.06) saturate(1.08);
}

/* ---------- Seed planting opening (Piece 5) ---------- */

/* Sits above the tree scene and the counter, below the birthday-mode curtain
   (#black-overlay, z 60) and the wish layer — all of which only appear long
   after seed.js has removed this stage from the DOM. */
#seed-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

/* The night. Height, vignette and soft-edge mask are all computed in seed.js
   against the hill line; this element is only ever MOVED by transform, so the
   reveal costs a compositor shift and never a repaint of the scene beneath. */
#seed-veil {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

#seed-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Generous circular hit area centred on the seed. */
#seed-hit {
  position: fixed;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: auto;
  cursor: var(--sparkle-cursor);
  -webkit-tap-highlight-color: transparent;
}

#seed-hit:focus {
  outline: none;
}

#seed-hit:focus-visible {
  outline: 2px solid rgba(181, 123, 238, 0.6);
  outline-offset: 6px;
}

#seed-hint {
  position: fixed;
  transform: translateX(-50%);
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(11px, 1.05vw, 14px);
  letter-spacing: 0.42em;
  color: #d9b8ff;
  text-shadow: 0 0 10px rgba(181, 123, 238, 0.35);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

/* Soak up the trailing letter-spacing so the text stays optically centred. */
#seed-hint span {
  margin-right: -0.42em;
}

#seed-hint.in {
  animation: seedHintIn 1.4s ease-out forwards,
             seedHintPulse 3.4s ease-in-out 1.4s infinite;
}

@keyframes seedHintIn {
  from { opacity: 0; }
  to { opacity: 0.62; }
}

@keyframes seedHintPulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 0.34; }
}
