:root {
  --paper: #f2efea;
  --paper-soft: #fbf8f3;
  --paper-card: #fcfaf6;
  --line: #7b2926;
  --line-strong: #6a211f;
  --text: #4f2423;
  --text-soft: #6a4746;
  --shadow: rgba(58, 25, 24, 0.12);
  --seal: #b33a37;
  --seal-dark: #8f2d2b;
  --fold-center-y: 48.4%;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-ui: "IBM Plex Mono", "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "Pecito", "IBM Plex Sans", cursive;
  --text-xs: clamp(0.82rem, 1.5vw, 0.92rem);
  --text-sm: clamp(0.92rem, 1.7vw, 1rem);
  --text-base: clamp(1rem, 1.9vw, 1.1rem);
  --text-lg: clamp(1.35rem, 3.2vw, 1.72rem);
  --title-lg: clamp(2.15rem, 6vw, 3.5rem);
  --title-md: clamp(1.85rem, 4.8vw, 2.75rem);
  --display-xl: clamp(2.7rem, 9vw, 4.7rem);
  --space-2xs: clamp(0.25rem, 0.6vw, 0.4rem);
  --space-xs: clamp(0.45rem, 1.1vw, 0.7rem);
  --space-sm: clamp(0.7rem, 1.8vw, 1.05rem);
  --space-md: clamp(1rem, 2.5vw, 1.5rem);
  --space-lg: clamp(1.45rem, 3.8vw, 2.2rem);
  --space-xl: clamp(2.2rem, 6vw, 3.8rem);
  --section-gap: clamp(4.8rem, 13vw, 8rem);
}

