/* =====================================================
   BEATRIZ & JORGE ANGEL — INVITACIÓN DE BODA
   Paleta: "Campo Blanco" — crema, salvia y oro viejo
   ===================================================== */

:root {
  --cream:        #F8F3E9;
  --cream-soft:   #F1EADB;
  --paper:        #FFFDF8;
  --sage:         #7C8B68;
  --sage-dark:    #47523A;
  --sage-deep:    #303B27;
  --gold:         #B8925A;
  --gold-soft:    #D8B989;
  --ink:          #33392C;
  --ink-soft:     #5B6350;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-script:  "Mrs Saint Delafield", cursive;
  --font-body:    "EB Garamond", Georgia, serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 20px 45px -20px rgba(48, 59, 39, 0.35);

  --ease: cubic-bezier(.22,.68,.35,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- textura de grano sutil ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#petal-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 40; pointer-events: none;
}

/* =====================================================
   SOBRE / PANTALLA DE BIENVENIDA
   ===================================================== */
.envelope-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px;
  transition: opacity .9s var(--ease), visibility .9s var(--ease);
}
.envelope-screen.is-closing { opacity: 0; visibility: hidden; }

.envelope-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 15%, rgba(184,146,90,.18), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(124,139,104,.25), transparent 50%),
    linear-gradient(160deg, var(--sage-deep) 0%, var(--sage-dark) 45%, #3c4831 100%);
}
.envelope-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.envelope-wrap {
  position: relative; z-index: 2;
  max-width: 420px; width: 100%;
  text-align: center; color: var(--cream);
  animation: envelope-in 1.1s var(--ease) both;
}
@keyframes envelope-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.envelope-monogram {
  font-family: var(--font-display);
  font-size: 15px; letter-spacing: .35em; text-transform: uppercase;
  color: var(--gold-soft);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 18px;
}
.envelope-monogram .amp { font-style: italic; opacity: .75; }

.envelope-eyebrow {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  letter-spacing: .06em;
  color: rgba(248,243,233,.75);
  margin: 0 0 6px;
}
.envelope-names {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 20px;
}
.envelope-names em { font-style: italic; color: var(--gold-soft); font-size: .7em; margin: 0 6px; }

.envelope-msg {
  font-size: 16px;
  color: rgba(248,243,233,.88);
  max-width: 320px; margin: 0 auto 34px;
}

.btn-open {
  position: relative;
  border: 1px solid rgba(216,185,137,.6);
  background: rgba(248,243,233,.06);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: .05em;
  padding: 16px 34px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease);
  animation: pulse-ring 2.6s ease-in-out infinite;
}
.btn-open:hover, .btn-open:focus-visible { transform: translateY(-2px); background: rgba(248,243,233,.14); }
.btn-open:active { transform: translateY(0) scale(.98); }
.btn-open-seal { font-size: 20px; transform: translateY(-1px); }
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,185,137,.35); }
  50% { box-shadow: 0 0 0 10px rgba(216,185,137,0); }
}

.envelope-hint {
  margin-top: 18px; font-size: 13px;
  color: rgba(248,243,233,.55);
  font-style: italic;
}

/* =====================================================
   INVITACIÓN
   ===================================================== */
.invitation { position: relative; z-index: 1; }

.music-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,253,248,.85);
  border: 1px solid rgba(124,139,104,.35);
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  backdrop-filter: blur(6px);
}
.music-icon { display: inline-block; }
.music-icon.spinning { animation: spin 6s linear infinite; }
.music-icon.paused { animation-play-state: paused; opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- helpers de sección con fondo ---------- */
.section, .hero {
  position: relative;
  padding: 96px 22px;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center 50%;
}
.section-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(248,243,233,.94) 0%, rgba(248,243,233,.9) 55%, rgba(248,243,233,.96) 100%);
}
.section-overlay.dark {
  background: linear-gradient(180deg, rgba(48,59,39,.88) 0%, rgba(48,59,39,.94) 100%);
}
.section > *:not(.section-overlay) { position: relative; z-index: 2; }
.countdown-section, .media-photo-section, .notes-section, .dresscode-section, .wishes-section { background: var(--cream); }
.countdown-section { background: var(--cream-soft); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in-view { opacity: 1; transform: none; }

.eyebrow {
  font-family: var(--font-body); font-style: italic;
  color: var(--gold); letter-spacing: .08em;
  font-size: 15px; margin: 0 0 8px;
}
.eyebrow.center { text-align: center; }
.section-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--sage-deep);
  margin: 0 0 34px;
}
.section-title.center { text-align: center; }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 64px 20px 48px;
  overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(48,59,39,.55) 0%, rgba(71,82,58,.35) 35%, rgba(248,243,233,.97) 92%);
}
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 440px; width: 100%; }

