﻿/* ====================== FONTS ====================== */
/* Файлы лежат в assets/fonts/ в формате .otf. */

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

/* TT Commons — все начертания */
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Thin Italic.otf") format("opentype");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons ExtraLight.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons ExtraLight Italic.otf") format("opentype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Light Italic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Medium Italic.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons DemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons DemiBold Italic.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Bold Italic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons ExtraBold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons ExtraBold Italic.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("../assets/fonts/TT Commons Black Italic.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* ====================== TOKENS ====================== */
:root {
  --color-bg: #2b0507;
  --color-overlay: rgba(95, 12, 18, 0.78);
  --color-text: #f5e9ea;
  --color-text-muted: rgba(245, 233, 234, 0.72);
  --color-accent: #ffffff;

  /* Light section */
  --color-cream: #ffffff;
  --color-cream-warm: #f1ebdc;
  --color-dark: #1A1A1A;
  --color-dark-muted: #6b6562;
  --color-muted: #b1aca0;
  --color-burgundy: #6e1322;
  --color-hairline: rgba(26, 26, 26, 0.18);
  --color-line-soft: rgba(26, 26, 26, 0.22);

  --font-script: "Kalissa", "Pinyon Script", "Allura", cursive;
  --font-sans: "TT Commons";

  --container-padding: 40px;
  --header-padding-top: 32px;
}

/* ====================== RESET ====================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: #ffffff;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

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

/* ====================== HERO ====================== */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: var(--header-padding-top) var(--container-padding) 40px;
  display: flex;
  flex-direction: column;
  background-image: url("../assets/images/hero.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  isolation: isolate;
}

.hero > * {
  position: relative;
  z-index: 2;
}

/* ====================== HEADER ====================== */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  width: 100%;
}

.nav__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav__link {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.nav__link:hover {
  opacity: 0.7;
}

.header__center {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.header__code {
  font-family: var(--font-script);
  font-size: 36px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0;
}

.rsvp-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  border-radius: 2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rsvp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ====================== HERO CONTENT ====================== */
.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero__title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(64px, 13vw, 220px);
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-text);
  white-space: nowrap;
  margin-bottom: clamp(120px, 18vh, 220px);
}

.hero__amp {
  font-family: var(--font-script);
  font-weight: 400;
}

/* ===== Date pill with horizontal line and diamonds ===== */
.date-pill {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
}

.date-pill__line {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Mirror the right line so the decorative cap from arrow2.svg sits at the outer tip on both sides */
.date-pill__line--right {
  transform: scaleX(-1);
}

.date-pill__oval {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  height: 80px;
  padding: 0 60px;
  border: 1px solid rgba(245, 233, 234, 0.55);
  border-radius: 999px;
  flex-shrink: 0;
}

.date-pill__arrow {
  position: absolute;
  display: block;
  width: 16px;
  height: 68px;
  pointer-events: none;
  user-select: none;
}

.date-pill__arrow--top {
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
}

.date-pill__arrow--bottom {
  left: 50%;
  top: 100%;
  transform: translateX(-50%) rotate(180deg);
}

.date-pill__text {
  font-family: var(--font-script);
  font-size: 44px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0;
}

/* ====================== HERO META ====================== */
.hero__meta {
  margin: 40px auto 0;
  max-width: 880px;
  text-align: center;
  font-family: var(--font-sans);
  line-height: 1.6;
  word-spacing: 0.2em;
}

.meta__item {
  display: inline;
}

.meta__label {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: lowercase;
  letter-spacing: 0;
  margin-right: 6px;
}

.meta__value {
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0;
}

.meta__sep {
  display: inline-block;
  margin: 0 16px;
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ====================== SECTION: BANQUET ====================== */
.banquet {
  position: relative;
  background-color: var(--color-cream);
  color: var(--color-dark);
  padding: 80px var(--container-padding) 120px;
}

.section-anchor {
  position: absolute;
  top: 80px;
  left: var(--container-padding);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-dark);
}

.section-anchor__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark);
}

/* ===== Section title (bold + script) ===== */
.section-title {
  max-width: 1100px;
  margin: 0 auto 100px;
  text-align: center;
  font-family: var(--font-sans);
  line-height: 1.05;
}