@font-face {
  font-family: "Pecito";
  src: url("assets/fonts/Pecita.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 10%, #f8f5f0 0%, var(--paper) 56%, #ebe5de 100%);
  color: var(--line-strong);
  font-family: var(--font-body);
  line-height: 1.55;
}

body {
  overflow-x: hidden;
}

.language-switcher {
  position: fixed;
  top: clamp(0.7rem, 2.2vw, 1.25rem);
  right: clamp(1.25rem, 3.4vw, 2.1rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  padding: 0.16rem;
  border: 1px solid rgba(106, 33, 31, 0.24);
  border-radius: 999px;
  background: rgba(252, 250, 246, 0.84);
  backdrop-filter: blur(4px);
}

.music-toggle {
  position: fixed;
  top: clamp(0.7rem, 2.2vw, 1.25rem);
  left: clamp(1.25rem, 3.4vw, 2.1rem);
  z-index: 70;
  appearance: none;
  width: clamp(2.34rem, 4.1vw, 2.62rem);
  aspect-ratio: 1;
  border: 1px solid rgba(106, 33, 31, 0.24);
  border-radius: 999px;
  background: rgba(252, 250, 246, 0.84);
  color: var(--line);
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.music-toggle::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 1.15rem;
  background: rgba(106, 33, 31, 0.72);
  transform: rotate(-45deg);
  transition: opacity 0.18s ease;
}

.music-toggle:hover {
  background: rgba(123, 41, 38, 0.08);
}

.music-toggle:focus-visible {
  outline: 2px solid rgba(123, 41, 38, 0.38);
  outline-offset: 1px;
}

.music-toggle.is-playing {
  background: rgba(123, 41, 38, 0.16);
  color: var(--line-strong);
}

.music-toggle.is-playing::after {
  opacity: 0;
}

.music-icon-image {
  width: 1.08rem;
  height: 1.08rem;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.language-option {
  appearance: none;
  min-width: 2.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.64rem;
  background: transparent;
  color: var(--line);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.language-option:hover {
  background: rgba(123, 41, 38, 0.08);
}

.language-option.is-active {
  background: rgba(123, 41, 38, 0.16);
  color: var(--line-strong);
}

.language-option:focus-visible {
  outline: 2px solid rgba(123, 41, 38, 0.38);
  outline-offset: 1px;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  perspective: 1800px;
  transition: opacity 0.85s ease, visibility 0.85s ease;
}

.envelope-stage {
  position: relative;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #f5f2ed 0%, #efebe5 100%);
}

.envelope-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 16%, rgba(123, 41, 38, 0.03), transparent 32%),
    radial-gradient(circle at 82% 86%, rgba(123, 41, 38, 0.02), transparent 38%);
  pointer-events: none;
  z-index: 1;
}

.flap {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.6s ease;
  will-change: transform;
}

.flap-top {
  clip-path: polygon(0 0, 100% 0, 50% var(--fold-center-y));
  background: linear-gradient(180deg, #f6f4ef 0%, #efebe5 100%);
  box-shadow: inset 0 -22px 34px rgba(92, 74, 60, 0.12);
  transform-origin: center top;
  transition-delay: 0s;
  z-index: 7;
}

.flap-left {
  clip-path: polygon(0 0, 50% var(--fold-center-y), 0 100%);
  background: linear-gradient(120deg, #f0ece6 0%, #ebe5dd 100%);
  box-shadow: inset -24px 0 34px rgba(95, 77, 62, 0.08);
  transform-origin: 0% var(--fold-center-y);
  transition-delay: 0.12s;
  z-index: 5;
}

.flap-right {
  clip-path: polygon(100% 0, 50% var(--fold-center-y), 100% 100%);
  background: linear-gradient(240deg, #f0ece6 0%, #ebe5dd 100%);
  box-shadow: inset 24px 0 34px rgba(95, 77, 62, 0.08);
  transform-origin: 100% var(--fold-center-y);
  transition-delay: 0.12s;
  z-index: 5;
}

.flap-bottom {
  clip-path: polygon(0 100%, 100% 100%, 50% var(--fold-center-y));
  background: linear-gradient(0deg, #f6f3ee 0%, #efebe5 100%);
  box-shadow: inset 0 16px 28px rgba(94, 78, 63, 0.1);
  transform-origin: center bottom;
  transition-delay: 0.2s;
  z-index: 5;
}

.flap-note {
  position: absolute;
  top: clamp(3vh, 5.8vw, 10vh);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--line);
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  transition: transform 0.7s ease, opacity 0.45s ease;
}

.flap-signature {
  position: absolute;
  left: 50%;
  bottom: clamp(5vh, 6.8vw, 8vh);
  transform: translateX(-50%);
  margin: 0;
  color: var(--line);
  text-align: center;
  font-size: clamp(1.25rem, 2.7vw, 2rem);
  letter-spacing: 0.04em;
  transition: transform 0.7s ease, opacity 0.45s ease;
}

.flap-signature strong {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(1.5rem, 3.2vw, 2.7rem);
   font-weight: 700;
    letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.seal-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  transform: translate(-50%, -50%);
  appearance: none;
  width: clamp(124px, 16.4vw, 188px);
  aspect-ratio: 1326 / 1230;
  border: none;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  filter: drop-shadow(0 10px 14px rgba(85, 24, 23, 0.3));
  transition: transform 0.24s ease, filter 0.24s ease, opacity 0.35s ease;
}

.seal-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("assets/wax seal.png") center / contain no-repeat;
}

.seal-button span {
  position: relative;
  z-index: 1;
  color: #fff8f4;
  font-family: var(--font-ui);
  font-size: clamp(1rem, 1.65vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: none;
  text-shadow: 0 1px 1px rgba(64, 16, 16, 0.4);
}

.seal-button:hover,
.seal-button:focus-visible {
  transform: translate(-50%, -50%) scale(1.04);
  filter: drop-shadow(0 12px 16px rgba(85, 24, 23, 0.34));
}

.seal-button:focus-visible {
  outline: 3px solid rgba(179, 58, 55, 0.5);
  outline-offset: 4px;
}

.intro-hint {
  position: absolute;
  top: calc(53.4% + clamp(78px, 11vw, 108px));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--line);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 13;
  opacity: 0.82;
}

.intro.opened .flap-top {
  transform: rotateX(-178deg);
}

.intro.opened .flap-left {
  transform: rotate(-7deg) translateX(-44%);
  opacity: 0.08;
}

.intro.opened .flap-right {
  transform: rotate(7deg) translateX(44%);
  opacity: 0.08;
}

.intro.opened .flap-bottom {
  transform: translateY(48%) rotate(2.5deg);
  opacity: 0.1;
}

.intro.opened .flap-note {
  transform: translateX(-50%) translateY(-16px);
  opacity: 0;
}

.intro.opened .flap-signature {
  transform: translate(-50%, 20px);
  opacity: 0;
}

.intro.opened .seal-button {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.76);
  pointer-events: none;
}

.intro.opened .intro-hint {
  opacity: 0;
  pointer-events: none;
}

.intro.fade-out {
  opacity: 0;
  visibility: hidden;
}

.invitation {
  width: 100%;
  max-width: 940px;
  min-width: min(940px, 92vw);
  flex-shrink: 0;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.5rem) clamp(1rem, 3.2vw, 2rem);
  border: 1.5px solid rgba(123, 41, 38, 0.18);
  border-radius: 26px;
  background: linear-gradient(180deg, #fcfaf6 0%, #f5eee5 100%);
  box-shadow: 0 14px 28px var(--shadow);
  display: grid;
  gap: var(--section-gap);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

body.invitation-visible .invitation {
  opacity: 1;
  transform: translateY(0);
}

.letter-hero,
.letter-card,
.calendar-section,
.location-section,
.countdown-section {
  position: relative;
  margin: 0;
  padding: var(--space-sm) clamp(0.3rem, 1.2vw, 0.8rem);
  border: none;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.letter-hero::before,
.letter-card::before,
.calendar-section::before,
.location-section::before,
.countdown-section::before {
  content: none;
}

.letter-hero {
  min-height: calc(100vh - clamp(1.5rem, 4vw, 2.8rem));
  min-height: calc(100svh - clamp(1.5rem, 4vw, 2.8rem));
  justify-content: center;
  gap: clamp(1.4rem, 4vw, 2.6rem);
  padding-bottom: clamp(3.8rem, 8vw, 5rem);
}

.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + clamp(0.6rem, 2vw, 1.1rem));
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: rgba(106, 33, 31, 0.85);
  pointer-events: none;
  user-select: none;
}

.scroll-indicator__text {
  font-family: var(--font-ui);
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-indicator__arrow {
  display: block;
  font-size: clamp(1.3rem, 2.7vw, 1.7rem);
  line-height: 1;
  animation: scroll-indicator-bounce 1.8s ease-in-out infinite;
}

.eyebrow {
  margin: 0;
  text-align: center;
  color: var(--text-soft);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  text-align: center;
  color: var(--line-strong);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.8vw, 0.85rem);
  font-size: var(--title-lg);
  font-weight: 500;
  white-space: nowrap;
}

.hero-title {
  display: block;
   color: var(--line-strong);
  width: 100%;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  font-family: var(--font-display);
   /* font-size: var(--title-lg); */
   font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 500;
}

.hero-title .no-break {
  white-space: nowrap;
}

.invitation-couple-names {
  padding: 0 0 var(--space-md);
  line-height: 0.98;
  color: var(--line-strong);
  font-family: var(--font-ui);
  font-size: var(--title-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invitation-couple-names + .polaroid-grid {
  margin-top: var(--space-xl);
}

.polaroid-grid + h1 {
  margin-top: var(--space-lg);
}

h1 em {
  color: var(--line);
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.08em;
}

h2 {
  font-size: var(--title-md);
}

.lead {
  margin: 0;
  max-width: 58ch;
  text-align: center;
  color: var(--line-strong);
  line-height: 1.65;
  font-size: var(--text-lg);
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 300px));
  gap: clamp(0.9rem, 2.6vw, 1.5rem);
  align-items: start;
  justify-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.polaroid {
  --polaroid-base-transform: translateY(0) rotate(0deg);
  --polaroid-sway-distance: clamp(2px, 0.45vw, 5px);
  --polaroid-sway-lift: clamp(1px, 0.24vw, 2.5px);
  --polaroid-sway-tilt: 0.95deg;
  --polaroid-sway-origin: 50% 10%;
  --polaroid-sway-duration: 6.6s;
  --polaroid-sway-delay: 0s;
  position: relative;
  margin: 0;
  padding: clamp(0.4rem, 1.2vw, 0.65rem) clamp(0.4rem, 1.2vw, 0.65rem)
    clamp(1.1rem, 2.6vw, 1.45rem);
  border: 1px solid rgba(123, 41, 38, 0.18);
  border-radius: 4px;
  background: linear-gradient(180deg, #fffdfb 0%, #f7f1e9 100%);
  box-shadow: 0 14px 28px rgba(58, 25, 24, 0.15), 0 3px 8px rgba(58, 25, 24, 0.1);
  transform-origin: var(--polaroid-sway-origin);
  transform: translateX(0) var(--polaroid-base-transform);
  animation: polaroid-sway var(--polaroid-sway-duration) ease-in-out infinite;
  animation-delay: var(--polaroid-sway-delay);
  will-change: transform;
}

.polaroid::before,
.polaroid::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 40%;
  height: 13px;
  border: 1px solid rgba(123, 41, 38, 0.13);
  background: rgba(255, 252, 246, 0.78);
  box-shadow: 0 2px 4px rgba(58, 25, 24, 0.08);
  pointer-events: none;
  z-index: 1;
}

.polaroid::before {
  left: 7%;
  transform: rotate(-6deg);
}

.polaroid::after {
  right: 7%;
  transform: rotate(6deg);
}

.polaroid:first-child {
  z-index: 1;
  --polaroid-base-transform: translateY(-6px) rotate(-5deg);
  --polaroid-sway-origin: 16% 8%;
  --polaroid-sway-tilt: 1deg;
  --polaroid-sway-delay: -1.1s;
}

.polaroid:last-child {
  z-index: 3;
  --polaroid-base-transform: translateX(-1%) translateY(12px) rotate(6deg);
  --polaroid-sway-distance: clamp(1.5px, 0.38vw, 4px);
  --polaroid-sway-origin: 84% 8%;
  --polaroid-sway-tilt: 0.9deg;
  --polaroid-sway-duration: 6.1s;
  --polaroid-sway-delay: -2.2s;
}

.photo-frame {
  position: relative;
  aspect-ratio: 7 / 10;
  overflow: hidden;
  border: 1px solid rgba(123, 41, 38, 0.22);
  background: #f8f2e8;
  box-shadow: inset 0 0 0 6px rgba(255, 250, 242, 0.76);
  z-index: 2;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(123, 41, 38, 0.14);
  pointer-events: none;
  z-index: 1;
}

.polaroid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.98) contrast(1.03);
}

.polaroid figcaption {
  margin-top: clamp(0.5rem, 1.8vw, 0.75rem);
  text-align: center;
  color: var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.7vw, 1.65rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: none;
  text-shadow: 0 1px 0 rgba(255, 252, 246, 0.85);
  position: relative;
  z-index: 2;
}

.polaroid:first-child figcaption {
  transform: rotate(-2deg);
}

.polaroid:last-child figcaption {
  transform: rotate(1.6deg);
}

@keyframes polaroid-sway {
  0% {
    transform: translateX(calc(var(--polaroid-sway-distance) * -0.7))
      translateY(var(--polaroid-sway-lift))
      rotate(calc(var(--polaroid-sway-tilt) * -1))
      var(--polaroid-base-transform);
  }

  25% {
    transform: translateX(calc(var(--polaroid-sway-distance) * -0.2))
      translateY(calc(var(--polaroid-sway-lift) * -1))
      rotate(calc(var(--polaroid-sway-tilt) * -0.35))
      var(--polaroid-base-transform);
  }

  50% {
    transform: translateX(var(--polaroid-sway-distance))
      translateY(calc(var(--polaroid-sway-lift) * -0.85))
      rotate(var(--polaroid-sway-tilt))
      var(--polaroid-base-transform);
  }

  75% {
    transform: translateX(calc(var(--polaroid-sway-distance) * 0.25))
      translateY(calc(var(--polaroid-sway-lift) * 0.7))
      rotate(calc(var(--polaroid-sway-tilt) * 0.4))
      var(--polaroid-base-transform);
  }

  100% {
    transform: translateX(calc(var(--polaroid-sway-distance) * -0.7))
      translateY(var(--polaroid-sway-lift))
      rotate(calc(var(--polaroid-sway-tilt) * -1))
      var(--polaroid-base-transform);
  }
}

@keyframes scroll-indicator-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.62;
  }

  45% {
    transform: translateY(7px);
    opacity: 1;
  }
}