.arch-frame {
  position: relative;
  width: min(72vw, 250px);
  margin: 0 auto 22px;
  aspect-ratio: 3 / 4.1;
}
.hero-photo {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 130px 130px 12px 12px;
  border: 6px solid var(--cream);
  box-shadow: 0 25px 50px -15px rgba(20,25,15,.55);
  animation: photo-in 1.3s var(--ease) both;
}
@keyframes photo-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
.arch-vine {
  position: absolute; inset: -14px;
  width: calc(100% + 28px); height: calc(100% + 28px);
  pointer-events: none;
}
.vine-path {
  stroke: var(--gold-soft); stroke-width: 2; opacity: .9;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: draw-vine 2.4s var(--ease) .3s forwards;
}
@keyframes draw-vine { to { stroke-dashoffset: 0; } }

.eyebrow-hero, .hero-content .eyebrow {
  color: var(--gold-soft); text-align: center;
}
.couple-names {
  font-family: var(--font-display); font-weight: 500;
  color: var(--cream);
  font-size: clamp(2.3rem, 10vw, 3.1rem);
  margin: 6px 0 14px; line-height: 1.05;
}
.couple-names span:first-child { display: block; }
.couple-names span:last-child { display: block; color: var(--sage-deep); }
.couple-names em { font-style: italic; color: var(--gold); font-size: .55em; display: block; margin: 2px 0; }

