@font-face {
  font-family: Averia;
  src: url("assets/fonts/AveriaSerif-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
}
@font-face {
  font-family: Averia;
  src: url("assets/fonts/AveriaSerif-Light.ttf") format("truetype");
  font-display: swap;
  font-weight: 300;
}
@font-face {
  font-family: Averia;
  src: url("assets/fonts/AveriaSerif-Italic.ttf") format("truetype");
  font-display: swap;
  font-style: italic;
}
@font-face {
  font-family: Averia;
  src: url("assets/fonts/AveriaSerif-Bold.ttf") format("truetype");
  font-display: swap;
  font-weight: 700;
}
@font-face {
  font-family: Chapter;
  src: url("assets/fonts/ChapterTwelve.otf") format("opentype");
  font-display: swap;
}
:root {
  --cream: #fdf9e1;
  --red: #792b39;
  --green: #2b4832;
  --green-ink: #385a46;
  --wine: #812d3c;
  --script: Chapter, "Brush Script MT", "Segoe Script", cursive;
  --serif: Averia, Georgia, serif;
  --content: 1040px;
  --overlap: clamp(90px, 18vw, 220px);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--green);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.4;
}
main {
  overflow: hidden;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
p {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #a47d47;
  outline-offset: 3px;
}
.section {
  position: relative;
  isolation: isolate;
}
.red {
  background: var(--red) url("assets/fondo-guinda.webp") center top/
    max(100%, 850px) auto repeat-y;
}
.green {
  background: var(--green) url("assets/fondo-verde.webp") center
    top/max(100%, 850px) auto repeat-y;
}
.content {
  position: relative;
  z-index: 1;
  margin-inline: auto;
  width: min(calc(100% - 40px), var(--content));
}
.decoration {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  max-width: none;
}
.flake {
  width: clamp(100px, 35vw, 400px);
}
.f1 {
  top: 0;
  left: 0;
}
.f2 {
  right: 0;
  top: clamp(160px, 25vw, 300px);
  width: clamp(75px, 15vw, 180px);
}
.f3 {
  right: 0;
  top: clamp(50px, 15vw, 170px);
}
.f4 {
  left: 0;
  bottom: calc(var(--overlap) + 70px);
  width: clamp(90px, 50vw, 360px);
}
.f5 {
  right: 0;
  top: calc(var(--overlap) + 22px);
  width: clamp(70px, 18vw, 305px);
}
.f6 {
  left: 0;
  top: calc(var(--overlap) + 230px);
  width: clamp(80px, 20vw, 280px);
}
.f7 {
  right: 0;
  bottom: -25px;
}
.f8 {
  left: 0;
  top: 0;
  width: clamp(110px, 25vw, 330px);
}
.ho {
  width: clamp(210px, 49vw, 580px);
  opacity: 0.9;
}
.ho1 {
  left: 0;
  top: 0;
}
.ho2 {
  right: 0;
  bottom: var(--overlap);
}
.ho3 {
  right: 0;
  bottom: -8rem;
  width: clamp(220px, 48vw, 550px);
}
.intro {
  padding: clamp(85px, 15vw, 160px) 0 clamp(65px, 11vw, 120px);
}
.hero {
  text-align: center;
}
.hero h1 {
  font-weight: 400;
  line-height: 1.04;
}
.hero h1 span {
  display: block;
  font-size: clamp(25px, 3.5vw, 45px);
}
.hero h1 em {
  display: block;
  font-family: var(--script);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(43px, 6.9vw, 84px);
  line-height: 1.12;
}
.hero .date {
  margin-top: 18px;
  font-size: clamp(16px, 2.1vw, 25px);
}
.intro-copy {
  margin: 30px auto 0;
  max-width: 760px;
  font-size: clamp(14px, 1.55vw, 18px);
  line-height: 1.6;
}
.intro-copy p + p {
  margin-top: 6px;
}
.events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  max-width: 790px;
  gap: clamp(36px, 10vw, 126px);
  margin-top: clamp(65px, 12vw, 130px);
}
.event {
  aspect-ratio: 115.48259/165.09727;
  background: url("assets/cards-inicio.svg") center/100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14% 8% 13%;
  text-align: center;
  color: var(--wine);
  gap: clamp(6px, 1vw, 12px);
  font-size: clamp(13px, 1.5vw, 18px);
  line-height: 1.2;
}
.event h2 {
  font: 400 clamp(27px, 3.1vw, 39px)/1.1 var(--script);
  white-space: nowrap;
}
.event-icon {
  height: clamp(80px, 12vw, 135px);
  width: 80%;
  display: grid;
  place-items: center;
}
.event-icon img {
  max-height: 100%;
  max-width: 85%;
  object-fit: contain;
}
.event .event-date {
  font-style: italic;
  font-weight: 700;
}
.event p:nth-of-type(2) {
  min-height: 2.4em;
}
.pill {
  background: var(--green);
  color: var(--cream);
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 22px;
  font-size: 13px;
  transition:
    background 0.2s,
    transform 0.2s;
}
.pill:hover {
  background: #46684e;
  transform: translateY(-1px);
}
.event .pill {
  min-height: 30px;
  font-size: 12px;
  padding: 5px 25px;
}
.plans {
  padding-top: clamp(60px, 8vw, 100px);
  padding-bottom: 0;
}
.itinerary {
  max-width: 600px;
}
.itinerary img {
  width: 100%;
}
.menu-zone {
  max-width: 390px;
  margin-top: clamp(50px, 10vw, 110px);
  transform: translateY(var(--overlap));
  margin-bottom: calc(-1 * var(--overlap));
  z-index: 3;
}
.menu {
  border-radius: 50% 50% 0 0 / clamp(92px, 16vw, 170px) clamp(92px, 16vw, 170px)
    0 0;
  background: var(--cream);
  color: var(--wine);
  text-align: center;
  padding: clamp(45px, 7vw, 70px) 22px 45px;
  min-height: 480px;
}
.menu h2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.85;
  font-weight: 400;
}
.menu h2 span {
  font-size: 22px;
  color: var(--green);
  padding-left: 65px;
}
.menu h2 em {
  font: 400 clamp(55px, 8vw, 74px)/1 var(--script);
  font-style: normal;
}
.mistletoe {
  width: 83px;
  margin: 6px auto 20px;
}
.menu-category {
  margin: 0 0 24px;
  min-height: 35px;
}
.menu-category:last-child {
  margin-bottom: 0;
}
.menu-category h3 {
  font-size: 17px;
  font-style: italic;
  color: var(--green-ink);
  margin: 0 0 5px;
}
.menu-category ul {
  padding: 0;
  list-style: none;
  margin: 0;
}
.menu-category li {
  padding: 4px 0;
  overflow-wrap: anywhere;
}
.menu-category li span {
  display: block;
  font-size: 13px;
  color: var(--green-ink);
}
.menu-note {
  font-size: 12px;
  line-height: 1.3;
  margin: 14px 0 0;
  color: var(--green-ink);
}
.menu-note:empty {
  display: none;
}
.celebration {
  padding-top: calc(var(--overlap) + clamp(60px, 8vw, 92px));
  padding-bottom: clamp(75px, 9vw, 110px);
}
.dress {
  max-width: 390px;
  margin-bottom: clamp(65px, 9vw, 100px);
  position: relative;
  min-height: 340px;
}
.dress-copy {
  position: relative;
  z-index: 1;
  text-align: left;
  margin-left: 43%;
  width: 57%;
}
.dress h2 {
  font: 400 clamp(38px, 5.5vw, 59px)/1.03 var(--script);
  white-space: nowrap;
}
.dress p {
  font-size: 15px;
  line-height: 1.15;
  margin: 3px 0 0 8%;
}
.dress img {
  width: 83%;
  margin-top: -5px;
  margin-left: 4%;
}
.rsvp-wrap {
  max-width: 475px;
}
.rsvp {
  position: relative;
  background: var(--cream);
  color: var(--wine);
  padding: 45px clamp(21px, 5vw, 52px) 32px;
  border-bottom: 30px solid var(--green);
  isolation: isolate;
}
.rsvp:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 16px;
  background: radial-gradient(
      circle at 50% 0,
      transparent 10px,
      var(--cream) 10.5px
    )
    repeat-x;
  background-size: 34px 16px;
  transform: translateY(-1px);
  background-color: transparent;
  mask-image: radial-gradient(circle at 50% 0, transparent 10px, #000 10.5px);
  mask-size: 34px 16px;
}
.rsvp {
  clip-path: shape(
    from 0 0,
    line to 100% 0,
    line to 100% 100%,
    line to 0 100%,
    close
  );
  background: linear-gradient(var(--cream), var(--cream)) 0 13px/100%
    calc(100% - 13px) no-repeat;
}
.rsvp header {
  text-align: center;
  margin-bottom: 30px;
}
.rsvp h2 {
  font: 400 clamp(40px, 6.3vw, 62px)/0.95 var(--script);
  color: var(--green);
}
.rsvp header p {
  font-size: 20px;
  line-height: 1.1;
}
form {
  display: grid;
  gap: 8px;
}
form label {
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  display: block;
  margin-top: 6px;
}
form input,
form select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #a6aa90;
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  padding: 8px 13px;
  outline-offset: 2px;
  font-size: 16px;
}
form input::placeholder {
  color: #687965;
  opacity: 1;
}
form select {
  appearance: auto;
}
form select:invalid {
  color: #687965;
}
.dish-row {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  position: relative;
}
.dish-row + .dish-row {
  border-top: 1px solid #c8c4a9;
  padding-top: 10px;
  margin-top: 15px;
}
.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}
.remove-dish {
  background: none;
  border: 0;
  color: var(--wine);
  font-size: 13px;
  padding: 4px 0;
  text-decoration: underline;
}
.add-dish {
  background: none;
  border: 0;
  color: var(--wine);
  padding: 10px 0;
  text-align: left;
  font-style: italic;
  font-weight: 700;
  justify-self: start;
}
.submit {
  width: 80%;
  justify-self: center;
  min-height: 42px;
  font-weight: 700;
}
.submit:disabled {
  opacity: 0.55;
  cursor: wait;
}
.form-message {
  font-size: 14px;
  color: var(--green);
  text-align: center;
  margin-top: 8px;
}
.form-message.error {
  color: var(--wine);
}
.closing {
  text-align: center;
  padding: clamp(40px, 6vw, 65px) 0 clamp(70px, 12vw, 150px);
}
.countdown {
  max-width: 340px;
  z-index: 2;
  top: -1.2rem;
}
.digits {
  display: flex;
  justify-content: center;
  gap: 9px;
  position: relative;
}
.digit {
  display: grid;
  place-items: center;
  background: url("assets/cuenta-regresiva.svg") center/100% 100% no-repeat;
  aspect-ratio: 91.293136/116.43579;
  width: clamp(58px, 12vw, 115px);
  color: var(--green);
  font-size: clamp(64px, 13vw, 128px);
  line-height: 1;
  position: relative;
}
.digit:before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: clamp(112px, 15vw, 175px);
  background: #e3d9b7;
  z-index: -1;
}
.digit:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--green);
  opacity: 0.8;
}
.countdown > p {
  margin-top: 20px;
  font-size: 18px;
}
.countdown h2 {
  font: 400 53px/0.85 var(--script);
}
.farewell {
  margin-top: clamp(65px, 10vw, 120px);
  font-size: clamp(18px, 2.6vw, 28px);
}
.farewell p + p {
  font-size: 17px;
  margin-top: 8px;
}
.music {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  z-index: 10;
  background: var(--cream);
  color: var(--green);
  border: 1px solid #d4ccb0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 9px #0003;
}
.music svg {
  width: 23px;
}
.music-slash {
  position: absolute;
  width: 25px;
  height: 2px;
  background: var(--green);
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1px var(--cream);
}
.music[aria-pressed="true"] .music-slash {
  display: none;
}
.js-reveal .reveal:not(.is-visible) {
  opacity: 0;
  translate: 0 18px;
}
.reveal {
  transition:
    opacity 0.7s ease,
    translate 0.7s ease;
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}
/* Transición dinámica entre los fondos */
.menu-zone {
  margin-top: calc(clamp(65px, 8vw, 105px) - var(--overlap));
  transform: translateY(var(--overlap));
  margin-bottom: 0;
  container-type: inline-size;
}

