/* ==========================================================================
   Invitación de boda · José Luis e Inma · 17.10.2026 · Sollana (Valencia)
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --paper:        #FCF9F3;  /* fondo de la tarjeta */
  --paper-soft:   #FDFBF6;  /* paneles y campos */
  --cream:        #F6F1E6;  /* franja cuenta atrás */
  --sand:         #F1EADC;  /* franja confirmación */
  --slot-bg:      #E4E0D3;  /* hueco de foto */

  --ink:          #2C2A26;  /* texto principal */
  --body:         #4A463D;  /* párrafos largos */
  --soft:         #6C6455;  /* texto secundario */
  --muted:        #8C7A5B;  /* antetítulos */
  --faint:        #9A8B70;  /* notas en cursiva */
  --meta:         #A99880;  /* pie */

  --gold:         #A8823F;
  --gold-dark:    #8C6A2E;
  --gold-light:   #C9A465;
  --line:         rgba(168, 130, 63, .3);
  --line-soft:    rgba(168, 130, 63, .22);
  --line-faint:   rgba(168, 130, 63, .18);

  --serif:  "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Parisienne", "Brush Script MT", cursive;

  --page-pad: 34px;
  --card-max: 520px;
  --cta-h:    80px;  /* alto reservado para la barra fija */
}

/* --- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: radial-gradient(120% 60% at 50% 0%, #FBF7EF 0%, #EFE9DD 60%, #E7E0D1 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  text-wrap: pretty;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); }

img { max-width: 100%; }

/* Gana a las reglas display:flex/grid de abajo */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 12px 18px;
  background: var(--gold);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: .1em;
}
.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
  color: var(--paper);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* --- Tarjeta ------------------------------------------------------------ */
.card {
  width: 100%;
  max-width: var(--card-max);
  position: relative;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(94, 78, 50, .18);
}

/* --- Piezas compartidas ------------------------------------------------- */
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--muted);
}

.script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--gold);
}

/* Filete decorativo: línea · corazón · línea */
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 0;
}
.flourish i {
  height: 1px;
  width: 56px;
  background: linear-gradient(90deg, rgba(168, 130, 63, 0), var(--gold-light));
}
.flourish i + b + i {
  background: linear-gradient(90deg, var(--gold-light), rgba(168, 130, 63, 0));
}
.flourish b {
  font-weight: 400;
  font-size: 15px;
  color: var(--gold-light);
}

/* Separador vertical entre ceremonia y celebración */
.stem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 22px 0;
}
.stem i {
  width: 1px;
  height: 26px;
  background: rgba(168, 130, 63, .4);
}
.stem b {
  font-weight: 400;
  font-size: 14px;
  color: var(--gold-light);
  animation: pulseHeart 3.4s ease-in-out infinite;
}

/* Encabezado de sección con filete */
.section-head {
  margin: 0 0 30px;
  font-weight: 400;
  text-align: center;
}
.section-head span {
  display: inline-block;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-head::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(90deg, rgba(168, 130, 63, 0), rgba(168, 130, 63, .45), rgba(168, 130, 63, 0));
}

/* --- Huecos de foto ----------------------------------------------------- */
/* El degradado difuminado hace de fondo mientras no haya foto real.
   Si el archivo de img/ no existe, JS marca .is-empty y sale el rótulo. */
.slot {
  position: relative;
  overflow: hidden;
  background: var(--slot-bg);
}
.slot__wash { position: absolute; inset: -14px; }
.slot__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Con JS la foto entra con un fundido: así no se ve el icono de imagen rota
   mientras carga, y de fondo queda el degradado, que ya es digno.
   Sin JS se muestran tal cual — nunca se quedan invisibles. */
.js .slot__img {
  opacity: 0;
  transition: opacity .45s ease;
}
.js .slot.is-filled .slot__img { opacity: 1; }
.slot__hint { display: none; }

.slot.is-empty .slot__img { display: none; }
.slot.is-empty .slot__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(252, 249, 243, .95);
  text-shadow: 0 1px 12px rgba(44, 42, 38, .55);
}

