/* =========================================================
   ليان و آدم — دعوة زفاف سماوية
   Palette: midnight blue · cobalt · warm gold · ivory
   ========================================================= */

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

:root {
  color-scheme: dark;
  --midnight: #050b2e;
  --deep: #09143d;
  --cobalt: #14265f;
  --cobalt-soft: #203777;
  --ivory: #f7ecd8;
  --ivory-soft: #e9dcc6;
  --gold: #d9b26f;
  --gold-bright: #f7d99a;
  --gold-deep: #b58a45;
  --rose: #ffb4a8;
  --text-muted: rgba(247, 236, 216, 0.7);
  --line: rgba(217, 178, 111, 0.24);
  --font-display: "ATHULUTH", "Aref Ruqaa", "Amiri", serif;
  --font-body: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.32);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --section-bg: url("assets/Midnight_blue_night_sky_background_20261026112540.jpg");
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--midnight);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(217, 178, 111, 0.34);
  color: #fffaf0;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 500;
  padding: 0.65rem 1rem;
  border-radius: 4px;
  background: var(--gold-bright);
  color: var(--midnight);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- fixed atmosphere ---------- */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 300;
  height: 2px;
  background: linear-gradient(90deg, rgba(217, 178, 111, 0), var(--gold-bright));
  transform: scaleX(0);
  transform-origin: right center;
  box-shadow: 0 0 12px rgba(247, 217, 154, 0.7);
  pointer-events: none;
}

/* ---------- invitation gate ---------- */

html.gate-open,
html.gate-open body {
  overflow: hidden;
}

html.gate-open {
  overscroll-behavior: none;
}

.invite-gate {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  background: var(--midnight);
  clip-path: inset(0);
  transition: clip-path 1.05s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: clip-path;
}

.invite-gate.is-opening {
  clip-path: inset(0 0 100% 0);
}

.invite-gate__open {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--midnight);
  color: var(--ivory);
  text-align: center;
}

.invite-gate__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
  opacity: 0.62;
  filter: saturate(0.82);
  transform: scale(1.015);
  transition: transform 1.05s var(--ease-out);
}

.invite-gate.is-opening .invite-gate__img {
  transform: scale(1.06);
}

.invite-gate__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(5, 11, 46, 0.18) 0%, rgba(5, 11, 46, 0.58) 48%, rgba(5, 11, 46, 0.94) 100%),
    linear-gradient(180deg, rgba(5, 11, 46, 0.55), rgba(5, 11, 46, 0.18) 45%, rgba(5, 11, 46, 0.92));
}

.invite-gate__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(100%, 760px);
  padding: 2rem 1.25rem;
}

.invite-gate__bismillah {
  color: var(--gold);
  font-size: clamp(0.9rem, 2.4vw, 1.08rem);
  line-height: 1.9;
  text-shadow: 0 2px 14px rgba(5, 11, 46, 0.8);
}

.invite-gate__names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.02em 0.34em;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 12vw, 7rem);
  font-weight: 400;
  line-height: 1.55;
  text-shadow:
    0 0 12px rgba(247, 217, 154, 0.28),
    0 0 48px rgba(247, 217, 154, 0.18),
    0 8px 34px rgba(0, 0, 0, 0.55);
}

.invite-gate__amp {
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.46em;
  line-height: 1;
}

.invite-gate__hint {
  margin-top: clamp(2rem, 8vh, 4.5rem);
  padding: 0.7rem 1.15rem;
  border: 1px solid rgba(217, 178, 111, 0.38);
  border-radius: 999px;
  background: rgba(5, 11, 46, 0.46);
  color: var(--gold-bright);
  font-size: clamp(0.78rem, 2.2vw, 0.9rem);
  line-height: 1.6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  animation: gatePulse 2.4s ease-in-out infinite;
}

/* ---------- navigation ---------- */

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 120;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(5, 11, 46, 0.9), rgba(5, 11, 46, 0.38) 70%, transparent);
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-nav.is-scrolled {
  border-color: rgba(217, 178, 111, 0.18);
  background: rgba(5, 11, 46, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: min(1180px, calc(100% - 1.5rem));
  min-height: 60px;
  margin-inline: auto;
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(247, 217, 154, 0.35);
}

.site-nav__star {
  font-family: var(--font-body);
  font-size: 0.7rem;
  transform: translateY(-1px);
}

.site-nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
}

.site-nav__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border-radius: 3px;
  color: rgba(247, 236, 216, 0.76);
  font-size: 0.84rem;
  line-height: 1.3;
  transition: color 0.25s ease, background 0.25s ease;
}

.site-nav__links a::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
  opacity: 0;
  transform: translateX(50%) scale(0);
  box-shadow: 0 0 8px var(--gold-bright);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-nav__links a:hover,
.site-nav__links a.is-active {
  color: var(--gold-bright);
  background: rgba(217, 178, 111, 0.06);
}

.site-nav__links a.is-active::after {
  opacity: 1;
  transform: translateX(50%) scale(1);
}

.music-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(217, 178, 111, 0.38);
  border-radius: 50%;
  background: rgba(5, 11, 46, 0.35);
  color: var(--gold-bright);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.music-btn--floating {
  position: fixed;
  top: max(0.7rem, env(safe-area-inset-top));
  left: max(0.7rem, env(safe-area-inset-left));
  z-index: 130;
}

