/* ==========================================================================
   FROZEN THEME - SAANVI'S 5TH BIRTHDAY INVITATION
   ULTRA-OPTIMIZED FOR MIDRANGE & HIGH-END MOBILE (60 FPS ZERO-LAG)
   ========================================================================== */

:root {
  --font-royal: 'Cinzel Decorative', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Frozen Palette */
  --bg-deep: #030814;
  --bg-dark: #07132b;
  --card-bg: #0c1e45;
  --card-border: #224b8c;
  --ice-cyan: #7df9ff;
  --ice-glow: #38bdf8;
  --frost-silver: #f1f5f9;
  --frozen-violet: #c084fc;
  --gold-glow: #fbbf24;

  /* Fast Transitions */
  --trans-fast: transform 0.25s ease, opacity 0.25s ease, background-color 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-deep);
  color: var(--frost-silver);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, #071536 0%, #040c21 50%, #020612 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LIGHTWEIGHT PARTICLE CANVAS
   ========================================================================== */
#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ==========================================================================
   FLOATING ACTION CONTROLS
   ========================================================================== */
.floating-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.control-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0d204a;
  border: 1.5px solid var(--ice-cyan);
  color: var(--ice-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: var(--trans-fast);
  position: relative;
}

.control-bubble:hover, .control-bubble:active {
  transform: scale(1.08);
  background: #143270;
  color: #ffffff;
}

.control-bubble.music-playing {
  color: var(--gold-glow);
  border-color: var(--gold-glow);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
}

.bubble-tooltip {
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  background: #081533;
  color: var(--ice-cyan);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.control-bubble:hover .bubble-tooltip {
  opacity: 1;
}

/* ==========================================================================
   PHASE 1: THE INVITATION ENVELOPE OPENING STAGE
   ========================================================================== */
.envelope-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  background: radial-gradient(circle at center, #0b1d47 0%, #061026 70%, #020612 100%);
  transition: opacity 0.5s ease, visibility 0.5s;
  padding: 20px;
}

.envelope-screen.unsealed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.envelope-card-preview {
  margin-bottom: 20px;
  text-align: center;
}

.preview-text {
  font-family: var(--font-royal);
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ice-cyan);
}

/* Envelope Geometry */
.envelope {
  position: relative;
  width: 100%;
  height: 260px;
  background: #0e2454;
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.envelope:hover {
  transform: translateY(-4px);
}

.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #09173d;
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  z-index: 3;
  border-bottom: 1px solid var(--card-border);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #143372;
  clip-path: polygon(0 0, 50% 55%, 100% 0);
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 4;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope-letter-peep {
  position: absolute;
  top: 25px;
  left: 6%;
  width: 88%;
  height: 210px;
  background: #f8fafc;
  border-radius: 8px;
  z-index: 2;
  transition: transform 0.6s ease;
}

.envelope.open .envelope-letter-peep {
  transform: translateY(-60px);
}

/* Glowing Pulsing Snowflake Seal Button */
@keyframes sealPulseLight {
  0% {
    box-shadow: 0 0 16px rgba(125, 249, 255, 0.7), 0 0 32px rgba(2, 132, 199, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1);
    border-color: #7df9ff;
  }
  50% {
    box-shadow: 0 0 38px rgba(125, 249, 255, 1), 0 0 75px rgba(56, 189, 248, 0.95), 0 0 115px rgba(192, 132, 252, 0.65), inset 0 0 20px rgba(255, 255, 255, 0.9);
    transform: translate(-50%, -50%) scale(1.08);
    border-color: #ffffff;
  }
  100% {
    box-shadow: 0 0 16px rgba(125, 249, 255, 0.7), 0 0 32px rgba(2, 132, 199, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1);
    border-color: #7df9ff;
  }
}

.ice-seal-button {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284c7 0%, #0369a1 100%);
  border: 2.5px solid var(--ice-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  animation: sealPulseLight 2.2s infinite ease-in-out;
  transition: transform 0.25s ease;
}

.ice-seal-button:hover, .ice-seal-button:active {
  transform: translate(-50%, -50%) scale(1.14);
}

.seal-snowflake {
  width: 46px;
  height: 46px;
  color: #ffffff;
}

.snowflake-svg {
  width: 100%;
  height: 100%;
}

.envelope-instruction {
  margin-top: 24px;
  text-align: center;
}

.instruction-title {
  font-family: var(--font-royal);
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 4px;
}

.instruction-subtitle {
  font-size: 0.9rem;
  color: var(--ice-cyan);
  font-weight: 500;
}

/* ==========================================================================
   PHASE 2: MAIN INVITATION CARD LAYOUT
   ========================================================================== */
.main-card-screen {
  position: relative;
  z-index: 20;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 30px 14px 60px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.main-card-screen.card-hidden {
  opacity: 0;
  display: none;
  pointer-events: none;
}

.invitation-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Solid Lightweight Cards (Zero-Lag on Mobile) */
.solid-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 28px 22px;
  overflow: hidden;
}

.ice-border-accent {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ice-cyan), var(--frozen-violet), var(--ice-cyan), transparent);
}
.top-border { top: 0; }
.bottom-border { bottom: 0; }

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-royal);
  font-size: 1.35rem;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.8px;
}

