/* ==================================================================
   Wedding Invitation — stylesheet
   Mobile-first. Re-theme by editing the custom properties in :root.
   ================================================================== */

:root {
  /* --- Palette (the only place colours are defined) --- */
  --color-primary: #7c3a52;      /* mulberry — headings, buttons */
  --color-primary-dark: #5d2b3d;
  --color-secondary: #c9a86a;    /* antique gold — rules, accents */
  --color-accent-1: #9aa88f;     /* sage */
  --color-accent-2: #d9a5a0;     /* dusty rose */
  --color-accent-3: #f6efe6;     /* cream */

  --color-bg: #fffdfb;
  --color-bg-alt: var(--color-accent-3);
  --color-surface: #ffffff;
  --color-ink: #2f2a2c;
  --color-ink-soft: #6d6266;
  --color-line: #e7ded3;

  /* --- Type --- */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Scheherazade New is a traditional naskh/thuluth face — the same style as
     the Bismillah mark. Fallbacks are common system Arabic fonts. */
  --font-arabic: 'Scheherazade New', 'Amiri', 'Traditional Arabic',
    'Geeza Pro', 'Noto Naskh Arabic', serif;

  /* Eight-point star (khatim) lattice, used at low opacity as ornament. */
  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23c9a86a' stroke-width='1' opacity='0.22'%3E%3Cpath d='M36 8 43 22 57 15 50 29 64 36 50 43 57 57 43 50 36 64 29 50 15 57 22 43 8 36 22 29 15 15 29 22Z'/%3E%3C/g%3E%3C/svg%3E");

  /* --- Spacing / shape --- */
  --gutter: 1.25rem;
  --wrap: 68rem;
  --wrap-narrow: 40rem;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 10px 30px -18px rgba(47, 42, 44, 0.45);
  --section-y: 4.5rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: var(--color-primary); }

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

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

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

/* ------------------------------------------------------------- layout */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }
.center { text-align: center; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: 3rem; }
.section--cream { background: var(--color-bg-alt); }
.section--accent {
  background:
    linear-gradient(180deg, rgba(124, 58, 82, 0.05), rgba(201, 168, 106, 0.09));
}

/* ------------------------------------------------- shared type pieces */
.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-secondary);
  font-weight: 400;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 500;
  color: var(--color-primary);
}

.rule {
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 1.25rem auto 1.5rem;
  background: var(--color-secondary);
  position: relative;
}

/* Two overlaid squares, one rotated 45deg, form an eight-point star — the
   khatim motif common in Islamic geometric ornament. Drawn in CSS rather
   than with a glyph so it never depends on font coverage. */
.rule::before,
.rule::after {
  content: '';
  position: absolute;
  top: -3.5px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--color-secondary);
}
.rule::before { transform: translateX(-50%); }
.rule::after  { transform: translateX(-50%) rotate(45deg); }

.rule--light { background: rgba(255, 255, 255, 0.45); }
.rule--light::before,
.rule--light::after { background: rgba(255, 255, 255, 0.5); }

/* ------------------------------------------------ arabic calligraphy */
/* The Bismillah is a vector of the Scheherazade New thuluth ligature rather
   than live text, so the calligraphy is identical everywhere and never falls
   back to a plain system rendering. Regenerate with bismillah-build.mjs. */
.bismillah { margin: 0 0 1.25rem; }

.bismillah__mark {
  display: block;
  width: clamp(12rem, 54vw, 21rem);
  height: auto;
  margin-inline: auto;
}

/* Qur'anic epigraph: Arabic, translation, citation, flanked by gold rules. */
.verse {
  position: relative;
  max-width: 30rem;
  margin: 0 auto 2rem;
  padding: 1.5rem 1.25rem 1.25rem;
}
.verse::before,
.verse::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 3.5rem;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
}
.verse::before { top: 0; }
.verse::after { bottom: 0; }

