@font-face { font-family: "Pinyon Script"; src: url(vendor/fonts/pinyon-script-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(vendor/fonts/cormorant-garamond-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(vendor/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(vendor/fonts/cormorant-garamond-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --cream: #f5efe7;
  --blue: #d6dfe6;
  --olive: #5f6247;
  --ink: #4d4a41;
  --rule: #c4bdae;
  --column: 480px;
}

* { box-sizing: border-box; }
html { background: #2b2a22; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #2b2a22;
  color: var(--ink);
  font: 400 19px/1.4 "Cormorant Garamond", Georgia, serif;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100svh; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.script { font-family: "Pinyon Script", cursive; font-weight: 400; }
.caps { font-size: 16px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; }
.title { font-size: 34px; font-style: italic; font-weight: 400; line-height: 1.1; }
.sprig { display: inline-block; width: 32px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; color: var(--olive); vertical-align: middle; }
.sprig.flip { transform: scaleX(-1); }
.ico { display: block; width: 58px; height: 58px; margin: 0 auto 6px; fill: none; stroke: var(--olive); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.pill {
  display: inline-block; min-height: 44px; margin-top: 14px; padding: 10px 28px;
  border: 0; border-radius: 99px; background: var(--olive); color: #fbf8f1;
  font-size: 15px; line-height: 24px; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.pill[hidden] { display: none; }

/* Apertura */
#intro {
  position: fixed; z-index: 20; top: 0; left: 50%;
  width: min(100%, var(--column)); height: 100svh;
  transform: translateX(-50%);
  overflow: hidden; background: #efe9df;
}
.env, #introVideo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
#envOpen { opacity: 0; }
#seal {
  position: absolute; top: 50%; left: 50%;
  width: 164px; height: 164px; margin: -82px 0 0 -82px;
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
}
#hint {
  position: absolute; top: calc(50% + 94px); left: 50%; transform: translateX(-50%);
  padding: 2px 14px; border-radius: 99px; white-space: nowrap;
  background: #f5efe7d9; color: #3d3f2c; font-style: italic; font-size: 19px;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .6; } }
#skip {
  position: absolute; right: 12px; bottom: max(14px, env(safe-area-inset-bottom));
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 99px;
  background: #f5efe7d9; color: #3d3f2c; font-size: 17px; cursor: pointer;
}

/* Hoja */
#page { position: relative; width: min(100%, var(--column)); margin: 0 auto; background: var(--cream); overflow: hidden; text-align: center; }
.band { position: relative; }
.edge { position: absolute; left: 0; right: 0; height: 20px; z-index: 2; pointer-events: none; }
.edge.bottom { bottom: -1px; }
.edge.top { top: -1px; transform: scaleY(-1); }
.edge svg { display: block; width: 100%; height: 100%; }

/* Portada */
#hero { height: 76svh; min-height: 520px; overflow: hidden; background: #6f543d; color: #fffaf1; }
#hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
#hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 42%, #1d120bd9 82%); }
.draft {
  position: absolute; z-index: 2; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  padding: 2px 12px; border-radius: 99px; white-space: nowrap;
  background: #f5efe7e6; color: #3d3f2c; font-size: 15px; font-weight: 500;
}
.hero-text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 36px; padding: 0 12px; }
.hero-text h1 { font-size: clamp(42px, 12.4vw, 58px); line-height: 1.2; white-space: nowrap; }
.hero-date { font-size: 23px; letter-spacing: .06em; }
.hero-text .sprig { color: #fffaf1; margin-top: 4px; }

/* Cuenta atrás */
#cuenta { padding: 18px 16px 0; }
#countdown { display: grid; grid-template-columns: repeat(4, 1fr); }
.unit + .unit { border-left: 1px solid var(--rule); }
.num { position: relative; display: block; overflow: visible; color: var(--olive); font-size: 40px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.val { display: inline-block; }
.ghost { position: absolute; inset: 0; pointer-events: none; }
.lbl { display: block; font-size: 15px; }
.count-done { grid-column: 1 / -1; font-family: "Pinyon Script", cursive; color: var(--olive); font-size: 38px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 28px 36px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* Ceremonia y recepción */
.event .time { font-size: 21px; margin-top: 2px; }
.event .place { margin-top: 2px; }
.event .addr { font-size: 18px; }

/* Programa */
#programa { padding: 48px 24px 72px; }
.monogram { font-size: 52px; line-height: 1; }
.heading { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 6px; }
#timeline { position: relative; list-style: none; width: fit-content; max-width: 100%; margin: 22px auto 0; padding: 0; text-align: left; }
#timeline li { display: grid; grid-template-columns: 34px 62px 1fr; align-items: center; min-height: 78px; line-height: 1.2; }
#timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--olive); position: relative; z-index: 1; }
#timeline .ico { width: 48px; height: 48px; margin: 0; }
#timeline time { display: block; font-size: 19px; }
#timeline .act { display: block; font-size: 19px; }
#timeline .line { position: absolute; left: 4px; width: 1px; background: var(--olive); transform-origin: top; }

/* Foto */
#foto { overflow: hidden; aspect-ratio: 4 / 5; background: #a9896a; }
#fotoImg { display: block; width: 100%; height: 112%; margin-top: -6%; object-fit: cover; }

/* Comparte */
#comparte { padding: 56px 32px 64px; background: var(--blue); }
#comparte p:not(.pill) { margin-top: 10px; }
.tag { text-transform: none; letter-spacing: .02em; font-size: 19px; }

/* Canciones */
#canciones { padding: 44px 32px 0; }
#canciones > p:not([role]) { margin-top: 10px; }
#playlistStatus { margin-top: 8px; font-size: 17px; font-weight: 500; }
#playlistStatus:empty { display: none; }

/* Confirmación */
#confirmar { padding: 0 32px; }
#confirmar > p { margin-top: 6px; }
#rsvp { display: grid; gap: 16px; max-width: 360px; margin: 20px auto 0; text-align: left; }
#rsvp label { display: block; }
#rsvp input:not([type="radio"]), #rsvp textarea {
  display: block; width: 100%; padding: 6px 2px; font-size: 18px;
  background: transparent; border: 0; border-bottom: 1px solid #8d8778; border-radius: 0;
}
#rsvp [aria-invalid="true"] { border-bottom: 2px solid #9c1c1c; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 2px; }
.choice { display: flex !important; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--olive); }
#rsvp .pill { justify-self: center; margin-top: 0; }
#rsvpStatus { text-align: center; min-height: 1.4em; font-weight: 500; }

/* Cierre */
#cierre { padding: 44px 24px calc(84px + env(safe-area-inset-bottom)); }
.monogram.big { margin-top: 36px; font-size: 76px; }
#replay { display: block; min-height: 44px; margin: 14px auto 0; background: none; border: 0; font-size: 17px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Música */
#music {
  position: fixed; z-index: 15;
  right: max(16px, calc(50vw - var(--column) / 2 + 16px));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--olive); color: #fbf8f1; font-size: 15px; cursor: pointer;
}
#music[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  #hint { animation: none; }
}
