/* =========================================================
   Nuestro primer aniversario — hoja de estilos
   Paleta: vino, rosa empolvado, crema y dorado
   ========================================================= */

:root {
  --wine-950: #2a0911;
  --wine-900: #3a0e1a;
  --wine-800: #4a1322;
  --wine-700: #5d1a2c;
  --rose: #d9a4a8;
  --rose-soft: #efd3d2;
  --gold: #c9a86a;
  --gold-soft: #e3cfa6;
  --cream: #fbf6ef;
  --cream-deep: #f3e9dd;
  --ink: #2c1c1f;
  --ink-soft: #5c4a4c;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;
  --font-script: "Parisienne", "Segoe Script", cursive;

  --shadow-soft: 0 24px 60px -30px rgba(58, 14, 26, 0.55);
  --shadow-letter: 0 30px 70px -35px rgba(58, 14, 26, 0.45);
  --radius: 18px;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--wine-950);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, p, figure, blockquote {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--wine-700);
  color: var(--cream);
}

/* ---------- Aureola suave que sigue al cursor ---------- */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 50%) var(--my, 20%),
      rgba(217, 164, 168, 0.08), transparent 60%);
  transition: background 0.4s ease;
}

/* =========================================================
   PORTADA
   ========================================================= */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem) clamp(4.5rem, 8vw, 6rem);
  overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 78% 8%, rgba(201, 168, 106, 0.16), transparent 55%),
    radial-gradient(90% 80% at 8% 92%, rgba(93, 26, 44, 0.85), transparent 60%),
    linear-gradient(160deg, var(--wine-900) 0%, var(--wine-950) 55%, #20060d 100%);
}

/* textura muy sutil */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: min(100%, var(--max));
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.hero__portrait {
  display: flex;
  justify-content: center;
}

.hero__copy {
  max-width: 34rem;
}

/* ---------- Marco de la foto ---------- */
.portrait {
  position: relative;
  width: min(340px, 70vw);
  aspect-ratio: 3 / 4;
  padding: 12px;
  margin: 0;
  border-radius: 999px 999px 22px 22px;
  background:
    linear-gradient(160deg, rgba(227, 207, 166, 0.9), rgba(201, 168, 106, 0.25) 45%, rgba(227, 207, 166, 0.7));
  box-shadow:
    0 0 0 1px rgba(227, 207, 166, 0.35),
    0 40px 70px -30px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(42, 9, 17, 0.35);
  pointer-events: none;
  z-index: 3;
}

.portrait__img,
.portrait__fallback {
  width: 100%;
  height: 100%;
  border-radius: 999px 999px 14px 14px;
  object-fit: cover;
  object-position: center 25%;
}

.portrait__img {
  position: relative;
  z-index: 1;
  filter: saturate(0.95) contrast(1.02);
}

.portrait__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1.5rem;
  background:
    radial-gradient(120% 80% at 50% 20%, #6a2236, transparent 70%),
    linear-gradient(180deg, #53182a, #2f0b15);
  color: var(--gold-soft);
}

.portrait__heart {
  font-size: clamp(2rem, 6vw, 2.6rem);
  color: var(--rose);
  opacity: 0.9;
  animation: beat 3.2s ease-in-out infinite;
}

.portrait__fallback p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.portrait__fallback small {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
}

.portrait.is-empty .portrait__img {
  display: none;
}

.portrait:not(.is-empty) .portrait__fallback {
  display: none;
}

.portrait__shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 47%, transparent 58%);
  transform: translateX(-120%);
  animation: shine 9s ease-in-out 2.5s infinite;
  pointer-events: none;
}

/* ---------- Corazones y pétalos que caen ---------- */
.fall-layer {
  --heart-color: #e2b0b4;
  --petal-color: #d1909a;
  --petal-color-deep: #a95f6d;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fall-layer--light {
  --heart-color: rgba(150, 62, 82, 0.45);
  --petal-color: #d79aa4;
  --petal-color-deep: #b06e7a;
}

.fall__item {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  will-change: transform, opacity;
}

.fall__item--heart {
  font-family: var(--font-display);
  line-height: 1;
  color: var(--heart-color);
  text-shadow: 0 0 10px rgba(217, 164, 168, 0.35);
}

.fall-layer--light .fall__item--heart {
  text-shadow: none;
}

.fall__item--petal {
  background: radial-gradient(120% 120% at 30% 25%,
    rgba(255, 244, 240, 0.6), var(--petal-color) 62%, var(--petal-color-deep));
  border-radius: 62% 38% 58% 42% / 60% 55% 45% 40%;
  box-shadow: inset -1px -1px 2px rgba(120, 40, 55, 0.18);
}

