:root {
  --bg: #f6efe6;
  --bg-2: #efe5d6;
  --ink: #2a2520;
  --ink-soft: #6b5e51;
  --gold: #b88a4a;
  --rose: #c98e8a;
  --sage: #94a896;
  --paper: #fdfaf3;
  --shadow: 0 30px 60px -20px rgba(50, 35, 20, .35);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ===== Envelope (v2) ===== */
.envelope-screen {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at center, #ece1cf 0%, #d8c8af 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .8s ease;
}
.envelope-screen.is-gone { opacity: 0; pointer-events: none; }

.envelope {
  position: relative;
  width: min(82vw, 440px);
  aspect-ratio: 3 / 2;
  perspective: 1600px;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform .35s ease;
}
.envelope:hover { transform: translateY(-4px); }

/* Back of envelope: full rectangle */
.envelope__back {
  position: absolute; inset: 0;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.15), transparent 60%),
    linear-gradient(160deg, #e0caa6 0%, #c8ac7c 100%);
  box-shadow: var(--shadow);
  z-index: 1;
}

/* Letter sits between back and front: hidden under front while closed */
.envelope__letter {
  position: absolute;
  left: 8%; right: 8%; top: 10%; bottom: 10%;
  background:
    radial-gradient(ellipse at 50% 0%, #fff 0%, var(--paper) 70%);
  border-radius: 4px;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 30px rgba(180, 140, 80, .15);
  transform: translateY(0) scale(.96);
  transition:
    transform 1.1s cubic-bezier(.6,.05,.25,1) .55s,
    z-index 0s linear .9s;
}
.envelope.is-open .envelope__letter {
  z-index: 8;
  transform: translateY(-118%) scale(1.06);
  transition:
    transform 1.1s cubic-bezier(.6,.05,.25,1) .55s,
    z-index 0s linear .55s;
}

/* Front: full rectangle covering letter while closed; bottom flap seams via gradients */
.envelope__front {
  position: absolute; inset: 0;
  border-radius: 8px;
  z-index: 4;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(80,55,25,.18) 49.85%, rgba(80,55,25,.18) 50.15%, transparent 50.4%) bottom left  / 50% 50% no-repeat,
    linear-gradient(to top left,  transparent 49.6%, rgba(80,55,25,.18) 49.85%, rgba(80,55,25,.18) 50.15%, transparent 50.4%) bottom right / 50% 50% no-repeat,
    linear-gradient(135deg, #ecd9b9 0%, #d6bd92 100%);
  box-shadow:
    inset 0 -30px 50px -20px rgba(80, 55, 25, .15),
    inset 0 30px 40px -25px rgba(255,255,255,.4);
}

/* Top flap: triangle, hinged at top, opens backward */
.envelope__flap {
  position: absolute; left: 0; right: 0; top: 0;
  height: 50%;
  background: linear-gradient(180deg, #dcc197 0%, #bf9f6e 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 1.05s cubic-bezier(.65,.05,.3,1);
  z-index: 6;
  border-radius: 8px 8px 0 0;
  backface-visibility: hidden;
}
.envelope__flap::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.25), transparent 50%),
    linear-gradient(180deg, transparent 60%, rgba(0,0,0,.10));
  clip-path: inherit;
}
.envelope.is-open .envelope__flap {
  transform: rotateX(-178deg);
}

/* Wax seal */
.envelope__seal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  background:
    radial-gradient(circle at 35% 30%, #d65a5a 0%, #a52e2e 45%, #6e1818 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fae3c4;
  font-family: var(--serif);
  font-weight: 600; font-size: 20px; letter-spacing: 1px;
  z-index: 7;
  box-shadow:
    0 8px 22px rgba(120, 30, 30, .45),
    inset -4px -5px 10px rgba(0,0,0,.30),
    inset 3px 3px 8px rgba(255,255,255,.15);
  transition: transform .55s cubic-bezier(.7,-.1,.4,1.4), opacity .5s ease;
}
.envelope.is-open .envelope__seal {
  transform: translate(-50%, -50%) scale(.2) rotate(40deg);
  opacity: 0;
}