.hero-quote {
  font-style: italic; color: var(--ink-soft);
  max-width: 300px; margin: 0 auto 26px;
  font-size: 16px;
}
.hero-date {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  color: var(--sage-deep); margin-bottom: 8px;
}
.hero-date span { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.hero-date-mid { text-align: center; }
.hero-date-mid b { display: block; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .04em; }
.hero-date-mid small { font-size: 11px; letter-spacing: .2em; color: var(--gold); }

.scroll-cue {
  margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink-soft); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.scroll-cue-line { width: 1px; height: 30px; background: linear-gradient(var(--gold), transparent); animation: scroll-cue-move 1.8s ease-in-out infinite; }
@keyframes scroll-cue-move { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* =====================================================
   FRASE GRANDE
   ===================================================== */
.quote-block { text-align: center; max-width: 480px; margin: 0 auto; }
.deco-leaf { font-size: 26px; display: block; margin: 0 auto 14px; }
.big-quote {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  color: var(--sage-deep); line-height: 1.5; margin: 0;
}

/* =====================================================
   COUNTDOWN
   ===================================================== */
.countdown-section { padding-top: 80px; padding-bottom: 80px; }
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; max-width: 420px; margin: 0 auto 30px;
}
.countdown-item {
  background: var(--paper);
  border: 1px solid rgba(184,146,90,.3);
  border-radius: var(--radius-md);
  padding: 16px 6px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.countdown-item span {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2rem); color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}
.countdown-item small { font-size: 11px; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; }

.btn-outline {
  display: block; margin: 0 auto;
  background: transparent; border: 1px solid var(--sage);
  color: var(--sage-dark); font-family: var(--font-body); font-size: 15px;
  padding: 13px 26px; border-radius: 999px; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.btn-outline:hover { background: var(--sage); color: var(--paper); transform: translateY(-2px); }

/* =====================================================
   FAMILIA
   ===================================================== */
.family-grid {
  display: grid; gap: 16px; max-width: 460px; margin: 0 auto;
  grid-template-columns: 1fr; 
}
@media (min-width: 460px) { .family-grid { grid-template-columns: 1fr 1fr; } }
.family-card {
  background: var(--paper); border-radius: var(--radius-md);
  padding: 26px 18px; text-align: center; box-shadow: var(--shadow-soft);
  border: 1px solid rgba(124,139,104,.18);
}
.family-icon { font-size: 24px; display: block; margin-bottom: 10px; }
.family-card h3 {
  font-family: var(--font-display); font-size: 1rem; letter-spacing: .04em;
  color: var(--gold); margin: 0 0 10px; text-transform: uppercase; font-weight: 500;
}
.family-card p { margin: 4px 0; color: var(--ink); font-size: 16px; }

/* =====================================================
   FOTO MEDIA
   ===================================================== */
.media-photo-section { padding-top: 70px; padding-bottom: 70px; }
.media-frame { max-width: 480px; margin: 0 auto; text-align: center; }
.media-frame img {
  width: 100%; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.media-caption {
  font-family: var(--font-display); font-style: italic; color: var(--sage-dark);
  font-size: 17px; margin-top: 20px;
}

/* =====================================================
   EVENTO
   ===================================================== */
.detail-card {
  background: var(--paper); border-radius: var(--radius-md);
  padding: 26px 22px; text-align: center; box-shadow: var(--shadow-soft);
  max-width: 420px; margin: 0 auto 16px;
  border: 1px solid rgba(184,146,90,.22);
}
.detail-icon { font-size: 26px; display: block; margin-bottom: 8px; }
.detail-card h3 {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em;
  font-size: .85rem; color: var(--gold); margin: 0 0 6px; font-weight: 500;
}
.detail-card p { margin: 0; font-size: 17px; color: var(--ink); }
.btn-map {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; text-decoration: none;
  background: var(--sage-dark); color: var(--cream);
  padding: 12px 22px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.btn-map:hover { background: var(--sage-deep); transform: translateY(-2px); }

/* =====================================================
   VESTIMENTA
   ===================================================== */
.dresscode-section { padding-top: 70px; padding-bottom: 70px; }
.dresscode-card {
  max-width: 420px; margin: 0 auto; text-align: center;
  background: var(--cream-soft); border-radius: var(--radius-lg);
  padding: 32px 24px; border: 1px solid rgba(184,146,90,.25);
}
.dresscode-main {
  font-family: var(--font-display); font-size: 1.6rem; color: var(--sage-deep);
  margin: 0 0 18px;
}
.no-white { display: flex; align-items: center; gap: 14px; text-align: left; }
.no-white-swatch {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gold);
  position: relative;
}
.no-white-swatch::after {
  content: ""; position: absolute; inset: -2px;
  border-top: 2px solid var(--gold);
  transform: rotate(45deg);
}
.no-white p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* =====================================================
   REGALO
   ===================================================== */
.gift-section { padding-top: 76px; padding-bottom: 76px; }
.gift-card { max-width: 460px; margin: 0 auto; text-align: center; }
.gift-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.gift-text { font-size: 17px; color: var(--ink); }

/* =====================================================
   RECOMENDACIONES
   ===================================================== */
.notes-section { padding-top: 70px; padding-bottom: 70px; }
.notes-list { list-style: none; margin: 0 auto; padding: 0; max-width: 460px; }
.notes-list li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper); border-radius: var(--radius-md);
  padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-soft);
  border: 1px solid rgba(124,139,104,.16);
  font-size: 15.5px; color: var(--ink);
}
.notes-emoji { font-size: 20px; flex: none; }

/* =====================================================
   RSVP
   ===================================================== */