.snowflake-icon {
  font-size: 1.15rem;
}

/* ==========================================================================
   HEADER & CELEBRANT SPOTLIGHT
   ========================================================================== */
.header-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tiara-container {
  width: 75px;
  height: 42px;
  margin-bottom: 10px;
}

.tiara-svg {
  width: 100%;
  height: 100%;
}

.crest-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.crest-line {
  width: 40px;
  height: 1px;
  background: var(--ice-cyan);
}

.crest-text {
  font-family: var(--font-royal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--ice-cyan);
}

.intro-quote {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: #e0f2fe;
  margin-bottom: 8px;
}

.invitation-lead {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: #bfdbfe;
  max-width: 520px;
  margin-bottom: 18px;
}

.celebrant-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.celebrant-name {
  font-family: var(--font-royal);
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7df9ff;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
  line-height: 1.1;
  text-align: center;
}

.age-milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #6b21a8;
  border: 1px solid var(--ice-cyan);
  padding: 6px 20px;
  border-radius: 24px;
}

.milestone-text {
  font-family: var(--font-royal);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.milestone-star {
  font-size: 1rem;
}

/* Portrait Stage with Flanking 5-Tier Birthday Cakes */
.portrait-stage-wrapper {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin-top: 10px;
}

.flanking-cake {
  width: 95px;
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.5));
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.flanking-cake:hover {
  transform: scale(1.06);
}

.cake-svg {
  width: 100%;
  height: 100%;
}

.portrait-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portrait-ice-frame {
  position: relative;
  width: 230px;
  height: 340px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px;
}

.frame-crystal-border {
  position: absolute;
  inset: 0;
  border-radius: 110px 110px 24px 24px;
  background: #09173d;
  border: 2px solid var(--ice-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  z-index: 1;
}

.frame-gem {
  position: absolute;
  font-size: 1.15rem;
  z-index: 5;
}
.gem-tl { top: -6px; left: 16px; }
.gem-tr { top: -6px; right: 16px; }
.gem-bl { bottom: -4px; left: 8px; }
.gem-br { bottom: -4px; right: 8px; }

.portrait-img-container {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.saanvi-photo {
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
}

.portrait-caption {
  font-family: var(--font-royal);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--ice-cyan);
  margin-top: 10px;
}

/* ==========================================================================
   HEARTFELT INVITATION LETTER
   ========================================================================== */
.invitation-letter-card {
  text-align: center;
}

.letter-greeting {
  font-family: var(--font-royal);
  font-size: 1.25rem;
  color: var(--ice-cyan);
  margin-bottom: 12px;
}

.letter-text {
  font-size: 1rem;
  color: #e2e8f0;
  line-height: 1.7;
  margin-bottom: 12px;
}

.letter-signoff {
  font-size: 1rem;
  color: #93c5fd;
  font-weight: 500;
  margin-top: 14px;
  margin-bottom: 20px;
}

.family-signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
}

.signature-line {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: #bfdbfe;
}

.family-name {
  font-family: var(--font-royal);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
}

/* ==========================================================================
   COUNTDOWN TIMER
   ========================================================================== */
.countdown-section {
  text-align: center;
}

