/* Fonts: replace assets/fonts/thuluth.woff2 with a licensed Thuluth file when available. */
@font-face {
  font-family: "ThuluthLocal";
  src: url("assets/fonts/thuluth.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "AmoshrefThulth";
  src: url("assets/fonts/amoshref-thulth.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --pearl: #F0EEEC;
  --greige: #E4DEDA;
  --blush-haze: #EBD9D4;
  --blush: #F2B8B5;
  --rose: #E8939A;
  --dusty-rose: #C98B8B;
  --peach: #F5C9A8;
  --mauve-taupe: #B58E85;
  --sage-gray: #8F8B7A;
  --terracotta: #A9755F;
  --bougainvillea: #A3243B;
  --deep-red: #7E1A2E;
  --ink: #4A3B38;

  --font-title: "ThuluthLocal", "Aref Ruqaa", serif;
  --font-body: "Amiri", "Noto Naskh Arabic", serif;
  --font-latin: "Cormorant Garamond", "Great Vibes", serif;
  --font-signature: "Great Vibes", "Cormorant Garamond", cursive;

  --column: 480px;
  --section-pad: 28px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--pearl);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  background-color: var(--pearl);
  background-image: image-set(
    url("assets/processed/paper-texture.webp") type("image/webp"),
    url("assets/Watercolor_paper_texture_background_79253c70.jpg") type("image/jpeg")
  );
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(240, 238, 236, 0.32), rgba(228, 222, 218, 0.18));
}

body.is-locked {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

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

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

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--bougainvillea);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: -1px;
}

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

.noscript-note {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  padding: 14px;
  background: var(--pearl);
  color: var(--deep-red);
  text-align: center;
}

/* ---------- Splash and opening sequence ---------- */

.gate-splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--greige);
  cursor: pointer;
  isolation: isolate;
  transition: opacity 0.8s ease;
}

.gate-splash.is-engaged {
  cursor: default;
}

.gate-splash.is-hiding {
  opacity: 0;
}

.gate-art,
.gate-art img,
.gate-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.gate-art {
  margin: 0;
}

.gate-art--closed {
  z-index: 0;
}

.gate-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.gate-splash.is-video .gate-video {
  opacity: 1;
}

.hero-video-cta {
  position: absolute;
  top: 68%;
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 32px);
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dusty-rose);
  font-family: "AmoshrefThulth", serif;
  font-size: clamp(1.35rem, 6.4vw, 2.15rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 18px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  cursor: pointer;
  isolation: isolate;
  animation: cta-fade-in 1.2s ease 0.4s both;
  transition: opacity 0.3s ease, transform 0.5s ease, filter 0.5s ease, text-shadow 0.5s ease;
  -webkit-tap-highlight-color: transparent;
}

.hero-video-cta.is-dismissed {
  animation: none;
  opacity: 0;
  pointer-events: none;
}

.hero-video-cta::before {
  position: absolute;
  inset: -18px -26px;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 74%);
  content: "";
  pointer-events: none;
}

.hero-video-cta:hover {
  transform: translate(-50%, -50%) scale(1.035);
  filter: drop-shadow(0 0 10px rgba(201, 139, 139, 0.45));
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 18px rgba(201, 139, 139, 0.7);
}

.hero-video-cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@keyframes cta-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gate-art--open {
  z-index: 2;
  opacity: 0;
  transform: scale(1);
  transform-origin: 50% 38%;
  transition: opacity 0.5s ease, transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gate-splash.is-opening .gate-video {
  opacity: 0;
}

.gate-splash.is-opening .gate-art--open {
  opacity: 1;
  transform: scale(1.12);
}

.light-bloom {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255, 253, 250, 0.98) 0%, rgba(244, 238, 234, 0.9) 34%, rgba(240, 238, 236, 0) 74%);
  transition: opacity 1.2s ease;
}

.gate-splash.is-opening .light-bloom {
  opacity: 1;
}

.gate-splash.is-simple-open .gate-art--open {
  transform: none;
  transition: opacity 0.55s ease;
}

.gate-splash.is-simple-open .light-bloom {
  opacity: 0.32;
  transition: opacity 0.7s ease;
}

/* ---------- Petal overlay ---------- */

.petal-layer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 4;
  width: min(100%, var(--column));
  overflow: hidden;
  pointer-events: none;
  opacity: 0.95;
  transform: translateX(-50%);
  transition: opacity 0.8s ease;
}

body.is-locked .petal-layer,
body:not(.is-past-hero) .petal-layer {
  display: none;
}