.polaroid.missing-photo img {
  display: none;
}

.polaroid.missing-photo .photo-frame::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--line);
  background: linear-gradient(180deg, rgba(247, 239, 230, 0.84) 0%, rgba(243, 231, 218, 0.92) 100%);
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
  z-index: 2;
}

.photo-missing-note {
  margin: 0;
  text-align: center;
  color: var(--text-soft);
  font-size: var(--text-sm);
}

.photo-missing-note code {
  padding: 0.12rem 0.34rem;
  border-radius: 5px;
  background: rgba(123, 41, 38, 0.1);
  font-family: var(--font-ui);
}

.calendar-section,
.location-section,
.countdown-section {
  text-align: center;
}

.letter-card + .calendar-section,
.calendar-section + .location-section,
.location-section + .countdown-section {
  margin-top: 0;
}

.calendar-section {
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

.event-date {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--text-base);
}

.calendar {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: var(--space-2xs) 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.calendar-head {
  padding: 0 0 var(--space-md);
  color: var(--line-strong);
  font-family: var(--font-ui);
  font-size: var(--title-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  /* text-transform: uppercase; */
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
}

.week-days span {
  padding: 0;
  color: var(--line);
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  font-weight: 500;
  text-transform: uppercase;
}

.week-days span:last-child {
  font-weight: 700;
}

.days span {
  min-height: clamp(42px, 5.3vw, 58px);
  display: grid;
  place-items: center;
  color: var(--line);
  font-size: clamp(1rem, 2.35vw, 1.55rem);
  line-height: 1;
}

.days .heart-cell {
  min-height: clamp(42px, 5.3vw, 58px);
  display: grid;
  place-items: center;
}

.heart-day {
  position: relative;
  width: clamp(66px, 8vw, 94px);
  height: clamp(60px, 7.2vw, 86px);
  display: grid;
  place-items: center;
  background: url("assets/heart.png") center / contain no-repeat;
}

.heart-day > span {
  position: relative;
  z-index: 1;
  color: #fff8f5;
  font-size: clamp(1.4rem, 3vw, 1.96rem);
  font-weight: 700;
  line-height: 1;
}

.location-title {
  padding: 0 0 var(--space-md);
  color: var(--line-strong);
  font-family: var(--font-ui);
  font-size: var(--title-md);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
}

.venue-name,
.venue-address {
 color: var(--line-strong);
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 3vw, 1.74rem);
  font-weight: 400;
  line-height: 1.4;
}

.venue-name {
  margin: 0;
  font-family: var(--font-display);
   font-size: var(--title-lg);
  font-weight: 500;
}

.venue-address {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--line-strong);
}