.section-title__bold {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 84px);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-dark);
}

.section-title__script {
  display: inline-block;
  margin-left: 0.2em;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(56px, 8vw, 120px);
  color: var(--color-burgundy);
  letter-spacing: 0;
  line-height: 0.9;
  vertical-align: baseline;
}

/* ===== Layout: photo + info ===== */
.banquet__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.banquet__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
}

.banquet__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Info table ===== */
.info {
  display: flex;
  flex-direction: column;
}

.info__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-hairline);
}

.info__row:first-child {
  padding-top: 0;
}

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

.info__label {
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 400;
  color: var(--color-dark-muted);
  letter-spacing: 0;
  padding-top: 4px;
}

.info__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info__value {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 400;
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.4;
}

.info__value--accent {
  color: var(--color-burgundy);
  margin-top: 18px;
}

.info__value--accent:first-child {
  margin-top: 0;
}

.info__note {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-dark);
  line-height: 1.5;
  margin-top: 10px;
}

.info__note--accent {
  color: var(--color-burgundy);
}

.info__text {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-dark);
  line-height: 1.55;
  max-width: 520px;
}

/* ===== Dress code pills ===== */
.dresscode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dresscode__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 8px 8px;
  border: 1px solid rgba(60, 60, 60, 0.25);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 400;
  color: var(--color-dark);
}

.dresscode__swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #c8c8c8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.dresscode__name {
  letter-spacing: 0;
}

/* ====================== SECTION: SCHEDULE ====================== */
.schedule {
  position: relative;
  background-color: #ffffff;
  color: var(--color-dark);
  padding: 80px var(--container-padding) 100px;
  overflow: hidden;
}

.section-anchor--schedule {
  top: 80px;
}

.schedule__inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 0;
}

/* ===== Timeline ===== */
.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-width: 880px;
}

.timeline__item {
  display: grid;
  grid-template-columns: 280px 90px minmax(0, 510px);
  align-items: start;
  gap: 0;
  padding: 6px 0;
  cursor: default;
  transition: padding 0.3s ease;
}

/* Time (script font) */
.timeline__time {
  font-family: var(--font-script);
  font-size: clamp(48px, 5vw, 80px);
  font-weight: 400;
  line-height: 1;
  color: var(--color-muted);
  text-align: right;
  padding-right: 60px;
  transition: color 0.3s ease;
}

.timeline__item.is-active .timeline__time {
  color: var(--color-dark);
}

/* Rail with vertical line + dash */
.timeline__rail {
  position: relative;
  align-self: stretch;
  display: block;
}

.timeline__rail::before {
  /* vertical line */
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  background: var(--color-line-soft);
  transform: translateX(-50%);
}

.timeline__dash {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 30px;
  height: 1px;
  background: var(--color-muted);
  transition: background 0.3s ease, width 0.3s ease;
}

.timeline__item.is-active .timeline__dash {
  background: var(--color-dark);
  width: 36px;
}

/* Body: title + details */
.timeline__body {
  padding-top: 14px;
  padding-left: 8px;
}

.timeline__title {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
  transition: color 0.3s ease;
}

.timeline__item.is-active .timeline__title {
  color: var(--color-dark);
}

.timeline__details {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.4s ease, margin-top 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  margin-top: 0;
}

.timeline__details > * {
  min-height: 0;
}

.timeline__item.is-active .timeline__details {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 24px;
}

.timeline__details-inner,
.timeline__details > div:first-child + div,
.timeline__details {
  /* allow children to render */
}

/* Each detail block (sub-time + description) */
.detail {
  margin-bottom: 18px;
}
.detail:last-child {
  margin-bottom: 0;
}

.detail__time {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-dark);
  margin: 0 0 6px;
}

.detail__text {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-dark);
  opacity: 0.7;
  line-height: 1.5;
  margin: 0;
  max-width: 510px;
}

/* ====================== SECTION: STORY ====================== */
.story {
  position: relative;
  background-color: #ffffff;
  background-image: url("../assets/images/paper-torn.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: var(--color-dark);
  padding: 140px var(--container-padding) 160px;
  overflow: hidden;
}

.story__inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 100px;
  align-items: center;
}

