:root {
  --background: #e8d2ae;
  --foreground: #35251e;
  --card: #f2e5ca;
  --card-foreground: #35251e;
  --primary: #642a35;
  --primary-foreground: #fff8ea;
  --secondary: #68705a;
  --secondary-foreground: #fff8ea;
  --muted: #d8c29f;
  --muted-foreground: #6e5d4f;
  --accent: #8a4f38;
  --accent-foreground: #fff8ea;
  --border: rgba(92, 65, 43, 0.28);
  --input: rgba(92, 65, 43, 0.2);
  --ring: #6f3440;
  --radius: 0.4rem;
  --font-ampersand: 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Brush Script MT', cursive;
  color-scheme: only light;
}

.dark {
  --background: #211714;
  --foreground: #f2e5ca;
  --card: #2e201c;
  --card-foreground: #f2e5ca;
  --primary: #bd7a83;
  --primary-foreground: #241719;
  --secondary: #79816b;
  --secondary-foreground: #171b13;
  --muted: #3c2d27;
  --muted-foreground: #cab99f;
  --accent: #b16d51;
  --accent-foreground: #211714;
  --border: rgba(242, 229, 202, 0.18);
  --input: rgba(242, 229, 202, 0.16);
  --ring: #bd7a83;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

.music-player {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.music-toggle {
  display: grid;
  width: 3.15rem;
  height: 3.15rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 248, 234, 0.62);
  border-radius: 50%;
  background: rgba(83, 40, 47, 0.92);
  box-shadow: 0 8px 26px rgba(55, 31, 24, 0.24);
  color: #fff8ea;
  cursor: pointer;
  touch-action: none;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  backdrop-filter: blur(7px);
}

.music-toggle:hover,
.music-toggle:focus-visible {
  background: #4f252d;
  box-shadow: 0 10px 30px rgba(55, 31, 24, 0.3);
  transform: translateY(-1px);
}

.music-toggle:focus-visible {
  outline: 2px solid #fff8ea;
  outline-offset: 3px;
}

.music-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.music-icon-pause,
.music-player.is-playing .music-icon-play {
  display: none;
}

.music-player.is-playing .music-icon-pause {
  display: block;
}

.volume-popover {
  display: flex;
  min-width: 10.5rem;
  padding: 0.65rem 0.75rem;
  align-items: center;
  border: 1px solid rgba(94, 67, 49, 0.22);
  border-radius: 999px;
  background: rgba(250, 241, 222, 0.94);
  box-shadow: 0 8px 26px rgba(55, 31, 24, 0.18);
  color: #542b2f;
  gap: 0.65rem;
  backdrop-filter: blur(7px);
}

.volume-popover[hidden] {
  display: none;
}

.volume-popover span {
  min-width: 2rem;
  font-size: 0.67rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.volume-popover input {
  width: 6.2rem;
  accent-color: #642f39;
}

.invitation-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  background: #d7bb8c;
}

.botanical-backdrop,
.paper-wash {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
}

.botanical-backdrop {
  z-index: -3;
  background-image: url('/assets/fondo-abstracto.png');
  background-position: 51% center;
  background-size: cover;
  transform: scale(1.01);
}

.paper-wash {
  z-index: -2;
  background: linear-gradient(rgba(235, 214, 177, 0.2), rgba(235, 214, 177, 0.1));
}

.invitation-shell::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  content: '';
  opacity: 0.09;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hero {
  display: flex;
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding:
    calc(clamp(2.1rem, 6vh, 4.5rem) + env(safe-area-inset-top))
    max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-right))
    calc(clamp(1.7rem, 4vh, 3rem) + env(safe-area-inset-bottom))
    max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-left));
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.home-hero .monogram-seal {
  width: clamp(7.5rem, 14vw, 10rem);
  margin-top: 0;
}

.home-hero .names {
  margin-top: clamp(0.55rem, 1.8vh, 1rem);
}

.eyebrow {
  display: flex;
  width: min(100%, 330px);
  align-items: center;
  gap: 1rem;
  color: #5f604b;
}

.eyebrow span {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, currentColor);
  opacity: 0.62;
}

.eyebrow span:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.eyebrow p {
  margin: 0;
  font-size: 0.69rem;
  font-weight: 650;
  letter-spacing: 0.31em;
  text-transform: uppercase;
}

.monogram-seal {
  display: block;
  width: clamp(6.5rem, 11vw, 8.25rem);
  height: auto;
  margin-top: clamp(1.15rem, 3vh, 1.9rem);
  filter: sepia(0.15) saturate(0.72) drop-shadow(0 5px 9px rgba(76, 63, 42, 0.12));
}

