@font-face {
  font-family: "Safira March";
  src: url("./assets/Safira March Personal Use Only.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Evolventa";
  src: url("./assets/Evolventa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf8f0;
  --ink: #33251c;
  --brown: #3a251b;
  --evolventa: Evolventa, Arial, Helvetica, sans-serif;
  --safira: "Safira March", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fff;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Georgia, serif;
}

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

.phone-frame {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: #fff;
}

.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  transition: opacity 1.1s ease, visibility 1.1s ease;
}

.envelope-screen.is-gone {
  visibility: hidden;
  opacity: 0;
}

.video-envelope {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
}

.video-envelope video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site {
  position: relative;
  min-height: 100vh;
  background: #fff;
}

.site.is-revealed {
  animation: revealSite 1s ease both;
}

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

.top-controls {
  position: fixed;
  top: 18px;
  right: 16px;
  z-index: 12;
}

.language-toggle {
  position: fixed;
  top: 18px;
  left: 16px;
  z-index: 12;
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(77, 55, 39, 0.22);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(53, 38, 27, 0.14);
  font-family: var(--evolventa);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.language-button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.music-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(77, 55, 39, 0.22);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(53, 38, 27, 0.14);
}

.music-toggle.is-playing {
  color: var(--paper);
  background: var(--ink);
}

.music-toggle span {
  font-size: 18px;
  transform: translateY(-1px);
}

.language-version {
  display: none;
}

.language-version.is-active {
  display: block;
}

.invite-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #fff;
}

.invite-page img,
.invite-page video {
  display: block;
  width: 100%;
  min-height: 100svh;
  object-fit: cover;
}

.invite-page video {
  background: #fff;
}

.composite-page > img,
.layer-bg {
  position: relative;
  z-index: 1;
}

.composite-animation {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  opacity: 0;
  background: transparent;
  transition: opacity 0.45s ease;
}

.composite-animation.is-playing,
.composite-animation[data-played="true"] {
  opacity: 1;
}

.composite-page-3 .composite-animation {
  inset: auto 0 14.8% 0;
  width: 100%;
  height: 31%;
  min-height: 0;
  object-fit: contain;
  object-position: center center;
}

.layer-element {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  min-height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: none;
  filter: none;
  clip-path: inset(0 0 0 0);
  transition:
    opacity 4.8s ease,
    transform 4.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 4.8s ease,
    clip-path 4.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.28s;
  will-change: opacity, transform, filter, clip-path;
}

.anim-slide-left {
  transform: translateX(-52px);
  filter: blur(8px);
}

.anim-scale {
  transform: scale(0.9);
  filter: blur(10px);
}

.anim-soft-down {
  transform: translateY(-32px);
  filter: blur(10px);
}

.anim-wipe-down {
  clip-path: inset(0 0 100% 0);
}

.anim-wipe-right {
  clip-path: inset(0 100% 0 0);
}

.anim-speed-fast {
  transition-duration: 4.2s, 4.2s, 4.2s, 4.2s;
}

.anim-speed-quick {
  transition-duration: 4s, 4s, 4s, 4s;
}

.anim-speed-slow {
  transition-duration: 4.5s, 4.5s, 4.5s, 4.5s;
}

.layer-element.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  clip-path: inset(0 0 0 0);
}

.map-button {
  position: absolute;
  right: 16%;
  bottom: 12.6%;
  left: 16%;
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 0;
  color: #fff;
  background: var(--brown);
  font-family: var(--evolventa);
  font-size: clamp(15px, 4.1vw, 18px);
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
}

.rsvp-form {
  position: absolute;
  top: 26.2%;
  right: 11.5%;
  left: 11.5%;
  display: grid;
  gap: 13px;
  color: #111;
  font-family: var(--evolventa);
  font-size: clamp(11px, 3.05vw, 14px);
  font-weight: 400;
}

.form-label,
.rsvp-form legend {
  font-family: var(--evolventa);
  font-size: clamp(13px, 3.45vw, 16px);
  font-weight: 400;
  line-height: 1.25;
}

.rsvp-form input[type="text"] {
  width: 100%;
  min-height: 35px;
  padding: 6px 10px;
  border: 1px solid rgba(58, 37, 27, 0.26);
  border-radius: 0;
  color: #111;
  background: rgba(255, 255, 255, 0.64);
  font-family: var(--evolventa);
  font-size: 14px;
  font-weight: 400;
}

.rsvp-form fieldset {
  display: grid;
  gap: 10px;
  margin: 9px 0 0;
  padding: 0;
  border: 0;
}

.rsvp-form legend {
  margin-bottom: 7px;
}

.rsvp-form fieldset label {
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 8px;
  align-items: center;
  line-height: 1.28;
  font-weight: 400;
}

.rsvp-form input[type="radio"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--brown);
}

.rsvp-form button {
  min-height: 40px;
  margin-top: 8px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--brown);
  font-family: var(--evolventa);
  font-size: clamp(13px, 3.45vw, 16px);
  font-weight: 400;
}

.form-status {
  min-height: 16px;
  margin: 0;
  font-family: var(--evolventa);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

.wedding-countdown {
  position: absolute;
  right: 7%;
  bottom: 8.8%;
  left: 7%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  color: #fff;
  font-family: var(--safira);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.wedding-countdown strong {
  display: block;
  font-size: clamp(25px, 7.4vw, 36px);
  font-weight: 400;
  line-height: 0.9;
  font-variant-numeric: lining-nums tabular-nums;
}

.wedding-countdown span {
  display: block;
  margin-top: 4px;
  font-size: clamp(10px, 2.9vw, 14px);
  line-height: 1;
}

@media (min-width: 431px) {
  body {
    padding: 0;
  }

  .phone-frame,
  .envelope-screen {
    min-height: 100vh;
    border-radius: 0;
  }
}

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