/* Bodas de Oro — Perla Doralicia & Ramón Damián */
:root {
  --ivory: #FAF7F2;
  --cream: #F3EDE2;
  --line: #E5DEC9;
  --ink: #2C2825;
  --earth: #5C554E;
  --gold: #B89758;
  --gold-soft: rgba(184, 151, 88, .35);
  --olive: #6B705C;
  --serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --col: 560px;
  --gutter: 22px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
h1, h2, h3, p, blockquote, figcaption { text-wrap: balance; }
.chapter__text { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
em { font-style: italic; }
.muted { color: var(--earth); font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- Tipografía base ---------- */
.eyebrow {
  margin: 0;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow .dot { margin: 0 .35em; }
.section-title {
  margin: 0 0 .4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 9vw, 2.7rem);
  line-height: 1.1;
  text-align: center;
  letter-spacing: .01em;
}
.section-lead {
  margin: 0 auto 1.8rem;
  max-width: 30ch;
  text-align: center;
  color: var(--earth);
  font-size: .95rem;
}

/* ---------- Divisor ornamental ---------- */
.divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 auto 1.6rem;
  width: min(220px, 70%);
}
.divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.divider i {
  width: 7px; height: 7px; flex: none;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.divider--small { width: min(140px, 50%); margin: 3.5rem auto; }

/* ---------- Música ---------- */
.music {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 50;
  display: flex; align-items: center; gap: 8px;
}
.music__label {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(250, 247, 242, .94);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(44, 40, 37, .08);
  font-size: .74rem;
  font-weight: 500;
  color: var(--earth);
  white-space: nowrap;
  transition: opacity .5s ease, transform .5s ease;
  animation: label-in .8s 1s both ease;
}
.music.is-playing .music__label,
.music.label-hidden .music__label { opacity: 0; transform: translateX(8px); pointer-events: none; }
@keyframes label-in { from { opacity: 0; transform: translateX(8px); } }
.music__btn {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(250, 247, 242, .94);
  color: var(--gold);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(44, 40, 37, .10);
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease;
}
.music__btn:active { transform: scale(.94); }
.music__btn::after { /* pulso suave mientras no suena */
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--gold-soft);
  animation: pulse 2.6s ease-out infinite;
}
.music.is-playing .music__btn::after { animation: none; opacity: 0; }
@keyframes pulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.music__note { width: 21px; height: 21px; }
.music__eq { display: none; align-items: flex-end; gap: 3px; height: 16px; }
.music__eq i { width: 2.5px; height: 100%; background: var(--gold); border-radius: 2px; transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.music__eq i:nth-child(2) { animation-delay: -.4s; }
.music__eq i:nth-child(3) { animation-delay: -.8s; }
.music__eq i:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.music.is-playing .music__note { display: none; }
.music.is-playing .music__eq { display: flex; }

/* ---------- Portada ---------- */
.hero {
  min-height: 100svh;
  padding: calc(76px + env(safe-area-inset-top)) var(--gutter) 2.5rem;
  max-width: var(--col);
  margin: 0 auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.hero__names {
  margin: 1.1rem 0 .6rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.7rem, 12.5vw, 3.9rem);
  line-height: 1;
  letter-spacing: .005em;
}
.hero__names span { display: block; }
.amp {
  font-style: italic;
  color: var(--gold);
  font-size: .72em;
  line-height: 1.25;
}
.hero__sub {
  margin: 0 0 2rem;
  font-family: var(--serif);
  font-size: 1.22rem;
  color: var(--earth);
  line-height: 1.4;
}
.hero__sub em { color: var(--olive); }

.arch {
  position: relative;
  width: min(100%, 360px);
  padding: 10px;
}
.arch::before { /* marco dorado fino desplazado */
  content: ""; position: absolute; inset: 0;
  border: 1px solid var(--gold);
  border-radius: 999px 999px 4px 4px;
}
.arch__inner {
  border-radius: 999px 999px 2px 2px;
  overflow: hidden;
  aspect-ratio: 4 / 5.4;
  background: var(--cream);
}
.arch__inner img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 40%; }
.arch figcaption {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  background: var(--ivory);
  padding: 0 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold);
  white-space: nowrap;
}

.scroll-cue {
  margin-top: 2.6rem;
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--earth);
  text-decoration: none;
  font-size: .72rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
}
.scroll-cue svg { width: 22px; height: 22px; color: var(--gold); animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Secciones comunes ---------- */
main > section {
  max-width: var(--col);
  margin: 0 auto;
  padding: 3.6rem var(--gutter);
}
main > .story { padding-top: 2.5rem; }

/* ---------- Historia ---------- */
.chapter { text-align: center; }
.chapter__num {
  margin: 1.6rem 0 .3rem;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--olive);
}
.chapter__title {
  margin: 0 0 1.2rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 7.4vw, 2.2rem);
  line-height: 1.15;
}
.chapter__title em { font-weight: 400; }
.chapter__text {
  margin: 0 auto 2rem;
  max-width: 34em;
  color: var(--earth);
  font-size: 1rem;
  text-align: left;
  hyphens: auto;
}
.dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4.1em;
  line-height: .82;
  padding: .06em .1em 0 0;
  color: var(--gold);
}

