/* ==============================================
   BIRTHDAY SURPRISE — Mobile-First CSS
   ============================================== */

/* === RESET & TOKENS === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0610;
  --bg2:         #120920;
  --rose:        #c9526a;
  --rose-l:      #e8849a;
  --rose-pale:   #f2c2cc;
  --gold:        #d4a843;
  --gold-l:      #f0d080;
  --cream:       #fdf6f0;
  --txt:         #f5e6ea;
  --txt-muted:   #b89aaa;
  --glass:       rgba(255,255,255,0.04);
  --glass-bd:    rgba(255,255,255,0.10);
  --rose-glow:   rgba(201,82,106,0.35);
  --r-sm:        16px;
  --r-md:        20px;
  --r-lg:        28px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================
   OPENING SCREEN
   ========================================= */
.opening-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, #1c0d2e 0%, var(--bg) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.opening-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.floating-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* --- Opening Content --- */
.opening-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 420px;
  width: 100%;
  animation: fadeUp 1.2s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Petal ring */
.petal-ring {
  display: flex;
  gap: 0.6rem;
  font-size: 1.3rem;
  animation: spin 10s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.petal-ring span {
  animation: pulse 2s ease-in-out infinite alternate;
}
.petal-ring span:nth-child(even) { animation-delay: 0.4s; }
@keyframes pulse {
  from { opacity: 0.5; transform: scale(0.85); }
  to   { opacity: 1;   transform: scale(1.1);  }
}

.opening-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.9rem, 3.5vw, 1.05rem);
  color: var(--rose-pale);
  letter-spacing: 0.08em;
}

.opening-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 10vw, 4.5rem);
  font-weight: 300;
  color: var(--cream);
  text-shadow: 0 0 40px var(--rose-glow);
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.opening-hint {
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  color: var(--txt-muted);
  letter-spacing: 0.06em;
  margin-top: -0.2rem;
}

/* Open Button */
.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.9rem 2.2rem;
  background: linear-gradient(135deg, var(--rose) 0%, #7a2538 100%);
  color: #fff;
  border: 1px solid var(--rose-l);
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.9rem, 4vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 28px var(--rose-glow);
  min-height: 52px; /* bigger tap target */
}
.open-btn:hover, .open-btn:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 48px rgba(201,82,106,0.65);
  outline: none;
}
.open-btn:active { transform: scale(0.96); }

.btn-icon { font-size: 1.1em; }

.opening-date {
  font-size: clamp(0.7rem, 2.8vw, 0.78rem);
  color: var(--txt-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* =========================================
   CONFETTI
   ========================================= */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  display: none;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 55%, #0d0716 100%);
  min-height: 100vh;
  padding-bottom: 3rem;
}
.main-content.hidden  { display: none; }
.main-content.visible { display: block; animation: fadeUp 1.4s ease forwards; }

/* =========================================
   SHARED UTILITIES
   ========================================= */
.deco-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 1.1rem;
  margin-bottom: 1.4rem;
}
.deco-row.sm { font-size: 0.95rem; }
.deco-row.sm .deco-line { width: 40px; }

.deco-line {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4rem) 1.25rem 1.5rem;
}