.story__photo {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background-color: #ffffff;
  box-shadow: 0 30px 60px -40px rgba(26, 26, 26, 0.25);
}

.story__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story__content {
  position: relative;
  padding-left: 64px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

/* Decorative rail */
.story__rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 26px;
  pointer-events: none;
  background: url('../assets/images/palka.svg') no-repeat center / 100% 100%;
}

/* Eyebrow */
.story__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-burgundy);
  margin: 0 0 28px;
}

.story__eyebrow-dot {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

/* Role buttons (script-style names) */
.story__roles {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 32px;
  margin-bottom: 48px;
  white-space: nowrap;
}

.role-btn {
  font-family: var(--font-script);
  font-size: clamp(50px, 4.2vw, 78px);
  line-height: 1;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: rgba(110, 19, 34, 0.32);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.role-btn:hover {
  color: rgba(110, 19, 34, 0.6);
}

.role-btn.is-active {
  color: var(--color-burgundy);
}

/* Stage chip buttons */
.story__stages {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: 40px;
  max-width: 620px;
}

.story__stages-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(26, 26, 26, 0.22);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--color-dark-muted);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.stage-btn__num {
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
}

.stage-btn:hover {
  color: var(--color-dark);
  border-color: rgba(26, 26, 26, 0.4);
}

.stage-btn.is-active {
  color: var(--color-burgundy);
  border-color: var(--color-burgundy);
}

.stage-btn.is-active .stage-btn__num {
  opacity: 0.85;
}

/* Quote */
.story__quote {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  max-width: 620px;
}

.story__date {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-dark-muted);
  white-space: nowrap;
  margin-top: 6px;
}

.story__text {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-dark);
  margin: 0;
}

.story__highlight {
  color: var(--color-burgundy);
}

/* ====================== SECTION: GALLERY ====================== */
.gallery {
  position: relative;
  background-color: #ffffff;
  color: var(--color-dark);
  padding: 80px var(--container-padding) 100px;
  overflow: hidden;
  isolation: isolate;

  --gallery-side-w: clamp(120px, 9vw, 150px);
  --gallery-side-h: calc(var(--gallery-side-w) * 1.32);
  --gallery-active-scale: 3.0;
  --gallery-medium-scale: 2.05;
  --gallery-gap-center: clamp(16px, 1.4vw, 22px);
  --gallery-gap-side: clamp(8px, 0.7vw, 12px);
}

.section-anchor--gallery {
  top: 80px;
}

.gallery__title {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(120px, 16vw, 240px);
  line-height: 1;
  color: rgba(150, 142, 120, 0.32);
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  margin: 0;
}

.gallery__stage {
  position: relative;
  z-index: 2;
  margin-top: clamp(90px, 10vw, 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery__viewport {
  position: relative;
  width: 100%;
  /* Cap width so exactly 9 slots fit (active + 4 each side); d=±5 gets clipped */
  max-width: calc(
    var(--gallery-side-w) * var(--gallery-active-scale)
    + 2 * var(--gallery-gap-center)
    + 2 * var(--gallery-side-w) * var(--gallery-medium-scale)
    + 6 * var(--gallery-gap-side)
    + 6 * var(--gallery-side-w)
    + 6px
  );
  margin-left: auto;
  margin-right: auto;
  height: calc(var(--gallery-side-h) * var(--gallery-active-scale) + 24px);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.gallery__viewport.is-dragging {
  cursor: grabbing;
}

.gallery__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--gallery-side-w);
  height: var(--gallery-side-h);
  padding: 0;
  margin: 0;
  border: 0;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  opacity: var(--op, 1);
  transform: translate(calc(-50% + var(--tx, 0px)), -50%) scale(var(--scale, 1));
  transform-origin: center;
  transition:
    transform 0.55s cubic-bezier(0.4, 0.6, 0.2, 1),
    opacity 0.55s ease;
  z-index: var(--z, 1);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.gallery-slide.is-active {
  cursor: default;
}

.gallery-slide:focus-visible {
  outline: 2px solid var(--color-burgundy);
  outline-offset: 4px;
}

/* Progress line + tick */
.gallery__progress {
  position: relative;
  width: 92px;
  height: 6px;
  margin: 36px 0 14px;
}

.gallery__progress-track {
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: rgba(26, 26, 26, 0.18);
  transform: translateY(-50%);
}

.gallery__progress-tick {
  position: absolute;
  top: 50%;
  left: calc(var(--p, 0) * (100% - 18px));
  width: 18px;
  height: 3px;
  background: var(--color-burgundy);
  transform: translateY(-50%);
  transition: left 0.5s cubic-bezier(0.4, 0.6, 0.2, 1);
}

/* Controls row: arrows + counter */
.gallery__controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(420px, 90%);
  margin-top: 6px;
  font-family: var(--font-sans);
}

.gallery__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-dark);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery__arrow:first-child { justify-self: start; }
.gallery__arrow:last-child  { justify-self: end; }

