:root {
  color-scheme: light;
  --black: #120f10;
  --soft-black: #201a1c;
  --white: #fffefd;
  --paper: #f7f2eb;
  --champagne: #e8d2b4;
  --champagne-deep: #b98d61;
  --burgundy: #641c2b;
  --burgundy-dark: #3e101b;
  --ink-soft: #6f6264;
  --cover-x: 0px;
  --cover-y: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: var(--black);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--black);
  background: var(--black);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body:not(.invitation-open) {
  overflow: hidden;
}

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

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--burgundy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.loading-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--champagne);
  background: var(--black);
  transition: opacity 400ms ease, visibility 400ms ease;
}

.loading-screen img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  animation: logo-breathe 1.8s ease-in-out infinite;
}

.loading-screen span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.loading-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.invalid-invite {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px 24px;
  color: var(--paper);
  text-align: center;
  background: var(--black);
}

.invalid-invite img {
  width: 112px;
  margin-bottom: 32px;
}

.invalid-invite h1 {
  max-width: 720px;
  margin: 20px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.03;
}

.invalid-invite > p:not(.eyebrow) {
  max-width: 520px;
  color: #cfc4c5;
  font-size: 15px;
  line-height: 1.8;
}

.invalid-invite a,
.gift-copy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 22px;
  padding: 0 28px;
  color: var(--black);
  background: var(--champagne);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease, background 200ms ease, transform 200ms ease;
}

.invalid-invite a:hover,
.gift-copy a:hover {
  color: var(--white);
  background: var(--black);
  transform: translateY(-3px);
}

.invite-gate {
  --pointer-x: 0px;
  --pointer-y: 0px;
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: clamp(14px, 2.5vh, 28px);
  overflow: hidden;
  min-height: 100dvh;
  padding: clamp(22px, 3.8vh, 42px) 24px clamp(20px, 3vh, 34px);
  color: var(--paper);
  background: var(--black);
  opacity: 0;
  transition: opacity 800ms ease;
}

.invite-gate::before,
.invite-gate::after {
  position: absolute;
  width: min(32vw, 410px);
  aspect-ratio: 1;
  border: 1px solid rgba(232, 210, 180, 0.22);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.invite-gate::before {
  top: -18vw;
  left: -8vw;
}

.invite-gate::after {
  right: -12vw;
  bottom: -20vw;
}

.invite-gate.is-ready {
  opacity: 1;
}

.gate-copy {
  position: absolute;
  z-index: 8;
  top: clamp(24px, 3vh, 32px);
  left: 50%;
  width: min(calc(100% - 48px), 760px);
  max-width: 680px;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 450ms ease, transform 700ms ease;
}

.gate-copy .eyebrow {
  color: var(--champagne);
}

.gate-copy h1 {
  margin: 13px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4.5vw, 52px);
  font-weight: 400;
  line-height: 1.08;
}

.envelope-trigger {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(84vw, 1000px, calc((100dvh - 345px) * 1.42));
  aspect-ratio: 1.42;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  perspective: 1800px;
  transform: translate(
    calc(-50% + var(--pointer-x)),
    calc(-50% + var(--pointer-y))
  );
  transition: transform 260ms ease;
}

.envelope-trigger:disabled {
  cursor: default;
}

.envelope {
  position: absolute;
  inset: 0;
  display: block;
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.52));
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope-back {
  position: absolute;
  inset: 0;
  display: block;
  background: #d7bea0;
  box-shadow:
    inset 0 0 0 1px rgba(79, 53, 37, 0.22),
    inset 0 -18px 32px rgba(109, 76, 51, 0.08);
}

.invitation-preview {
  position: absolute;
  z-index: 1;
  left: 8%;
  right: 8%;
  top: 7%;
  bottom: 8%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  color: var(--burgundy);
  background: var(--paper);
  box-shadow: 0 10px 22px rgba(45, 24, 18, 0.18);
  transition: transform 850ms cubic-bezier(0.16, 1, 0.3, 1) 280ms;
}

.invitation-preview::before {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(100, 28, 43, 0.26);
  content: "";
}

.invitation-preview img {
  width: clamp(68px, 18%, 100px);
  filter: sepia(0.25) saturate(0.8);
}