.music-btn:hover {
  border-color: var(--gold);
  background: rgba(217, 178, 111, 0.1);
  transform: translateY(-1px);
}

.music-btn__note {
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.music-btn__pulse {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.music-btn__pulse i {
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.music-btn.is-playing .music-btn__note {
  opacity: 0;
  transform: scale(0.7);
}

.music-btn.is-playing .music-btn__pulse {
  opacity: 1;
}

.music-btn.is-playing .music-btn__pulse i {
  animation: equalizer 0.9s ease-in-out infinite alternate;
}

.music-btn.is-playing .music-btn__pulse i:nth-child(2) {
  animation-delay: -0.35s;
}

.music-btn.is-playing .music-btn__pulse i:nth-child(3) {
  animation-delay: -0.65s;
}

/* ---------- shared layout ---------- */

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2.25rem, 6vw, 5.5rem);
}

.split--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.split--reverse .split-copy {
  order: 1;
}

.split--reverse .split-media {
  order: 2;
}

.split-media {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.split-copy {
  min-width: 0;
}

.section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: clamp(4rem, 9vw, 7rem) 0;
  background: linear-gradient(180deg, rgba(9, 20, 61, 0.76), rgba(5, 11, 46, 0.84));
  scroll-margin-top: 64px;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--section-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: var(--bg-pos, 50% 50%);
  opacity: 0.14;
  filter: saturate(0.82);
  transform: scale(1.02);
}

.section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at var(--glow-x, 18%) var(--glow-y, 26%), rgba(122, 143, 255, 0.15), transparent 44%),
    radial-gradient(circle at 82% 78%, rgba(247, 217, 154, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(5, 11, 46, 0.62), rgba(5, 11, 46, 0.3) 42%, rgba(5, 11, 46, 0.82));
}

.section--countdown {
  --bg-pos: 76% 22%;
  --glow-x: 18%;
  --glow-y: 30%;
}

.section--rsvp {
  --bg-pos: 22% 68%;
  --glow-x: 82%;
  --glow-y: 22%;
}

.section--programme {
  --bg-pos: 50% 82%;
  --glow-x: 16%;
  --glow-y: 62%;
}

/* ---------- ornaments & type ---------- */

.emblem {
  display: block;
  width: clamp(86px, 10vw, 126px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 20px rgba(247, 217, 154, 0.3));
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.7;
}

.section-title {
  position: relative;
  display: block;
  max-width: 18ch;
  margin: 0 0 1.15rem;
  padding-bottom: 1rem;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 4rem);
  font-weight: 400;
  line-height: 1.55;
  text-shadow: 0 0 26px rgba(247, 217, 154, 0.2);
}

.section-title__inner {
  display: inline-block;
  padding-inline: 0.24em;
  margin-inline: -0.24em;
}

.section-title::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.25rem;
  width: min(11rem, 56%);
  height: 1px;
  background: linear-gradient(90deg, var(--gold-bright), rgba(217, 178, 111, 0));
  box-shadow: 0 0 8px rgba(247, 217, 154, 0.3);
  transform: scaleX(1);
  transform-origin: right center;
}

.lead {
  max-width: 46ch;
  margin: 0 0 1.8rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.95;
}

.word {
  display: inline-block;
}

.section-divider {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
  overflow: clip;
  padding: clamp(1.4rem, 3.6vw, 2.6rem) 1rem;
  background: linear-gradient(180deg, rgba(5, 11, 46, 0.98), rgba(9, 20, 61, 0.74) 55%, rgba(5, 11, 46, 0.98));
}

.section-divider::before,
.section-divider::after {
  content: "";
  width: min(22vw, 240px);
  height: 1px;
  margin-top: auto;
  margin-bottom: auto;
  background: linear-gradient(90deg, transparent, rgba(217, 178, 111, 0.26));
}

.section-divider::after {
  background: linear-gradient(90deg, rgba(217, 178, 111, 0.26), transparent);
}

.section-divider img {
  width: min(78vw, 680px);
  height: auto;
  margin-inline: clamp(0.5rem, 2vw, 1.5rem);
  filter: drop-shadow(0 0 14px rgba(247, 217, 154, 0.38));
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 6.5rem 1rem 4rem;
  background: var(--midnight);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}

.hero-fallback,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}

.hero-video {
  will-change: transform;
  transition: opacity 0.8s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 18% 74%, rgba(91, 112, 255, 0.2), transparent 52%),
    radial-gradient(ellipse at 82% 58%, rgba(247, 179, 97, 0.15), transparent 48%),
    linear-gradient(180deg, rgba(5, 11, 46, 0.72) 0%, rgba(5, 11, 46, 0.22) 35%, rgba(5, 11, 46, 0.5) 68%, var(--midnight) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  box-shadow: inset 0 0 26vw rgba(2, 6, 26, 0.72);
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 980px);
  padding-top: clamp(1.5rem, 6vh, 4rem);
  text-align: center;
  will-change: transform, opacity;
}

.emblem--hero {
  width: clamp(82px, 9vw, 118px);
  margin-bottom: clamp(1rem, 2.4vh, 1.8rem);
  opacity: 0;
  animation: emblemFade 1.15s var(--ease-out) 0.15s forwards, emblemFloat 8s ease-in-out 1.4s infinite;
}