.gallery__arrow:hover {
  opacity: 1;
}

.gallery__arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.gallery__counter {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-dark);
  text-align: center;
}

.gallery__counter-sep {
  margin: 0 4px;
  color: var(--color-dark-muted);
}

/* ====================== MOBILE: header toggle + drawer + hero CTA ====================== */
.header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--color-text);
  cursor: pointer;
  justify-self: end;
}

.hero__cta-mobile {
  display: none;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  isolation: isolate;
  overflow: hidden;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.mobile-menu::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: url("../assets/images/hero.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(18px);
  z-index: -2;
}

.mobile-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(40, 8, 14, 0.78), rgba(20, 4, 8, 0.88));
  z-index: -1;
}

.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.mobile-menu__code {
  position: absolute;
  top: 18px;
  left: 20px;
  font-family: var(--font-script);
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0;
}

.mobile-menu__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
}

.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mobile-menu__link {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 0;
  display: inline-block;
}

/* ====================== WELCOME MODAL ====================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.32s ease, visibility 0s linear 0.32s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.32s ease, visibility 0s linear 0s;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.86);
  cursor: pointer;
}

.modal__card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  width: min(620px, 100%);
  padding: 60px clamp(28px, 5vw, 64px) 56px;
  text-align: center;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(8px);
  transition: transform 0.32s ease;
}

.modal.is-open .modal__card {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-burgundy);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.modal__close:hover {
  opacity: 1;
  background-color: rgba(110, 19, 34, 0.08);
}

.modal__eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-dark);
  margin: 0 0 12px;
}

.modal__name {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 1;
  color: var(--color-burgundy);
  margin: 0 0 28px;
  word-break: break-word;
}

.modal__text {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-dark);
  margin: 0 0 36px;
}

.modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-burgundy);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  border-radius: 3px;
  padding: 18px 38px;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.modal__cta:hover {
  background-color: #5a1019;
  transform: translateY(-1px);
}

.modal__cta:focus {
  outline: none;
}

.modal__cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.modal__close:focus {
  outline: none;
}

.modal__close:focus-visible {
  outline: 2px solid var(--color-burgundy);
  outline-offset: 2px;
}

@media (max-width: 540px) {
  .modal__card {
    padding: 48px 24px 40px;
  }
  .modal__name {
    font-size: clamp(48px, 14vw, 80px);
  }
}

/* ====================== SECTION: RSVP ====================== */
.rsvp {
  position: relative;
  background-color: #ffffff;
  color: var(--color-dark);
  padding: 80px var(--container-padding) 0;
  overflow: hidden;
  isolation: isolate;
}

.section-anchor--rsvp {
  top: 80px;
}

.rsvp__inner {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(60px, 8vw, 140px);
  padding-top: clamp(60px, 8vw, 100px);
  padding-bottom: clamp(80px, 12vw, 180px);
  align-items: start;
}

.rsvp__intro {
  display: flex;
  flex-direction: column;
}

.rsvp__title {
  font-family: var(--font-sans);
  margin: 0;
  line-height: 1.05;
}

.rsvp__title-bold {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 56px);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-dark);
  line-height: 1.02;
}

.rsvp__title-script {
  display: inline-block;
  margin-top: -0.18em;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(48px, 6.8vw, 100px);
  color: var(--color-burgundy);
  line-height: 0.85;
}

.rsvp__contact {
  margin-top: clamp(48px, 6vw, 88px);
  font-family: var(--font-sans);
  color: var(--color-dark);
}