.invitation-preview small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.envelope-pocket {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
}

.envelope-pocket-left {
  inset: 0;
  background: #e5cfb2;
  clip-path: polygon(0 0, 51% 50%, 0 100%);
  filter: drop-shadow(8px 0 10px rgba(95, 66, 44, 0.05));
}

.envelope-pocket-right {
  inset: 0;
  background: #dcc3a3;
  clip-path: polygon(100% 0, 49% 50%, 100% 100%);
  filter: drop-shadow(-8px 0 10px rgba(95, 66, 44, 0.05));
}

.envelope-pocket-bottom {
  inset: 0;
  background: #ecd9bf;
  clip-path: polygon(0 100%, 50% 47%, 100% 100%);
  box-shadow: inset 0 -1px rgba(79, 53, 37, 0.18);
}

.envelope-flap {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: block;
  background: #ead6ba;
  clip-path: polygon(0 0, 50% 57%, 100% 0);
  filter: drop-shadow(0 7px 7px rgba(91, 61, 40, 0.12));
  transform: rotateX(0deg);
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 800ms cubic-bezier(0.76, 0, 0.24, 1) 180ms, z-index 0ms 620ms;
}

.envelope-flap::after {
  position: absolute;
  inset: 0;
  background: #c9ab87;
  clip-path: polygon(0 0, 50% 57%, 100% 0);
  content: "";
  opacity: 0;
  transform: rotateX(180deg);
  backface-visibility: hidden;
}

.wax-seal {
  position: absolute;
  z-index: 7;
  top: 48%;
  left: 50%;
  display: grid;
  width: clamp(116px, 17%, 190px);
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  filter:
    drop-shadow(0 14px 12px rgba(45, 10, 18, 0.36))
    drop-shadow(0 3px 2px rgba(45, 10, 18, 0.52));
  transform: translate(-50%, -50%);
  transition: opacity 350ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wax-seal::before {
  position: absolute;
  z-index: 2;
  inset: 25%;
  border: 1px solid rgba(255, 231, 200, 0.24);
  border-radius: 50%;
  content: "";
  box-shadow:
    inset 0 2px 4px rgba(255, 236, 214, 0.18),
    inset 0 -3px 5px rgba(48, 7, 16, 0.42);
  pointer-events: none;
}

.seal-ridge {
  position: absolute;
  z-index: 3;
  inset: 20%;
  border: 1px solid rgba(232, 210, 180, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.wax-texture {
  position: absolute;
  z-index: 1;
  inset: -5%;
  width: 110%;
  height: 110%;
  object-fit: contain;
  pointer-events: none;
}

.wax-seal .seal-monogram {
  position: relative;
  z-index: 4;
  width: 48%;
  height: 48%;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(35, 5, 12, 0.7));
  opacity: 0.96;
}

.envelope-trigger:hover .wax-seal {
  transform: translate(-50%, -50%) scale(1.08);
}

.open-hint {
  position: absolute;
  z-index: 8;
  bottom: clamp(20px, 3.5vh, 38px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: #bfb1b2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 350ms ease, transform 500ms ease;
  animation: hint-pulse 2s ease-in-out infinite;
}

.open-hint span {
  width: 36px;
  height: 1px;
  background: var(--champagne-deep);
}

.particle-field {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle-field span {
  position: absolute;
  left: var(--x);
  bottom: -30px;
  color: var(--champagne);
  font-family: Georgia, serif;
  font-size: var(--size);
  opacity: 0;
  animation: float-particle var(--duration) linear var(--delay) infinite;
}

.invite-gate.is-opening .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.65) rotate(18deg);
}

.invite-gate.is-opening .envelope-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

.invite-gate.is-opening .invitation-preview {
  transform: translateY(-48%);
}

.invite-gate.is-opening .envelope {
  transform: translateY(20%) scale(0.94);
}

.invite-gate.is-opening .gate-copy {
  opacity: 0;
  transform: translate(-50%, -18px);
}

.invite-gate.is-opening .open-hint {
  opacity: 0;
  transform: translate(-50%, 18px);
}

.invite-gate.is-opening {
  pointer-events: none;
  animation: gate-exit 650ms ease 850ms forwards;
}

.invitation {
  min-height: 100dvh;
  opacity: 0;
  background: var(--white);
}

.invitation.is-revealed {
  opacity: 1;
  transition: opacity 900ms ease;
}

.invite-cover {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  padding: 30px clamp(22px, 6vw, 90px);
  color: var(--black);
  background: var(--paper);
}

.invite-cover::before,
.invite-cover::after {
  position: absolute;
  border: 1px solid rgba(100, 28, 43, 0.14);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(var(--cover-x), var(--cover-y));
  transition: transform 400ms ease-out;
}

.invite-cover::before {
  width: min(46vw, 620px);
  aspect-ratio: 1;
  top: -24vw;
  left: -16vw;
}

.invite-cover::after {
  width: min(32vw, 440px);
  aspect-ratio: 1;
  right: -14vw;
  bottom: -18vw;
}

.invite-cover .particle-field span {
  color: var(--burgundy);
  opacity: 0.18;
}

.cover-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cover-header img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: sepia(0.1) saturate(0.85);
}

.cover-header span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cover-content {
  position: relative;
  z-index: 3;
  align-self: center;
  justify-self: center;
  width: min(100%, 960px);
  padding: clamp(38px, 7vh, 72px) 0;
  text-align: center;
}

.cover-content .eyebrow {
  margin-bottom: 11px;
}

.guest-name {
  margin: 0 auto;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 2.7vw, 29px);
  font-style: italic;
  line-height: 1.35;
}