body:not(.is-locked) .petal-layer,
body.is-opened .petal-layer {
  z-index: 2;
}

body.is-past-hero .petal-layer {
  opacity: 0.9;
}

.falling-petals {
  position: absolute;
  inset: 0;
}

.falling-petal {
  position: absolute;
  top: -18vh;
  left: var(--x, 50%);
  display: block;
  width: var(--size, 16px);
  height: calc(var(--size, 16px) * var(--h, 144) / var(--w, 140));
  opacity: 0;
  transform: translate3d(0, -12vh, 0);
  animation: petal-fall var(--duration, 30s) linear var(--delay, 0s) infinite;
}

.falling-petal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: petal-sway var(--duration, 30s) ease-in-out var(--delay, 0s) infinite alternate;
}

.falling-petal.is-static {
  top: var(--y, 30vh);
  opacity: var(--alpha, 0.7);
  transform: rotate(var(--tilt, 0deg));
  animation: none;
}

.falling-petal.is-static img {
  animation: none;
}

body.is-petals-paused .falling-petal,
body.is-petals-paused .falling-petal img {
  animation-play-state: paused;
}

@keyframes petal-fall {
  0% { opacity: 0; transform: translate3d(0, -12vh, 0); }
  12% { opacity: var(--alpha, 0.7); }
  88% { opacity: var(--alpha, 0.7); }
  100% { opacity: 0; transform: translate3d(0, 118vh, 0); }
}

@keyframes petal-sway {
  from { transform: translate3d(calc(0px - var(--sway, 24px)), 0, 0) rotate(var(--tilt, 0deg)); }
  to { transform: translate3d(var(--sway, 24px), 0, 0) rotate(calc(var(--tilt, 0deg) + var(--spin, 240deg))); }
}

/* ---------- Invitation shell and hero ---------- */

.invitation-shell {
  position: relative;
  width: 100%;
  max-width: var(--column);
  margin-inline: auto;
  overflow: clip;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 253, 250, 0.1), rgba(240, 238, 236, 0.26) 70%),
    linear-gradient(180deg, rgba(240, 238, 236, 0.16), rgba(240, 238, 236, 0.06) 55%, rgba(240, 238, 236, 0.75));
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding: 72px 24px calc(54px + env(safe-area-inset-bottom));
  text-align: center;
}

.hero-open-button {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hero-open-button:focus-visible {
  outline: 1px solid rgba(201, 139, 139, 0.6);
  outline-offset: -7px;
}

.reveal-invite {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.95s ease, transform 0.95s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.is-opened .reveal-invite {
  opacity: 1;
  transform: none;
}

body.is-opened .reveal-invite:nth-child(1) { transition-delay: 0.08s; }
body.is-opened .reveal-invite:nth-child(2) { transition-delay: 0.22s; }
body.is-opened .reveal-invite:nth-child(3) { transition-delay: 0.38s; }
body.is-opened .reveal-invite:nth-child(4) { transition-delay: 0.54s; }
body.is-opened .reveal-invite:nth-child(5) { transition-delay: 0.7s; }
body.is-opened .reveal-invite:nth-child(6) { transition-delay: 0.82s; }

.title {
  margin: 0 0 10px;
  color: var(--deep-red);
  font-family: var(--font-title);
  font-size: clamp(1.85rem, 8vw, 2.5rem);
  font-weight: 400;
  line-height: 1.45;
  text-wrap: balance;
}

.title--hero {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 13vw, 4.5rem);
  line-height: 1.18;
}

.hero-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin: 0;
}

.hero-rule span {
  display: block;
  width: 120px;
  height: 1px;
  margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--bougainvillea), transparent);
}

.latin-names {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 400;
  white-space: nowrap;
}

.latin-names--small span,
.latin-names--footer span {
  padding-inline: 0.12em;
  font-size: 0.62em;
  vertical-align: 0.12em;
  color: var(--dusty-rose);
}

.latin-names--hero {
  color: var(--ink);
  font-size: clamp(1.9rem, 8.4vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: break-word;
}

.latin-names--hero > span {
  display: block;
}

.latin-names--hero .latin-names__amp {
  font-size: 0.62em;
  line-height: 1.1;
  color: var(--dusty-rose);
}

.latin-names--small {
  margin-top: 14px;
  color: var(--terracotta);
  font-size: 1.75rem;
}

.latin-names--footer {
  color: var(--terracotta);
  font-size: 2rem;
}

.hero-date {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
}

.scroll-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mauve-taupe);
}