.hero-invite {
  margin: 0 0 0.25rem;
  color: var(--gold-bright);
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
  line-height: 1.9;
  text-shadow: 0 0 18px rgba(5, 11, 46, 0.9);
}

.hero-invite .word {
  opacity: 0;
  animation: heroWord 0.85s var(--ease-out) forwards;
  animation-delay: calc(0.5s + (var(--w, 0) * 0.09s));
}

.hero-names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.02em 0.34em;
  margin: 0.15rem 0 0;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(3.65rem, 13vw, 9.2rem);
  font-weight: 400;
  line-height: 1.55;
  text-shadow:
    0 0 12px rgba(247, 217, 154, 0.28),
    0 0 48px rgba(247, 217, 154, 0.18),
    0 8px 34px rgba(0, 0, 0, 0.55);
}

.hero-name {
  display: inline-block;
  opacity: 0;
  animation: heroName 1.15s var(--ease-out) 0.25s forwards;
}

.hero-name:last-child {
  animation-delay: 0.52s;
}

.hero-amp {
  display: inline-block;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.46em;
  line-height: 1;
  opacity: 0;
  animation: heroName 1s var(--ease-out) 0.82s forwards;
}

.hero-divider {
  width: min(260px, 66vw);
  margin: clamp(0.25rem, 1.5vh, 0.75rem) auto 0;
  overflow: hidden;
}

.hero-divider img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(247, 217, 154, 0.36));
  clip-path: inset(0 50% 0 50%);
  animation: dividerOpen 1.25s var(--ease-out) 0.95s forwards;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.72rem;
  margin: clamp(0.9rem, 2vh, 1.4rem) 0 0;
  color: var(--ivory-soft);
  font-size: clamp(0.92rem, 1.7vw, 1.06rem);
  line-height: 1.7;
  opacity: 0;
  animation: heroWord 1s var(--ease-out) 1.12s forwards;
}

.hero-meta__dot {
  color: var(--gold);
}

.scroll-cue {
  position: absolute;
  top: calc(100% + clamp(2.2rem, 7vh, 4.8rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.4rem;
  color: rgba(247, 236, 216, 0.72);
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0;
  animation: heroWord 1s var(--ease-out) 1.4s forwards;
}

.scroll-cue__chevron {
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
  animation: cueBounce 2.2s ease-in-out infinite;
}

/* ---------- photo frames ---------- */

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 777 / 1078;
  margin: 0;
  isolation: isolate;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 22px rgba(217, 178, 111, 0.16));
}

.photo-frame__img {
  position: absolute;
  inset: 4.2% 6.4%;
  z-index: 1;
  width: 87.2%;
  height: 91.6%;
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
}

.photo-frame__border {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(247, 217, 154, 0.16));
}

.photo-frame__shimmer {
  position: absolute;
  inset: 8.5%;
  z-index: 3;
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 39%, rgba(255, 247, 226, 0.23) 50%, transparent 61%);
  background-size: 240% 100%;
  background-position: 130% 0;
  opacity: 0;
}

.photo-frame:hover .photo-frame__shimmer {
  animation: frameShimmer 1.8s var(--ease-out);
}

.photo-frame.is-inview .photo-frame__shimmer {
  animation: frameShimmer 2.4s var(--ease-out) 0.6s 1;
}

/* ---------- countdown ---------- */

.countdown {
  margin-top: clamp(1.8rem, 4vw, 2.7rem);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.4rem, 1.4vw, 0.8rem);
  max-width: 540px;
}

.count-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(84px, 12vw, 122px);
  padding: 0.8rem 0.25rem 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(217, 178, 111, 0.25);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(247, 217, 154, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(16, 31, 82, 0.84), rgba(6, 13, 46, 0.78));
  box-shadow: inset 0 1px 0 rgba(247, 217, 154, 0.12), 0 10px 30px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.count-card::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 7px rgba(247, 217, 154, 0.34);
  transform: translateX(-50%);
  pointer-events: none;
}

.count-card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(217, 178, 111, 0.1);
  border-radius: 7px;
  pointer-events: none;
}

.count-value {
  display: block;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.8vw, 3.15rem);
  font-weight: 400;
  line-height: 1.25;
  text-shadow: 0 0 18px rgba(247, 217, 154, 0.34);
  font-variant-numeric: tabular-nums;
}

.count-value.is-ticking {
  animation: countTick 0.5s var(--ease-out);
}

.count-label {
  margin-top: 0.1rem;
  color: rgba(247, 236, 216, 0.72);
  font-size: clamp(0.68rem, 1.5vw, 0.82rem);
  line-height: 1.5;
}

.countdown-done {
  margin: 1rem 0 0;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.55;
  text-shadow: 0 0 20px rgba(247, 217, 154, 0.32);
}

.countdown-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1.5rem 0 0;
  color: var(--ivory-soft);
  font-size: 0.92rem;
}

.countdown-date__star {
  color: var(--gold);
  font-size: 0.7rem;
}

/* ---------- RSVP form ---------- */

.rsvp-form {
  position: relative;
  margin-top: 2rem;
  padding: clamp(1.35rem, 3.2vw, 2.2rem);
  border: 1px solid rgba(217, 178, 111, 0.27);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 217, 154, 0.08), transparent 32%),
    linear-gradient(155deg, rgba(13, 27, 74, 0.9), rgba(5, 12, 43, 0.82));
  box-shadow: inset 0 1px 0 rgba(247, 217, 154, 0.12), var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rsvp-form::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(217, 178, 111, 0.08);
  border-radius: 9px;
  pointer-events: none;
}

