/* --- Tokens --- */
:root {
  --mauve: #c49a9b;
  --sage: #939b71;
  --vintage-peach: #b58470;
  --rust: #7a4526;
  --cream: #faf8f5;
  --cream-dark: #f0ebe4;
  --ink: #3d3229;
  --ink-muted: #6b5d52;
  --white: #ffffff;

  --suit-sage: #6e7158;
  --suit-mauve-accent: #9a7a7c;
  --suit-peach: #b8956f;
  --suit-rust: #4a3228;

  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Montserrat", system-ui, sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 2px;
  --max-mobile: 420px;
  --max-desktop: 1140px;
  --nav-w: 200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream-dark);
  -webkit-font-smoothing: antialiased;
}

body.intro-active {
  overflow: hidden;
}

body.intro-active .page,
body.intro-active .nav-desktop {
  opacity: 0;
  pointer-events: none;
}

body.intro-revealed .page,
body.intro-revealed .nav-desktop {
  opacity: 1;
  transition: opacity 0.9s var(--ease) 0.15s;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--rust);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Side nav (desktop) --- */
.nav-desktop {
  display: none;
}

/* --- Page shell --- */
.page {
  max-width: var(--max-mobile);
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 60px rgba(61, 50, 41, 0.08);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(180deg, rgba(61, 50, 41, 0.35) 0%, rgba(61, 50, 41, 0.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem 3rem;
}

.hero__label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin: 0 0 2rem;
  opacity: 0.9;
}

.hero__names {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  line-height: 1.15;
  margin: 0 0 1.25rem;
  letter-spacing: 0.02em;
}

.hero__name {
  display: block;
}

.hero__amp {
  display: block;
  font-size: 0.55em;
  font-style: italic;
  margin: 0.15em 0;
  opacity: 0.85;
}

.hero__date {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 2.5rem;
}

.hero__hint {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0;
}

.hero__scroll {
  display: block;
  width: 1px;
  height: 48px;
  margin: 1.5rem auto 0;
  background: linear-gradient(to bottom, var(--white), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Split row (intro + countdown) --- */
.split-row {
  display: block;
}

/* --- Sections --- */
.section {
  padding: 3rem 1.75rem;
  text-align: center;
}

.section--intro {
  padding-top: 3.5rem;
}

.section__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 1.25rem;
}

.section__title--center {
  text-align: center;
}

.section__lead {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 1.5rem;
}

.section__text {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
}

.section__text--center {
  text-align: center;
}

.section__text strong {
  font-weight: 500;
  color: var(--rust);
}

.section__text--venue {
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

/* --- Countdown --- */
.section--countdown {
  background: var(--cream-dark);
  padding: 2.5rem 1.75rem;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-family: var(--font-serif);
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.5rem;
}

.countdown__value {
  font-size: 2rem;
  font-weight: 400;
  color: var(--rust);
  line-height: 1;
}

.countdown__label {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.35rem;
}

.countdown__sep {
  font-size: 1.25rem;
  color: var(--mauve);
  opacity: 0.6;
  align-self: flex-start;
  margin-top: 0.35rem;
}

/* --- Venue gallery --- */
.section--venue {
  padding-left: 1rem;
  padding-right: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
}

.gallery__item {
  position: relative;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1;
}

.gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery__item:hover img {
  transform: scale(1.04);
}

.gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.65rem;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(transparent, rgba(61, 50, 41, 0.75));
  text-align: left;
}

.gallery__note {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

.gallery__note code {
  font-size: 12px;
  background: var(--cream-dark);
  padding: 0.1em 0.35em;
}

/* --- Details --- */
.details__grid {
  text-align: center;
}

.details__date {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.details__meta {
  margin-bottom: 0;
}

/* --- Timeline --- */
.section--timeline {
  background: var(--white);
  text-align: left;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--cream-dark);
}

.timeline__item:last-child {
  border-bottom: none;
}

.timeline__time {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--rust);
  font-weight: 500;
}

.timeline__heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.timeline__body p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

/* --- Dress code --- */
.section--dress {
  padding-left: 0;
  padding-right: 0;
}

.dress__hero {
  position: relative;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.75rem;
  background: var(--cream-dark);
}

.dress__palette {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(220px, 55vw);
  box-shadow: 0 12px 40px rgba(61, 50, 41, 0.25);
}

.dress__swatch {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(0.6rem, 2.5vw, 0.75rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.3;
}

.dress__swatch--mauve { background: var(--mauve); }
.dress__swatch--sage { background: var(--sage); }
.dress__swatch--peach { background: var(--vintage-peach); }
.dress__swatch--rust { background: var(--rust); }

@media (max-width: 899px) {
  .dress__hero {
    display: none;
  }
}

.dress__content {
  padding: 2.5rem 1.75rem 3rem;
  text-align: center;
}

/* Outfit examples */
.outfits {
  text-align: left;
  margin-top: 2rem;
}

.outfits__group {
  margin-bottom: 2rem;
}

.outfits__group:last-child {
  margin-bottom: 0;
}

.outfits__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--rust);
  margin: 0 0 1rem;
  letter-spacing: 0.06em;
}

.outfits__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.outfit-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--cream-dark);
}