.scroll-hint span {
  display: block;
  width: 1px;
  height: 34px;
  margin: 0 auto 10px;
  background: linear-gradient(180deg, transparent, var(--dusty-rose));
}

.click-hint {
  margin: 2px 0 0;
  color: var(--dusty-rose);
  font-size: 0.82rem;
}

/* ---------- Paper sections ---------- */

.paper-flow {
  position: relative;
  padding: 48px 0 0;
}

.paper-flow::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 110px;
  background: linear-gradient(180deg, rgba(240, 238, 236, 0), rgba(240, 238, 236, 0.58));
  pointer-events: none;
}

.floral {
  position: absolute;
  z-index: 1;
  width: clamp(180px, 52vw, 260px);
  height: auto;
  opacity: 0.48;
  pointer-events: none;
  filter: saturate(0.72);
  will-change: transform;
}

.floral--top {
  top: -30px;
  right: -72px;
  transform: translate3d(0, var(--floral-top-shift, 0px), 0);
  transform-origin: top right;
}

.floral--bottom {
  bottom: -30px;
  left: -72px;
  transform: rotate(180deg) translate3d(0, var(--floral-bottom-shift, 0px), 0);
  transform-origin: center;
}

.section {
  position: relative;
  z-index: 3;
  padding: 26px var(--section-pad);
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.section-divider {
  position: relative;
  z-index: 3;
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 2px auto -4px;
  opacity: 0.72;
}

.ornament-rule span {
  display: block;
  width: 110px;
  height: 1px;
  margin: 4px auto 20px;
  background: linear-gradient(90deg, transparent, var(--dusty-rose), transparent);
}

/* Welcome */

.welcome-section {
  padding-top: 10px;
}

.welcome-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 768 / 1376;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 16px 38px rgba(74, 59, 56, 0.08);
}

.welcome-card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.arch-photo-frame {
  position: absolute;
  top: 15.6%;
  left: 19%;
  display: block;
  width: 63%;
  height: 68%;
  overflow: hidden;
  border-radius: 999px 999px 8px 8px;
  outline: 1px solid rgba(240, 238, 236, 0.88);
  outline-offset: -5px;
  box-shadow: inset 0 0 26px rgba(74, 59, 56, 0.16);
}

.arch-photo-frame picture,
.arch-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.arch-photo-frame img {
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.82) contrast(0.97);
  user-select: none;
}

.arch-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blush-haze);
  mix-blend-mode: soft-light;
  opacity: 0.2;
  pointer-events: none;
}

.welcome-copy {
  margin-top: 26px;
}

.guest-greeting {
  margin: 0 0 12px;
  color: var(--bougainvillea);
  font-size: 1.05rem;
}

.invitation-text {
  max-width: 34ch;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 2;
  text-wrap: pretty;
}

/* Details */

.details-list {
  max-width: 350px;
  margin: 0 auto;
}

.details-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(181, 142, 133, 0.28);
  text-align: right;
}

.details-row dt {
  color: var(--mauve-taupe);
  font-size: 0.9rem;
}

.details-row dd {
  margin: 0;
  color: var(--ink);
}

.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
}

.info-section .thuluth {
  font-family: var(--font-title);
  font-weight: 400;
}

.info-section .title {
  margin-top: -8px;
}

.info-line {
  margin: 8px 0 0;
  color: var(--deep-red);
  font-size: clamp(1.45rem, 6vw, 1.85rem);
  line-height: 1.9;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.info-line--privacy {
  margin-top: 12px;
  color: var(--mauve-taupe);
  font-size: clamp(1.05rem, 4.8vw, 1.3rem);
}

.info-section.is-soft-open .info-line {
  transform: translateY(-2px);
}

/* Countdown */

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 370px;
  margin: 22px auto 0;
}

.count-card {
  padding: 14px 4px 11px;
  border: 1px solid rgba(181, 142, 133, 0.34);
  border-radius: 11px;
  background: rgba(240, 238, 236, 0.82);
  box-shadow: 0 8px 22px rgba(74, 59, 56, 0.045);
}