/* ---------- Texto de portada ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.hero__title {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--cream);
}

.hero__title em {
  font-style: italic;
  color: var(--rose-soft);
  display: inline-block;
  position: relative;
}

.hero__title em::after {
  content: "";
  position: absolute;
  left: 0.05em;
  right: 0.05em;
  bottom: -0.08em;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero__subtitle {
  margin-top: 1.5rem;
  max-width: 30rem;
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  color: rgba(251, 246, 239, 0.78);
  line-height: 1.85;
}

.hero__actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.7rem;
  border: 1px solid rgba(227, 207, 166, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(217, 164, 168, 0.16), rgba(201, 168, 106, 0.1));
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s ease;
}

.btn:hover,
.btn:focus-visible {
  background: linear-gradient(135deg, rgba(217, 164, 168, 0.3), rgba(201, 168, 106, 0.2));
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.8);
  outline: none;
}

.btn:hover svg {
  transform: translateY(3px);
}

.link-quiet {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 246, 239, 0.65);
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 246, 239, 0.25);
  padding-bottom: 3px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.link-quiet:hover,
.link-quiet:focus-visible {
  color: var(--cream);
  border-color: var(--gold);
  outline: none;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.2rem, 4vh, 2.2rem);
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(251, 246, 239, 0.5);
}

.scroll-cue__line {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, transparent, rgba(227, 207, 166, 0.8));
  animation: pulseLine 2.6s ease-in-out infinite;
}

/* =========================================================
   SECCIONES GENERALES
   ========================================================= */
.section {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: clamp(4.5rem, 11vw, 8rem) clamp(1.25rem, 5vw, 3rem);
}

/* el contenido siempre por encima de los corazones que caen */
.section__head,
.letter,
.phrases,
.phrases__note,
.final {
  position: relative;
  z-index: 1;
}

.section__head {
  max-width: 46rem;
  margin: 0 auto clamp(2.5rem, 6vw, 3.75rem);
  text-align: center;
}

.eyebrow--dark {
  color: #9b6b4a;
}

.section__title {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  color: var(--wine-800);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  font-size: 0.65rem;
  color: var(--gold);
}

.ornament i {
  display: block;
  width: clamp(38px, 9vw, 64px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 106, 0.8));
}

.ornament i:last-child {
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.8), transparent);
}

/* =========================================================
   CARTA
   ========================================================= */
.section--letter {
  background:
    radial-gradient(70% 50% at 12% 0%, rgba(217, 164, 168, 0.22), transparent 60%),
    radial-gradient(60% 60% at 95% 100%, rgba(201, 168, 106, 0.16), transparent 60%),
    var(--cream);
}

.letter {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 6vw, 4rem) clamp(2.2rem, 6vw, 3.5rem);
  background: linear-gradient(180deg, #fffdf9, #fdf8f1);
  border: 1px solid rgba(201, 168, 106, 0.35);
  border-radius: 4px;
  box-shadow: var(--shadow-letter);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  line-height: 1.95;
  color: #3a2b2d;
}

.letter::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 168, 106, 0.18);
  border-radius: 2px;
  pointer-events: none;
}

.letter p + p {
  margin-top: 1.15em;
}

.letter__mark {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wine-800);
  border: 1px solid rgba(227, 207, 166, 0.6);
  box-shadow: 0 10px 24px -12px rgba(58, 14, 26, 0.8);
}

.letter__mark svg {
  width: 18px;
  height: 18px;
  fill: var(--rose-soft);
}

.letter__salute {
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--wine-700);
  margin-bottom: 0.35em;
}

.dropcap {
  float: left;
  font-family: var(--font-display);
  font-size: 3.6em;
  line-height: 0.78;
  font-weight: 500;
  padding: 0.06em 0.12em 0 0;
  color: var(--wine-700);
}

.letter__closing {
  margin-top: 1.7em;
  font-style: italic;
  color: var(--wine-700);
}

.letter__signature {
  margin-top: 0.2em;
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  line-height: 1.3;
  text-align: right;
  color: var(--wine-800);
}

/* =========================================================
   FRASES
   ========================================================= */
.section--phrases {
  background:
    radial-gradient(80% 60% at 80% 0%, rgba(217, 164, 168, 0.22), transparent 60%),
    var(--cream-deep);
}

.phrases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
  max-width: 62rem;
  margin: 0 auto;
}

.phrase {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.5rem, 3.5vw, 2.25rem);
  background: rgba(255, 253, 249, 0.85);
  border: 1px solid rgba(201, 168, 106, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 20px 45px -35px rgba(58, 14, 26, 0.55);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.phrase::after {
  content: "";
  position: absolute;
  left: 0;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

.phrase p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.12rem, 2vw, 1.4rem);
  line-height: 1.65;
  color: #3d2a2f;
}

