:root {
  --plum: #2b1a3d;
  --plum-soft: #6d5786;
  --lilac: #9d7bb8;
  --gold: #c9a85a;
  --gold-bright: #f2dda6;
  --gold-deep: #a9853f;
  --ivory: #f7efe0;
  --ink: #f6ecd8;
  --ink-soft: rgba(240, 224, 190, 0.76);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Great Vibes', 'Snell Roundhand', cursive;
  --amharic: 'Noto Serif Ethiopic', 'Nyala', serif;

  /* Frosted glass card */
  --glass-fill: rgba(34, 19, 50, 0.44);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --glass-line: rgba(242, 221, 166, 0.62);
  --gold-gradient: linear-gradient(180deg, #f4dfa8 0%, #d9b872 46%, #a9853f 100%);
}

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

html {
  background: #2a1a3a;
  scroll-snap-type: y proximity;
}
body {
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.intro-lock { overflow: hidden; height: 100%; }
body.intro-lock #pages { visibility: hidden; }

/* ---------- Fixed background (never changes) ---------- */
#bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #2a1a3a url('assets/background.jpg') center / cover no-repeat;
}

/* ---------- Opening video ---------- */
#stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #2a1a3a;
  overflow: hidden;
}
#intro-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Tap to open ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12svh;
  transition: opacity 1s ease;
  outline: none;
}
#intro.done { opacity: 0; pointer-events: none; }
.tap {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 1px 16px rgba(20, 8, 34, 0.75);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- Pages: one screen each, content only ---------- */
#pages { position: relative; }
.page {
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
}

/* ---------- The frosted glass card ---------- */
.card {
  position: relative;
  width: min(360px, 100%);
  padding: 40px 28px 34px;
  border-radius: 10px;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(158deg, var(--glass-hi) 0%, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(52, 30, 72, 0.50) 0%, var(--glass-fill) 100%);
  border: 1px solid rgba(242, 221, 166, 0.26);
  box-shadow:
    0 24px 55px rgba(16, 6, 30, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  overflow: hidden;
}

/* Thin gold frame inset from the edges (the reference card's inner border) */
.card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--glass-line);
  border-radius: 5px;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 26px rgba(201, 168, 90, 0.10);
}

/* Gold corner flourishes */
.orn {
  position: absolute;
  width: 44px;
  height: 44px;
  color: var(--gold-bright);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s ease 0.15s;
  filter: drop-shadow(0 0 7px rgba(201, 168, 90, 0.4));
}
.page.is-visible .orn { opacity: 1; }
.orn.tl { top: 12px; left: 12px; }
.orn.tr { top: 12px; right: 12px; transform: scaleX(-1); }
.orn.bl { bottom: 12px; left: 12px; transform: scaleY(-1); }
.orn.br { bottom: 12px; right: 12px; transform: scale(-1, -1); }
.orn-line { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: 0.95; }
.orn-vine { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: 0.62; stroke-linecap: round; }
.orn-leaf { fill: currentColor; opacity: 0.72; }
.orn-dot { fill: currentColor; }

/* No backdrop-filter (older browsers): keep the glass readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: linear-gradient(180deg, rgba(38, 21, 54, 0.90), rgba(30, 16, 44, 0.92)); }
}

/* Each piece of text fades in when its page is on screen and fades out when it leaves */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  transition-delay: calc(var(--i, 0) * 120ms);
}
.page.is-visible .reveal { opacity: 1; transform: none; }

/* ---------- Gold typography ---------- */
.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #d9b872;
  text-shadow: 0 1px 3px rgba(40, 20, 60, 0.35);
  margin-bottom: 12px;
}
.title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 8vw, 2.5rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 6px;
}
.script-title,
.names {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.script-title {
  display: inline-block;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.4rem);
  line-height: 1.1;
  filter: drop-shadow(0 2px 10px rgba(20, 8, 34, 0.55));
}
.body {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 14px;
}
.small {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 8px;
}
.amharic {
  font-family: var(--amharic);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: rgba(242, 221, 166, 0.85);
  margin-top: 6px;
}

/* Monogram: AB with a slash, like the reference */
.monogram {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 14px;
}
.monogram .slash {
  font-style: italic;
  color: var(--gold);
  margin: 0 0.12em;
}

/* Gold divider with a diamond in the middle */
.rule {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}
.rule span {
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  position: relative;
}
.rule span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(242, 221, 166, 0.7);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Cover names */
.names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.2rem, 14vw, 4.4rem);
  line-height: 1.05;
  filter: drop-shadow(0 2px 12px rgba(20, 8, 34, 0.6));
}
.names .amp {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.45em;
  color: var(--gold-bright);
  -webkit-text-fill-color: var(--gold-bright);
  margin: 0.1em 0;
}
.date-line {
  font-size: 1rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-top: 14px;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; text-align: left; margin-top: 14px; }