.ornament {
  display: block;
  margin: clamp(24px, 4vh, 40px) 0;
  color: var(--champagne-deep);
  font-size: 9px;
}

.cover-content h1 {
  display: grid;
  gap: 2px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 9.5vw, 128px);
  font-weight: 400;
  line-height: 0.83;
}

.cover-content h1 small {
  margin: 7px 0;
  color: var(--burgundy);
  font-size: 0.27em;
  font-style: italic;
  font-weight: 400;
}

.cover-date {
  margin: clamp(32px, 5vh, 52px) 0 0;
  color: var(--burgundy);
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 800;
  letter-spacing: 0;
}

.cover-subtitle {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.7vw, 20px);
  font-style: italic;
}

.reveal-item {
  opacity: 0;
  transform: translateY(24px);
}

.is-revealed .reveal-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 800ms ease, transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-revealed .reveal-item:nth-child(2) {
  transition-delay: 120ms;
}

.is-revealed .reveal-item:nth-child(3) {
  transition-delay: 220ms;
}

.is-revealed .reveal-item:nth-child(4) {
  transition-delay: 320ms;
}

.is-revealed .reveal-item:nth-child(5) {
  transition-delay: 440ms;
}

.is-revealed .reveal-item:nth-child(6) {
  transition-delay: 520ms;
}

.scroll-cue {
  position: relative;
  z-index: 4;
  justify-self: center;
  width: 34px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(18, 15, 16, 0.28);
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}

.scroll-cue span {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 3px;
  height: 8px;
  border-radius: 4px;
  background: var(--burgundy);
  transform: translateX(-50%);
  animation: scroll-dot 1.8s ease-in-out infinite;
}

.countdown-section {
  min-height: 66vh;
  display: grid;
  align-content: center;
  gap: clamp(50px, 8vw, 100px);
  padding: clamp(80px, 11vw, 150px) clamp(24px, 7vw, 110px);
  color: var(--white);
  background: var(--black);
  text-align: center;
}

.section-heading h2,
.letter-copy h2,
.date-intro h2,
.gift-copy h2 {
  margin: 12px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.02;
}

.countdown-section .eyebrow,
.gift-section .eyebrow {
  color: var(--champagne);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 1080px);
  margin: 0 auto;
}

.countdown div {
  min-width: 0;
  padding: 10px clamp(8px, 3vw, 38px);
  border-left: 1px solid rgba(232, 210, 180, 0.24);
}

.countdown div:last-child {
  border-right: 1px solid rgba(232, 210, 180, 0.24);
}

.countdown strong {
  display: block;
  color: var(--champagne);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7.5vw, 92px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown span {
  display: block;
  margin-top: 16px;
  color: #b7acad;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.countdown-complete {
  color: var(--champagne);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 80px);
}