.rsvp__contact-eyebrow {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-dark-muted);
  text-transform: lowercase;
  margin: 0 0 22px;
}

.rsvp__contact-handle {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-dark);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.rsvp__contact-note {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-dark-muted);
  margin: 0;
}

/* Form */
.rsvp__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 620px;
  width: 100%;
  justify-self: end;
}

.rsvp-field {
  display: flex;
}

.rsvp-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  color: var(--color-dark);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(26, 26, 26, 0.18);
  border-radius: 3px;
  padding: 18px 22px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.rsvp-input::placeholder {
  color: var(--color-dark-muted);
  opacity: 0.85;
}

.rsvp-input:hover {
  border-color: rgba(26, 26, 26, 0.32);
}

.rsvp-input:focus {
  border-color: var(--color-burgundy);
  background: rgba(255, 255, 255, 0.85);
}

.rsvp-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.45;
}

/* Grouped controls */
.rsvp-group {
  margin-top: 14px;
}

.rsvp-group__label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-dark);
  margin: 0 0 14px;
}

.rsvp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rsvp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(26, 26, 26, 0.22);
  border-radius: 999px;
  padding: 12px 22px;
  color: var(--color-dark-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.rsvp-pills--compact .rsvp-pill {
  min-width: 76px;
  justify-content: center;
  padding: 12px 26px;
}

.rsvp-pill__num {
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
}

.rsvp-pill:hover {
  color: var(--color-dark);
  border-color: rgba(26, 26, 26, 0.4);
}

.rsvp-pill.is-active {
  color: var(--color-burgundy);
  border-color: var(--color-burgundy);
}

.rsvp-pill.is-active .rsvp-pill__num {
  opacity: 0.85;
}

/* Submit + status */
.rsvp__footer {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.rsvp-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--color-burgundy);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0;
  border-radius: 3px;
  padding: 18px 38px;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.rsvp-submit:hover {
  background-color: #5a1019;
  transform: translateY(-1px);
}

.rsvp-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rsvp-status {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-dark-muted);
  margin: 0;
  min-height: 1em;
}

.rsvp-status[data-kind="ok"] { color: #2f6b3a; }
.rsvp-status[data-kind="error"] { color: var(--color-burgundy); }
.rsvp-status[data-kind="pending"] { color: var(--color-dark-muted); }

/* Decorative signature at bottom */
.rsvp__signature {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(120px, 16vw, 260px);
  line-height: 0.9;
  color: rgba(110, 19, 34, 0.18);
  user-select: none;
  pointer-events: none;
  margin: 0 auto;
  padding-bottom: 0;
  transform: translateY(18%);
  white-space: nowrap;
}

.rsvp__signature-amp {
  font-style: italic;
}

@media (max-width: 900px) {
  .rsvp__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-bottom: 40px;
  }
  .rsvp__contact {
    margin-top: 32px;
  }
  .rsvp__form {
    justify-self: stretch;
    max-width: none;
  }
  .rsvp__signature {
    display: none;
  }
  .rsvp {
    padding-bottom: 60px;
  }
}

@media (max-width: 768px) {
  .gallery {
    --gallery-side-w: 70px;
    --gallery-active-scale: 3.4;
    --gallery-medium-scale: 2.0;
    --gallery-gap-center: 14px;
    --gallery-gap-side: 8px;
    padding: 80px var(--container-padding) 80px;
  }
  .gallery__title {
    font-size: clamp(64px, 17vw, 130px);
    top: clamp(80px, 13vw, 90px);
  }
  .gallery__stage {
    margin-top: clamp(50px, 16vw, 110px);
  }
}

@media (max-width: 900px) {
  .story {
    padding: 100px var(--container-padding) 120px;
  }
  .story__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }
  .story__photo {
    max-width: 100%;
  }
  .story__content {
    padding-left: 40px;
    min-height: 0;
  }
  .role-btn {
    font-size: clamp(54px, 12vw, 80px);
  }
  .story__roles {
    gap: 32px;
    margin-bottom: 32px;
  }
  .story__quote {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .story__date {
    margin-top: 0;
  }
}