.form-corner {
  position: absolute;
  z-index: 3;
  width: clamp(62px, 8vw, 92px);
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(247, 217, 154, 0.18));
}

.form-corner--tl {
  top: -8px;
  left: -8px;
}

.form-corner--tr {
  top: -8px;
  right: -8px;
  transform: scaleX(-1);
}

.form-corner--bl {
  bottom: -8px;
  left: -8px;
  transform: scaleY(-1);
}

.form-corner--br {
  bottom: -8px;
  right: -8px;
  transform: scale(-1, -1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 0.38rem;
  padding: 0;
  color: rgba(247, 236, 216, 0.88);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(217, 178, 111, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field select {
  cursor: pointer;
}

.field select option {
  background: var(--deep);
  color: var(--ivory);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(247, 236, 216, 0.55);
  opacity: 1;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: rgba(217, 178, 111, 0.42);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--gold);
  outline: none;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 0 0 3px rgba(217, 178, 111, 0.12);
}

.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select,
.attendance-field.has-error .toggle span {
  border-color: rgba(255, 180, 168, 0.72);
}

.field-error {
  margin: 0.35rem 0 0;
  color: var(--rose);
  font-size: 0.8rem;
  line-height: 1.6;
}

.field-hint {
  margin: 0.3rem 0 0;
  color: rgba(247, 236, 216, 0.58);
  font-size: 0.78rem;
}

.attendance-field {
  grid-column: 1 / -1;
}

.attendance-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.toggle {
  position: relative;
  display: block;
  margin: 0 !important;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.toggle span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(217, 178, 111, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(247, 236, 216, 0.8);
  font-size: 0.93rem;
  line-height: 1.4;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.toggle input:checked + span {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--midnight);
  font-weight: 700;
  box-shadow: 0 0 22px rgba(247, 217, 154, 0.22);
}

.toggle input:focus-visible + span {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.35rem;
}

.form-status {
  min-height: 1.3rem;
  margin: 0.65rem 0 0;
  color: rgba(247, 236, 216, 0.68);
  font-size: 0.84rem;
  line-height: 1.6;
}

.form-status.is-error {
  color: var(--rose);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.82rem 1.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  isolation: isolate;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(247, 217, 154, 0.24) 0deg 1.2deg,
    transparent 1.2deg 30deg
  );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 42%, #000 54%, transparent 82%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 42%, #000 54%, transparent 82%);
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
  pointer-events: none;
}

.btn--gold:hover::before,
.btn--gold:focus-visible::before,
.btn--outline:hover::before,
.btn--outline:focus-visible::before,
.btn--calendar:hover::before,
.btn--calendar:focus-visible::before {
  opacity: 0.85;
  transform: scale(1);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn--gold {
  border-color: rgba(255, 238, 203, 0.5);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 52%, #c69a55 100%);
  color: var(--midnight);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26), 0 0 28px rgba(247, 217, 154, 0.18);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32), 0 0 36px rgba(247, 217, 154, 0.28);
}

.btn--gold:active {
  transform: translateY(0);
}

.btn--outline {
  border-color: rgba(217, 178, 111, 0.52);
  background: transparent;
  color: var(--gold-bright);
}

.btn--outline:hover {
  border-color: var(--gold-bright);
  background: rgba(217, 178, 111, 0.1);
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: rgba(217, 178, 111, 0.4);
  background: transparent;
  color: var(--ivory);
}

.btn--ghost:hover {
  border-color: var(--gold);
  background: rgba(217, 178, 111, 0.09);
}

.btn[aria-busy="true"] {
  pointer-events: none;
}

.btn[aria-busy="true"] .btn-label {
  opacity: 0.45;
}

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(5, 11, 46, 0.28);
  border-top-color: var(--midnight);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn[aria-busy="true"] .spinner {
  display: block;
}

/* ---------- thank you ---------- */

.thank-you {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  margin-top: 2rem;
  padding: 2.4rem 1.35rem;
  border: 1px solid rgba(217, 178, 111, 0.28);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 15%, rgba(247, 217, 154, 0.13), transparent 38%),
    linear-gradient(155deg, rgba(13, 27, 74, 0.9), rgba(5, 12, 43, 0.86));
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(247, 217, 154, 0.12), var(--shadow-soft);
}

.thank-you::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(217, 178, 111, 0.08);
  border-radius: 9px;
  pointer-events: none;
}

.thank-you h3 {
  margin: 1rem 0 0.35rem;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 400;
  line-height: 1.6;
  text-shadow: 0 0 20px rgba(247, 217, 154, 0.24);
}

.thank-you p {
  max-width: 34ch;
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.starburst {
  position: relative;
  width: 76px;
  height: 76px;
}

.starburst span {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--gold-bright);
  font-size: 2rem;
  line-height: 1;
  text-shadow: 0 0 20px rgba(247, 217, 154, 0.6);
  transform: translate(-50%, -50%);
}

.starburst i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 31px;
  background: linear-gradient(180deg, var(--gold-bright), transparent);
  opacity: 0;
  transform-origin: 50% 0;
  transform: translateX(-50%) rotate(calc(var(--i) * 45deg)) scaleY(0);
}