.letter-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  min-height: 92vh;
  overflow: hidden;
  background: var(--white);
}

.letter-copy {
  align-self: center;
  max-width: 780px;
  padding: clamp(80px, 10vw, 150px) clamp(28px, 8vw, 130px);
}

.letter-copy > p:not(.eyebrow) {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.8;
}

.signature {
  display: grid;
  gap: 9px;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid rgba(100, 28, 43, 0.18);
}

.signature span {
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
}

.signature strong {
  color: var(--burgundy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 2vw, 29px);
  font-weight: 400;
  line-height: 1.35;
}

.portrait-scene {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  background: var(--burgundy-dark);
}

.portrait-scene::before {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(232, 210, 180, 0.25);
  content: "";
}

.portrait-scene img {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -14%;
  width: min(92%, 560px);
  max-height: 92%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 22px 38px rgba(0, 0, 0, 0.35));
  transform: translateX(-50%);
}

.portrait-monogram {
  position: absolute;
  z-index: 1;
  top: 10%;
  left: 50%;
  color: rgba(232, 210, 180, 0.11);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(120px, 18vw, 260px);
  line-height: 0.48;
  text-align: center;
  transform: translateX(-50%);
}

.portrait-monogram i {
  font-size: 0.22em;
  font-weight: 400;
}

.date-section {
  min-height: 82vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "intro date"
    "button date";
  align-content: center;
  align-items: end;
  gap: 34px clamp(50px, 10vw, 160px);
  padding: clamp(80px, 11vw, 150px) clamp(28px, 9vw, 150px);
  background: var(--paper);
}

.date-intro {
  grid-area: intro;
  max-width: 720px;
}

.date-intro > p:last-child {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.date-composition {
  grid-area: date;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto 1fr;
  align-items: end;
  min-width: min(34vw, 410px);
  color: var(--burgundy);
}

.date-composition > span {
  grid-column: 1 / -1;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(100, 28, 43, 0.3);
  font-size: 12px;
  font-weight: 900;
}

.date-composition > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(120px, 18vw, 240px);
  font-weight: 400;
  line-height: 0.84;
}

.date-composition > div {
  display: grid;
  align-self: stretch;
  align-content: space-between;
  padding: 20px 0 9px 20px;
}

.date-composition b,
.date-composition small {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.outline-button {
  grid-area: button;
  justify-self: start;
  min-height: 50px;
  padding: 0 25px;
  border: 1px solid var(--burgundy);
  border-radius: 0;
  color: var(--burgundy);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
}

.outline-button:hover {
  color: var(--white);
  background: var(--burgundy);
}

.gift-section {
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(48px, 8vw, 130px);
  padding: clamp(80px, 10vw, 140px) clamp(28px, 9vw, 150px);
  color: var(--white);
  background: var(--burgundy);
}

.gift-mark {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(232, 210, 180, 0.28);
  border-radius: 50%;
}

.gift-mark::before,
.gift-mark::after {
  position: absolute;
  border: 1px solid rgba(232, 210, 180, 0.18);
  border-radius: 50%;
  content: "";
}

.gift-mark::before {
  inset: 8%;
}

.gift-mark::after {
  inset: 18%;
}

.gift-mark img {
  width: 48%;
  height: 48%;
  object-fit: contain;
}

.gift-copy {
  max-width: 720px;
}

.gift-copy p:not(.eyebrow) {
  max-width: 590px;
  margin: 25px 0 0;
  color: #e1d4d5;
  font-size: 16px;
  line-height: 1.8;
}

.gift-copy a:hover {
  color: var(--burgundy);
  background: var(--white);
}

.invite-footer {
  min-height: 58vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 80px 24px;
  color: var(--paper);
  background: var(--black);
  text-align: center;
}

.invite-footer img {
  width: 96px;
  margin-bottom: 30px;
}

.invite-footer p {
  margin: 0 0 14px;
  color: #bfb2b3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-style: italic;
}

.invite-footer strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 400;
}