.verse__ar {
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--color-primary);
  font-size: clamp(1.45rem, 6vw, 2.1rem);
  line-height: 2.1;
  margin: 0 0 0.5rem;
}
.verse__en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  color: var(--color-ink);
  margin: 0 0 0.5rem;
}
.verse__cite {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.insha {
  font-family: var(--font-arabic);
  direction: rtl;
  /* Mulberry rather than gold — thin naskh strokes need the contrast. */
  color: var(--color-primary);
  font-size: clamp(1.15rem, 4.4vw, 1.5rem);
  line-height: 2;
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--color-ink-soft);
  max-width: 38rem;
  margin-inline: auto;
}
.lede--sm { font-size: 0.95rem; }

/* ------------------------------------------------------------ buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-primary);
  --btn-border: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.9rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--solid { --btn-bg: var(--color-primary); --btn-fg: #fff; }
.btn--solid:hover { --btn-bg: var(--color-primary-dark); }
.btn--ghost:hover { --btn-bg: rgba(124, 58, 82, 0.08); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------- card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.card__line { margin-bottom: 0.75rem; }
.card__line--muted { color: var(--color-ink-soft); font-size: 0.95rem; }

/* =============================================================== 1. HERO */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 5rem var(--gutter) 6rem;
  overflow: hidden;
  text-align: center;
}

/* Swap this gradient for `background-image: url(../assets/hero.jpg)` when
   you have a photo — keep a dark overlay if the text needs contrast. */
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    var(--pattern-star) repeat,
    radial-gradient(120% 85% at 50% 0%, #fffdfb 0%, var(--color-accent-3) 45%, #efe0d6 100%);
  background-size: 72px 72px, auto;
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(201, 168, 106, 0.55);
  border-radius: 2px;
  pointer-events: none;
}

.hero__inner { position: relative; }

.hero__label {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
}

.hero__names {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 16vw, 7rem);
  line-height: 1.02;
  color: var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  margin-bottom: 1.75rem;
}
.hero__amp {
  font-style: italic;
  font-size: 0.42em;
  color: var(--color-secondary);
}

.hero__date {
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.hero__venue {
  color: var(--color-ink-soft);
  font-size: 0.9rem;
  margin-bottom: 2.25rem;
}
.dot { margin-inline: 0.4rem; color: var(--color-secondary); }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-ink-soft);
}
.hero__scroll-text {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(var(--color-secondary), transparent);
  animation: scroll-pulse 2.2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.25; transform: scaleY(0.6); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1);   transform-origin: top; }
}

/* ==================================================== 2. COUPLE PHOTOS */
.portraits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 46rem;
  margin-inline: auto;
}

.portrait { text-align: center; }

.portrait__frame {
  position: relative;
  padding: 0.75rem;
  border: 1px solid var(--color-secondary);
  border-radius: 999px 999px var(--radius) var(--radius);
}
.portrait__frame::before {
  content: '';
  position: absolute;
  inset: 0.3rem;
  border: 1px solid rgba(201, 168, 106, 0.35);
  border-radius: 999px 999px var(--radius) var(--radius);
  pointer-events: none;
}
.portrait__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 999px 999px var(--radius) var(--radius);
  background: var(--color-accent-3);
}
.portrait__caption {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

@media (min-width: 40rem) {
  .portraits { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

/* One photo: centred, and squared off rather than arched — the arch suits
   head-and-shoulders portraits, not a wider single image. */
.portraits--single { max-width: 25rem; }

.portraits--single .portrait__frame,
.portraits--single .portrait__frame::before {
  border-radius: var(--radius-lg);
}

.portraits--single .portrait__img {
  /* Matches the source image, so nothing is cropped. */
  aspect-ratio: 4 / 5;
  border-radius: calc(var(--radius-lg) - 2px);
}

@media (min-width: 40rem) {
  .portraits--single { grid-template-columns: 1fr; }
}

/* ======================================================= 3. COUNTDOWN */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 34rem;
  margin: 2.5rem auto 0;
}
.countdown__unit {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 1rem 0.35rem;
}
.countdown__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  line-height: 1.1;
}
.countdown__label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-top: 0.35rem;
}
.countdown__done {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* ======================================================== 4. LOCATION */
.location {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.location__map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow);
  min-height: 18rem;
  background: var(--color-accent-3);
}
.location__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 18rem;
  border: 0;
}