.thank-you.is-active .starburst i {
  animation: starRay 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i) * 0.035s);
}

.thank-you.is-active .starburst span {
  animation: starTwinkle 1.9s ease-in-out 0.55s infinite;
}

/* ---------- programme ---------- */

.timeline {
  position: relative;
  margin: 2rem 0 0;
  padding: 0 3rem 0 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 15px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(217, 178, 111, 0.56) 8%, rgba(217, 178, 111, 0.56) 92%, transparent);
  box-shadow: 0 0 10px rgba(247, 217, 154, 0.2);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.35rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-node {
  position: absolute;
  top: 3px;
  right: -3rem;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(217, 178, 111, 0.28);
  border-radius: 50%;
  background: rgba(5, 11, 46, 0.86);
  color: rgba(247, 236, 216, 0.34);
  transition: color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease;
  transition-delay: calc(var(--n, 0) * 0.04s);
}

.timeline-node svg {
  width: 13px;
  height: 13px;
}

.timeline-item.is-lit .timeline-node {
  border-color: var(--gold);
  background: rgba(217, 178, 111, 0.12);
  color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(247, 217, 154, 0.5), inset 0 0 8px rgba(247, 217, 154, 0.18);
}

.timeline-card {
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease;
  opacity: 0.76;
}

.timeline-item.is-lit .timeline-card {
  border-color: rgba(217, 178, 111, 0.2);
  background: linear-gradient(135deg, rgba(217, 178, 111, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  opacity: 1;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.timeline-time {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.5;
  white-space: nowrap;
}

.timeline-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-inline-start: auto;
  color: var(--gold);
}

.timeline-icon svg {
  width: 17px;
  height: 17px;
}

.timeline-title {
  margin: 0.18rem 0 0.1rem;
  color: var(--ivory);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.6;
}

.timeline-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* ---------- venue ---------- */

.venue-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 2rem;
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border: 1px solid rgba(217, 178, 111, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 217, 154, 0.09), transparent 35%),
    linear-gradient(145deg, rgba(12, 25, 70, 0.8), rgba(5, 12, 43, 0.74));
  box-shadow: inset 0 1px 0 rgba(247, 217, 154, 0.09);
}

.venue-card h3 {
  margin: 0 0 0.5rem;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 400;
  line-height: 1.55;
}

.venue-address {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.venue-address__label {
  color: var(--gold);
  font-weight: 700;
}

.dress-code {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.15rem 1.25rem;
  border-right: 1px solid rgba(217, 178, 111, 0.24);
}

.dress-code__label {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
}

.dress-code strong {
  color: var(--ivory-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.dress-code__swatches {
  display: flex;
  gap: 0.38rem;
  margin-top: 0.35rem;
}

.dress-code__swatches i {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(247, 236, 216, 0.2);
  border-radius: 50%;
}

.dress-code__swatches i:nth-child(1) {
  background: #0a1440;
}

.dress-code__swatches i:nth-child(2) {
  background: var(--gold);
}

.dress-code__swatches i:nth-child(3) {
  background: var(--ivory);
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6rem) 1.25rem 3rem;
  background:
    linear-gradient(180deg, rgba(5, 11, 46, 0.96), rgba(9, 20, 61, 0.9)),
    var(--section-bg);
  background-size: cover;
  background-position: center 82%;
  text-align: center;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(247, 217, 154, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(5, 11, 46, 0.76), rgba(5, 11, 46, 0.96));
}

.emblem--footer {
  width: clamp(78px, 9vw, 108px);
  margin-bottom: 1.15rem;
  opacity: 0.92;
}

.footer-thanks {
  max-width: 22ch;
  margin: 0 0 0.3rem;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.7vw, 2.6rem);
  font-weight: 400;
  line-height: 1.62;
  text-shadow: 0 0 22px rgba(247, 217, 154, 0.2);
}

.footer-initials {
  margin: 0 0 1.5rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.55;
}

.btn--calendar {
  border-color: rgba(217, 178, 111, 0.4);
  background: rgba(217, 178, 111, 0.06);
  color: var(--gold-bright);
  font-size: 0.9rem;
}

.btn--calendar:hover {
  border-color: var(--gold-bright);
  background: rgba(217, 178, 111, 0.12);
  transform: translateY(-2px);
}

.footer-see {
  margin: 1.6rem 0 0;
  color: rgba(247, 236, 216, 0.62);
  font-size: 0.85rem;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  right: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 400;
  max-width: min(90vw, 420px);
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(217, 178, 111, 0.38);
  border-radius: 10px;
  background: rgba(9, 20, 61, 0.96);
  color: var(--ivory);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translate(50%, 18px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

/* =========================================================
   Scroll reveals — scroll-driven when available
   ========================================================= */

@keyframes titleSweep {
  from {
    clip-path: inset(0 0 0 100%);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes titleLine {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes gatePulse {
  0%,
  100% {
    border-color: rgba(217, 178, 111, 0.32);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 0 rgba(247, 217, 154, 0);
  }
  50% {
    border-color: rgba(247, 217, 154, 0.62);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 24px rgba(247, 217, 154, 0.16);
  }
}

@keyframes dividerOpen {
  from {
    opacity: 0;
    clip-path: inset(0 50% 0 50%);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
  }
}

@keyframes photoReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.94);
    filter: blur(7px) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 0 rgba(217, 178, 111, 0));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 22px rgba(217, 178, 111, 0.16));
  }
}

@keyframes wordsRise {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@supports (animation-timeline: view()) {
  .section-title__inner {
    animation: titleSweep linear both;
    animation-timeline: view();
    animation-range: entry 12% cover 34%;
  }

  .section-title::after {
    animation: titleLine linear both;
    animation-timeline: view();
    animation-range: entry 22% cover 38%;
  }

  .section-divider img {
    animation: dividerOpen linear both;
    animation-timeline: view();
    animation-range: entry 8% cover 34%;
  }

  .photo-frame {
    animation: photoReveal linear both;
    animation-timeline: view();
    animation-range: entry 6% cover 38%;
  }

  .split-copy .word,
  .venue-card .kicker,
  .venue-card h3 {
    animation: wordsRise linear both;
    animation-timeline: view();
    animation-range: entry 16% cover 42%;
  }

  .timeline-item .timeline-card {
    animation: wordsRise linear both;
    animation-timeline: view();
    animation-range: entry 22% cover 48%;
  }
}

/* JS fallback: reversible when IntersectionObserver drives the classes */
.js-scroll-fallback .section-title__inner {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.9s var(--ease-out);
}

.js-scroll-fallback .section-title.is-visible .section-title__inner {
  clip-path: inset(0);
}

.js-scroll-fallback .section-title::after {
  transform: scaleX(0);
  transition: transform 0.9s var(--ease-out) 0.1s;
}

.js-scroll-fallback .section-title.is-visible::after {
  transform: scaleX(1);
}

.js-scroll-fallback .section-divider img {
  opacity: 0;
  clip-path: inset(0 50% 0 50%);
  transition: opacity 0.8s ease, clip-path 1s var(--ease-out);
}

.js-scroll-fallback .section-divider.is-visible img {
  opacity: 1;
  clip-path: inset(0);
}

.js-scroll-fallback .photo-frame {
  opacity: 0;
  transform: translateY(30px) scale(0.94);
  filter: blur(7px) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.42));
  transition: opacity 0.8s ease, transform 1s var(--ease-out), filter 0.9s ease;
}