.outfit-card__swatch {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(61, 50, 41, 0.12);
}

.outfit-card__swatch--mauve { background: var(--mauve); }
.outfit-card__swatch--sage { background: var(--sage); }
.outfit-card__swatch--peach { background: var(--vintage-peach); }
.outfit-card__swatch--rust { background: var(--rust); }
.outfit-card__swatch--suit-sage { background: linear-gradient(135deg, var(--suit-sage) 55%, #8a8d72 55%); }
.outfit-card__swatch--suit-mauve { background: linear-gradient(135deg, #5c5a58 55%, var(--suit-mauve-accent) 55%); }
.outfit-card__swatch--suit-peach { background: linear-gradient(135deg, var(--suit-peach) 55%, #e8dcc8 55%); }
.outfit-card__swatch--suit-rust { background: linear-gradient(135deg, var(--suit-rust) 55%, var(--vintage-peach) 55%); }

.outfit-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 14px;
  color: var(--ink-muted);
}

.outfit-card__text strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 15px;
}

/* --- Gifts --- */
.section--gifts {
  background: var(--cream-dark);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  color: var(--rust);
  border: 1px solid var(--rust);
}

.btn--outline:hover {
  background: var(--rust);
  color: var(--white);
  text-decoration: none;
}

.btn--primary {
  width: 100%;
  background: var(--sage);
  color: var(--white);
  border: 1px solid var(--sage);
  margin-top: 0.5rem;
}

.btn--primary:hover {
  background: var(--rust);
  border-color: var(--rust);
}

/* --- RSVP --- */
.section--rsvp {
  background: var(--cream-dark);
  text-align: left;
}

.section--rsvp .section__title,
.section--rsvp .section__text--center {
  text-align: center;
}

.rsvp__inner {
  max-width: 100%;
}

.rsvp-form {
  margin-top: 2rem;
}

.field {
  margin-bottom: 1.75rem;
  border: none;
  padding: 0;
}

.field--group {
  margin-bottom: 1.75rem;
}

.field__label,
.field--group legend {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.75rem;
}

.field__hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin: -0.35rem 0 0.75rem;
}

.field__input {
  width: 100%;
  padding: 0.85rem 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--mauve);
  outline: none;
  transition: border-color 0.2s;
}

.field__input:focus {
  border-bottom-color: var(--rust);
}

.field__input::placeholder {
  color: #b5a99e;
}

.field__error {
  display: block;
  font-size: 12px;
  color: #a63d3d;
  margin-top: 0.35rem;
  min-height: 1em;
}

/* Radio & checkbox */
.radio,
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-muted);
}

.radio input,
.check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio__mark,
.check__mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid var(--mauve);
  transition: border-color 0.2s, background 0.2s;
}

.radio__mark {
  border-radius: 50%;
}

.check__mark {
  border-radius: var(--radius);
}

.radio input:checked + .radio__mark {
  border-color: var(--rust);
  background: radial-gradient(circle, var(--rust) 40%, transparent 42%);
}

.check input:checked + .check__mark {
  border-color: var(--sage);
  background: var(--sage);
  position: relative;
}

.check input:checked + .check__mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.radio input:focus-visible + .radio__mark,
.check input:focus-visible + .check__mark,
.field__input:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

/* --- Footer --- */
.footer {
  padding: 3rem 1.75rem 4rem;
  text-align: center;
  background: var(--ink);
  color: var(--cream);
}

.footer__sign {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 0.5rem;
}

.footer__names {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  margin: 0 0 0.5rem;
}

.footer__wait {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  opacity: 0.85;
  margin: 0 0 2rem;
}

.footer__top {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mauve);
}

