:root {
  --cream: #f6f1e9;
  --cream-2: #efe7da;
  --ivory: #fbf5ea;
  --ink: #2a2620;
  --ink-soft: #5c554b;
  --olive: #6f6e4f;
  --gold: #a88a5c;
  --line: rgba(42, 38, 32, 0.14);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Pinyon Script", cursive;
  --sans: "Jost", system-ui, sans-serif;
  --track: 0.22em;
}

[lang^="ar"] {
  --serif: "Amiri", "Noto Naskh Arabic", serif;
  --sans: "Tajawal", system-ui, sans-serif;
  --track: 0; /* letter-spacing breaks Arabic letter joining */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[lang^="ar"] body { font-size: 18px; line-height: 1.9; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  color: var(--ivory);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
  padding: 22px 4vw;
}
.nav.is-solid {
  background: rgba(42, 38, 32, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-block: 10px;
}
.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}
.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav__links--start { justify-content: flex-end; }
.nav__links--end { justify-content: flex-start; }
.nav__links a {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s;
}
[lang^="ar"] .nav__links a { font-size: 0.95rem; }
.nav__links a:hover { opacity: 1; }

/* Floating language bubble — physical left so it stays bottom-left in both directions */
.lang {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 20;
  min-width: 56px;
  height: 56px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 245, 234, 0.35);
  background: rgba(42, 38, 32, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ivory);
  box-shadow: 0 6px 22px rgba(20, 17, 12, 0.28);
  cursor: pointer;
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: transform 0.2s, background 0.2s;
}
.lang:hover { transform: translateY(-2px); background: var(--olive); }
.lang:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[lang="en"] .lang { font-family: "Tajawal", sans-serif; font-size: 1rem; letter-spacing: 0; text-transform: none; }
@media (max-width: 820px) { .lang { left: 14px; bottom: 14px; height: 48px; min-width: 48px; } }
.nav__mark img { width: 64px; height: auto; transition: width 0.4s; }
.nav.is-solid .nav__mark img { width: 42px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  color: var(--ivory);
  background: #2a2620;
  overflow: hidden;
  isolation: isolate;
}
/* Layer 1: the same photo, blurred and dimmed, fills the frame behind everything */
.hero__bg {
  position: absolute;
  inset: -60px;
  z-index: -3;
  background: url("/assets/story.jpg") center 30% / cover no-repeat;
  filter: blur(32px) brightness(0.5) saturate(0.85);
}
/* Layer 2: the sharp photo on the right, fading into the blur on its left edge */
.hero__photo {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -2;
  width: 58%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 38%);
          mask-image: linear-gradient(to right, transparent 0%, #000 38%);
}
/* Layer 3: shading so the cream text and nav stay readable */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 17, 12, 0.55) 0%, rgba(20, 17, 12, 0) 22%),
    linear-gradient(90deg, rgba(20, 17, 12, 0.55) 0%, rgba(20, 17, 12, 0.3) 45%, rgba(20, 17, 12, 0.08) 70%, rgba(20, 17, 12, 0.15) 100%);
}
.hero__content {
  /* physical margins on purpose: the text stays on the photo's open side in both languages */
  margin-left: clamp(1.5rem, 7vw, 8rem);
  margin-right: auto;
  padding: 140px 0 160px;
  text-align: center;
  max-width: 640px;
}
.eyebrow {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  margin: 0 0 1.2rem;
  opacity: 0.92;
}
[lang^="ar"] .eyebrow { font-size: 1.6rem; }

.names { margin: 0; font-weight: 300; }
.names--en {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.4rem, 9vw, 7.2rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}
.names__one { display: inline; }
/* script "and" sits after the first name and dips into the second line, like the mock */
.names__and {
  display: inline-block;
  font-family: var(--script);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.58em;
  margin-left: 0.15em;
  transform: translateY(0.38em) rotate(-10deg);
}
.names__two { display: block; padding-left: 1.4em; }

.names--ar { display: none; }
.names--ar img { width: min(560px, 82vw); height: auto; margin: 0 auto; filter: drop-shadow(0 2px 14px rgba(0,0,0,0.25)); }
[lang^="ar"] .names--en { display: none; }
[lang^="ar"] .names--ar { display: block; }

.dateline {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  margin: 1.8rem 0 2.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}
[lang^="ar"] .dateline { font-size: 1.35rem; }
.dateline__sep { width: 1px; height: 1.1em; background: currentColor; opacity: 0.6; }

.countdown { display: flex; justify-content: center; }
.countdown > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.6rem;
  padding: 0 1rem;
}
.countdown > div + div { border-inline-start: 1px solid rgba(251, 245, 234, 0.45); }
.countdown__n { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 300; line-height: 1.2; font-variant-numeric: lining-nums tabular-nums; }
.countdown__l { font-family: var(--sans); font-size: 0.68rem; letter-spacing: var(--track); text-transform: uppercase; margin-top: 0.5rem; opacity: 0.85; }
[lang^="ar"] .countdown__l { font-size: 0.95rem; margin-top: 0.2rem; }
.countdown.is-done { font-family: var(--script); font-size: 2.6rem; }
[lang^="ar"] .countdown.is-done { font-family: var(--serif); }

.hero__curve { position: absolute; inset: auto 0 -1px 0; height: clamp(50px, 9vw, 120px); color: var(--olive); }
.hero__curve svg:first-child { width: 100%; height: 100%; display: block; fill: var(--cream); }
.hero__curve .sprig { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); }