.js-scroll-fallback .photo-frame.is-visible {
  opacity: 1;
  transform: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 22px rgba(217, 178, 111, 0.16));
}

.js-scroll-fallback .word {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(5px);
  transition: opacity 0.5s ease, transform 0.65s var(--ease-out), filter 0.55s ease;
}

.js-scroll-fallback .word.is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

.js-scroll-fallback .timeline-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.7s var(--ease-out), border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.js-scroll-fallback .timeline-item.is-lit .timeline-card {
  opacity: 1;
  transform: none;
}

/* ---------- keyframes ---------- */

@keyframes emblemFade {
  from {
    opacity: 0;
    filter: blur(8px) drop-shadow(0 0 0 rgba(247, 217, 154, 0));
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 20px rgba(247, 217, 154, 0.3));
    transform: scale(1);
  }
}

@keyframes emblemFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-7px) rotate(1.5deg);
  }
}

@keyframes heroWord {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes heroName {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes cueBounce {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(5px) rotate(45deg);
    opacity: 1;
  }
}

@keyframes equalizer {
  from {
    height: 5px;
  }
  to {
    height: 14px;
  }
}

@keyframes frameShimmer {
  0% {
    background-position: 130% 0;
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    background-position: -130% 0;
    opacity: 0;
  }
}

@keyframes countTick {
  0% {
    opacity: 0.35;
    transform: translateY(-5px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes starRay {
  0% {
    opacity: 0;
    transform: translateX(-50%) rotate(calc(var(--i) * 45deg)) scaleY(0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) rotate(calc(var(--i) * 45deg)) scaleY(1);
  }
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0.92) rotate(0deg);
    text-shadow: 0 0 14px rgba(247, 217, 154, 0.45);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(8deg);
    text-shadow: 0 0 26px rgba(247, 217, 154, 0.86);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(50%, 18px);
  }
  to {
    opacity: 1;
    transform: translate(50%, 0);
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (min-width: 660px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .split,
  .split--reverse {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 3rem);
  }

  .split--reverse .split-copy,
  .split--reverse .split-media {
    order: 0;
  }

  .split-media {
    order: -1;
  }

  .split-copy {
    max-width: 680px;
    margin-inline: auto;
  }

  .section-title {
    max-width: 22ch;
  }

  .photo-frame {
    max-width: min(390px, 88%);
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 60px;
  }

  .site-nav__inner {
    width: calc(100% - 1rem);
    min-height: 56px;
    gap: 0.25rem;
  }

  .site-nav__brand {
    font-size: 0.95rem;
  }

  .site-nav__links {
    gap: 0;
  }

  .site-nav__links a {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .music-btn {
    width: 44px;
    height: 44px;
  }

  .music-btn__note,
  .music-btn__pulse {
    width: 16px;
    height: 16px;
  }

  .hero {
    padding-top: 5.4rem;
  }

  .hero-names {
    font-size: clamp(3.4rem, 16vw, 6rem);
  }

  .scroll-cue {
    top: calc(100% + 2.3rem);
  }

  .hero-meta {
    max-width: 24ch;
    gap: 0.12rem 0.55rem;
  }

  .hero-meta .hero-meta__dot {
    display: none;
  }

  .countdown-grid {
    max-width: none;
  }

  .count-card {
    min-height: 84px;
    padding-inline: 0.1rem;
  }

  .timeline {
    padding-right: 2.5rem;
  }

  .timeline-node {
    right: -2.5rem;
    width: 26px;
    height: 26px;
  }

  .timeline::before {
    right: 12.5px;
    top: 10px;
  }

  .venue-card {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .dress-code {
    border-top: 1px solid rgba(217, 178, 111, 0.24);
    border-right: 0;
    padding: 1.1rem 0 0;
  }

  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 1rem;
  }

  .container {
    width: calc(100% - 1.35rem);
  }

  .site-nav__star {
    display: none;
  }

  .site-nav__brand {
    font-size: 0.84rem;
    padding-inline-end: 0.1rem;
  }

  .site-nav__links a {
    padding-inline: 0.36rem;
    font-size: 0.8rem;
  }

  .hero-invite {
    font-size: 0.86rem;
  }

  .hero-names {
    gap: 0 0.2em;
    font-size: clamp(3.15rem, 17.5vw, 4.8rem);
  }

  .section {
    padding-block: 3.5rem;
  }

  .section-title {
    font-size: clamp(1.9rem, 8.2vw, 2.6rem);
  }

  .lead {
    font-size: 0.97rem;
  }

  .photo-frame {
    max-width: 100%;
  }

  .count-value {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }

  .count-label {
    font-size: 0.75rem;
  }

  .rsvp-form {
    padding: 1.25rem 1rem;
  }

  .form-corner {
    width: 56px;
  }

  .attendance-toggle {
    gap: 0.4rem;
  }

  .timeline-card {
    padding: 0.65rem 0.7rem;
  }

  .timeline-time {
    font-size: 1.05rem;
  }

  .footer-thanks {
    font-size: 1.65rem;
  }
}

@media (max-width: 360px) {
  .site-nav__brand {
    display: none;
  }

  .site-nav__links {
    flex: 1;
    justify-content: space-around;
  }

  .hero-names {
    font-size: 3rem;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */

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

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

  #starfield {
    display: none;
  }

  .hero-content {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-video {
    transform: none !important;
  }

  .emblem--hero,
  .hero-invite .word,
  .hero-name,
  .hero-amp,
  .hero-meta,
  .scroll-cue {
    opacity: 1;
    filter: none;
  }

  .hero-divider img {
    clip-path: none;
  }

  .section-title__inner,
  .section-divider img,
  .photo-frame,
  .word,
  .timeline-card {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .section-title::after {
    transform: scaleX(1) !important;
  }

  .photo-frame__shimmer,
  .starburst i,
  .starburst span {
    animation: none !important;
    opacity: 0 !important;
  }

  .timeline-item .timeline-card {
    opacity: 1;
  }

  .scroll-cue__chevron,
  .music-btn.is-playing .music-btn__pulse i {
    animation: none;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  html {
    color-scheme: light;
  }

  #starfield,
  .invite-gate,
  .site-nav,
  .scroll-progress,
  .music-btn,
  .scroll-cue,
  .skip-link,
  .section-divider,
  .toast,
  .hero-media,
  .hero-overlay,
  .form-corner,
  .photo-frame__shimmer,
  .starburst,
  .btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .hero,
  .section,
  .site-footer {
    min-height: 0;
    background: #fff;
    color: #111;
  }

  .hero {
    padding: 0 0 1.5rem;
  }

  .section {
    padding: 1.5rem 0;
  }

  .count-card,
  .timeline-item,
  .venue-card,
  .rsvp-form,
  .thank-you,
  .photo-frame {
    break-inside: avoid;
  }

  .section::before,
  .section::after,
  .site-footer::before {
    display: none;
  }

  .hero-names,
  .section-title,
  .footer-thanks,
  .timeline-title,
  .timeline-time,
  .count-value,
  .venue-card h3,
  .thank-you h3 {
    color: #111;
    text-shadow: none;
  }

  .hero-invite,
  .hero-meta,
  .kicker,
  .lead,
  .countdown-date,
  .count-label,
  .timeline-desc,
  .venue-address,
  .footer-see,
  .footer-initials,
  .dress-code strong,
  .venue-address__label,
  .dress-code__label,
  .field label,
  .field-hint,
  .form-status,
  .thank-you p {
    color: #222;
    text-shadow: none;
  }

  .dress-code strong {
    color: #111;
  }

  .field-error,
  .form-status.is-error {
    color: #8b1d1d;
  }

  .count-card,
  .rsvp-form,
  .thank-you,
  .timeline-card,
  .venue-card {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
  }

  .timeline-card {
    opacity: 1 !important;
  }

  .field input,
  .field textarea,
  .field select,
  .toggle span {
    border-color: #999;
    background: #fff;
    color: #111;
  }

  .field input::placeholder,
  .field textarea::placeholder {
    color: #666;
  }

  .hero-content,
  .hero-name,
  .hero-amp,
  .hero-meta,
  .word,
  .section-title__inner,
  .photo-frame,
  .section-divider img,
  .timeline-card {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero-divider img {
    clip-path: none !important;
  }

  .site-footer {
    padding-top: 2rem;
  }
}

/* =========================================================
   GUEST PROTECTION — access screen, personalization,
   preview mode, watermark and deterrence layers
   ========================================================= */

.invite-gate {
  place-items: center;
  padding: 1.25rem;
}

.invite-gate__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: min(100%, 540px);
  padding: clamp(1.6rem, 5vw, 2.8rem);
  text-align: center;
  transition: opacity 0.45s ease, transform 0.55s var(--ease-out);
}

.invite-gate.is-opening .invite-gate__panel {
  opacity: 0;
  transform: translateY(-14px);
}

.invite-gate__emblem {
  width: clamp(62px, 10vw, 88px);
  height: auto;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 8px 28px rgba(247, 217, 154, 0.2));
}

.invite-gate__eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: clamp(0.74rem, 2vw, 0.84rem);
}

.invite-gate__title {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 9vw, 4.5rem);
  font-weight: 400;
  line-height: 1.55;
  text-shadow: 0 0 30px rgba(247, 217, 154, 0.2);
}

.invite-gate__status {
  max-width: 38ch;
  min-height: 2.9em;
  margin: 0.55rem 0 0;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(217, 178, 111, 0.3);
  border-radius: 12px;
  background: rgba(5, 11, 46, 0.58);
  color: var(--ivory-soft);
  font-size: clamp(0.8rem, 2.3vw, 0.92rem);
  line-height: 1.7;
}

.invite-gate__spinner {
  width: 22px;
  height: 22px;
  margin-top: 0.25rem;
  border: 1.5px solid rgba(247, 217, 154, 0.25);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: protectionSpin 0.85s linear infinite;
}

.invite-gate__spinner[hidden] {
  display: none !important;
}

.invite-gate__retry {
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(217, 178, 111, 0.44);
  border-radius: 999px;
  background: rgba(5, 11, 46, 0.6);
  color: var(--gold-bright);
  font-size: 0.82rem;
}

.invite-gate__noscript {
  margin: 0.7rem 0 0;
  color: var(--rose);
  font-size: 0.8rem;
}

.hero-guest {
  margin: 0 0 0.7rem;
  color: var(--gold-bright);
  font-size: clamp(0.8rem, 2.4vw, 0.95rem);
  line-height: 1.7;
  text-shadow: 0 2px 18px rgba(5, 11, 46, 0.8);
}

.hero-guest span {
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.18em;
}

.preview-banner {
  position: fixed;
  top: max(0.8rem, env(safe-area-inset-top));
  right: 50%;
  z-index: 520;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(247, 217, 154, 0.5);
  border-radius: 999px;
  background: rgba(5, 11, 46, 0.92);
  color: var(--gold-bright);
  font-size: 0.76rem;
  line-height: 1.4;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  transform: translateX(50%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.preview-banner a {
  padding-inline-start: 0.75rem;
  border-inline-start: 1px solid rgba(247, 217, 154, 0.28);
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guest-watermark {
  position: fixed;
  inset: -34%;
  z-index: 405;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: center;
  gap: clamp(2rem, 7vw, 6rem) clamp(1.2rem, 4vw, 3rem);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: clamp(0.58rem, 1vw, 0.78rem);
  line-height: 1.4;
  text-align: center;
  opacity: 0.12;
  transform: rotate(-27deg);
  pointer-events: none;
  user-select: none;
}

.guest-watermark span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html.is-preview .guest-watermark {
  opacity: 0.075;
}

.privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(20, 38, 95, 0.72), rgba(5, 11, 46, 0.98) 68%),
    var(--midnight);
  text-align: center;
}

.privacy-shield__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  max-width: 34ch;
  padding: 1.5rem;
  border: 1px solid rgba(217, 178, 111, 0.34);
  border-radius: 18px;
  background: rgba(9, 20, 61, 0.7);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.privacy-shield__panel strong {
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.privacy-shield__star {
  color: var(--gold-bright);
  font-size: 1.5rem;
}

html.guest-protected body,
html.guest-protected img,
html.guest-protected video {
  -webkit-touch-callout: none;
  user-select: none;
}

html.guest-protected input,
html.guest-protected textarea,
html.guest-protected select {
  -webkit-touch-callout: default;
  user-select: text;
}

html.guest-protected .hero-video {
  pointer-events: none;
}

html.is-embedded body > * {
  display: none !important;
}

html.is-embedded body::before {
  content: "لا يمكن عرض هذه الدعوة داخل إطار آخر.";
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
  color: var(--ivory);
  font-family: var(--font-body);
  text-align: center;
}

@keyframes protectionSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .invite-gate__status {
    max-width: 31ch;
  }

  .guest-watermark {
    inset: -28%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(2.2rem, 10vw, 5rem) 1.2rem;
    font-size: 0.58rem;
  }

  .preview-banner {
    top: max(0.55rem, env(safe-area-inset-top));
    max-width: calc(100% - 1rem);
    white-space: nowrap;
  }
}

@media print {
  #main,
  .site-footer,
  .invite-gate,
  .guest-watermark,
  .preview-banner,
  .music-btn,
  .privacy-shield,
  .toast,
  #starfield,
  .scroll-progress {
    display: none !important;
  }

  body::after {
    content: "هذه الدعوة شخصية، ولا يمكن طباعتها أو تصويرها.";
    display: block;
    padding: 3rem 1rem;
    color: #111;
    font-family: "Amiri", serif;
    font-size: 1rem;
    text-align: center;
  }
}