.count-number {
  display: block;
  color: var(--bougainvillea);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 8vw, 2.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.count-number.is-ticking {
  animation: tick 0.32s ease;
}

@keyframes tick {
  0% { opacity: 0.45; transform: translateY(-3px) rotateX(35deg); }
  100% { opacity: 1; transform: none; }
}

.count-label {
  display: block;
  margin-top: 6px;
  color: var(--mauve-taupe);
  font-family: var(--font-title);
  font-size: 0.98rem;
}

.countdown-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.countdown-done {
  margin: 24px 0 0;
  color: var(--deep-red);
  font-family: var(--font-title);
  font-size: 1.5rem;
}

/* Location */

.location-section {
  max-width: 360px;
  margin-inline: auto;
  border: 1px solid rgba(181, 142, 133, 0.34);
  border-radius: 14px;
  background: rgba(240, 238, 236, 0.72);
  padding: 28px 24px;
  box-shadow: 0 12px 30px rgba(74, 59, 56, 0.045);
}

.location-copy {
  margin: 0 auto 22px;
  color: var(--mauve-taupe);
}

/* RSVP */

.section-intro {
  margin: -4px 0 20px;
  color: var(--mauve-taupe);
}

.rsvp-form {
  max-width: 380px;
  margin-inline: auto;
  padding: 24px;
  border: 1px solid rgba(181, 142, 133, 0.34);
  border-radius: 14px;
  background: rgba(240, 238, 236, 0.7);
  box-shadow: 0 12px 30px rgba(74, 59, 56, 0.045);
  text-align: right;
}

.field {
  margin-bottom: 16px;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  color: var(--mauve-taupe);
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(181, 142, 133, 0.38);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.76);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}

.choice-field {
  padding: 0;
  border: 0;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid rgba(181, 142, 133, 0.38);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.6);
  color: var(--ink);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--dusty-rose);
  background: rgba(242, 184, 181, 0.2);
}

.choice input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--bougainvillea);
}

.form-error {
  margin: -2px 0 14px;
  color: var(--deep-red);
  font-size: 0.92rem;
}

.rsvp-thanks {
  position: relative;
  display: grid;
  min-height: 190px;
  place-content: center;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(181, 142, 133, 0.3);
  border-radius: 14px;
  background: rgba(240, 238, 236, 0.72);
  color: var(--deep-red);
  font-family: var(--font-title);
  font-size: 1.45rem;
}

.rsvp-thanks__small {
  color: var(--mauve-taupe);
  font-family: var(--font-body);
  font-size: 1rem;
}

.petal-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.petal-bit {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--size, 22px);
  height: calc(var(--size, 22px) * var(--h, 144) / var(--w, 140));
  transform: translate(-50%, -50%);
  animation: petal-burst 1.5s cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
}

.petal-bit img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes petal-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg); }
  18% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--spin)); }
}

/* Buttons and links */

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  border-color: var(--deep-red);
  background: var(--bougainvillea);
  color: var(--pearl);
}

.button--primary:hover {
  background: var(--deep-red);
}

.button--secondary {
  border-color: rgba(181, 142, 133, 0.55);
  background: rgba(240, 238, 236, 0.8);
  color: var(--ink);
}

.button--secondary:hover {
  background: rgba(255, 252, 249, 0.92);
  border-color: var(--dusty-rose);
}

.button--wide {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}

.button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.text-link {
  color: var(--deep-red);
  font-size: 0.95rem;
  text-decoration-color: var(--dusty-rose);
  text-underline-offset: 4px;
}

/* Bride's letter */

.letter-card {
  position: relative;
  max-width: 380px;
  margin-inline: auto;
  padding: 44px 26px 30px;
  border: 1px solid rgba(201, 139, 139, 0.62);
  border-radius: 10px;
  background: var(--pearl);
  box-shadow: 0 14px 34px rgba(74, 59, 56, 0.07);
  text-align: center;
}

.letter-seal {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 34px;
  height: 34px;
  background-image: url("assets/processed/petal-seal.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transform: translateX(-50%) rotate(-12deg);
}

.letter-greeting {
  margin: 0 0 14px;
  color: var(--mauve-taupe);
  font-size: 1rem;
}

.letter-lines p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 21px;
  line-height: 2;
  text-wrap: pretty;
}

.letter-lines p.is-title {
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 7.5vw, 2.1rem);
  line-height: 1.6;
}

.letter-lines p.is-last {
  margin-top: 18px;
  margin-bottom: 0;
  color: var(--bougainvillea);
}

.letter-line-animate {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease var(--line-delay, 0ms), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--line-delay, 0ms);
}

.letter-card.is-visible .letter-line-animate {
  opacity: 1;
  transform: none;
}

.letter-signature {
  display: block;
  margin-top: 22px;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--terracotta);
  font-family: var(--font-signature);
  font-size: 2.35rem;
  line-height: 1.2;
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 3;
  padding: 18px 24px calc(48px + env(safe-area-inset-bottom));
  text-align: center;
}

.footer-thanks {
  margin: 12px 0 6px;
  color: var(--deep-red);
  font-family: var(--font-title);
  font-size: 1.4rem;
}