.timeline li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(242, 221, 166, 0.22);
}
.timeline li:last-child { border-bottom: none; }
.timeline time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.timeline .label {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.timeline .note {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- Photo placeholder (replace with real images later) ---------- */
.photo-slot {
  margin: 18px auto 0;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px dashed rgba(242, 221, 166, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 30px rgba(20, 8, 34, 0.35);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* ---------- Map ---------- */
.map {
  margin-top: 16px;
  height: 230px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  background: #1d1230;
  box-shadow: inset 0 0 30px rgba(10, 3, 20, 0.6);
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Hotels as little frosted panels ---------- */
.hotel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 221, 166, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hotel strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
}
.hotel .small { display: block; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-block;
  margin-top: 22px;
  min-height: 46px;
  line-height: 46px;
  padding: 0 30px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
  color: var(--plum);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  background: linear-gradient(180deg, #f8e8b8 0%, #dcbe7c 48%, #b8954c 100%);
  box-shadow:
    0 10px 24px rgba(10, 3, 20, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(120, 90, 30, 0.4);
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}
/* Sheen sweep on hover */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  outline: none;
  box-shadow:
    0 14px 30px rgba(10, 3, 20, 0.5),
    0 0 0 1px rgba(242, 221, 166, 0.6),
    0 0 22px rgba(201, 168, 90, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.btn:hover::after, .btn:focus-visible::after { left: 125%; }
.btn:active { transform: translateY(0); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: center;
  padding: 24px 0 36px;
  min-height: 18svh;
  align-items: flex-end;
}
.replay {
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid rgba(242, 221, 166, 0.55);
  border-radius: 999px;
  background: rgba(34, 19, 50, 0.5);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.replay:hover, .replay:focus-visible {
  background: linear-gradient(180deg, #f8e8b8 0%, #c9a85a 100%);
  color: var(--plum);
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 12px 26px rgba(10, 3, 20, 0.45), 0 0 20px rgba(201, 168, 90, 0.4);
}

/* ---------- Error card ---------- */
.error {
  position: relative;
  width: min(340px, 90vw);
  padding: 28px 24px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  text-align: center;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(38, 21, 54, 0.9), rgba(30, 16, 44, 0.92));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 45px rgba(16, 6, 30, 0.5);
}
.error .small { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity 0.4s ease; transform: none; }
  .tap { animation: none; }
  .btn, .btn::after, .replay { transition: none; }
}

/* =====================================================================
   Ultimate modules — added on top of the base template, same palette.
   ===================================================================== */

/* Wider card for the RSVP form and galleries */
.card--wide { width: min(420px, 100%); }

/* The `hidden` attribute must always win over layout rules like display:grid. */
[hidden] { display: none !important; }

/* ---------- Language switcher (fixed, top) ---------- */
.lang-switch {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 60;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(34, 19, 50, 0.55);
  border: 1px solid rgba(242, 221, 166, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lang-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.lang-btn.is-active { background: linear-gradient(180deg, #f8e8b8, #c9a85a); color: var(--plum); }
.lang-btn:focus-visible { outline: 1px solid var(--gold-bright); }

/* Amharic language: render body copy in Noto Serif Ethiopic */
html.lang-am {
  --serif: 'Noto Serif Ethiopic', 'Cormorant Garamond', Georgia, serif;
}

/* ---------- Countdown ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.cd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border: 1px solid rgba(242, 221, 166, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}
.cd-num {
  font-size: clamp(1.5rem, 7vw, 1.9rem);
  font-weight: 600;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}
.countdown-done { color: var(--gold-bright); }

/* ---------- Name logo ---------- */
.name-logo {
  font-family: var(--script);
  font-size: clamp(3.4rem, 16vw, 5rem);
  line-height: 1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(20, 8, 34, 0.6));
}
.name-logo .amp-lite { font-family: var(--serif); font-style: italic; font-size: 0.6em; margin: 0 0.06em; }

/* ---------- Photo gallery (unlimited photos, lazy-loaded) ---------- */
.gallery {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(242, 221, 166, 0.28);
  background: rgba(255, 255, 255, 0.05);
}
.gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

/* ---------- Profile ---------- */
.profile { margin-top: 16px; text-align: center; }
.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--glass-line);
  box-shadow: 0 8px 20px rgba(10, 3, 20, 0.45);
}
.profile-photo--empty {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
}
.profile strong {
  display: block;
  margin-top: 8px;
  color: var(--gold-bright);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}
.profile .small { margin-top: 4px; }

/* ---------- Multiple locations ---------- */
.location-item { margin-top: 20px; }
.location-item + .location-item { padding-top: 18px; border-top: 1px solid rgba(242, 221, 166, 0.2); }
.location-item h2 { font-size: clamp(2rem, 9vw, 2.6rem); margin-bottom: 4px; }

/* ---------- RSVP app ---------- */
.rsvp-app { margin-top: 16px; }
.rsvp-name {
  font-family: var(--script);
  font-size: clamp(1.8rem, 8vw, 2.2rem);
  color: var(--gold-bright);
  line-height: 1.1;
}
.rsvp-note { font-size: 0.95rem; color: var(--ink); margin-top: 10px; line-height: 1.5; }
.rsvp-form { margin-top: 14px; text-align: left; display: grid; gap: 12px; }
.rsvp-choice { border: 0; display: grid; gap: 8px; }
.rsvp-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 221, 166, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 1rem;
}
.rsvp-radio:has(input:checked) { border-color: var(--gold-bright); background: rgba(242, 221, 166, 0.12); }
.rsvp-radio input { accent-color: var(--gold-deep); width: 18px; height: 18px; }
.rsvp-field { display: grid; gap: 5px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-bright); }
.rsvp-field span { opacity: 0.9; }
.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(242, 221, 166, 0.35);
  background: rgba(20, 10, 32, 0.55);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
}
.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus { outline: 1px solid var(--gold-bright); }
.rsvp-field select option { color: #1c1030; }
.rsvp-error {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 140, 0.55);
  background: rgba(120, 20, 40, 0.35);
  color: #ffd9d9;
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
}
.rsvp-done { margin-top: 14px; }
.rsvp-app .btn { width: 100%; text-align: center; }
.privacy { margin-top: 18px; text-align: left; }