.footer__top:hover {
  color: var(--white);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 50, 41, 0.92);
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox__caption {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--cream);
  letter-spacing: 0.08em;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--cream);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__nav--prev { left: 0.5rem; }
.lightbox__nav--next { right: 0.5rem; }

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 50, 41, 0.5);
  backdrop-filter: blur(4px);
}

.modal__box {
  position: relative;
  background: var(--white);
  padding: 2.5rem 2rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--rust);
  margin: 0 0 1rem;
}

.modal__text {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  font-size: 14px;
}

/* Mobile tweaks */
@media (min-width: 480px) {
  body {
    padding: 2rem 0;
  }

  .hero__name {
    display: inline;
  }

  .hero__amp {
    display: inline;
    margin: 0 0.25em;
  }
}

/* ========== DESKTOP (полноценная версия) ========== */
@media (min-width: 900px) {
  body {
    padding: 0;
    display: grid;
    grid-template-columns: var(--nav-w) 1fr;
    min-height: 100vh;
  }

  .nav-desktop {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 2rem 1.25rem;
    background: var(--ink);
    z-index: 50;
  }

  .nav-desktop a {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(250, 248, 245, 0.55);
    text-decoration: none;
    padding: 0.45rem 0;
    transition: color 0.2s;
  }

  .nav-desktop a:hover {
    color: var(--mauve);
    text-decoration: none;
  }

  .page {
    max-width: none;
    margin: 0;
    box-shadow: none;
    width: 100%;
  }

  /* Hero full width */
  .hero {
    min-height: 92vh;
  }

  .hero__names {
    font-size: 4.5rem;
  }

  .hero__date {
    font-size: 1.5rem;
  }

  /* Intro + countdown side by side */
  .split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: var(--max-desktop);
    margin: 0 auto;
    gap: 0;
  }

  .split-row .section--intro {
    padding: 4rem 3rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .split-row .section--countdown {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .section__lead {
    font-size: 1.65rem;
  }

  .countdown__value {
    font-size: 2.75rem;
  }

  /* Venue — wide layout */
  .section--venue {
    max-width: var(--max-desktop);
    margin: 0 auto;
    padding: 4rem 2rem;
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .gallery__item--wide {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery__item:nth-child(1) {
    grid-column: 1 / 3;
    aspect-ratio: 16 / 10;
  }

  /* Details two columns */
  .section--details {
    max-width: var(--max-desktop);
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
  }

  .details__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    text-align: left;
    align-items: start;
  }

  .details__date {
    font-size: 2rem;
  }

  /* Timeline horizontal */
  .section--timeline {
    padding: 4rem 2rem;
  }

  .section--timeline .section__title {
    margin-bottom: 2.5rem;
  }

  .timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    max-width: var(--max-desktop);
    margin: 0 auto;
    position: relative;
  }

  .timeline::before {
    content: "";
    position: absolute;
    top: 2.5rem;
    left: 8%;
    right: 8%;
    height: 1px;
    background: var(--mauve);
    opacity: 0.4;
  }

  .timeline__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1rem 0;
    border: none;
    position: relative;
  }

  .timeline__time {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    background: var(--white);
    padding: 0 0.5rem;
  }

  .timeline__body {
    padding-top: 0.5rem;
  }

  /* Dress — split layout */
  .section--dress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: none;
    padding: 0;
  }

  .dress__hero {
    margin: 0;
    padding: 4rem 2rem;
    align-self: stretch;
  }

  .dress__palette {
    flex-direction: row;
    width: min(90%, 480px);
  }

  .dress__swatch {
    aspect-ratio: auto;
    flex: 1;
    min-height: 120px;
  }

  .dress__content {
    padding: 4rem 3rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .outfits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
  }

  .outfits__group {
    margin-bottom: 0;
  }

  /* Gifts */
  .section--gifts {
    padding: 4rem 2rem;
  }

  .gifts__inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
  }

  /* RSVP centered card */
  .section--rsvp {
    padding: 5rem 2rem;
  }

  .rsvp__inner {
    max-width: 480px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border: 1px solid var(--cream-dark);
    box-shadow: 0 8px 40px rgba(61, 50, 41, 0.06);
  }

  .footer {
    padding: 4rem 2rem;
  }

  .footer__names {
    font-size: 2.75rem;
  }

  .lightbox__nav--prev { left: 2rem; }
  .lightbox__nav--next { right: 2rem; }
}