.slot__wash--hero {
  filter: blur(26px);
  background-color: #DED9C8;
  background-image:
    radial-gradient(38% 46% at 30% 62%, rgba(74, 66, 52, .55) 0%, rgba(74, 66, 52, 0) 70%),
    radial-gradient(30% 40% at 62% 58%, rgba(58, 52, 42, .5) 0%, rgba(58, 52, 42, 0) 72%),
    radial-gradient(70% 55% at 50% 8%, rgba(252, 249, 243, .95) 0%, rgba(232, 226, 208, .4) 60%, rgba(232, 226, 208, 0) 100%),
    radial-gradient(45% 60% at 88% 78%, rgba(122, 138, 104, .6) 0%, rgba(122, 138, 104, 0) 70%),
    radial-gradient(50% 60% at 8% 88%, rgba(140, 154, 118, .55) 0%, rgba(140, 154, 118, 0) 72%),
    linear-gradient(165deg, #EFEADC 0%, #DCD6C2 55%, #C9C4AE 100%);
}
.slot__wash--a {
  filter: blur(20px);
  background-color: #DED9C8;
  background-image:
    radial-gradient(42% 48% at 40% 60%, rgba(70, 62, 48, .5) 0%, rgba(70, 62, 48, 0) 72%),
    radial-gradient(55% 45% at 70% 20%, rgba(252, 249, 243, .9) 0%, rgba(252, 249, 243, 0) 75%),
    radial-gradient(50% 55% at 90% 85%, rgba(132, 148, 112, .55) 0%, rgba(132, 148, 112, 0) 72%),
    linear-gradient(150deg, #ECE6D7 0%, #D7D1BC 60%, #C4BFA8 100%);
}
.slot__wash--b {
  filter: blur(16px);
  background-color: #DED9C8;
  background-image:
    radial-gradient(50% 55% at 62% 55%, rgba(64, 58, 46, .45) 0%, rgba(64, 58, 46, 0) 74%),
    radial-gradient(60% 50% at 20% 22%, rgba(252, 249, 243, .85) 0%, rgba(252, 249, 243, 0) 78%),
    radial-gradient(45% 50% at 12% 88%, rgba(122, 138, 104, .5) 0%, rgba(122, 138, 104, 0) 72%),
    linear-gradient(200deg, #EDE8DA 0%, #D9D3BE 60%, #C6C1AB 100%);
}
.slot__wash--c {
  filter: blur(16px);
  background-color: #DED9C8;
  background-image:
    radial-gradient(45% 50% at 48% 66%, rgba(76, 66, 50, .48) 0%, rgba(76, 66, 50, 0) 72%),
    radial-gradient(65% 55% at 55% 12%, rgba(252, 249, 243, .9) 0%, rgba(252, 249, 243, 0) 78%),
    radial-gradient(40% 45% at 92% 40%, rgba(190, 164, 110, .45) 0%, rgba(190, 164, 110, 0) 72%),
    linear-gradient(135deg, #EFEADB 0%, #DBD5C0 60%, #C8C3AC 100%);
}

/* --- Portada ------------------------------------------------------------ */
.hero { position: relative; padding: 0 0 44px; }

.hero__media { position: relative; }
.slot--hero { height: 420px; }

.hero__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* El texto de la portada empieza a ~83 %: ahí el crema ya debe ser opaco,
     si no "Nos casamos" se pierde sobre una foto oscura. */
  background: linear-gradient(180deg,
    rgba(252, 249, 243, .15) 0%,
    rgba(252, 249, 243, 0) 35%,
    rgba(252, 249, 243, .72) 76%,
    rgba(252, 249, 243, .97) 87%,
    var(--paper) 93%);
}

.hero__intro {
  position: relative;
  margin-top: -72px;
  padding: 0 var(--page-pad);
  text-align: center;
  animation: rise .9s ease both;
}

/* "Nos casamos" casi al nivel de los nombres.
   El tracking baja de .42em a .16em: a este tamaño el espaciado ancho de un
   antetítulo pequeño queda desparramado, y además desbordaría en móvil
   (a 38px con .42em mediría 437px, y en una pantalla de 320 solo hay 276). */
.hero__intro .eyebrow {
  margin: 0 0 10px;
  font-size: clamp(24px, 7.5vw, 38px);
  letter-spacing: .16em;
  line-height: 1.15;
}

.names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: 56px;   /* "José Luis" mide 202 px: entra hasta en pantallas de 320 */
  line-height: 1.05;
  color: var(--gold);
}
.names__a,
.names__b { display: block; }
.names__and {
  display: block;
  padding: 2px 0;
  font-size: 38px;
}

.hero__date {
  margin: 20px 0 0;
  font-size: 19px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero__place {
  margin: 8px 0 0;
  font-size: 16px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Cuenta atrás ------------------------------------------------------- */
.countdown {
  padding: 36px var(--page-pad) 42px;
  background: var(--cream);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.countdown .eyebrow {
  margin: 0 0 20px;
  letter-spacing: .4em;
}
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.countdown__cell { margin: 0; }
.countdown__num {
  display: block;
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown__done {
  margin: 20px 0 0;
  font-family: var(--script);
  font-size: 32px;
  line-height: 1.1;
  color: var(--gold);
}

/* --- Nuestra historia --------------------------------------------------- */
.story {
  padding: 54px var(--page-pad) 10px;
  text-align: center;
}
.story > .script {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}
.story__text {
  margin: 18px 0 0;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--body);
}
.story__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0 0;
}
.story__stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}
.slot--tall  { height: 200px; border-radius: 3px; }
.slot--short { min-height: 94px; border-radius: 3px; }
.story__note {
  margin: 14px 0 0;
  font-size: 14px;
  font-style: italic;
  color: var(--faint);
}

/* --- El día ------------------------------------------------------------- */
.day { padding: 54px var(--page-pad) 0; }

.panel {
  padding: 30px 26px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  text-align: center;
}
.panel__kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel__time {
  margin: 14px 0 0;
  font-size: 40px;
  line-height: 1;
}
.panel__place {
  margin: 16px 0 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
}
.panel__place span {
  font-size: 17px;
  color: var(--soft);
}
.panel__note {
  margin: 14px 0 0;
  font-size: 17px;
  font-style: italic;
  color: var(--soft);
}

/* --- Botones ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: inherit;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.btn--ghost {
  margin-top: 20px;
  padding: 11px 22px;
  min-height: 44px;
  line-height: 22px;
  border: 1px solid var(--gold-light);
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--gold-dark);
}
.btn--ghost:hover {
  background: var(--gold-light);
  color: var(--paper);
}

.btn--dashed {
  width: 100%;
  margin-top: 26px;
  padding: 15px;
  min-height: 50px;
  background: none;
  border: 1px dashed rgba(168, 130, 63, .55);
  font-size: 12px;
  letter-spacing: .26em;
  color: var(--gold-dark);
}
.btn--dashed:hover { background: var(--cream); }

.btn--solid {
  padding: 16px;
  min-height: 52px;
  background: var(--gold);
  border: none;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .28em;
}
.btn--solid:hover {
  background: var(--gold-dark);
  color: var(--paper);
}

/* --- Cómo llegar -------------------------------------------------------- */
.travel { padding: 52px var(--page-pad) 0; }
.travel .section-head { margin-bottom: 24px; }

.travel__list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.travel__row {
  display: flex;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line-faint);
}
.travel__row:last-child { border-bottom: none; }
.travel__row dt {
  flex: 0 0 86px;
  padding-top: 4px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.travel__row dd {
  margin: 0;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--body);
}

/* --- Confirmación ------------------------------------------------------- */
.rsvp {
  margin: 52px 0 0;
  padding: 46px var(--page-pad) 54px;
  background: var(--sand);
  border-top: 1px solid var(--line-soft);
}
.rsvp__intro { text-align: center; }
.rsvp__intro .script {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}
.rsvp__intro p {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--body);
}
.rsvp__intro strong { font-weight: 500; }

.rsvp__form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field__label {
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__input {
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid rgba(168, 130, 63, .4);
  border-radius: 2px;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
}
textarea.field__input {
  min-height: auto;
  resize: vertical;
  line-height: 1.5;
}
.field__input::placeholder { color: var(--faint); opacity: 1; }
.field__input:focus-visible { outline-offset: 1px; }

/* Campo con error tras intentar enviar */
.field__input.is-invalid,
.choice.is-invalid .choice__opt span {
  border-color: #B4553F;
}
.field__error {
  font-size: 15px;
  font-style: italic;
  color: #B4553F;
}

.choice {
  margin: 0;
  padding: 0;
  min-width: 0;
  border: 0;
}
.choice legend {
  padding: 0;
  margin-bottom: 8px;
}
.choice__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice__opt { position: relative; }
.choice__opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.choice__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 14px 10px;
  min-height: 52px;
  border: 1px solid rgba(168, 130, 63, .4);
  border-radius: 2px;
  background: var(--paper-soft);
  color: var(--soft);
  font-size: 16px;
  letter-spacing: .06em;
  text-align: center;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.choice__opt input:checked + span {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}
.choice__opt input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.rsvp__hint {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-style: italic;
  color: var(--faint);
}

.rsvp__form.is-sending { opacity: .6; pointer-events: none; }

.rsvp__thanks {
  margin-top: 30px;
  padding: 34px 24px;
  border: 1px solid rgba(168, 130, 63, .4);
  background: var(--paper-soft);
  text-align: center;
  animation: rise .5s ease both;
}
.rsvp__heart {
  margin: 0;
  font-size: 22px;
  color: var(--gold-light);
}
.rsvp__thanks .script {
  margin: 10px 0 0;
  font-size: 32px;
  line-height: 1.1;
}
.rsvp__thanks p + p:not(.script) {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--body);
}

.linkish {
  margin-top: 20px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--gold-dark);
  text-decoration: underline;
  cursor: pointer;
}