.sprig { width: 120px; height: 30px; color: var(--olive); }
.sprig--title { display: block; margin: 0 auto 1rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 1.5rem; text-align: center; }
.section--tint { background: var(--cream-2); }
.section__title {
  font-weight: 300;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
[lang^="ar"] .section__title { letter-spacing: 0; font-weight: 400; }
.section__intro { color: var(--ink-soft); font-style: italic; max-width: 36rem; margin: 0 auto 3rem; }
[lang^="ar"] .section__intro { font-style: normal; }

/* Story — narrative with a thin timeline rule */
.story { max-width: 620px; margin: 0 auto; }
.story__text { text-align: start; }
.story__since { font-family: var(--script); color: var(--gold); font-size: 3rem; line-height: 1; margin: 0 0 1.8rem; }
[lang^="ar"] .story__since { font-family: var(--serif); font-size: 2.2rem; }
.story__beat { padding-inline-start: 1.6rem; border-inline-start: 1px solid var(--line); position: relative; padding-bottom: 1.8rem; }
.story__beat::before { content: ""; position: absolute; inset-inline-start: -5px; top: 0.6rem; width: 9px; height: 9px; border: 1px solid var(--gold); background: var(--cream); transform: rotate(45deg); }
.story__beat:last-child { padding-bottom: 0; }
.story__sprig { margin-top: 2rem; }
.story h3, .schedule h3 { font-weight: 500; font-size: 1.4rem; margin: 0 0 0.3rem; }
.story p, .schedule p { margin: 0; color: var(--ink-soft); }

/* Details — cards */
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; max-width: 1000px; margin: 2.4rem auto 0; }
.card { background: var(--cream); border: 1px solid var(--line); padding: 2.4rem 1.6rem; position: relative; }
.card::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); pointer-events: none; }
.card__label { font-family: var(--sans); font-size: 0.7rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); margin: 0 0 0.8rem; }
[lang^="ar"] .card__label { font-size: 1rem; }
.card__value { font-size: 1.5rem; margin: 0 0 0.3rem; }
.card__sub { color: var(--ink-soft); margin: 0; font-size: 1rem; }

/* Schedule */
.schedule { list-style: none; padding: 0; margin: 2.4rem auto 0; max-width: 620px; }
.schedule li { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); text-align: start; align-items: baseline; }
.schedule li:last-child { border-bottom: 0; }
.schedule__time { font-family: var(--sans); font-weight: 300; letter-spacing: 0.12em; color: var(--gold); font-size: 0.95rem; text-align: end; }
[lang^="ar"] .schedule__time { letter-spacing: 0; font-size: 1.1rem; }

/* Directions */
.map { max-width: 900px; margin: 0 auto 2rem; aspect-ratio: 16 / 8; border: 1px solid var(--line); padding: 7px; background: var(--cream); }
.map iframe { width: 100%; height: 100%; border: 0; filter: sepia(0.25) saturate(0.85); }
.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2.2rem;
  background: var(--ink);
  color: var(--ivory);
  transition: background 0.25s;
}
[lang^="ar"] .button { font-size: 1rem; }
.button:hover { background: var(--olive); }

/* Footer */
.footer { background: var(--ink); color: var(--ivory); text-align: center; padding: 4rem 1.5rem 3rem; }
.footer__mark { width: 90px; height: auto; margin: 0 auto 1.2rem; opacity: 0.9; }
.footer p { margin: 0; font-style: italic; opacity: 0.85; }
[lang^="ar"] .footer p { font-style: normal; }
.footer .footer__credit {
  margin-top: 2.4rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.5;
}
[lang^="ar"] .footer .footer__credit { font-size: 0.85rem; letter-spacing: 0; }
.footer__credit a { text-decoration: none; border-bottom: 1px solid rgba(251, 245, 234, 0.35); font-family: "Jost", sans-serif; letter-spacing: 0.08em; }
.footer__credit a:hover { border-bottom-color: currentColor; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .nav { position: absolute; padding: 16px 1rem; }
  .nav.is-solid { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav__inner { grid-template-columns: 1fr; gap: 0.8rem; }
  .nav__mark { order: -1; justify-self: center; }
  .nav__mark img, .nav.is-solid .nav__mark img { width: 52px; }
  .nav__links { justify-content: center !important; gap: 1.1rem; flex-wrap: wrap; }
  .nav__links--start { margin-bottom: -0.4rem; }

  /* Phone: portrait photo fills the screen under the nav; text sits low over the shaded bottom */
  .hero { align-items: flex-end; }
  .hero__photo {
    width: 100%;
    top: 96px;
    height: calc(100% - 96px);
    object-position: 50% 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 14%);
  }
  .hero__shade {
    background: linear-gradient(180deg, rgba(20, 17, 12, 0.5) 0%, rgba(20, 17, 12, 0.05) 24%, rgba(20, 17, 12, 0.12) 38%, rgba(20, 17, 12, 0.72) 54%, rgba(20, 17, 12, 0.9) 100%);
  }
  .names--ar img { width: min(320px, 76vw); }
  .names--en { font-size: clamp(3rem, 15vw, 4rem); }
  .eyebrow { margin-bottom: 0.6rem; }
  .dateline { margin: 1.2rem 0 1.6rem; }
  .hero__content { margin: 0 auto; padding: 0 1rem clamp(70px, 14vw, 100px); }
  .dateline { flex-direction: column; gap: 0.3rem; }
  .dateline__sep { display: none; }
  .countdown > div { min-width: 0; flex: 1; padding: 0 0.5rem; }

  .schedule li { grid-template-columns: 5.5rem 1fr; gap: 1.2rem; }
  .map { aspect-ratio: 4 / 3; }
}