/* Fotos */
.ph { position: relative; overflow: hidden; background: var(--cream); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--tall { aspect-ratio: 3 / 4.3; }
.ph--land { aspect-ratio: 4 / 3; }
.ph--wide { aspect-ratio: 3 / 2; }
.ph--square { aspect-ratio: 1 / 1; }
.ph--portrait { aspect-ratio: 4 / 5; }
.framed { outline: 1px solid var(--gold); outline-offset: 7px; margin: 8px; }

.collage {
  position: relative;
  padding-bottom: 22%;
  margin-bottom: 2.6rem;
}
.collage__main {
  width: 78%;
  box-shadow: 0 18px 40px -22px rgba(44, 40, 37, .45);
}
.collage__inset {
  position: absolute;
  right: 0; bottom: 0;
  width: 56%;
  border: 6px solid var(--ivory);
  box-shadow: 0 14px 30px -14px rgba(44, 40, 37, .45);
}
.collage__main img, .collage__inset img { filter: sepia(.12) contrast(1.02); }

.keepsake {
  display: flex; align-items: center; gap: 18px;
  margin: 0 auto;
  max-width: 380px;
  text-align: left;
}
.keepsake__img {
  flex: none;
  width: 112px; height: 112px;
  border-radius: 50%;
  overflow: hidden;
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}
.keepsake__img img { width: 100%; height: 100%; object-fit: cover; }
.keepsake figcaption {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--ink);
}
.keepsake figcaption em { color: var(--earth); }

.stats {
  list-style: none;
  margin: 0 auto 2.2rem; padding: 1.2rem 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 420px;
}
.stats li + li { border-left: 1px solid var(--line); }
.stats strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold);
}
.stats span {
  font-size: .7rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--earth);
}

.duo {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 10px;
}

.pullquote {
  margin: 2.6rem 0 1.2rem;
  padding: 0;
}
.pullquote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 7vw, 2rem);
  line-height: 1.25;
  color: var(--ink);
}
.chapter .pullquote + .chapter__text { text-align: center; }

/* ---------- Cuenta regresiva ---------- */
main > .countdown {
  max-width: none;
  background: var(--cream);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 3.6rem var(--gutter);
}
.countdown__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 420px;
  margin: 1.2rem auto 1rem;
}
.countdown__grid div { position: relative; }
.countdown__grid div + div::before {
  content: ""; position: absolute; left: 0; top: 18%; height: 52%;
  width: 1px; background: var(--line);
}
.countdown__grid span {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 12vw, 3.3rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.countdown__grid small {
  font-size: .64rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--olive);
}
.countdown__foot, .countdown__done {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--earth);
}
.countdown__done { font-size: 1.6rem; color: var(--ink); margin: .6rem 0; }