/* --- Cierre ------------------------------------------------------------- */
.footer {
  padding: 44px var(--page-pad) calc(52px + var(--cta-h) + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: var(--paper);
}
.footer .flourish { margin: 0; }
.footer .flourish i { width: 44px; }
.footer .flourish b { font-size: 14px; }

.footer__thanks {
  margin: 20px 0 0;
  font-size: 30px;
  line-height: 1.2;
}
.footer__contact {
  margin: 12px 0 0;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--soft);
}
.footer__meta {
  margin: 24px 0 0;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--meta);
}

/* --- Barra fija --------------------------------------------------------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: 100%;
  max-width: var(--card-max);
  margin: 0 auto;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg,
    rgba(252, 249, 243, 0),
    rgba(252, 249, 243, .94) 40%,
    var(--paper) 100%);
  transition: opacity .3s ease, transform .3s ease;
}
.sticky-cta .btn--solid {
  display: block;
  padding: 15px;
  min-height: 50px;
  line-height: 20px;
  border-radius: 2px;
  font-size: 12px;
}
.sticky-cta.is-hidden {
  opacity: 0;
  transform: translateY(110%);
  pointer-events: none;
}

/* --- Música ------------------------------------------------------------- */
/* Se alinea con la tarjeta igual que la barra fija, para no descolgarse en
   pantallas anchas. La banda no captura clics; solo el botón. */