@media (min-width: 1200px) {
  :root {
    --nav-w: 220px;
    --max-desktop: 1280px;
  }

  .hero__names {
    font-size: 5rem;
  }
}

/* ========== Envelope intro ========== */
.envelope-intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #f5f0ea 0%, var(--cream-dark) 55%, #e8e0d6 100%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.envelope-intro.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-intro.is-hidden {
  display: none;
}

.envelope-intro__glow {
  position: absolute;
  width:  min(90vw, 420px);
  height: min(90vw, 420px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 154, 155, 0.25) 0%, transparent 70%);
  animation: envelope-glow 3s ease-in-out infinite;
}

.envelope-intro__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  overflow: visible;
}

.envelope__hint {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-style: italic;
  color: var(--rust);
  letter-spacing: 0.04em;
  animation: hint-pulse 2s ease-in-out infinite;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.envelope-intro.is-opening .envelope__hint,
.envelope-intro.is-leaving .envelope__hint {
  opacity: 0;
  transform: translateY(-12px);
  animation: none;
  pointer-events: none;
}

@keyframes envelope-glow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.envelope {
  position: relative;
  z-index: 1;
  display: inline-block;
  overflow: visible;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: envelope-enter 1s var(--ease) both;
}

@keyframes envelope-enter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.envelope:focus-visible .envelope__wrap {
  outline: 2px solid var(--rust);
  outline-offset: 8px;
}

.envelope__wrap {
  display: block;
  position: relative;
  z-index: 2;
  width: min(280px, 78vw);
  height: 190px;
  overflow: visible;
  border-radius: 4px;
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.5s var(--ease);
}

.envelope:not(:disabled):hover .envelope__wrap {
  transform: translateY(-4px);
}

.envelope-intro.is-opening .envelope,
.envelope-intro.is-leaving .envelope {
  pointer-events: none;
}

.envelope__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -12px;
  height: 24px;
  background: rgba(61, 50, 41, 0.18);
  border-radius: 50%;
  filter: blur(8px);
  transition: opacity 0.5s, transform 0.5s;
}

.envelope-intro.is-opening .envelope__shadow,
.envelope-intro.is-leaving .envelope__shadow {
  opacity: 0;
  transform: scale(0.6);
}

.envelope__back {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e8ddd2 0%, #d9cfc4 100%);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(61, 50, 41, 0.15);
}

.envelope__card {
  position: absolute;
  left: 14%;
  width: 72%;
  top: 52%;
  height: 88px;
  background: var(--white);
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(61, 50, 41, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    transform 1.6s cubic-bezier(0.22, 0.85, 0.32, 1) 0.15s,
    opacity 0.45s ease 0.12s;
}

.envelope-intro.is-opening .envelope__card {
  opacity: 1;
  z-index: 100;
  transform: translateY(-11rem);
}

.envelope-intro.is-leaving .envelope__card {
  opacity: 0;
  transform: translateY(-10rem) scale(1.02);
  transition:
    transform 0.6s var(--ease),
    opacity 0.5s var(--ease);
}

.envelope__card-text {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

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

.envelope__flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
  background: linear-gradient(180deg, #d4c8bc 0%, #c9bdb1 100%);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  z-index: 4;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
}

.envelope-intro.is-opening .envelope__flap {
  transform: rotateX(-180deg);
  opacity: 0.3;
}

.envelope__front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(180deg, #e5dbd0 0%, #d9cec3 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  z-index: 5;
  transition: opacity 0.5s 0.2s;
}

.envelope-intro.is-opening .envelope__front {
  opacity: 0;
}

.envelope__seal {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  margin-top: -26px;
  background: radial-gradient(circle at 35% 30%, var(--mauve) 0%, var(--rust) 85%);
  border-radius: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(122, 69, 38, 0.35);
  transition: transform 0.5s var(--ease), opacity 0.4s;
}

.envelope-intro.is-opening .envelope__seal {
  transform: scale(0);
  opacity: 0;
}

.envelope__seal-heart {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.envelope-intro.is-opening .envelope__wrap {
  animation: envelope-open-shake 0.6s var(--ease);
}

@keyframes envelope-open-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .hero__scroll { animation: none; }

  .envelope-intro__glow,
  .envelope__hint { animation: none; }
  .envelope { animation: none; }
  .envelope-intro.is-opening .envelope__flap { transform: none; opacity: 0; }
  .envelope-intro.is-opening .envelope__card {
    transform: translateY(-8rem);
  }
}