.footer-love {
  margin: 0;
  color: var(--mauve-taupe);
  font-family: var(--font-latin);
  font-style: italic;
}

.credit-line {
  margin: 18px 0 0;
}

.credit-link {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
  color: var(--terracotta);
  font-family: var(--font-latin);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.82;
  text-decoration: none;
  transition: opacity 0.6s ease;
}

.credit-link:hover,
.credit-link:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Music control */

.music-toggle {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  z-index: 30;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(181, 142, 133, 0.38);
  border-radius: 999px;
  background: rgba(240, 238, 236, 0.82);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.music-toggle svg {
  width: 19px;
  height: 19px;
}

.music-toggle .music-wave,
.music-toggle[aria-pressed="false"] .music-slash {
  display: none;
}

.music-toggle[aria-pressed="true"] .music-wave {
  display: block;
}

/* Desktop frame */

@media (min-width: 521px) {
  .invitation-shell {
    box-shadow: 0 0 80px rgba(74, 59, 56, 0.07);
  }

  .gate-splash::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(181, 142, 133, 0.16);
  }

  .section {
    padding-inline: 34px;
  }
}

@media (max-width: 360px) {
  :root {
    --section-pad: 20px;
  }

  .letter-card {
    padding-inline: 20px;
  }

  .letter-lines p {
    font-size: 19px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .reveal-invite,
  .letter-line-animate {
    opacity: 1 !important;
    transform: none !important;
  }

  .falling-petal,
  .falling-petal img {
    animation: none !important;
  }

  .hero-video-cta {
    animation: none !important;
    opacity: 1;
  }
}

@media (prefers-reduced-data: reduce) {
  .falling-petal,
  .falling-petal img {
    animation: none !important;
  }
}

body.access-locked {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.access-locked > :not(#accessScreen) {
  display: none !important;
}

.access-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 32%, rgba(235, 217, 212, 0.72), transparent 58%),
    linear-gradient(160deg, var(--pearl), var(--blush-haze));
}

.access-screen__inner {
  width: min(100%, 420px);
  padding: 34px 24px 30px;
  border: 1px solid rgba(201, 139, 139, 0.38);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.72);
  box-shadow: 0 24px 70px rgba(74, 59, 56, 0.1);
  text-align: center;
}

.access-screen__ornament {
  display: block;
  margin-bottom: 6px;
  color: var(--dusty-rose);
  font-size: 1.5rem;
}

.access-screen__eyebrow {
  margin: 0;
  color: var(--terracotta);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.access-screen__title {
  margin: 8px 0 14px;
  color: var(--bougainvillea);
  font-family: var(--font-title);
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 400;
  line-height: 1.5;
}

.access-screen__message {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.9;
}

.access-screen__retry {
  min-height: 42px;
  margin-top: 20px;
  padding: 7px 22px;
  border: 1px solid var(--dusty-rose);
  border-radius: 999px;
  background: transparent;
  color: var(--bougainvillea);
  cursor: pointer;
}

.preview-banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  inset-inline: 12px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid rgba(201, 139, 139, 0.5);
  border-radius: 999px;
  background: rgba(240, 238, 236, 0.94);
  color: var(--bougainvillea);
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(74, 59, 56, 0.12);
}

.preview-banner a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(240, 238, 236, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.privacy-shield__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: var(--font-title);
  text-align: center;
}

.privacy-shield__panel span:first-child {
  color: var(--dusty-rose);
  font-size: 1.8rem;
}

.privacy-shield__panel strong {
  color: var(--bougainvillea);
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  font-weight: 400;
}

.privacy-toast {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  inset-inline: 16px;
  z-index: 115;
  width: fit-content;
  max-width: min(90vw, 420px);
  margin-inline: auto;
  padding: 10px 16px;
  border: 1px solid rgba(201, 139, 139, 0.45);
  border-radius: 10px;
  background: rgba(240, 238, 236, 0.98);
  color: var(--ink);
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.privacy-toast.is-visible {
  opacity: 1;
  transform: none;
}

body.guest-protected {
  -webkit-user-select: none;
  user-select: none;
}

body.guest-protected input,
body.guest-protected textarea {
  -webkit-user-select: text;
  user-select: text;
}

@media print {
  body.guest-protected .gate-splash,
  body.guest-protected #invitation,
  body.guest-protected .petal-layer,
  body.guest-protected .music-toggle {
    visibility: hidden !important;
  }

  body.guest-protected::after {
    content: "هذه الدعوة خاصة";
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--bougainvillea);
  }
}

