/* ============================================================
   MAIN.CSS — Global Design System
   Tarjeta Digital de Boda — Nicolás & Isabella
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ── CSS Variables ── */
:root {
  --color-cream:       #faf8f5; /* Warm off-white background */
  --color-warm-white:  #ffffff; /* Pure white for cards/modals background */
  --color-gold:        #778c43; /* Elegant olive green */
  --color-gold-light:  #eef2e1; /* Soft cream/champagne with a touch of olive */
  --color-gold-dark:   #43581c; /* Darker olive green */
  --color-rose:        #586e26; /* Olive green */
  --color-rose-light:  #dce3c8; /* Soft light olive green */
  --color-rose-dark:   #253a05; /* Deep olive forest green */
  --color-sage:        #586e26;
  --color-sage-light:  #9ebb6a;
  --color-deep:        #203500; /* Deep olive forest green for titles */
  --color-dark:        #203500;
  --color-text:        #3b5110; /* Dark olive green for text */
  --color-text-light:  #485e1b;
  --color-text-muted:  #5e7631;
  --color-border:      #d4dcc5; /* Soft delicate olive-grey border */

  --font-script:   'Great Vibes', cursive;
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', system-ui, sans-serif;

  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     32px;
  --radius-xl:     64px;
  --radius-round:  50%;

  --shadow-neumorphic: 4px 4px 12px rgba(32,53,0,0.08), -4px -4px 12px rgba(255,255,255,0.7);
  --shadow-neumorphic-inset: inset 2px 2px 6px rgba(32,53,0,0.08), inset -2px -2px 6px rgba(255,255,255,0.7);
  --shadow-card:   0 16px 48px rgba(32,53,0,0.12), 0 4px 12px rgba(32,53,0,0.06);
  --shadow-glow:   0 0 40px rgba(119,140,67,0.3);

  --transition-smooth: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast:   0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --z-bg: 0;
  --z-content: 1;
  --z-overlay: 10;
  --z-modal: 100;
  --z-top: 1000;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-cream);
  background-image: 
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px);
  color: var(--color-text);
  overflow-x: clip;
  line-height: 1.7;
}

html.no-scroll, body.no-scroll {
  overflow: hidden !important;
  height: 100% !important;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

/* ── Typography ── */
.font-script   { font-family: var(--font-script); }
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }

.text-gold     { color: var(--color-gold); }
.text-rose     { color: var(--color-rose); }
.text-deep     { color: var(--color-deep); }
.text-cream    { color: var(--color-cream); }
.text-muted    { color: var(--color-text-muted); }

/* ── Section Shared ── */
.content-wrapper {
  position: relative;
  z-index: 1;
  background-color: var(--color-cream);
  background-image: 
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px);
}

.section {
  position: relative;
  overflow: hidden;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: block;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-script);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-deep);
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 400;
  font-style: normal;
  color: var(--color-text-light);
  margin-top: 16px;
}

/* ── Premium Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 36px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

/* Glass/Shimmer Reflection */
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  z-index: -1;
}

.btn:hover::after {
  animation: shimmerSweep 1.5s infinite;
}

@keyframes shimmerSweep {
  0% { left: -150%; }
  100% { left: 150%; }
}

/* Icon Animation on hover */
.btn .btn-icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn:hover .btn-icon {
  transform: scale(1.2) rotate(-10deg);
}

/* Base Hover */
.btn:hover {
  transform: translateY(-4px) scale(1.02);
}

.btn:active {
  transform: translateY(2px) scale(0.98);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(119,140,67,0.3), inset 0 2px 2px rgba(255,255,255,0.2), inset 0 -2px 4px rgba(0,0,0,0.1);
}
.btn-primary:hover {
  box-shadow: 0 16px 32px rgba(119,140,67,0.4), inset 0 2px 2px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.1);
}

/* Secondary Button */
.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-gold-dark);
  border: 1.5px solid var(--color-gold);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(119,140,67,0.1);
}
.btn-secondary::after {
  background: linear-gradient(90deg, rgba(119,140,67,0) 0%, rgba(119,140,67,0.1) 50%, rgba(119,140,67,0) 100%);
}
.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--color-gold-dark);
  color: var(--color-gold-dark);
  box-shadow: 0 16px 32px rgba(119,140,67,0.25);
}

/* Rose Button */
.btn-rose {
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-dark) 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(88,110,38,0.3), inset 0 2px 2px rgba(255,255,255,0.2), inset 0 -2px 4px rgba(0,0,0,0.1);
}
.btn-rose:hover {
  box-shadow: 0 16px 32px rgba(88,110,38,0.4), inset 0 2px 2px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.1);
}

/* ── Cards ── */
.card {
  background: var(--color-warm-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-neumorphic);
  padding: 32px;
  transition: var(--transition-smooth);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(32,53,0,0.15);
}

/* ── Modal Overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,18,10,0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}
.modal-box {
  background: var(--color-warm-white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
  margin: auto;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-card), 0 0 60px rgba(201,169,110,0.2);
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 250px;
  z-index: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  pointer-events: none;
}

.modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-cover-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to bottom, transparent 0%, var(--color-warm-white) 100%);
}

.modal-content-inner {
  position: relative;
  z-index: 1;
  margin-top: 150px; /* Pushes content down so the cover is visible at the top */
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-cream);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-neumorphic);
}
.modal-close:hover {
  background: var(--color-rose-light);
  color: var(--color-rose-dark);
}

/* ── Music Player ── */
#music-player {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--z-top);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-gold);
  color: white;
  display: none; /* Initially hidden */
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(119,140,67,0.25);
  transition: var(--transition-spring);
  cursor: pointer;
}
#music-player.visible {
  display: flex;
  animation: fadeIn 0.5s ease;
}
#music-player:hover {
  background: var(--color-rose);
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 6px 20px rgba(88, 110, 38, 0.35);
}
#music-player.playing {
  animation: musicPulse 1.5s ease-in-out infinite;
}
#music-player svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
#music-player .icon-pause {
  display: none;
}
#music-player.playing .icon-play {
  display: none;
}
#music-player.playing .icon-pause {
  display: block;
}

/* ── Decorative SVG Dividers ── */
.divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  position: relative;
  z-index: 1;
}
.divider svg {
  display: block;
  width: 100%;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Scroll delay helpers ── */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ── Utility ── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-4        { gap: 16px; }
.gap-6        { gap: 24px; }
.gap-8        { gap: 32px; }
.mt-4         { margin-top: 16px; }
.mt-6         { margin-top: 24px; }
.mt-8         { margin-top: 32px; }
.mb-4         { margin-bottom: 16px; }
.mb-6         { margin-bottom: 24px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-cream); }
::-webkit-scrollbar-thumb { background: var(--color-gold-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .section-inner { padding: 60px 20px; }
  .btn { padding: 12px 24px; font-size: 0.8rem; }
  .modal-overlay { padding: 16px; align-items: flex-start; }
  .modal-box { 
    padding: 36px 20px; 
    max-height: none; /* Let overlay scroll handle it if taller than screen */
    margin: 16px auto; 
  }
  .modal-cover { height: 180px; }
  .modal-content-inner { margin-top: 110px; }
}