/* ---------- Tarjeta ---------- */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem 1.3rem 1.4rem;
  position: relative;
}
.card::before { /* doble filete interior */
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(184, 151, 88, .25);
  border-radius: 3px;
  pointer-events: none;
}
.info { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.info li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: .95rem 0;
}
.info li + li { border-top: 1px solid var(--line); }
.info svg, .btn svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: var(--gold); stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.info svg { margin-top: 2px; }
.info small {
  display: block;
  font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--olive);
}
.info p {
  margin: .1rem 0 0;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.3;
  font-weight: 600;
}
.info p .muted { font-weight: 400; font-style: italic; }

/* ---------- Botones ---------- */
.btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background-color .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.985); }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold svg { stroke: #fff; }
.btn--dark { background: var(--ink); color: var(--ivory); }
.btn--dark:hover { background: #3a3531; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn.is-loading .btn__text::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -2px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-sub {
  position: relative; z-index: 1;
  display: block;
  margin: 1rem auto 0;
  padding: 6px;
  background: none; border: 0;
  font-family: var(--sans);
  font-size: .86rem;
  color: var(--olive);
  text-align: center;
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- RSVP ---------- */
.rsvp__card { padding: 1.7rem 1.3rem 1.3rem; }
.rsvp form { position: relative; z-index: 1; }
.field { display: block; margin: 0 0 1.4rem; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend {
  display: block;
  margin-bottom: .5rem; padding: 0;
  font-size: .82rem; font-weight: 600;
  color: var(--ink);
}
.field input[type="text"], .field textarea, .more select {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem; /* ≥16px evita el zoom en iOS */
  line-height: 1.4;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 84px; font-size: 1rem; }
.field input::placeholder, .field textarea::placeholder { color: #A39A90; }
.field input:focus, .field textarea:focus, .more select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 151, 88, .18);
}
.field.has-error input { border-color: #A4543E; }

.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: grid; place-items: center;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ivory);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  transition: all .18s ease;
  pointer-events: none;
}
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.chips input:focus-visible + span { box-shadow: 0 0 0 3px rgba(184, 151, 88, .35); }
.field.has-error .chips span { border-color: #C79A8C; }
.more { display: block; margin-top: .9rem; }
.more span { display: block; font-size: .82rem; color: var(--earth); margin-bottom: .4rem; }
.more select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error {
  margin: -.4rem 0 1rem;
  padding: .7rem .9rem;
  border-left: 2px solid #A4543E;
  background: rgba(164, 84, 62, .06);
  color: #7E3F2E;
  font-size: .88rem;
  line-height: 1.5;
}
.form-error a { color: inherit; font-weight: 600; }

.thanks { position: relative; z-index: 1; text-align: center; padding: .6rem 0 .2rem; outline: none; }
.thanks__icon svg { width: 64px; height: 64px; fill: none; stroke: var(--gold); stroke-width: 1.4; margin: 0 auto .6rem; display: block; }
.thanks h3 { margin: 0 0 .5rem; font-family: var(--serif); font-weight: 600; font-size: 1.9rem; line-height: 1.15; }
.thanks p { margin: 0 0 .3rem; color: var(--ink); }
.thanks.pop { animation: pop .6s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Cierre ---------- */
.closing { text-align: center; padding-bottom: calc(4rem + env(safe-area-inset-bottom)) !important; }
.closing__img { aspect-ratio: 4 / 3; border-radius: 999px 999px 0 0; }
.closing .divider--small { margin: 2.4rem auto 1.6rem; }
.closing__text {
  margin: 0 0 1.6rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--earth);
}
.closing__sign { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--earth); }
.closing__names {
  margin: .2rem 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 8.6vw, 2.5rem);
  line-height: 1.15;
}
.closing__names span { display: block; }
.closing__names .amp { font-size: .8em; line-height: 1.2; }

/* ---------- Animaciones de aparición ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; }
}

/* ---------- Pantallas grandes ---------- */
@media (min-width: 720px) {
  body { font-size: 17px; }
  .hero { padding-top: 90px; }
  .arch { width: 400px; }
}