.invite-footer span {
  margin-top: 17px;
  color: var(--champagne);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invite-footer a {
  margin-top: 46px;
  color: #918486;
  font-size: 11px;
  text-decoration: none;
}

.observe {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 850ms ease, transform 950ms cubic-bezier(0.16, 1, 0.3, 1);
}

.observe.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes logo-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12%,
  72% {
    opacity: 0.38;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -112vh, 0) rotate(160deg);
  }
}

@keyframes gate-exit {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes scroll-dot {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 19px);
  }
}

@media (max-width: 820px) {
  .invite-gate {
    display: block;
    padding: 0;
  }

  .envelope-trigger {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    transform: none;
  }

  .envelope {
    filter: none;
  }

  .gate-copy {
    top: clamp(26px, 5.5vh, 52px);
    z-index: 9;
    width: min(calc(100% - 40px), 520px);
  }

  .gate-copy .eyebrow {
    color: var(--burgundy);
  }

  .gate-copy h1 {
    color: var(--black);
  }

  .open-hint {
    z-index: 9;
    bottom: max(24px, env(safe-area-inset-bottom));
    color: rgba(62, 16, 27, 0.76);
    white-space: nowrap;
  }

  .open-hint span {
    background: var(--burgundy);
  }

  .invitation-preview {
    top: 4%;
    bottom: 4%;
  }

  .wax-seal {
    top: 51%;
    width: clamp(124px, 31vw, 154px);
  }

  .invite-gate.is-opening .invitation-preview {
    transform: translateY(-28%);
  }

  .invite-gate.is-opening .envelope {
    transform: translateY(5%) scale(0.98);
  }

  .letter-section {
    grid-template-columns: 1fr;
  }

  .portrait-scene {
    min-height: min(105vw, 700px);
  }

  .portrait-scene img {
    bottom: -17%;
    width: min(78%, 520px);
  }

  .date-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "date"
      "button";
    align-items: start;
  }

  .date-composition {
    width: min(100%, 440px);
    min-width: 0;
  }

  .gift-section {
    grid-template-columns: 1fr;
  }

  .gift-mark {
    width: min(66vw, 330px);
  }
}

@media (max-width: 560px) {
  .invite-gate {
    min-height: 100dvh;
  }

  .gate-copy {
    padding: 0 20px;
  }

  .gate-copy h1 {
    max-width: 330px;
  }

  .wax-seal {
    width: clamp(118px, 33vw, 146px);
  }

  .open-hint {
    gap: 9px;
  }

  .open-hint span {
    width: 18px;
  }

  .invite-cover {
    min-height: 100dvh;
    padding: 22px 20px 18px;
  }

  .cover-header img {
    width: 48px;
    height: 48px;
  }

  .cover-content h1 {
    font-size: clamp(50px, 17vw, 80px);
    line-height: 0.88;
  }

  .guest-name {
    max-width: 320px;
    font-size: 18px;
  }

  .cover-date {
    margin-top: 28px;
  }

  .countdown-section {
    min-height: 75vh;
    gap: 46px;
    padding-left: 17px;
    padding-right: 17px;
  }

  .countdown div {
    padding: 8px 4px;
  }

  .countdown strong {
    font-size: clamp(34px, 11vw, 54px);
  }

  .countdown span {
    margin-top: 12px;
    font-size: 8px;
  }

  .letter-copy {
    padding-left: 24px;
    padding-right: 24px;
  }

  .portrait-scene {
    min-height: 130vw;
  }

  .portrait-scene::before {
    inset: 18px;
  }

  .portrait-scene img {
    bottom: -13%;
    width: 92%;
  }

  .date-section,
  .gift-section {
    padding-left: 24px;
    padding-right: 24px;
  }

  .date-composition > strong {
    font-size: clamp(120px, 43vw, 190px);
  }

  .gift-mark {
    width: min(82vw, 320px);
  }
}

@media (max-height: 700px) and (min-width: 821px) {
  .invite-gate {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .gate-copy h1 {
    font-size: 28px;
  }

  .envelope-trigger {
    width: min(82vw, 880px, calc((100dvh - 250px) * 1.42));
  }

  .cover-content {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .cover-content h1 {
    font-size: min(14vh, 90px);
  }

  .ornament {
    margin-top: 16px;
    margin-bottom: 16px;
  }

  .cover-date {
    margin-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