.letter-inner { text-align: center; padding: 14px; }
.letter-monogram {
  font-family: var(--serif);
  font-size: clamp(22px, 5vw, 30px);
  color: var(--gold);
  letter-spacing: 4px;
}
.letter-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px; color: var(--ink-soft);
  margin: 6px 0 4px;
}
.letter-names {
  font-family: var(--serif);
  font-size: clamp(14px, 3.4vw, 18px);
  color: var(--ink);
}

.envelope-tap-hint {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .4 } 50% { opacity: .9 } }

/* ===== Content ===== */
.content { opacity: 0; transition: opacity 1s ease; }
.content.is-visible { opacity: 1; }

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 42px);
  text-align: center;
  margin: 0 0 32px;
  letter-spacing: 1px;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Hero */
.hero {
  position: relative;
  height: 100svh; min-height: 480px;
  text-align: center; color: #fff;
  overflow: hidden;
  background: #0f0c09;
}
/* Single horizontal image mode */
.hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  display: block;
}

/* Swiper fills the entire hero as background */
.hero__swiper {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero__swiper .swiper-slide {
  width: min(65svh, 82vw);   /* portrait card: ~2:3 ratio fills height */
  height: 100%;
  padding: 28px 8px;
  box-sizing: border-box;
}
.hero__swiper .swiper-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.65);
  pointer-events: none;
  user-select: none;
  display: block;
}
/* Dark overlay: strong vignette on edges + gradient for text at bottom */
.hero__overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 70% 100% at center, transparent 30%, rgba(10,7,5,.80) 100%),
    linear-gradient(180deg, rgba(10,7,5,.30) 0%, rgba(10,7,5,.65) 85%, rgba(10,7,5,.85) 100%);
  pointer-events: none;
}
/* Text centered over the slider */
.hero__inner {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}
.hero__date {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 8px;
  font-size: clamp(18px, 2.4vw, 26px);
  opacity: .95;
  margin-bottom: 18px;
}
.hero__names {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 9vw, 96px);
  line-height: 1.0;
  margin: 12px 0 8px;
}
.hero__name {
  display: block;
  text-shadow:
    0 2px 40px rgba(0,0,0,.85),
    0 4px 12px rgba(0,0,0,.70),
    0 0 2px rgba(0,0,0,.9);
}
.hero__scroll { pointer-events: auto; }
.hero__amp {
  display: block;
  font-style: italic;
  color: #f5e6c8;
  font-size: .55em;
  margin: 6px 0;
  font-weight: 400;
  text-shadow:
    0 0 22px rgba(245,230,200,.45),
    0 2px 8px rgba(0,0,0,.35);
}
.hero__quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(15px, 2vw, 20px);
  max-width: 540px; margin: 18px auto 0;
  opacity: .95;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.hero__scroll { margin-top: 36px; font-size: 26px; opacity: .8; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* Invite block */
.invite-block {
  max-width: 640px; margin: 0 auto;
  padding: 80px 24px 40px;
  text-align: center;
}
.ornament {
  font-size: 22px; color: var(--gold); margin-bottom: 18px;
}
.invite-greeting {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 8px;
}
.invite-greeting__names { color: var(--gold); }
.invite-list { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.invite-text {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.55;
  color: var(--ink);
  margin: 8px 0 0;
}

/* Countdown */
.countdown { padding: 60px 24px; text-align: center; }
.countdown__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; max-width: 520px; margin: 0 auto;
}
.countdown__cell {
  background: var(--paper); border-radius: 12px;
  padding: 18px 8px; box-shadow: 0 8px 24px -10px rgba(80,60,40,.2);
}
.countdown__cell span {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 6vw, 44px); display: block; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.countdown__cell em {
  font-style: normal; font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-soft);
}
.countdown__deadline {
  margin-top: 22px; color: var(--ink-soft); font-size: 14px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.countdown__deadline strong { color: var(--gold); font-weight: 600; }


/* Timeline */
.timeline { padding: 60px 24px; max-width: 720px; margin: 0 auto; }
.timeline__list { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline__list::before {
  content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px;
  width: 1px; background: linear-gradient(180deg, transparent, var(--gold), transparent);
}
.timeline__item {
  display: grid;
  grid-template-columns: 56px 80px 1fr;
  gap: 14px; align-items: start;
  padding: 16px 0; position: relative;
}
.timeline__icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); position: relative; z-index: 1;
  box-shadow: 0 4px 14px -4px rgba(120,80,40,.3);
}
.timeline__time {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  color: var(--gold); padding-top: 12px;
}
.timeline__title {
  font-family: var(--serif); font-size: 22px; padding-top: 12px;
}
.timeline__desc { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

/* Venue */
.venue { padding: 60px 24px; text-align: center; max-width: 600px; margin: 0 auto; }
.venue__name { font-family: var(--serif); font-size: 26px; margin-bottom: 6px; }
.venue__address { color: var(--ink-soft); margin-bottom: 6px; }
.venue__dress { color: var(--ink-soft); font-style: italic; margin-bottom: 14px; }

.dresscode-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 18px auto 24px;
  max-width: 480px;
}