@media (min-width: 52rem) {
  .location {
    grid-template-columns: 1fr 1.15fr;
    align-items: stretch;
  }
  .location__card { display: flex; flex-direction: column; justify-content: center; }
}

/* ======================================================== 5. TIMELINE */
/* Mobile: vertical spine on the left. Desktop: horizontal rail. */
.timeline {
  position: relative;
  margin-top: 2.75rem;
  display: grid;
  gap: 2rem;
  padding-left: 2.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.95rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--color-secondary);
  opacity: 0.55;
}

.tl__marker {
  position: absolute;
  left: -2.75rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-secondary);
  color: var(--color-primary);
}
.tl__marker svg { width: 1rem; height: 1rem; }

.tl__item { position: relative; }
.tl__time {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 0.25rem;
}
.tl__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}
.tl__desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-ink-soft);
}

@media (min-width: 60rem) {
  .timeline {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1.25rem;
    padding-left: 0;
    padding-top: 3.75rem;
    text-align: center;
  }
  .timeline::before {
    left: 0; right: 0;
    top: 3.75rem;
    bottom: auto;
    height: 1px;
    width: auto;
    transform: translateY(-1rem);
  }
  .tl__marker {
    left: 50%;
    top: -3.75rem;
    transform: translateX(-50%);
  }
  .tl__item { padding-inline: 0.5rem; }
}

/* ====================================================== 6. DRESS CODE */
.dress {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.dress__theme {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.dress__notes { margin-top: 1rem; display: grid; gap: 0.5rem; }
.dress__notes li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.92rem;
  color: var(--color-ink-soft);
}
.dress__notes li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.7em;
  width: 6px; height: 6px;
  transform: rotate(45deg);
  background: var(--color-secondary);
}

.dress__palette { align-self: center; }
.palette__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  text-align: center;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: 0.75rem;
}
.swatch {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  text-align: center;
}
.swatch__chip {
  display: block;
  height: 4.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  transition: transform 0.2s ease;
}
.swatch:hover .swatch__chip { transform: translateY(-3px); }
.swatch__name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
}
.swatch__hex {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--color-ink-soft);
  text-transform: uppercase;
}
.palette__hint {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-ink-soft);
}

@media (min-width: 52rem) {
  .dress { grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
}

/* =========================================================== 7. FORMS */
.form { margin-top: 2rem; display: grid; gap: 1.25rem; }

.field { display: grid; gap: 0.4rem; }
.field--fieldset { border: 0; padding: 0; margin: 0; }

.field__label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  padding: 0;
}
.req { color: var(--color-primary); }
.opt { text-transform: none; letter-spacing: 0; opacity: 0.7; }