.header-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  color: var(--rose-pale);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  font-weight: 300;
  color: var(--cream);
  text-shadow: 0 0 28px var(--rose-glow);
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.header-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 7vw, 2.8rem);
  font-weight: 600;
  background: linear-gradient(135deg, var(--rose-l), var(--gold-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
}

/* =========================================
   LOVE LETTER
   ========================================= */
.letter-section {
  max-width: 660px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.letter-card {
  background: var(--glass);
  border: 1px solid var(--glass-bd);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 6vw, 2.8rem) clamp(1.2rem, 5vw, 2.5rem);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 50px rgba(201,82,106,0.10), 0 2px 16px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.letter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(201,82,106,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.letter-greeting {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 5vw, 1.4rem);
  color: var(--rose-pale);
  margin-bottom: 1.2rem;
}

.letter-body {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.letter-body p {
  font-size: clamp(0.88rem, 3.5vw, 1rem);
  line-height: 1.85;
  color: var(--txt);
  font-weight: 300;
}
.letter-body em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--rose-l);
  font-size: 1.05em;
}

.letter-signature {
  text-align: right;
  margin-top: 1.8rem;
}
.sig-label {
  font-style: italic;
  color: var(--txt-muted);
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  margin-bottom: 0.2rem;
}
.sig-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 4.5vw, 1.3rem);
  background: linear-gradient(135deg, var(--rose-l), var(--gold-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================
   SORRY SECTION
   ========================================= */
.sorry-section {
  max-width: 660px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.sorry-card {
  background: linear-gradient(135deg, rgba(201,82,106,0.08), rgba(212,168,67,0.05));
  border: 1px solid rgba(201,82,106,0.25);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 6vw, 2.5rem) clamp(1.2rem, 5vw, 2.2rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.sorry-card::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 180%;
  background: radial-gradient(ellipse at center, rgba(201,82,106,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.sorry-icon {
  font-size: clamp(2rem, 8vw, 2.8rem);
  display: block;
  margin-bottom: 0.8rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.sorry-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.sorry-text {
  font-size: clamp(0.85rem, 3.5vw, 0.97rem);
  line-height: 1.85;
  color: var(--txt-muted);
  margin-bottom: 0.9rem;
}
.sorry-text strong {
  color: var(--rose-pale);
  font-weight: 600;
}

.sorry-promise {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: rgba(201,82,106,0.12);
  border: 1px solid rgba(201,82,106,0.3);
  border-radius: 50px;
}
.promise-icon { font-size: 1rem; }
.promise-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  color: var(--rose-pale);
  letter-spacing: 0.05em;
}

/* =========================================
   WISHES
   ========================================= */
.wishes-section {
  max-width: 660px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  text-align: center;
}

.wishes-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 5.5vw, 1.9rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1.3rem;
  letter-spacing: 0.04em;
}

.wishes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* 3 columns on wider phones / tablets */
@media (min-width: 480px) {
  .wishes-grid { grid-template-columns: repeat(3, 1fr); }
}

.wish-card {
  background: var(--glass);
  border: 1px solid var(--glass-bd);
  border-radius: var(--r-md);
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.wish-card:hover, .wish-card:active {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(201,82,106,0.2);
  border-color: rgba(201,82,106,0.4);
}

.wish-icon { font-size: clamp(1.5rem, 6vw, 1.8rem); }
.wish-text {
  font-size: clamp(0.75rem, 3vw, 0.85rem);
  color: var(--txt-muted);
  text-align: center;
  line-height: 1.4;
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.footer-text {
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  color: var(--txt-muted);
  margin-bottom: 0.25rem;
}
.footer-date {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  color: var(--rose);
  letter-spacing: 0.1em;
}

/* =========================================
   SAFE AREA (notch support)
   ========================================= */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
  .opening-content { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
}

/* =========================================
   MUSIC BUTTON
   ========================================= */
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 82, 106, 0.5), 0 4px 20px rgba(201, 82, 106, 0.3); }
  50%       { box-shadow: 0 0 0 10px rgba(201, 82, 106, 0), 0 4px 20px rgba(201, 82, 106, 0.5); }
}
@keyframes noteFloat {
  0%   { transform: translateY(0)  rotate(-10deg) scale(1);    opacity: 1; }
  100% { transform: translateY(-28px) rotate(10deg) scale(0.7); opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.music-btn {
  position: fixed;
  bottom: 1.6rem;
  right: 1.4rem;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 82, 106, 0.5);
  background: rgba(18, 9, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 20px rgba(201, 82, 106, 0.25);
}
.music-btn:hover {
  transform: scale(1.12);
  background: rgba(201, 82, 106, 0.2);
  border-color: var(--rose);
}
.music-btn.playing {
  border-color: var(--rose);
  background: rgba(201, 82, 106, 0.15);
  animation: musicPulse 2s ease-in-out infinite;
}
.music-btn.playing .music-icon {
  display: inline-block;
  animation: spin 4s linear infinite;
}
.music-btn:active {
  transform: scale(0.93);
}