.map-links {
  margin-top: var(--space-xs);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.map-link {
  display: inline-block;
  margin-top: 0;
  padding: 0.68rem 1.35rem;
  border-radius: 6px;
  text-decoration: none;
  color: #fff8f2;
  background: var(--line-strong);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 9px 14px rgba(72, 20, 20, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
}

.map-link:hover,
.map-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 11px 16px rgba(72, 20, 20, 0.26);
}

.countdown {
  --label-row-height: clamp(16px, 1.8vw, 22px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.65rem, 2.35vw, 1.2rem);
  margin-top: 0;
}

.time-unit {
  min-width: clamp(56px, 9.2vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.time-unit span {
  display: block;
  color: var(--line);
  font-family: var(--font-ui);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 500;
  line-height: 1;
}

.time-unit small {
  margin-top: 0.26rem;
  min-height: var(--label-row-height);
  display: flex;
  align-items: flex-start;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.6vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.countdown-section h2 {
  padding: 0 0 var(--space-md);
  line-height: 0.98;
  color: var(--line-strong);
  font-family: var(--font-ui);
  font-size: var(--title-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.countdown-message {
  margin: var(--space-md) 0 0;
  color: var(--line-strong);
  font-size: var(--text-lg);
}

.invite-credit {
  margin: 0;
  padding: var(--space-sm) 0 var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  color: var(--line-strong);
  font-family: var(--font-ui);
  font-size: clamp(0.84rem, 1.7vw, 0.96rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invite-credit-link {
  color: var(--line-strong);
  text-decoration: none;
  border-bottom: 1px solid rgba(106, 33, 31, 0.52);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.invite-credit-link:hover,
.invite-credit-link:focus-visible {
  color: var(--line);
  border-bottom-color: rgba(123, 41, 38, 0.8);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.78s ease, transform 0.78s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .flap-note {
    top: clamp(3vh, 8vw, 8vh);
    font-size: clamp(2rem, 9vw, 3.8rem);
  }

  .flap-signature {
    bottom: clamp(4.8vh, 9vw, 7vh);
    font-size: clamp(1rem, 3.8vw, 1.45rem);
  }

  .flap-signature strong {
    font-size: clamp(1.02rem, 4.6vw, 1.65rem);
    font-weight: 700;
    letter-spacing: 0.04em;
  text-transform: uppercase;
  }
}

@media (max-width: 740px) {
  .seal-button {
    top: 54.2%;
  }

  .intro-hint {
    top: calc(54.2% + clamp(74px, 12vw, 100px));
  }

  .invitation {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: clamp(1rem, 4vw, 1.5rem);
    gap: clamp(3.8rem, 15vw, 5.8rem);
  }

  h1 {
    font-size: clamp(1.68rem, 8.1vw, 2.35rem);
  }

  .polaroid-grid {
    grid-template-columns: repeat(2, minmax(126px, 1fr));
    gap: 0.72rem;
    width: min(100%, 520px);
  }

  .polaroid:first-child {
    --polaroid-base-transform: translateY(-3px) rotate(-4deg);
  }

  .polaroid:last-child {
    --polaroid-base-transform: translateX(-1%) translateY(7px) rotate(4.5deg);
  }

  .countdown {
    gap: clamp(0.62rem, 2.6vw, 1rem);
  }
}

@media (max-width: 480px) {
  .language-switcher {
    top: 0.62rem;
    right: 1.12rem;
  }

  .music-toggle {
    top: 0.62rem;
    left: 1.12rem;
  }

  .language-option {
    min-width: 2.18rem;
    padding: 0.33rem 0.55rem;
    font-size: 0.68rem;
  }

  .flap-note {
    top: 4.6vh;
    font-size: clamp(1.75rem, 9vw, 2.6rem);
  }

  .flap-signature {
    bottom: 4.5vh;
    font-size: 0.98rem;
  }

  .flap-signature strong {
    font-size: clamp(0.86rem, 5.8vw, 1.35rem);
  }

  h1 {
    font-size: clamp(1.4rem, 8vw, 1.95rem);
  }

  .polaroid:first-child {
    --polaroid-base-transform: translateY(-2px) rotate(-3deg);
  }

  .polaroid:last-child {
    --polaroid-base-transform: translateX(-1%) translateY(5px) rotate(3.5deg);
  }

}

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