/* Proporciones del arco del menú */
.menu {
  border-radius: 50% 50% 0 0 / 42cqw 42cqw 0 0;
}

.celebration {
  padding-top: calc(var(--overlap) + clamp(60px, 8vw, 92px));
}

/* Ajustar transición de fondo en la cuenta regresiva */
:root {
  --countdown-shift: 30px;
}

.celebration {
  padding-bottom: calc(clamp(75px, 9vw, 110px) - var(--countdown-shift));
}

.closing {
  padding-top: calc(clamp(40px, 6vw, 65px) + var(--countdown-shift));
}

@media (max-width: 650px) {
  :root {
    --overlap: 105px;
  }
  .content {
    width: min(calc(100% - 44px), var(--content));
  }
  .intro {
    padding-top: 110px;
  }
  .hero h1 em {
    font-size: clamp(38px, 13vw, 64px);
  }
  .hero .date {
    margin-top: 3rem;
    margin-bottom: 3rem;
    font-size: clamp(16px, 5vw, 25px);
}
  .intro-copy {
    max-width: 330px;
  }
  .events {
    grid-template-columns: minmax(0, 280px);
    gap: 28px;
    margin-top: 50px;
  }
  .event {
    padding: 13% 8%;
    gap: 9px;
    font-size: 15px;
  }
  .event h2 {
    font-size: 34px;
  }
  .event-icon {
    height: 102px;
  }
  .event .pill {
    min-height: 35px;
  }
  .f1 {
    width: 120px;
  }
  .f2 {
    top: 220px;
  }
  .f3 {
    top: -50px;
    right: -25px;
  }
  .f4 {
    left: -20px;
    bottom: calc(var(--overlap) - 75px);
  }
  .f5 {
    top: calc(var(--overlap) + 75px);
    right: -20px;
  }
  .f6 {
    left: -25px;
    top: calc(var(--overlap) + 280px);
  }
  .f7 {
    right: -20px;
    width: 135px;
  }
  .itinerary {
    max-width: 380px;
  }
  .menu-zone {
    max-width: 330px;
    width: min(calc(100% - 72px), 330px);
  }
  .menu {
    min-height: 420px;
    padding-bottom: 32px;
  }
  .dress {
    max-width: 320px;
    min-height: auto;
  }
  .dress h2 {
    font-size: 44px;
  }
  .dress-copy {
    margin-left: 38%;
    width: 62%;
  }
  .dress img {
    width: 80%;
  }
  .rsvp-wrap {
    max-width: 400px;
  }
  .rsvp {
    padding-inline: 23px;
  }
  .rsvp h2 {
    font-size: clamp(38px, 11vw, 56px);
  }
  .closing {
    padding-bottom: 95px;
  }
  .f8 {
    left: -20px;
  }
  .digit {
    width: 76px;
    font-size: 85px;
  }
  .countdown {
  top: -1rem;
}
}
@media (max-width: 360px) {
  .content {
    width: calc(100% - 28px);
  }
  .hero h1 em {
    font-size: 38px;
  }
  .menu-zone {
    width: calc(100% - 56px);
  }
  .rsvp {
    padding-inline: 18px;
  }
  .dress h2 {
    font-size: 38px;
  }
  .event h2 {
    font-size: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .pill {
    transition: none !important;
  }
  .js-reveal .reveal {
    opacity: 1 !important;
    translate: none !important;
  }
}
.plans {
  z-index: 2;
}
.celebration {
  z-index: 1;
}
.closing {
  z-index: 3;
}
.rsvp {
  clip-path: none;
}
.rsvp:before {
  height: 15px;
  transform: none;
  top: 0;
  background: radial-gradient(
      circle at 50% 0,
      transparent 10px,
      var(--cream) 10.5px
    )
    0 0/34px 15px repeat-x;
  mask-image: none;
}
.rsvp {
  background: linear-gradient(var(--cream), var(--cream)) 0 14px/100%
    calc(100% - 14px) no-repeat;
}
.remove-dish[hidden],
.add-dish[hidden] {
  display: none;
}
/* Ajustes tras comprobar las proporciones de los SVG originales. */
.event-icon {
  flex-shrink: 0;
  min-height: 0;
}
.event-icon img {
  height: 100%;
  width: 100%;
  min-height: 0;
  max-height: none;
  max-width: 100%;
  object-fit: contain;
}
.event-icon {
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
.menu-zone {
  transform: none;
  margin-bottom: calc(-1 * var(--overlap));
}
.dress {
  min-height: 0;
}
.digits {
  width: clamp(175px, 24vw, 250px);
  aspect-ratio: 91.293136/116.43579;
  background: url("assets/cuenta-regresiva.svg") center/100% 100% no-repeat;
  margin: calc(-1 * clamp(100px, 14vw, 145px)) auto 0;
  align-items: flex-end;
  gap: 3.84%;
}
.digit {
  width: 48.08%;
  height: 60.35%;
  aspect-ratio: auto;
  background: none;
  font-size: clamp(78px, 12vw, 126px);
}
.digit:before,
.digit:after {
  display: none;
}
.countdown > p {
  margin-top: 20px;
}
.digits:has(.digit:nth-child(3)) {
  aspect-ratio: auto;
  min-height: 110px;
  background: none;
  margin-top: 0;
  align-items: stretch;
  gap: 8px;
}
.digits:has(.digit:nth-child(3)) .digit {
  height: auto;
  background: var(--cream);
  border-radius: 8px;
  font-size: 65px;
}
.plans {
  display: flow-root;
}
.menu-zone {
  transform: translateY(var(--overlap));
  margin-bottom: 0;
}

/* Crédito al pie de la invitación */
.ftw-credit {
  background: #5b0d17;
  color: var(--cream);
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.4;
  padding: 15px 68px calc(17px + env(safe-area-inset-bottom, 0px));
}
.ftw-credit a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}
.ftw-credit a:hover,
.ftw-credit a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Pantalla de bienvenida */
html.welcome-pending, html.welcome-pending body {
  overflow: hidden;
  overscroll-behavior: none;
  scroll-behavior: auto;
}
html.welcome-pending body { position: fixed; inset: 0; width: 100%; }
.welcome-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  padding: 12px;
  background: var(--green) url("assets/fondo-verde.webp") center / cover no-repeat;
  opacity: 1;
  transition: opacity 650ms ease;
}
html.welcome-pending .welcome-screen { display: flex; }
.welcome-screen.is-opening { opacity: 0; }
.welcome-card {
  position: relative;
  isolation: isolate;
  container-type: size;
  width: min(81vw, 65vh, 650px);
  width: min(81vw, 65dvh, 650px);
  height: min(85vh, 920px);
  height: min(85dvh, 920px);
  background: #eee8da;
  color: #630f19;
  text-align: center;
}
.welcome-flake { position: absolute; z-index: 0; pointer-events: none; user-select: none; max-width: none; }
.welcome-flake-top { width: 37%; right: -1%; top: -7%; }
.welcome-flake-bottom { width: 24%; left: 0; bottom: 0; }
.welcome-heading { position: absolute; z-index: 1; top: 26%; left: 3%; right: 3%; }
.welcome-heading p { font: 400 clamp(13px, 4.25cqw, 30px)/1.2 var(--serif); }
.welcome-heading h2 {
  margin: 1.3cqw 0 0;
  color: #30523d;
  font: 400 clamp(25px, 10.2cqw, 70px)/1.14 var(--script);
  white-space: nowrap;
}
.welcome-copy {
  position: absolute; z-index: 1; left: 17%; right: 17%; top: 44%;
  font: 400 clamp(12px, 2.85cqw, 20px)/1.33 var(--serif);
  text-wrap: pretty;
}
.welcome-ribbon {
  position: absolute; z-index: 1; width: 100%; max-width: none; left: 0; top: 68%;
  transform: translateY(-52%); pointer-events: none; user-select: none;
}
.welcome-open {
  position: absolute; z-index: 2; top: 86%; left: 50%; transform: translate(-50%, -50%);
  width: 43%; min-height: 40px; border: 0; border-radius: 999px; color: var(--cream);
  background: #345642; padding: 7px 15px;
  font: 400 clamp(17px, 4.5cqw, 29px)/1.1 var(--serif); transition: background 180ms ease;
}
.welcome-open:hover { background: #294632; }
@media (max-width: 650px) {
  .welcome-card { width: min(86vw, 67dvh); height: min(87dvh, 680px); }
  .welcome-copy { left: 11%; right: 11%; font-size: clamp(12px, 3.6cqw, 17px); }
  .welcome-flake-top { width: 36%; top: -4%; }
  .welcome-flake-bottom { width: 25%; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .welcome-card { width: min(88vw, 760px); height: 86dvh; }
  .welcome-heading { top: 12%; left: 8%; right: 8%; }
  .welcome-heading p { font-size: clamp(12px, 3.8cqh, 20px); }
  .welcome-heading h2 { font-size: clamp(24px, 11cqh, 48px); margin-top: 0; }
  .welcome-copy { top: 37%; left: 23%; right: 23%; font-size: clamp(12px, 4.4cqh, 16px); }
  .welcome-ribbon { top: 69%; width: 100%; height: auto; transform: translateY(-50%); }
  .welcome-flake-top { width: 18%; top: -13%; }
  .welcome-flake-bottom { width: 13%; bottom: -5%; }
  .welcome-open { top: 87%; width: 35%; font-size: clamp(15px, 5cqh, 20px); min-height: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-screen, .welcome-open { transition: none; }
}