.field__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color 0.2s ease;
}
.field__input:focus { border-color: var(--color-primary); }
.field__input--area { resize: vertical; min-height: 6rem; }
.field__input[aria-invalid='true'] { border-color: #b3261e; }

.field__error {
  margin: 0;
  font-size: 0.8rem;
  color: #b3261e;
}

.choices { display: grid; gap: 0.6rem; margin-top: 0.35rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.choice input:checked + .choice__box {
  border-color: var(--color-primary);
  background: rgba(124, 58, 82, 0.07);
  color: var(--color-primary);
}
.choice input:focus-visible + .choice__box {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.form__status { margin: 0; font-size: 0.9rem; min-height: 1.2em; }
.form__status--ok { color: #1b5e35; }
.form__status--err { color: #b3261e; }
.form__note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-ink-soft);
  opacity: 0.8;
}

@media (min-width: 34rem) {
  .choices { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ 8. TABS */
.tabs { margin-top: 2.5rem; }

.tabs__list {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: -1px;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__tab {
  flex: 0 0 auto;
  padding: 0.85rem 1.15rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.tabs__tab:hover { color: var(--color-primary); }
.tabs__tab[aria-selected='true'] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tabs__panel { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel__intro { color: var(--color-ink-soft); font-size: 0.95rem; }

/* 8a — guest list */
.guest-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
  margin: 1.25rem 0;
}
.guest-list li {
  padding: 0.6rem 0.85rem;
  background: var(--color-accent-3);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.guest-list--empty { display: block; color: var(--color-ink-soft); }

/* 8b — carousel */
.carousel {
  position: relative;
  margin: 1.25rem 0 0.75rem;
}
.carousel__track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-lg);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}
.carousel__slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--color-accent-3);
}
.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.carousel__nav--prev { left: 0.5rem; }
.carousel__nav--next { right: 0.5rem; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.carousel__dot {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-line);
  cursor: pointer;
}
.carousel__dot[aria-selected='true'] { background: var(--color-primary); }

.upload {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-line);
  margin-bottom: 0.75rem;
}

@media (min-width: 40rem) {
  .carousel__slide { flex-basis: calc(50% - 0.375rem); }
}
@media (min-width: 60rem) {
  .carousel__slide { flex-basis: calc(33.333% - 0.5rem); }
}

/* 8c — contributions */
.gifts {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}
.gift {
  padding: 1.15rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
}
.gift__label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.gift__detail {
  margin: 0 0 0.5rem;
  white-space: pre-line;
  font-size: 0.92rem;
}
.gift__note { margin: 0; font-size: 0.72rem; color: var(--color-ink-soft); opacity: 0.8; }

@media (min-width: 52rem) {
  .gifts { grid-template-columns: repeat(3, 1fr); }
}

/* 8d — find your table */
.seat-search {
  display: flex;
  gap: 0.6rem;
  margin: 1.25rem 0 1rem;
  flex-wrap: wrap;
}
.seat-search .field__input { flex: 1 1 12rem; }

.seat-result { min-height: 1.5em; font-size: 0.95rem; }
.seat-result strong { color: var(--color-primary); }

.seat-all summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-primary);
  padding: 0.5rem 0;
}
.seat-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.seat-table th,
.seat-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-line);
}
.seat-table th {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  font-weight: 400;
}

/* ========================================================== 9. FOOTER */
.footer {
  background: var(--color-primary);
  color: #fff;
  padding-block: 3.5rem;
}
.footer__names {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  margin-bottom: 0.25rem;
}
.footer .hero__amp { color: var(--color-secondary); }
.footer__date {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  opacity: 0.85;
}
.footer__label {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.6rem;
}
.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 1.75rem;
}
.footer__contacts a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); }
.footer__hashtag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}
.footer__copy { margin: 0; font-size: 0.72rem; opacity: 0.65; }

@media (min-width: 34rem) {
  /* justify-content, not align-items, controls the horizontal axis once the
     list is a row — without it the contacts sit left of centre. */
  .footer__contacts { flex-direction: row; justify-content: center; gap: 1.5rem; }
}

/* =========================================================== toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  z-index: 50;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ================================================= reveal on scroll */
/* Elements start displaced and settle as they scroll into view. The delay is
   set per element by app.js so grouped items cascade rather than snap in
   together. --ease is a gentle deceleration curve: quick start, soft landing. */
:root { --ease-out-soft: cubic-bezier(0.22, 0.68, 0.28, 1); }