/* ====================== MOBILE: HERO ====================== */
@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
    --header-padding-top: 20px;
  }

  .hero {
    padding-bottom: 24px;
  }

  /* Header reorders: code (left) | _ | hamburger (right) */
  .header {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .nav,
  .rsvp-btn {
    display: none;
  }

  .header__center {
    grid-column: 1;
    justify-content: flex-start;
    padding-top: 0;
  }

  .header__code {
    font-size: 28px;
  }

  .header__menu-toggle {
    display: inline-flex;
    grid-column: 3;
  }

  /* Title: two lines, "Виктория" / "& Даниил" */
  .hero__title {
    font-size: clamp(56px, 18vw, 120px);
    white-space: normal;
    line-height: 0.95;
    margin-bottom: clamp(80px, 16vh, 160px);
    text-align: center;
  }

  .hero__title-part {
    display: block;
  }

  /* Date pill: compact */
  .date-pill__oval {
    min-width: 180px;
    height: 64px;
    padding: 0 36px;
  }

  .date-pill__text {
    font-size: 32px;
  }

  .date-pill__arrow {
    width: 12px;
    height: 52px;
  }

  /* Side lines: swap to the smaller arrow3.svg variant on mobile */
  .date-pill__line {
    content: url("../assets/images/arrow3.svg");
    height: 16px;
  }

  /* Meta: smaller, allow wrapping onto multiple lines */
  .hero__meta {
    margin-top: 28px;
    padding: 0 8px;
    line-height: 1.7;
    word-spacing: 0;
  }

  .meta__label {
    font-size: 14px;
    margin-right: 5px;
  }

  .meta__value {
    font-size: 18px;
  }

  .meta__sep {
    font-size: 18px;
    margin: 0 8px;
  }

  /* Bottom CTA */
  .hero__cta-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 16px 0;
    padding: 18px 24px;
    background-color: #ffffff;
    color: var(--color-bg);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
    text-decoration: none;
  }
}

/* ====================== MOBILE: BANQUET ====================== */
@media (max-width: 768px) {
  .banquet {
    padding: 80px var(--container-padding) 40px;
  }

  .section-anchor {
    top: 32px;
  }

  .section-title {
    text-align: left;
    margin: 0 0 28px;
    max-width: none;
    line-height: 1;
  }

  .section-title__bold {
    font-size: clamp(28px, 8vw, 44px);
    display: inline;
    line-height: 1.05;
  }

  .section-title__script {
    display: block;
    font-size: clamp(46px, 13vw, 76px);
    margin-left: 0;
    margin-top: 6px;
    line-height: 0.85;
  }

  .section-title br {
    display: none;
  }

  .banquet__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .banquet__photo {
    aspect-ratio: 4 / 3;
  }

  .info__row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
  }

  .info__label {
    font-size: 13px;
    gap: 4px;
    padding-top: 2px;
  }

  .info__value {
    font-size: 18px;
    line-height: 1.35;
  }

  .info__value--accent {
    margin-top: 8px;
  }

  .info__note {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.45;
  }

  .info__text {
    font-size: 15px;
    line-height: 1.55;
    max-width: none;
  }

  .dresscode {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .dresscode__item {
    font-size: 16px;
    padding: 6px 20px 6px 6px;
  }

  .dresscode__swatch {
    width: 32px;
    height: 32px;
  }
}

/* ====================== MOBILE: SCHEDULE ====================== */
@media (max-width: 768px) {
  .schedule {
    padding: 80px 0 60px;
    overflow: hidden;
  }

  .section-anchor--schedule {
    top: 32px;
    left: var(--container-padding);
  }

  .schedule__inner {
    max-width: none;
    margin: 0;
    padding: 32px 0;
  }

  /* Timeline becomes a horizontal swipe rail */
  .timeline {
    flex-direction: row;
    max-width: none;
    margin: 0;
    padding: 0 var(--container-padding);
    gap: 28px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-padding);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
  }

  .timeline::-webkit-scrollbar { display: none; }

  .timeline__item {
    flex: 0 0 calc(100vw - 2 * var(--container-padding) - 36px);
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding: 0;
    scroll-snap-align: start;
  }

  .timeline__time {
    text-align: left;
    padding-right: 0;
    font-size: clamp(56px, 17vw, 92px);
  }

  .timeline__rail {
    align-self: start;
    width: 100%;
    height: 30px;
    margin: 4px 0 12px;
  }

  .timeline__rail::before {
    left: 0;
    top: 0;
    bottom: 0;
    transform: none;
  }

  .timeline__item.is-active .timeline__rail::before {
    background: var(--color-dark);
  }

  .timeline__dash { display: none; }

  .timeline__body {
    padding: 0;
  }

  .timeline__title {
    font-size: 16px;
    letter-spacing: 0.04em;
  }

  .timeline__item.is-active .timeline__details {
    margin-top: 18px;
  }

  .detail__time {
    font-size: 16px;
  }

  .detail__text {
    font-size: 15px;
    line-height: 1.5;
  }
}

