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

:root {
  --gold:      #f0c060;
  --gold2:     #ffd98a;
  --cream:     #f5ede0;
  --dim:       rgba(245,237,224,0.6);
  --bg:        #000008;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ══════════════════════════════════════
   START SCREEN
══════════════════════════════════════ */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000008;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.4s ease, visibility 1.4s;
}
#start-screen.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#start-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

#start-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 0 24px;
}

/* Spinning rings */
.start-rings {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 8px;
}
.ring {
  position: absolute;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(240,192,96,0.35);
}
.r1 { width: 180px; height: 180px; animation: spin 22s linear infinite; border-style: dashed; }
.r2 { width: 130px; height: 130px; animation: spin 15s linear infinite reverse; }
.r3 { width: 80px;  height: 80px;  animation: spin 9s  linear infinite; border-style: dotted; }

@keyframes spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}

.start-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  line-height: 1.15;
  color: var(--cream);
  letter-spacing: 0.02em;
  animation: fadeIn 1.8s ease both;
}
.start-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: rgba(240,192,96,0.7);
  letter-spacing: 0.25em;
  animation: fadeIn 1.8s ease 0.3s both;
}
#start-btn {
  margin-top: 8px;
  padding: 16px 44px;
  background: transparent;
  border: 1px solid rgba(240,192,96,0.55);
  border-radius: 50px;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: all 0.35s ease;
  animation: fadeIn 1.8s ease 0.6s both;
}
#start-btn:hover {
  background: rgba(240,192,96,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(240,192,96,0.3), 0 0 80px rgba(240,192,96,0.1);
  transform: scale(1.04);
}

/* ══════════════════════════════════════
   MAIN CANVAS (night sky + lanterns)
══════════════════════════════════════ */
#main-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ══════════════════════════════════════
   POEM STAGE
══════════════════════════════════════ */
#poem-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#poem-text {
  width: 100%;
  max-width: 820px;
  padding: 0 32px;
  text-align: center;
  position: relative;
}

/* ── Individual poem lines ── */
.poem-line {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 6.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--cream);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition: opacity 1.4s cubic-bezier(0.16,1,0.3,1),
              transform 1.4s cubic-bezier(0.16,1,0.3,1),
              filter 1.4s ease;
  margin-bottom: 0.15em;
  will-change: opacity, transform, filter;
}
.poem-line.in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.poem-line.out {
  opacity: 0;
  transform: translateY(-24px);
  filter: blur(4px);
  transition: opacity 0.9s ease, transform 0.9s ease, filter 0.9s ease;
}

/* Variants */
.poem-line.title-line {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 3.2vw, 1.6rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240,192,96,0.75);
  font-weight: 300;
  margin-bottom: 0.6em;
}
.poem-line.italic { font-style: italic; }
.poem-line.gold   { color: var(--gold2); }
.poem-line.large  {
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  font-weight: 700;
  line-height: 1.2;
}
.poem-line.small  {
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  color: var(--dim);
  font-style: italic;
}
.poem-line.closing {
  font-size: clamp(2rem, 6.8vw, 3.8rem);
  font-style: italic;
  line-height: 1.4;
}
.poem-line.caption-line {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.75rem, 2.2vw, 1.05rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240,192,96,0.55);
  font-weight: 300;
  margin-top: 1.2em;
}

/* ══════════════════════════════════════
   MUSIC BUTTON
══════════════════════════════════════ */
#music-btn {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 2000;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(240,192,96,0.35);
  color: var(--gold);
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}
#music-btn:hover {
  background: rgba(240,192,96,0.15);
  border-color: var(--gold);
  transform: scale(1.1);
}
#music-btn.muted { color: rgba(240,192,96,0.35); }

/* ══════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   MOBILE TWEAKS
══════════════════════════════════════ */
@media (max-width: 480px) {
  #poem-text { padding: 0 22px; }
  .poem-line { font-size: clamp(1.7rem, 7.5vw, 2.6rem); }
  .poem-line.large { font-size: clamp(2rem, 9vw, 3rem); }
  .poem-line.closing { font-size: clamp(1.7rem, 7.5vw, 2.6rem); }
}