.music {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  max-width: var(--card-max);
  height: 0;
  margin: 0 auto;
  pointer-events: none;
}
.music__btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(201, 164, 101, .75);
  border-radius: 50%;
  background: rgba(252, 249, 243, .82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--gold-dark);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 14px rgba(94, 78, 50, .22);
  transition: background .2s ease, color .2s ease;
}
.music__btn:hover {
  background: var(--gold-light);
  color: var(--paper);
}

.music__bars { display: none; }
.music__btn.is-playing .music__note { display: none; }
.music__btn.is-playing .music__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
}
.music__bars i {
  width: 3px;
  height: 100%;
  background: currentColor;
  transform-origin: bottom;
  animation: eq .9s ease-in-out infinite;
}
.music__bars i:nth-child(2) { animation-delay: .18s; }
.music__bars i:nth-child(3) { animation-delay: .36s; }

@keyframes eq {
  0%, 100% { transform: scaleY(.35); }
  50%      { transform: scaleY(1); }
}

/* Sin animación: las barras se quedan quietas pero se siguen viendo */
@media (prefers-reduced-motion: reduce) {
  .music__bars i { animation: none; transform: scaleY(.7); }
}

/* --- Pantallas estrechas ------------------------------------------------ */
@media (max-width: 360px) {
  :root { --page-pad: 22px; }
  .slot--hero { height: 360px; }
  .countdown__num { font-size: 34px; }
  .panel { padding: 26px 18px; }
  .travel__row { gap: 12px; }
  .travel__row dt { flex-basis: 74px; }
}

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

/* --- Impresión ---------------------------------------------------------- */
@media print {
  body { background: #fff; display: block; }
  .card { box-shadow: none; max-width: none; }
  .sticky-cta,
  .rsvp__form,
  .btn--dashed,
  .skip-link { display: none !important; }
  .footer { padding-bottom: 24px; }
}