.countdown-subtitle {
  font-size: 0.9rem;
  color: #93c5fd;
  margin-bottom: 20px;
}

.timer-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timer-box {
  width: 64px;
  height: 64px;
  background: #09173d;
  border: 1.5px solid var(--ice-cyan);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-number {
  font-family: var(--font-royal);
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
}

.timer-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ice-cyan);
}

.timer-separator {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ice-cyan);
  margin-bottom: 20px;
}

.calendar-action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 25px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: #09173d;
  color: var(--frost-silver);
  transition: var(--trans-fast);
}

.card-btn:hover, .card-btn:active {
  background: #143270;
  border-color: var(--ice-cyan);
  color: #ffffff;
}

.primary-btn {
  background: #0284c7;
  border-color: var(--ice-cyan);
  color: #ffffff;
}

.primary-btn:hover, .primary-btn:active {
  background: #0369a1;
}

.secondary-btn {
  background: #0f172a;
}

/* ==========================================================================
   EVENT DETAILS GRID
   ========================================================================== */
.event-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 600px) {
  .event-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 18px;
}

.info-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #09173d;
  border: 1.5px solid var(--ice-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.info-icon {
  font-size: 1.35rem;
  color: var(--ice-cyan);
}

.info-card-title {
  font-family: var(--font-royal);
  font-size: 1.1rem;
  color: var(--ice-cyan);
  margin-bottom: 8px;
}

.info-highlight {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.info-detail {
  font-size: 0.92rem;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.info-subdetail {
  font-size: 0.82rem;
  color: var(--frozen-violet);
  font-weight: 500;
  margin-top: 4px;
}

.venue-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

/* ==========================================================================
   RSVP BANNER
   ========================================================================== */
.rsvp-section {
  text-align: center;
}

.rsvp-title {
  font-family: var(--font-royal);
  font-size: 1.5rem;
  color: #ffffff;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.rsvp-subtitle {
  font-size: 0.95rem;
  color: #bfdbfe;
  margin-bottom: 20px;
}

.rsvp-contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 580px;
  margin: 0 auto 20px;
}

@media (min-width: 560px) {
  .rsvp-contacts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.rsvp-contact-card {
  background: #09173d;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsvp-contact-header {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.rsvp-icon {
  font-size: 1.15rem;
  color: var(--ice-cyan);
  background: #0c2456;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ice-cyan);
  flex-shrink: 0;
}

.rsvp-contact-info {
  display: flex;
  flex-direction: column;
}

.rsvp-person-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--frozen-violet);
  font-weight: 700;
}

.phone-number {
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
}

.rsvp-button-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: #16a34a;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 20px;
  transition: var(--trans-fast);
}

.whatsapp-btn:hover, .whatsapp-btn:active {
  background: #15803d;
}

.call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: #075985;
  border: 1px solid var(--ice-cyan);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 20px;
  transition: var(--trans-fast);
}

.call-btn:hover, .call-btn:active {
  background: #0369a1;
}

.rsvp-note {
  font-size: 0.88rem;
  color: var(--ice-cyan);
  font-style: italic;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-section {
  text-align: center;
  padding: 20px 12px;
  background: #020612;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.footer-title {
  font-family: var(--font-royal);
  font-size: 0.98rem;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer-date {
  font-size: 0.85rem;
  color: var(--ice-cyan);
  margin-bottom: 2px;
}

.footer-copy {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0b1c42;
  border: 1.5px solid var(--ice-cyan);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  transition: var(--trans-fast);
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MOBILE SCREEN TUNING
   ========================================================================== */
@media (max-width: 480px) {
  .portrait-stage-wrapper {
    gap: 8px;
  }

  .flanking-cake {
    width: 58px;
    height: 120px;
    margin-bottom: 18px;
  }

  .portrait-ice-frame {
    width: 175px;
    height: 265px;
  }

  .timer-box {
    width: 54px;
    height: 54px;
  }

  .timer-number {
    font-size: 1.4rem;
  }

  .timer-label {
    font-size: 0.65rem;
  }

  .timer-separator {
    font-size: 1.3rem;
    margin-bottom: 14px;
  }

  .floating-controls {
    top: 12px;
    right: 12px;
    gap: 8px;
  }

  .control-bubble {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}