.dresscode-palette__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.dresscode-palette__dot {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, .18),
    inset 0 1px 3px rgba(255, 255, 255, .35);
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}

.dresscode-palette__dot:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, .22),
    inset 0 1px 3px rgba(255, 255, 255, .35);
}

.dresscode-palette__label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.2;
  max-width: 70px;
}

.btn {
  display: inline-block; padding: 14px 24px;
  border-radius: 999px; font-size: 14px; letter-spacing: 1px;
  text-transform: uppercase; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--gold);
}
.btn--ghost:hover { background: var(--gold); color: #fff; }
.btn--accept { background: var(--sage); color: #fff; }
.btn--accept:hover { background: #7c9181; }
.btn--decline { background: transparent; color: var(--ink-soft); border: 1px solid #d2c5b3; }
.btn--decline:hover { background: #ede2d0; }
.btn.is-active.btn--accept { background: #5d7a64; box-shadow: 0 8px 20px -8px rgba(60,90,70,.6); }
.btn.is-active.btn--decline { background: #c98e8a; color: #fff; border-color: transparent; }

/* Seating */
.seating { padding: 60px 24px; }
.seating .section-title { text-align: center; }
.seating__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 820px) {
  .seating__layout { grid-template-columns: 1fr; }
}

.seating__plan {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.seating__zone {
  position: absolute;
  border: 1px dashed rgba(80,55,25,.30);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px;
  color: var(--ink-soft);
  pointer-events: none;
  text-align: center;
  padding: 4px;
}
.seating__zone--stage     { background: rgba(184,138,74,.18) !important; }
.seating__zone--presidium { background: rgba(201,142,138,.22) !important; }
.seating__zone--dancefloor{ background: rgba(148,168,150,.20) !important; }
.seating__zone--bar       { background: rgba(120,90,60,.20) !important; }

.seating__table {
  position: absolute;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--gold);
  font-family: var(--serif); font-size: clamp(9px, 1vw, 13px);
  color: var(--ink); cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  text-align: center;
  z-index: 2;
  overflow: hidden;
}
.seating__table > .seating__circle {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px; line-height: 1.05;
}
.seating__table:hover { transform: translate(-50%, -50%) scale(1.08); background: var(--gold); color: #fff; }
.seating__table.is-mine {
  background: var(--rose); color: #fff; border-color: var(--rose);
  box-shadow: 0 0 0 6px rgba(201,142,138,.22);
}
.seating__table.is-active {
  background: var(--gold); color: #fff;
  box-shadow: 0 0 0 8px rgba(184,138,74,.25);
}
.seating__circle { padding: 4px 6px; line-height: 1.1; }
.seating__hint { text-align: center; margin-top: 18px; color: var(--ink-soft); }

.seating__panel {
  background: var(--paper);
  border-radius: 16px;
  padding: 18px;
  min-height: 200px;
  box-shadow: 0 8px 24px -10px rgba(80,60,40,.2);
}
.seating__panel-empty {
  color: var(--ink-soft); text-align: center; padding: 30px 10px; font-size: 14px;
}
.seating__panel-title {
  font-family: var(--serif); font-size: 22px;
  margin-bottom: 12px; color: var(--ink);
}
.seating__panel-list { list-style: none; padding: 0; margin: 0; }
.seating__panel-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(184,138,74,.15);
  font-size: 14px;
}
.seating__panel-list li:last-child { border-bottom: 0; }
.seating__panel-list .badge {
  font-size: 10px; padding: 2px 8px; border-radius: 8px;
  background: var(--bg-2); color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 1px;
}
.seating__panel-list .badge.accepted { background: var(--sage); color: #fff; }
.seating__panel-list .badge.declined { background: var(--rose); color: #fff; }

/* RSVP */
.rsvp { padding: 60px 24px 40px; max-width: 640px; margin: 0 auto; }
.rsvp__hint { text-align: center; color: var(--ink-soft); margin-bottom: 24px; }
.rsvp__group { display: flex; flex-direction: column; gap: 14px; }
.rsvp__row {
  background: var(--paper); border-radius: 12px;
  padding: 16px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 10px;
}
.rsvp__name { font-family: var(--serif); font-size: 18px; }
.rsvp__buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.rsvp__buttons--lg { width: 100%; justify-content: center; }
.rsvp__buttons--lg .btn { flex: 1; min-width: 200px; }
.rsvp__note {
  width: 100%; margin-top: 18px;
  border: 1px solid #d8c9af; background: var(--paper);
  border-radius: 12px; padding: 14px;
  font: inherit; min-height: 80px; resize: vertical;
}
.rsvp__status {
  margin-top: 14px; text-align: center; font-size: 14px;
  color: var(--sage); min-height: 1.2em;
}
.rsvp__status.is-error { color: #b04848; }

/* ===== Gallery "Наши моменты" ===== */
.gallery { padding: 60px 0 60px; overflow: hidden; }
.gallery .section-title { text-align: center; margin-bottom: 32px; padding: 0 24px; }

.gallery__swiper { overflow: visible; padding: 12px 0 20px; cursor: grab; }
.gallery__swiper:active { cursor: grabbing; }

.gallery__swiper .swiper-slide {
  width: min(56vh, 72vw);
  max-width: 300px;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(50,35,20,.18);
  transition: transform .3s ease, box-shadow .3s ease;
  cursor: pointer;
}
.gallery__swiper .swiper-slide:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 48px rgba(50,35,20,.28);
}
.gallery__swiper .swiper-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
  pointer-events: none;
}
.gallery__swiper .swiper-slide:hover img { transform: scale(1.04); }

.gallery__caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 36px 14px 12px;
  background: linear-gradient(transparent, rgba(10,7,5,.7));
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
}

/* ===== Lightbox ===== */
.lb {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(8,6,4,.93);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.lb.is-open { opacity: 1; pointer-events: auto; }

.lb__img-wrap {
  max-width: 92vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.lb__img {
  max-width: 100%; max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  object-fit: contain;
  display: block;
}

.lb__btn {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: none; color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 24px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lb__btn:hover { background: rgba(255,255,255,.25); }
.lb__close { top: 18px; right: 18px; font-size: 18px; }
.lb__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 16px; top: 50%; transform: translateY(-50%); }

.lb__caption {
  position: absolute; bottom: 18px; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.6);
  font-size: 13px; letter-spacing: 0.04em;
  pointer-events: none;
}

@media (max-width: 600px) {
  .gallery { padding: 40px 0; }
  .gallery__swiper .swiper-slide { width: 70vw; max-width: none; }
  .lb__prev { left: 8px; }
  .lb__next { right: 8px; }
}

.footer { padding: 40px 24px 60px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.footer__hearts { font-size: 22px; color: var(--rose); margin-top: 12px; }

/* Landing fallback */
.landing { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.landing h1 { font-family: var(--serif); font-weight: 500; }

/* Mobile */
@media (max-width: 600px) {
  .countdown__grid { gap: 8px; }
  .countdown__cell { padding: 14px 4px; }
  .timeline__item { grid-template-columns: 48px 60px 1fr; gap: 10px; }
  .timeline__icon { width: 48px; height: 48px; }
  .timeline__time, .timeline__title { font-size: 18px; padding-top: 10px; }
  /* seating__circle is position:absolute inset:0 — size is set by table, not here */
  .seating__table { font-size: clamp(7px, 2.2vw, 10px); }
  /* hero slider: wider cards on mobile, minimal side peek */
  .hero__swiper .swiper-slide { width: 86vw; padding: 20px 4px; }
}

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