/* ====================== MOBILE: STORY ====================== */
@media (max-width: 768px) {
  .story {
    padding: 80px var(--container-padding) 64px;
    background-image: url("../assets/images/Vector%20(1).png");
    background-size: 100% 100%;
  }

  .story__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 28px;
  }

  .story__photo {
    grid-row: 2;
    max-width: 100%;
    aspect-ratio: 4 / 5;
  }

  .story__content {
    grid-row: 1;
    padding-left: 0;
    min-height: 0;
  }

  .story__rail { display: none; }

  .story__eyebrow {
    margin-bottom: 22px;
  }

  .story__roles {
    gap: 20px;
    margin-bottom: 24px;
  }

  .role-btn {
    font-size: clamp(38px, 11vw, 60px);
  }

  /* Stage pills: horizontal swipe rail */
  .story__stages {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    gap: 10px;
    margin: 0 calc(-1 * var(--container-padding)) 28px;
    padding: 4px var(--container-padding);
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--container-padding);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: none;
  }

  .story__stages::-webkit-scrollbar { display: none; }

  .story__stages .stage-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .story__stages-break { display: none; }

  .story__quote {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    max-width: none;
  }

  .story__date {
    font-size: 12px;
    margin-top: 4px;
  }

  .story__text {
    font-size: 17px;
    line-height: 1.5;
  }
}