.rsvp-section { padding-top: 76px; padding-bottom: 84px; }
.rsvp-card {
  max-width: 440px; margin: 0 auto; text-align: center;
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 36px 24px; box-shadow: var(--shadow-soft);
  border: 1px solid rgba(184,146,90,.25);
}
.rsvp-icon { font-size: 30px; display: block; margin-bottom: 10px; }
.rsvp-text { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 26px; }
.rsvp-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rsvp-label { font-size: 13px; letter-spacing: .05em; color: var(--gold); text-transform: uppercase; margin-top: 10px; }
.rsvp-form input[type="text"] {
  font-family: var(--font-body); font-size: 16px;
  border: 1px solid rgba(124,139,104,.4); border-radius: 12px;
  padding: 13px 14px; background: var(--cream-soft); color: var(--ink);
}
.rsvp-form input:focus, .wish-form input:focus, .wish-form textarea:focus {
  outline: 2px solid var(--gold-soft); outline-offset: 1px;
}
.stepper {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin: 8px 0 4px;
}
.stepper-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--sage); background: var(--cream-soft);
  color: var(--sage-dark); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease), transform .15s var(--ease);
}
.stepper-btn:hover { background: var(--sage); color: var(--paper); }
.stepper-btn:active { transform: scale(.92); }
#stepper-value {
  font-family: var(--font-display); font-size: 1.8rem; color: var(--sage-deep);
  min-width: 40px; text-align: center;
}
.stepper-hint { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 6px; }

.btn-whatsapp {
  margin-top: 18px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #4a5a3d, var(--sage-dark));
  color: var(--cream); font-family: var(--font-body); font-size: 16px;
  padding: 15px 22px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease);
}
.btn-whatsapp:hover { transform: translateY(-2px); }
.btn-whatsapp:active { transform: translateY(0) scale(.98); }

/* =====================================================
   BUENOS DESEOS
   ===================================================== */
.wishes-section { padding-top: 74px; padding-bottom: 74px; }
.wishes-intro { max-width: 440px; margin: 0 auto 26px; text-align: center; color: var(--ink-soft); font-size: 15px; }
.wish-form {
  max-width: 440px; margin: 0 auto 30px; display: flex; flex-direction: column; gap: 12px;
}
.wish-form input, .wish-form textarea {
  font-family: var(--font-body); font-size: 16px;
  border: 1px solid rgba(124,139,104,.4); border-radius: 12px;
  padding: 13px 14px; background: var(--cream-soft); color: var(--ink); resize: vertical;
}
.wishes-wall { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.wish-item {
  background: var(--paper); border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 16px; box-shadow: var(--shadow-soft);
  animation: wish-in .5s var(--ease) both;
}
@keyframes wish-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.wish-item p { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.wish-item span { font-family: var(--font-display); font-style: italic; color: var(--gold); font-size: 14px; }
.wishes-empty { text-align: center; color: var(--ink-soft); font-style: italic; font-size: 14px; }

/* =====================================================
   DESPEDIDA
   ===================================================== */
.farewell-section { min-height: 72vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 90px 24px; }
.farewell-monogram {
  font-family: var(--font-script); font-size: 3rem; color: var(--gold-soft);
  margin-bottom: 18px;
}
.farewell-monogram em { font-style: normal; color: var(--cream); margin: 0 8px; font-family: var(--font-display); }
.farewell-quote {
  font-family: var(--font-display); font-style: italic;
  color: var(--cream); font-size: clamp(1.2rem, 5vw, 1.5rem);
  line-height: 1.6; max-width: 420px; margin: 0 auto 26px;
}
.farewell-date { letter-spacing: .3em; color: var(--gold-soft); font-size: 13px; margin-bottom: 18px; }
.farewell-signature { color: rgba(248,243,233,.8); font-size: 15px; }
.farewell-signature em { font-family: var(--font-script); font-size: 1.6rem; color: var(--cream); font-style: normal; display: inline-block; margin-top: 6px; }

/* =====================================================
   RESPONSIVE TWEAKS
   ===================================================== */
@media (max-width: 360px) {
  .section, .hero { padding-left: 16px; padding-right: 16px; }
  .couple-names { font-size: 2.1rem; }
}

@media (min-width: 720px) {
  .section, .hero { padding-top: 120px; padding-bottom: 120px; }
}