.reveal {
  opacity: 0;
  transition:
    opacity 0.8s var(--ease-out-soft),
    transform 0.8s var(--ease-out-soft);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal--up { transform: translateY(22px); }
.reveal--scale { transform: translateY(16px) scale(0.96); }
.reveal--line { transform: scaleX(0); }

/* Must follow the variants so it wins at equal specificity. */
.reveal--in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ================================================= 0. ENVELOPE GATE */
/* A sealed envelope covers the page until the guest opens it. Layering,
   back to front: letter, flap, front pocket, ribbons, heart seal. */

body.is-sealed { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow-y: auto;
  background:
    var(--pattern-star) repeat,
    radial-gradient(120% 90% at 50% 8%, #fffdfb 0%, var(--color-accent-3) 55%, #e6d5c7 100%);
  background-size: 72px 72px, auto;
}

.gate__stage {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  perspective: 1400px;
}

.gate__bismillah {
  margin: 0;
  animation: hero-rise 1.1s 0.05s both var(--ease-out-soft);
}
.gate__bismillah .bismillah__mark { width: clamp(11rem, 50vw, 17rem); }
/* Fades with the seal so the envelope has the stage to itself as it opens. */
.gate.is-opening .gate__bismillah {
  animation: ribbon-away 0.5s both ease-out;
}

.gate__envelope {
  position: relative;
  /* The 56vh term caps the height on short screens: at 7/5 the envelope is
     width * 5/7 tall, so 56vh wide keeps it to roughly 40vh. */
  width: min(88vw, 28rem, 56vh);
  aspect-ratio: 7 / 5;
  border-radius: 6px;
  background: linear-gradient(158deg, #fffaf2, #f0e1d1);
  border: 1px solid var(--color-secondary);
  box-shadow: 0 34px 60px -32px rgba(47, 42, 44, 0.55);
  transform-style: preserve-3d;
  animation: gate-drop 1.1s 0.3s both var(--ease-out-soft);
}

@keyframes gate-drop {
  from { opacity: 0; transform: translateY(34px) scale(0.92) rotateX(12deg); }
  to   { opacity: 1; transform: none; }
}

/* The card tucked inside, which lifts out as the envelope opens. */
.gate__letter {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 12%;
  height: 74%;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: linear-gradient(#fffdf9, #fbf3e8);
  border: 1px solid rgba(201, 168, 106, 0.5);
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.4vw, 1.35rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* Top triangle, hinged along the envelope's top edge. */
.gate__flap {
  position: absolute;
  inset: 0 0 auto 0;
  height: 62%;
  z-index: 3;
  background: linear-gradient(172deg, #fdf5ea, #e9d8c5);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  backface-visibility: hidden;
}

/* Front pocket — the folded panel the letter sits behind. */
.gate__front {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(200deg, #fdf6ec, #ead9c7);
  clip-path: polygon(0 26%, 50% 70%, 100% 26%, 100% 100%, 0 100%);
  border-radius: 0 0 5px 5px;
}

.gate__ribbon {
  position: absolute;
  z-index: 5;
  background: linear-gradient(var(--color-primary), var(--color-primary-dark));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 10px -4px rgba(47, 42, 44, 0.6);
}
.gate__ribbon--v {
  top: -5%;
  bottom: -5%;
  left: 50%;
  width: 13%;
  transform: translateX(-50%);
}
.gate__ribbon--h {
  left: -4%;
  right: -4%;
  top: 50%;
  height: 13%;
  transform: translateY(-50%);
}

/* Heart seal where the ribbons cross. */
.gate__seal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 49%;
  z-index: 6;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}
.gate__heart {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(47, 42, 44, 0.4));
}
.gate__heart path {
  fill: var(--color-primary);
  stroke: var(--color-secondary);
  stroke-width: 3;
}
.gate__seal-names {
  position: absolute;
  display: grid;
  justify-items: center;
  line-height: 1.05;
  padding-bottom: 9%;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 3vw, 1.15rem);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.gate__amp {
  font-style: italic;
  color: var(--color-secondary);
  font-size: 0.85em;
}

.gate__open {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: none;
  cursor: pointer;
  animation: hero-rise 0.9s 1.05s both var(--ease-out-soft);
}
.gate__open-word {
  font-size: 0.9rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--color-primary);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-secondary);
  transition: letter-spacing 0.3s var(--ease-out-soft), color 0.3s ease;
}
.gate__open:hover .gate__open-word { letter-spacing: 0.55em; text-indent: 0.55em; }
.gate__open-hint {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  opacity: 0.75;
}

/* Gentle breathing on the seal so the envelope reads as interactive. */
@keyframes seal-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.045); }
}
.gate:not(.is-opening) .gate__seal {
  animation: seal-breathe 3.4s 1.4s ease-in-out infinite;
}