/* ====================== TOAST ====================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(20px, 4vw, 36px);
  z-index: 1100;
  padding: clamp(18px, 2.4vw, 26px) clamp(36px, 6vw, 72px);
  background: #1a1a1a;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-align: center;
  border-radius: 6px;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 24px);
  transition:
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.42s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-visible {
    transform: translateX(-50%);
    transition: opacity 0.2s linear, visibility 0s linear;
  }
}

/* Mobile: match the submit button width — anchor to container edges, drop the centering translate */
@media (max-width: 768px) {
  .toast {
    left: var(--container-padding);
    right: var(--container-padding);
    max-width: none;
    padding: 20px 24px;
    transform: translateY(24px);
  }
  .toast.is-visible {
    transform: translateY(0);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-visible {
    transform: none;
  }
}

/* ====================== ENTRY ANIMATIONS ====================== */
/* Hidden initial state — applies only when JS confirmed motion support */
html.js-anim :is(
  .hero .header,
  .hero__title-part,
  .date-pill,
  .hero__meta,
  .hero__cta-mobile,
  .section-anchor,
  .section-title,
  .banquet__photo,
  .info__row,
  .timeline__item,
  .story__photo,
  .story__rail,
  .story__eyebrow,
  .story__roles,
  .story__stages,
  .story__quote,
  .gallery__title,
  .gallery__stage,
  .rsvp__title,
  .rsvp__form .rsvp-field,
  .rsvp__form .rsvp-group,
  .rsvp__form .rsvp__footer,
  .rsvp__contact,
  .rsvp__signature
) {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* Directional / scaled overrides for selected blocks */
html.js-anim .hero__title-part:not(.hero__title-part--right) { transform: translateX(-44px); }
html.js-anim .hero__title-part--right { transform: translateX(44px); }
html.js-anim .date-pill { transform: scale(0.84); transition-duration: 1.1s; }
html.js-anim .banquet__photo { transform: scale(0.96) translateY(24px); transition-duration: 1.1s; }
html.js-anim .story__photo { transform: translateX(-44px); transition-duration: 1.1s; }
html.js-anim .gallery__stage { transform: scale(0.97) translateY(28px); transition-duration: 1.1s; }
html.js-anim .rsvp__signature { transform: translateY(40px); transition-duration: 1.2s; }

/* Stagger — hero (triggered after the welcome modal closes) */
html.js-anim .hero .header { transition-delay: 0.1s; }
html.js-anim .hero__title-part:not(.hero__title-part--right) { transition-delay: 0.3s; }
html.js-anim .hero__title-part--right { transition-delay: 0.45s; }
html.js-anim .date-pill { transition-delay: 0.62s; }
html.js-anim .hero__meta { transition-delay: 0.82s; }
html.js-anim .hero__cta-mobile { transition-delay: 0.98s; }

/* Stagger — banquet */
html.js-anim .banquet > .section-anchor { transition-delay: 0s; }
html.js-anim .banquet > .section-title { transition-delay: 0.1s; }
html.js-anim .banquet__photo { transition-delay: 0.18s; }
html.js-anim .info__row:nth-child(1) { transition-delay: 0.2s; }
html.js-anim .info__row:nth-child(2) { transition-delay: 0.3s; }
html.js-anim .info__row:nth-child(3) { transition-delay: 0.4s; }
html.js-anim .info__row:nth-child(4) { transition-delay: 0.5s; }

/* Stagger — schedule */
html.js-anim .schedule > .section-anchor { transition-delay: 0s; }
html.js-anim .timeline__item:nth-child(1) { transition-delay: 0.15s; }
html.js-anim .timeline__item:nth-child(2) { transition-delay: 0.25s; }
html.js-anim .timeline__item:nth-child(3) { transition-delay: 0.35s; }
html.js-anim .timeline__item:nth-child(4) { transition-delay: 0.45s; }
html.js-anim .timeline__item:nth-child(5) { transition-delay: 0.55s; }

/* Stagger — story */
html.js-anim .story__photo { transition-delay: 0s; }
html.js-anim .story__rail { transition-delay: 0.18s; }
html.js-anim .story__eyebrow { transition-delay: 0.22s; }
html.js-anim .story__roles { transition-delay: 0.32s; }
html.js-anim .story__stages { transition-delay: 0.42s; }
html.js-anim .story__quote { transition-delay: 0.52s; }

/* Stagger — gallery */
html.js-anim .gallery > .section-anchor { transition-delay: 0s; }
html.js-anim .gallery__title { transition-delay: 0.12s; }
html.js-anim .gallery__stage { transition-delay: 0.22s; }

/* Stagger — rsvp */
html.js-anim .rsvp > .section-anchor { transition-delay: 0s; }
html.js-anim .rsvp__title { transition-delay: 0.12s; }
html.js-anim .rsvp__form .rsvp-field:nth-child(1) { transition-delay: 0.22s; }
html.js-anim .rsvp__form .rsvp-field:nth-child(2) { transition-delay: 0.3s; }
html.js-anim .rsvp__form .rsvp-field:nth-child(3) { transition-delay: 0.38s; }
html.js-anim .rsvp__form .rsvp-group:nth-child(4) { transition-delay: 0.46s; }
html.js-anim .rsvp__form .rsvp-group:nth-child(5) { transition-delay: 0.54s; }
html.js-anim .rsvp__form .rsvp__footer { transition-delay: 0.62s; }
html.js-anim .rsvp__contact { transition-delay: 0.28s; }
html.js-anim .rsvp__signature { transition-delay: 0.42s; }

/* Visible state — placed last so source-order tiebreak beats directional overrides */
html.js-anim :is(
  .hero .header,
  .hero__title-part,
  .date-pill,
  .hero__meta,
  .hero__cta-mobile,
  .section-anchor,
  .section-title,
  .banquet__photo,
  .info__row,
  .timeline__item,
  .story__photo,
  .story__rail,
  .story__eyebrow,
  .story__roles,
  .story__stages,
  .story__quote,
  .gallery__title,
  .gallery__stage,
  .rsvp__title,
  .rsvp__form .rsvp-field,
  .rsvp__form .rsvp-group,
  .rsvp__form .rsvp__footer,
  .rsvp__contact,
  .rsvp__signature
).is-in {
  opacity: 1;
  transform: none;
}
