/* --- DESIGN SYSTEM: ORGANIC (LIGHT THEME) --- */

:root {
  /* Surface Earth Tones */
  --bg-sand: #E8DCC7;
  --bg-card: rgba(240, 234, 222, 0.65); /* Translucent warm oat */
  
  /* Text & Primary Structure */
  --primary-moss: #3C4735; /* Deep moss green */
  --text-dark: #2B3326;    /* Dark olive-black */
  
  /* Accents */
  --accent-sage: #7B8F75;  /* Sage green */
  --accent-clay: #B68668;  /* Warm clay */
  --accent-terracotta: #BE6146; /* Terracotta */
  --accent-gold: #C29F68;  /* Soft metallic gold */
  
  /* Typography Families */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Epilogue', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-sand);
  color: var(--text-dark);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

html {
  height: -webkit-fill-available;
}

/* Organic Grain Texture Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  filter: url(#noiseFilter);
  opacity: 0.18;
}

/* Ambient glow backgrounds */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.45;
}

.glow-1 {
  width: 50vw;
  height: 50vw;
  background-color: var(--accent-sage);
  top: -10vw;
  left: -10vw;
  animation: drift-slow 25s infinite alternate ease-in-out;
}

.glow-2 {
  width: 60vw;
  height: 60vw;
  background-color: var(--accent-clay);
  bottom: -20vw;
  right: -10vw;
  animation: drift-slow 30s infinite alternate-reverse ease-in-out;
}

/* Container */
.main-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
  z-index: 10;
}

.main-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Breathing Wreath Animation */
.wreath-container {
  width: 130px;
  height: 130px;
  margin-bottom: 2rem;
  position: relative;
}

.breathing-wreath {
  width: 100%;
  height: 100%;
  animation: breathe 8s infinite ease-in-out;
  transform-origin: center;
}

/* Typography Header */
.wedding-header {
  margin-bottom: 2.5rem;
}

.pre-heading {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-sage);
  margin-bottom: 0.75rem;
}

.names-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 300;
  color: var(--primary-moss);
  line-height: 1.1;
  font-style: italic;
  letter-spacing: -0.01em;
}

.ampersand {
  font-family: var(--font-serif);
  font-weight: 200;
  color: var(--accent-clay);
  display: inline-block;
  padding: 0 0.2rem;
}

.header-divider {
  width: 50px;
  height: 1px;
  background-color: var(--accent-gold);
  margin: 1.5rem auto 0 auto;
  opacity: 0.6;
}

/* Timer Section & Phase States */
.timer-section {
  display: none;
  width: 100%;
  animation: fade-in 0.8s ease forwards;
}

.timer-section.active {
  display: block;
}

.celebration-status {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--primary-moss);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

/* Glassmorphic Card Styles */
.timer-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  padding: 2.5rem 1.5rem;
  box-shadow: 0 20px 40px rgba(43, 51, 38, 0.06);
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  color: var(--accent-sage);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

/* Grid Layout for Countdown */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 1rem;
  width: 100%;
}

@media (max-width: 600px) {
  .grid-layout {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 0.75rem;
  }
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem;
}

.time-value {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  color: var(--primary-moss);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease;
}

.time-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-clay);
}

.ms-block .time-value {
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  color: var(--accent-terracotta);
}

/* Precise Grid Container & Romantic Header */
.precise-container {
  width: 100%;
  max-width: 800px;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.precise-romantic-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3.5vw, 1.8rem);
  font-style: italic;
  font-weight: 300;
  color: var(--accent-sage);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: none !important; /* Keep original casing */
}

/* Precise Grid Layout */
.precise-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}

@media (max-width: 768px) {
  .precise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Individual Elegant Card Items */
.precise-card-item {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  padding: 1.5rem 1rem;
  box-shadow: 0 10px 25px rgba(43, 51, 38, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s ease, 
              border-color 0.4s ease;
  will-change: transform, box-shadow;
  animation: float-micro 6s infinite ease-in-out alternate;
}

/* Stagger leaf float delays */
.precise-grid > .precise-card-item:nth-child(even) {
  animation-delay: -3s;
}

.precise-card-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 35px rgba(43, 51, 38, 0.07);
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(240, 234, 222, 0.8);
}

.precise-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-sage);
  margin-bottom: 0.5rem;
}

.precise-value {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--primary-moss);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.text-accent-clay {
  color: var(--accent-clay) !important;
}

.text-accent-terracotta {
  color: var(--accent-terracotta) !important;
}

@keyframes float-micro {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-4px);
  }
}

.target-date-info {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent-sage);
  margin-top: 1rem;
}

/* Anniversary specific styling */
.anniversary-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  color: var(--accent-terracotta);
}

.celebrate-banner {
  margin-top: 2rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent-sage);
  animation: pulse-slow 4s infinite ease-in-out;
}

/* Footer Styling */
.wedding-footer {
  margin-top: 3rem;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.wedding-footer:hover {
  opacity: 0.9;
}

.footer-note {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary-moss);
}

/* Floating SVG Petals */
.petals-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -50px;
  pointer-events: none;
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
}

/* KEYFRAME ANIMATIONS */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.04) rotate(2deg);
  }
}

@keyframes drift-slow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10vw, 8vw) scale(1.15);
  }
}

@keyframes pulse-slow {
  0%, 100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
    color: var(--accent-clay);
  }
}

/* Keyframes for falling/floating petals */
@keyframes fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.8);
  }
  10% {
    opacity: 0.75;
  }
  90% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translateY(105vh) rotate(360deg) scale(1.2);
  }
}

@keyframes sway {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(80px);
  }
}