/* ------------------------------------------------ opening sequence */
.gate.is-opening { pointer-events: none; }

@keyframes seal-away {
  35%  { transform: translate(-50%, -50%) scale(1.16); }
  100% { transform: translate(-50%, -150%) scale(0.65) rotate(-8deg); opacity: 0; }
}
.gate.is-opening .gate__seal {
  animation: seal-away 0.6s both var(--ease-out-soft);
}

@keyframes ribbon-away {
  to { opacity: 0; filter: blur(2px); }
}
.gate.is-opening .gate__ribbon--v {
  animation: ribbon-away 0.45s 0.12s both ease-out;
}
.gate.is-opening .gate__ribbon--h {
  animation: ribbon-away 0.45s 0.2s both ease-out;
}

@keyframes flap-open {
  to { transform: rotateX(-172deg); }
}
.gate.is-opening .gate__flap {
  animation: flap-open 0.85s 0.4s both var(--ease-out-soft);
}

@keyframes letter-rise {
  to { transform: translateY(-24%) scale(1.03); }
}
.gate.is-opening .gate__letter {
  animation: letter-rise 0.75s 0.75s both var(--ease-out-soft);
}

@keyframes gate-away {
  to { opacity: 0; transform: scale(1.5); filter: blur(7px); }
}
.gate.is-opening {
  animation: gate-away 0.8s 1.05s both var(--ease-out-soft);
}

/* ======================================== hero entrance (on load) */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-letter {
  from { opacity: 0; transform: translateY(26px); letter-spacing: 0.14em; }
  to   { opacity: 1; transform: none; letter-spacing: normal; }
}

/* Scoped to .is-open so the hero animates when the envelope is opened, not
   while it is still hidden behind it. Without the class (no JS, or a deep
   link that skips the gate) everything simply renders as normal. */
.is-open .hero__bismillah { animation: hero-rise 1s 0.05s both var(--ease-out-soft); }
.is-open .hero__label  { animation: hero-rise 0.9s 0.22s both var(--ease-out-soft); }
.is-open .hero__names  { animation: hero-letter 1.15s 0.34s both var(--ease-out-soft); }
.is-open .hero__date   { animation: hero-rise 0.9s 0.64s both var(--ease-out-soft); }
.is-open .hero__insha  { animation: hero-rise 0.9s 0.74s both var(--ease-out-soft); }
.is-open .hero__venue  { animation: hero-rise 0.9s 0.84s both var(--ease-out-soft); }
.is-open .hero__cta    { animation: hero-rise 0.9s 0.96s both var(--ease-out-soft); }

/* .hero__scroll is centred by translateX(-50%), so it needs its own keyframes —
   the generic hero-rise ends at `transform: none` and would drop the centring. */
@keyframes hero-rise-centred {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
.is-open .hero__scroll { animation: hero-rise-centred 1s 1.2s both var(--ease-out-soft); }

/* The decorative inner border draws itself in behind the text. */
@keyframes frame-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: none; }
}
.is-open .hero__bg::after { animation: frame-in 1.6s 0.1s both var(--ease-out-soft); }

/* ============================== scroll-linked hero drift (progressive) */
/* Only runs where scroll-driven animations exist; everything else simply
   skips it. No JS, no scroll listeners, no jank. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes hero-drift {
      to { transform: translateY(6%) scale(1.08); opacity: 0.75; }
    }
    .hero__bg {
      animation: hero-drift linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }
  }
}

/* ==================================== tab panel cross-fade on switch */
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.tabs__panel:not([hidden]) {
  animation: panel-in 0.45s both var(--ease-out-soft);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