.names {
  display: flex;
  margin: clamp(0.2rem, 1vh, 0.65rem) 0 0;
  align-items: center;
  flex-direction: column;
  color: #542b2f;
  font-family: Baskerville, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-size: clamp(4.1rem, 15vw, 7.7rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.names .person-name {
  display: block;
  line-height: 0.76;
  filter: drop-shadow(0 1px 0 rgba(255, 248, 232, 0.25));
}

.hero-ampersand {
  z-index: 1;
  display: block;
  width: 0.78em;
  margin: -0.05em 0 -0.12em;
  color: #9b634c;
  font-size: 0.7em;
  line-height: 0.82;
  transform: translateY(-0.015em);
}

.hero-ampersand img,
.inline-ampersand img {
  display: block;
  width: 100%;
  height: auto;
}

.inline-ampersand {
  display: inline-block;
  width: 0.78em;
  margin-inline: 0.06em;
  font-size: 1.45em;
  line-height: 0.72;
  transform: translateY(-0.08em);
}

.invitation-copy {
  max-width: 29rem;
  margin: clamp(1.15rem, 3vh, 2rem) 0 0;
  color: #55483c;
  font-family: Baskerville, 'Iowan Old Style', serif;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  font-style: italic;
  line-height: 1.45;
}

.personalized-copy {
  display: grid;
  max-width: 35rem;
  margin: clamp(1rem, 2.5vh, 1.7rem) 0 0;
  color: #55483c;
  gap: 0.25rem;
  font-family: Baskerville, 'Iowan Old Style', serif;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  font-style: italic;
  line-height: 1.42;
}

.personalized-copy .guest-line {
  color: #642f39;
  font-size: clamp(1.12rem, 2.7vw, 1.42rem);
  font-style: normal;
}

.hero-personalized .names {
  font-size: clamp(3.65rem, 13vw, 6.6rem);
}

.date-lockup {
  margin-top: clamp(1.25rem, 3vh, 2.2rem);
}

.month {
  display: block;
  margin-bottom: 0.3rem;
  color: #71323d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(0.8rem, 4vw, 1.5rem);
}

.date-row strong {
  padding: 0.02em 0.5em;
  border-inline: 1px solid rgba(95, 96, 75, 0.55);
  color: #4f332b;
  font-family: Baskerville, 'Iowan Old Style', serif;
  font-size: clamp(2.15rem, 6vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
}

.weekday,
.year {
  min-width: 4.7rem;
  color: #4f4e3f;
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.weekday {
  text-align: right;
}

.year {
  text-align: left;
}

.location {
  display: flex;
  margin-top: clamp(1rem, 2.5vh, 1.7rem);
  align-items: center;
  gap: 0.42rem;
  color: #4f4e3f;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.location svg {
  width: 0.92rem;
  height: 0.92rem;
  stroke-width: 1.55;
}

.calendar-button {
  display: inline-flex;
  min-height: 3rem;
  margin-top: clamp(1.1rem, 2.5vh, 1.8rem);
  padding: 0.7rem 1.2rem;
  align-items: center;
  border: 1px solid rgba(82, 41, 46, 0.5);
  border-radius: 999px;
  background: rgba(89, 40, 48, 0.91);
  box-shadow: 0 10px 26px rgba(73, 38, 31, 0.14);
  color: #fff8ea;
  gap: 0.55rem;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.calendar-button:hover {
  background: #4f252d;
  box-shadow: 0 12px 32px rgba(73, 38, 31, 0.22);
  transform: translateY(-2px);
}

.calendar-button:focus-visible {
  outline: 2px solid #763c45;
  outline-offset: 4px;
}

.calendar-button svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 1.8;
}

.countdown {
  min-height: 1.2rem;
  margin: clamp(1.15rem, 2.7vh, 1.8rem) 0 0;
  color: #6d5545;
  font-family: Baskerville, 'Iowan Old Style', serif;
  font-size: 0.9rem;
  font-style: italic;
}

.countdown strong {
  color: #642f39;
  font-style: normal;
  font-weight: 700;
}

.countdown-placeholder {
  opacity: 0.75;
}

.more-details {
  margin: 0.45rem 0 0;
  max-width: 28rem;
  padding: 0 0.35rem;
  color: rgba(78, 67, 56, 0.72);
  font-size: 0.62rem;
  font-weight: 560;
  line-height: 1.55;
  letter-spacing: 0.1em;
  text-wrap: balance;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .paper-wash {
    background:
      linear-gradient(
        180deg,
        rgba(249, 239, 218, 0) 0%,
        rgba(249, 239, 218, 0.08) 58%,
        rgba(249, 239, 218, 0.5) 76%,
        rgba(249, 239, 218, 0.18) 100%
      ),
      linear-gradient(rgba(235, 214, 177, 0.18), rgba(235, 214, 177, 0.12));
  }

  .countdown {
    margin-top: 0.85rem;
  }

  .more-details {
    margin-top: 0.25rem;
    color: rgba(62, 52, 44, 0.84);
    text-shadow:
      0 1px 6px rgba(249, 239, 218, 0.9),
      0 0 12px rgba(249, 239, 218, 0.7);
  }
}

.photo-section {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 12% 10%, rgba(120, 50, 61, 0.28), transparent 34%),
    linear-gradient(145deg, #414737, #2f332b 70%);
  color: #f5ead3;
}

.photo-intro {
  width: min(100%, 980px);
  margin: 0 auto clamp(1.7rem, 4vw, 2.8rem);
}

.photo-intro p {
  margin: 0 0 0.55rem;
  color: #c7bea1;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.photo-intro h2 {
  max-width: 17ch;
  margin: 0;
  font-family: Baskerville, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-size: clamp(2.15rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.polaroid-cluster {
  display: flex;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
  align-items: center;
  flex-direction: column;
}

.polaroid {
  width: min(91%, 25rem);
  margin: 0;
  padding: clamp(0.55rem, 1.6vw, 0.8rem) clamp(0.55rem, 1.6vw, 0.8rem) clamp(1rem, 2.8vw, 1.45rem);
  border: 1px solid rgba(91, 71, 48, 0.15);
  background: #f7efdc;
  box-shadow: 0 22px 56px rgba(13, 16, 11, 0.3);
  color: #5a3930;
  transform-origin: center;
}

.polaroid-left {
  transform: translateX(-2%) rotate(-2.2deg);
}

.polaroid-center {
  z-index: 1;
  margin-top: -1.1rem;
  transform: translateX(3%) rotate(1.2deg);
}

.polaroid-right {
  margin-top: -1.1rem;
  transform: translateX(-1%) rotate(-1.4deg);
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.97) sepia(0.06);
}

.polaroid figcaption {
  display: flex;
  min-height: 2.5rem;
  padding: 0.85rem 0.3rem 0;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  font-family: Baskerville, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  font-style: italic;
  letter-spacing: 0.02em;
}

.reveal {
  animation: reveal 850ms cubic-bezier(0.2, 0.76, 0.25, 1) both;
}

.reveal-one { animation-delay: 80ms; }
.reveal-two { animation-delay: 180ms; }
.reveal-three { animation-delay: 310ms; }
.reveal-four { animation-delay: 440ms; }
.reveal-five { animation-delay: 570ms; }

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 521px) {
  .botanical-backdrop {
    background-position: center;
  }

  .paper-wash {
    background:
      linear-gradient(90deg, rgba(226, 204, 165, 0.08), rgba(240, 220, 183, 0.2) 42%, rgba(234, 211, 173, 0.08)),
      radial-gradient(circle at 50% 42%, rgba(246, 228, 193, 0.38), rgba(221, 195, 150, 0.08) 54%, transparent 72%);
  }

}

@media (min-width: 700px) {
  .polaroid-cluster {
    display: grid;
    padding: 1.25rem 1rem 3.5rem;
    align-items: center;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .polaroid {
    width: 106%;
  }

  .polaroid-left {
    transform: translate(0, 0.8rem) rotate(-2.5deg);
  }

  .polaroid-center {
    z-index: 2;
    margin-top: 0;
    transform: translate(-3%, -0.65rem) rotate(0.8deg);
  }

  .polaroid-right {
    z-index: 1;
    margin-top: 0;
    transform: translate(-6%, 0.55rem) rotate(2.2deg);
  }
}

@media (min-width: 850px) {
  .botanical-backdrop {
    background-position: center;
  }

  .paper-wash {
    background:
      linear-gradient(90deg, rgba(208, 182, 137, 0.04), rgba(244, 225, 191, 0.3) 34%, rgba(244, 225, 191, 0.3) 66%, rgba(208, 182, 137, 0.04)),
      radial-gradient(ellipse at 50% 45%, rgba(248, 232, 200, 0.52), rgba(224, 199, 155, 0.08) 62%, transparent 78%);
  }
}

@media (max-height: 760px) {
  .hero {
    justify-content: flex-start;
  }

  .home-hero {
    justify-content: center;
  }

  .names {
    font-size: clamp(3.6rem, 13vh, 5.6rem);
  }
}

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