.phrase__quote {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.6;
  color: rgba(201, 168, 106, 0.7);
  margin-bottom: 0.4rem;
}

.phrase:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 168, 106, 0.6);
  box-shadow: 0 26px 50px -32px rgba(58, 14, 26, 0.6);
}

.phrases__note {
  max-width: 40rem;
  margin: clamp(2.25rem, 5vw, 3rem) auto 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: #7a5c53;
}

/* =========================================================
   CIERRE
   ========================================================= */
.section--final {
  text-align: center;
  color: var(--cream);
  padding-block: clamp(5rem, 12vw, 8.5rem);
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(217, 164, 168, 0.18), transparent 65%),
    linear-gradient(180deg, var(--wine-900), var(--wine-950));
}

.final {
  max-width: 40rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.final__heart {
  display: inline-block;
  font-size: 1.6rem;
  color: var(--rose);
  animation: beat 3.2s ease-in-out infinite;
}

.final .eyebrow {
  display: block;
  margin-top: 1.2rem;
}

.final__title {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.final__title em {
  font-style: italic;
  color: var(--rose-soft);
}

.final__text {
  margin-top: 1.4rem;
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  color: rgba(251, 246, 239, 0.76);
  line-height: 1.9;
}

.final__sign {
  margin-top: 2.2rem;
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  color: var(--gold-soft);
}

.footer {
  position: relative;
  z-index: 1;
  padding: 1.6rem 1.25rem 2rem;
  text-align: center;
  background: var(--wine-950);
  color: rgba(251, 246, 239, 0.4);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer span {
  color: var(--rose);
}

/* =========================================================
   ANIMACIONES
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* entrada escalonada dentro de la portada */
.hero__copy .reveal:nth-child(1) { transition-delay: 0.15s; }
.hero__copy .reveal:nth-child(2) { transition-delay: 0.28s; }
.hero__copy .reveal:nth-child(3) { transition-delay: 0.41s; }
.hero__copy .reveal:nth-child(4) { transition-delay: 0.54s; }
.hero__portrait.reveal { transition-delay: 0.05s; }

.phrases .phrase:nth-child(2) { transition-delay: 0.1s; }
.phrases .phrase:nth-child(3) { transition-delay: 0.2s; }
.phrases .phrase:nth-child(4) { transition-delay: 0.3s; }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.14); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.09); }
  48%      { transform: scale(1); }
}

@keyframes shine {
  0%, 55%   { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}

@keyframes pulseLine {
  0%, 100% { opacity: 0.35; transform: scaleY(0.8); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1);   transform-origin: top; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 2.75rem);
    text-align: center;
    justify-items: center;
    padding-top: 1rem;
  }

  .hero__copy {
    max-width: 34rem;
  }

  .hero__subtitle {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .portrait {
    width: min(300px, 66vw);
  }
}

@media (max-width: 640px) {
  .section--letter,
  .section--phrases {
    padding-inline: 1.1rem;
  }

  .letter {
    padding: 2.5rem 1.35rem 2rem;
    font-size: 1.04rem;
    line-height: 1.9;
  }

  .phrases {
    grid-template-columns: minmax(0, 1fr);
  }

  .phrase {
    padding: 1.6rem 1.35rem 1.7rem;
  }

  .phrase::after {
    top: 1.2rem;
    bottom: 1.2rem;
  }

  .hero__actions {
    flex-direction: column;
    gap: 1.1rem;
  }

  .btn {
    width: 100%;
    max-width: 20rem;
    justify-content: center;
  }

  .hero__title {
    font-size: clamp(2.3rem, 11vw, 3rem);
  }

  .scroll-cue {
    display: none;
  }
}

@media (max-width: 380px) {
  .portrait {
    width: 74vw;
  }

  .dropcap {
    font-size: 3.1em;
  }
}

/* respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .fall-layer {
    display: none;
  }
}

/* ---------- Botón de música ---------- */
.btn-musica {
  animation: pulseSerenata 2.5s infinite ease-in-out;
}

.btn-musica.playing {
  animation: none;
  box-shadow: 0 0 20px rgba(201, 168, 106, 0.6);
}

@keyframes pulseSerenata {
  0%, 100% { transform: scale(1) rotate(0deg); box-shadow: 0 0 0 0 rgba(201, 168, 106, 0.5); }
  25% { transform: scale(1.05) rotate(-2deg); box-shadow: 0 0 8px rgba(201, 168, 106, 0.4); }
  50% { transform: scale(1.1) rotate(2deg); box-shadow: 0 0 0 14px rgba(201, 168, 106, 0); }
  75% { transform: scale(1.05) rotate(-2deg); box-shadow: 0 0 8px rgba(201, 168, 106, 0.4); }
}
