/*
  Julia & Nouh — wedding invitation.
  Newer platform features (popover, :has(), scroll-driven animation, view
  transitions) are progressive enhancements: every guest still gets a complete,
  usable page on older phones and tablets. Layout uses logical properties
  (inline/block) so the Arabic right-to-left version mirrors automatically.
*/

/* ---------- Fonts (self-hosted, SIL OFL — see assets/fonts/) ---------- */
@font-face {
  font-family: "Cormorant";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/cormorant-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Downloaded only when Arabic text is on screen. */
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/noto-naskh-arabic-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --paper: #fbf8f2;
  --cream: #f4ede2;
  --sand: #ece3d4;
  --sand-deep: #d6c3a4;
  --white: #fffdf9;
  --ink: #232d27;
  --ink-soft: #3f4b43;
  --muted: #56615a;
  --line: rgb(35 45 39 / .12);
  --line-strong: rgb(35 45 39 / .22);
  --gold: #c4a06a;
  --gold-text: #7d5a26;
  --night: #2c3a32;
  --night-soft: #3b4c42;
  --on-night: #f6f0e4;
  --on-night-muted: rgb(246 240 228 / .78);
  --gold-on-night: #e3c690;
  --accept: #2f5a40;
  --accept-bg: #eaf1ea;
  --decline: #8a3f33;
  --decline-bg: #f8ece8;
  --serif: "Cormorant", "Noto Naskh Arabic", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Noto Naskh Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --content: 72rem;
  --radius: 1.25rem;
  --shadow: 0 1px 2px rgb(35 45 39 / .04), 0 18px 48px -20px rgb(35 45 39 / .22);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.1; text-wrap: balance; }
p, blockquote, figure, ol, ul { margin: 0; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.pre-line { white-space: pre-line; }
.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;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
[dir="rtl"] .icon-flip { transform: scaleX(-1); }
.skip-link {
  position: fixed; z-index: 50; inset-block-start: .75rem; inset-inline-start: .75rem;
  padding: .75rem 1.1rem; border-radius: .75rem; background: var(--white); color: var(--ink);
  box-shadow: var(--shadow); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Shared type & buttons ---------- */
.eyebrow {
  margin-block-end: 1rem;
  color: var(--gold-text);
  font: 600 .78rem/1.5 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
}
.section { padding: clamp(5rem, 3.8rem + 6vw, 9rem) var(--gutter); }
.section-heading { max-width: 44rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); text-align: center; }
.section-title { font-size: clamp(2.6rem, 1.9rem + 3.2vw, 4.75rem); letter-spacing: -.015em; }
.section-lead { margin-block-start: 1.1rem; color: var(--muted); font-size: 1.125rem; }
.ornament { display: flex; align-items: center; justify-content: center; gap: .9rem; margin: 1.75rem auto 2rem; }
.ornament span { width: 3rem; height: 1px; background: var(--gold); }
.ornament i { width: .45rem; height: .45rem; background: var(--gold); transform: rotate(45deg); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.125rem; padding: .85rem 1.6rem;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 .8rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, box-shadow .25s, transform .25s var(--ease-out);
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: none; }
.button-light { background: var(--white); color: var(--ink); box-shadow: 0 10px 30px -12px rgb(0 0 0 / .45); }
.button-light:hover { background: #fff; }
.button-glass {
  background: rgb(255 255 255 / .1); color: #fff; border-color: rgb(255 255 255 / .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.button-glass:hover { background: rgb(255 255 255 / .2); }
.button-dark { background: var(--night); color: var(--on-night); }
.button-dark:hover { background: var(--night-soft); }
.button-dark:disabled { opacity: .7; cursor: progress; transform: none; }
.button-outline { color: var(--on-night); border-color: rgb(227 198 144 / .55); }
.button-outline:hover { background: rgb(227 198 144 / .12); border-color: var(--gold-on-night); }
.text-link {
  display: inline-flex; align-items: center; gap: .45rem; padding-block: .55rem .4rem;
  border-bottom: 1px solid var(--gold); color: var(--night);
  font: 600 .78rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  transition: color .2s, border-color .2s;
}
.text-link:hover { color: var(--gold-text); border-color: var(--gold-text); }
.text-link .icon { width: 1rem; height: 1rem; }
.link-button {
  padding: .5rem .25rem; border: 0; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: .9rem; text-decoration: underline; text-underline-offset: .2em;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem;
  height: var(--header-h); padding-inline: var(--gutter);
  color: var(--ink);
  background: rgb(251 248 242 / .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color .35s, color .35s, border-color .35s;
}
/* While the hero is on screen the header floats transparently over the photo. */
.site-header[data-overlay] {
  color: #fff; background: rgb(24 36 29 / .88); border-color: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.wordmark {
  justify-self: start; display: inline-flex; align-items: center; min-height: 44px;
  font: 500 1.65rem/1 var(--serif); letter-spacing: .08em; text-decoration: none; white-space: nowrap;
}
.wordmark span { padding-inline: .12em; color: var(--gold); font-style: italic; }
.site-header[data-overlay] .wordmark span { color: var(--gold-on-night); }
/* On wide screens the nav is inline; reset the browser's built-in [popover] styles. */
.main-nav {
  position: static; inset: auto; width: auto; height: auto; margin: 0; padding: 0; overflow: visible;
  display: flex; align-items: center; gap: clamp(1.25rem, 2.6vw, 2.5rem);
  border: 0; background: none; color: inherit;
}
.main-nav a {
  position: relative; padding-block: .5rem;
  font: 500 .8rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
}
.main-nav a::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: .1rem; height: 1px;
  background: currentColor; transform: scaleX(0); transition: transform .3s var(--ease-out);
}
.main-nav a:hover::after { transform: scaleX(1); }
.menu-button, .menu-close { display: none; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: .5rem; }
.language-picker {
  display: flex; gap: .15rem; padding: .2rem; direction: ltr;
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.site-header[data-overlay] .language-picker { border-color: var(--line-strong); background: var(--cream); color: var(--ink); }
.language-button {
  min-width: 2.6rem; min-height: 2.25rem; padding: .3rem .6rem;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 600 .72rem/1 var(--sans); letter-spacing: .08em;
  transition: background-color .25s, color .25s;
}
/* A system font keeps visitors who never pick Arabic from downloading the Arabic webfont. */
.language-button:lang(ar) { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .8rem; letter-spacing: 0; }
.language-button:hover { background: rgb(35 45 39 / .06); }
.language-button[aria-pressed="true"] { background: var(--night); color: var(--on-night); }
.site-header[data-overlay] .language-button:hover { background: rgb(35 45 39 / .08); }
.site-header[data-overlay] .language-button[aria-pressed="true"] { background: var(--night); color: var(--on-night); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; place-items: center;
  min-height: 100vh; min-height: 100svh;
  margin-block-start: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + 3rem) var(--gutter) 7.5rem;
  background: #857f71; color: #fffdf8; text-align: center;
}
.header-sentinel { position: absolute; inset-block-start: 0; inset-inline: 0; height: 3rem; pointer-events: none; }
.hero-media, .hero-media img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: center 55%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(22 29 25 / .55), rgb(22 29 25 / 0) 24%),
    radial-gradient(ellipse 70% 52% at 50% 52%, rgb(22 29 25 / .42), rgb(22 29 25 / 0) 78%),
    linear-gradient(0deg, rgb(22 29 25 / .6), rgb(22 29 25 / 0) 42%);
}
.hero-content { max-width: 62rem; text-shadow: 0 2px 30px rgb(15 20 17 / .35); }
.hero-eyebrow { color: #f8e8cc; letter-spacing: .34em; }
.hero-names {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 .22em;
  font-size: clamp(3.9rem, 1.6rem + 9.5vw, 9.75rem); line-height: .95; letter-spacing: -.02em;
}
.hero-names i { color: #f0d3a2; font-weight: 400; font-size: .82em; }
.hero-date {
  margin-block-start: 1.75rem;
  font: 500 .9rem/1.4 var(--sans); letter-spacing: .28em; text-transform: uppercase;
}
.hero-place { margin-block-start: .5rem; font: italic 500 clamp(1.2rem, 1rem + .6vw, 1.5rem)/1.4 var(--serif); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-block-start: 2.25rem; }
.scroll-cue {
  position: absolute; inset-block-end: 1.75rem; left: 50%; transform: translateX(-50%);
  width: 1.5rem; height: 2.6rem; border: 1px solid rgb(255 255 255 / .7); border-radius: 1rem;
}
.scroll-cue span {
  position: absolute; inset-block-start: .5rem; left: 50%; width: 3px; height: .45rem; margin-left: -1.5px;
  border-radius: 3px; background: #fff; animation: scroll-cue 1.8s ease-in-out infinite;
}
@keyframes scroll-cue { 50% { transform: translateY(.55rem); opacity: .35; } }

/* ---------- Ribbon ---------- */
.ribbon { overflow: hidden; padding-block: 1rem; background: var(--night); color: var(--on-night); }
.ribbon-track { display: flex; width: max-content; }
.ribbon-group {
  display: flex; flex: none; align-items: center; gap: 2.25rem; padding-inline-end: 2.25rem;
  font: italic 500 1.4rem/1.2 var(--serif); white-space: nowrap;
}
.ribbon-group i { width: .4rem; height: .4rem; background: var(--gold-on-night); transform: rotate(45deg); }

/* ---------- Invitation ---------- */
.invitation { max-width: 54rem; margin-inline: auto; text-align: center; }
.invitation-copy { max-width: 40rem; margin-inline: auto; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.85; }
.couple-names { margin-block-start: 2.5rem; font: 500 clamp(1.5rem, 1.2rem + 1.3vw, 2.2rem)/1.3 var(--serif); }
.couple-names span, .signature span { padding-inline: .3em; color: var(--gold); font-style: italic; }
.invitation-signoff { margin-block-start: .6rem; color: var(--muted); }
.signature { margin-block-start: 1.75rem; font: italic 500 2.5rem/1 var(--serif); }

/* ---------- Story ---------- */
.story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
  padding: clamp(5rem, 9vw, 8.5rem) max(var(--gutter), calc((100% - var(--content)) / 2));
  background: var(--sand);
}
.story-copy { max-width: 32rem; justify-self: end; }
.story-copy .section-title { font-size: clamp(2.6rem, 1.9rem + 3vw, 4.5rem); }
.story-copy > p:not(.eyebrow) { margin-block-start: 1.5rem; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.85; }
.story-poem {
  display: grid; gap: 1.15rem; margin-block-start: 1.75rem;
  color: var(--ink-soft); font: 500 clamp(1.2rem, 1.1rem + .4vw, 1.45rem)/1.5 var(--serif);
  overflow-wrap: break-word;
}
.story-poem p { margin: 0; }
.story-poem-ending { color: var(--ink); font-style: italic; }
html:lang(ar) .story-poem { font-family: var(--sans); font-size: 1.15rem; line-height: 1.9; }
html:lang(ar) .story-poem-ending { font-style: normal; }
.story-gallery-link { margin-block-start: 1.5rem; }
.story-photo { position: relative; justify-self: start; width: min(100%, 26rem); }
.story-photo::before {
  content: ""; position: absolute; z-index: 0;
  inset-block: -1rem 3.5rem; inset-inline: 1rem -1rem;
  border: 1px solid var(--gold); border-radius: 50% 50% 1.25rem 1.25rem / 37.5% 37.5% 1.25rem 1.25rem;
}
.story-photo img {
  position: relative; width: 100%; height: auto; aspect-ratio: 3 / 4;
  object-fit: cover; object-position: 50% 64%;
  border-radius: 50% 50% 1.25rem 1.25rem / 37.5% 37.5% 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}
.story-photo figcaption { margin-block-start: 1rem; color: var(--muted); font: italic 500 1.2rem var(--serif); text-align: center; }
.story-seal {
  position: absolute; z-index: 1; inset-block-end: 22%; inset-inline-start: -3rem;
  display: grid; place-content: center; width: 8rem; height: 8rem; border-radius: 50%;
  background: var(--night); color: var(--on-night); text-align: center;
  font: 600 .72rem/1.45 var(--serif); letter-spacing: .14em;
  box-shadow: 0 0 0 5px var(--sand), 0 0 0 6px var(--gold);
  transform: rotate(-10deg);
}
[dir="rtl"] .story-seal { transform: rotate(10deg); }

/* ---------- The day ---------- */
.day {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgb(227 198 144 / .14), transparent 70%), var(--night);
  color: var(--on-night);
}
.day .eyebrow { color: var(--gold-on-night); }
.day .section-lead { color: var(--on-night-muted); }
.countdown { display: flex; justify-content: center; gap: clamp(.6rem, 2.5vw, 1.5rem); margin: 0 auto clamp(3rem, 6vw, 4.5rem); }
.countdown-item {
  display: grid; justify-items: center; gap: .4rem; min-width: clamp(5.5rem, 20vw, 7.5rem); padding: 1.1rem .75rem 1rem;
  border: 1px solid rgb(227 198 144 / .3); border-radius: 1.25rem; background: rgb(255 255 255 / .04);
}
.countdown-value { font: 500 clamp(2.5rem, 2rem + 2.4vw, 3.75rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown-unit { color: var(--gold-on-night); font: 600 .72rem/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.timeline { position: relative; max-width: 48rem; margin-inline: auto; padding: 0; list-style: none; }
.timeline::before {
  content: ""; position: absolute; inset-block: 1.5rem; left: 50%; width: 1px;
  background: linear-gradient(rgb(227 198 144 / 0), rgb(227 198 144 / .5) 12%, rgb(227 198 144 / .5) 88%, rgb(227 198 144 / 0));
}
.timeline-item {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 3.25rem minmax(0, 1fr);
  grid-template-areas: "time marker body"; align-items: start; column-gap: 1.75rem;
}
.timeline-item + .timeline-item { margin-block-start: 2.25rem; }
.timeline-time {
  grid-area: time; padding-block-start: .55rem; text-align: end;
  color: var(--gold-on-night); font: 500 1.5rem/1.2 var(--serif); font-variant-numeric: lining-nums; white-space: nowrap;
}
.timeline-marker {
  grid-area: marker; display: grid; place-items: center; width: 3.25rem; height: 3.25rem;
  border: 1px solid rgb(227 198 144 / .6); border-radius: 50%; background: var(--night); color: var(--gold-on-night);
}
.timeline-marker .icon { width: 1.35rem; height: 1.35rem; }
.timeline-body { grid-area: body; padding-block-start: .45rem; }
.timeline-body h3 { font-size: 1.65rem; }
.timeline-body p { margin-block-start: .35rem; color: var(--on-night-muted); font-size: 1rem; }
.calendar-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-block-start: clamp(3rem, 6vw, 4.5rem); }

/* ---------- Details ---------- */
.details-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem);
  max-width: var(--content); margin-inline: auto;
}
.detail-card {
  display: flex; flex-direction: column; gap: .75rem;
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow);
}
.detail-card .eyebrow { margin: .5rem 0 0; font-size: .72rem; }
.detail-card h3 { font-size: clamp(1.9rem, 1.6rem + 1vw, 2.4rem); }
.detail-card p:not(.eyebrow) { max-width: 30rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.detail-card .detail-subtitle { margin-block-start: -.35rem; color: var(--muted); font: italic 500 1.2rem var(--serif); }
.detail-icon {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem;
  border-radius: 50%; background: var(--cream); color: var(--gold-text);
}
.card-links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-block-start: auto; padding-block-start: .75rem; }
.source-note { font-size: .875rem !important; }
.source-note a { color: var(--muted); text-underline-offset: .2em; }

.swatches { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; margin-block-start: .75rem; padding: 0; list-style: none; }
.swatches li { display: grid; justify-items: center; gap: .45rem; width: 4.25rem; color: var(--muted); font-size: .78rem; line-height: 1.25; text-align: center; }
.swatch { width: 2.75rem; height: 2.75rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(35 45 39 / .12), 0 0 0 4px var(--white), 0 0 0 5px var(--line); }
.swatch-ivory { background: #f7f0df; }
.swatch-sand { background: #d6c1a3; }
.swatch-rose { background: #e2bcb5; }
.swatch-blue { background: #aec3cf; }
.swatch-sage { background: #aab296; }
.swatch-navy { background: #293f63; }
.swatch-black { background: #252525; }
.swatch-grey { background: #888b90; }

/* ---------- Gifts ---------- */
.gifts { background: linear-gradient(180deg, var(--cream), var(--sand)); text-align: center; }
.gifts-icon {
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 1.5rem;
  border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-text);
}
.gifts .section-title { font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.75rem); }
.gifts blockquote { max-width: 38rem; margin: 2rem auto 0; color: var(--ink-soft); font: italic 500 clamp(1.3rem, 1.15rem + .6vw, 1.6rem)/1.7 var(--serif); }

/* ---------- RSVP ---------- */
.rsvp {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start;
  gap: clamp(2.5rem, 6vw, 6rem); max-width: calc(var(--content) + 2 * var(--gutter)); margin-inline: auto;
}
.rsvp-intro { position: sticky; inset-block-start: calc(var(--header-h) + 2rem); }
.rsvp-intro > p:not(.eyebrow):not(.rsvp-deadline) { margin-block-start: 1.25rem; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.8; }
.rsvp-deadline {
  display: inline-flex; align-items: center; gap: .6rem; margin-block-start: 1.75rem; padding: .7rem 1.1rem;
  border-radius: 1rem; background: var(--cream); color: var(--night); font-size: .95rem;
}
.rsvp-deadline strong { font-weight: 600; }
.rsvp-contact-section { max-width: calc(var(--content) + 2 * var(--gutter)); margin-inline: auto; padding-block-start: 0; }
.rsvp-contact {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line); border-radius: 1.5rem; background: var(--cream);
}
.rsvp-contact h2 { font: 500 clamp(1.8rem, 3vw, 2.5rem)/1.2 var(--serif); }
.rsvp-contact > p { max-width: 52rem; margin-block-start: 1.25rem; color: var(--ink-soft); line-height: 1.8; }
.rsvp-contact .rsvp-contact-label { color: var(--night); font-weight: 600; }
.rsvp-contact-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-block-start: .75rem; }
.rsvp-contact-links a {
  display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  padding: 1rem 1.25rem; min-height: 44px; border: 1px solid var(--line);
  border-radius: 1rem; background: var(--white); color: var(--night); text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}
.rsvp-contact-links a:hover { border-color: var(--gold); background: var(--cream); }
.rsvp-contact-links a:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; }
.rsvp-contact-links a > span { font-size: .875rem; }
.rsvp-contact-links bdi { white-space: nowrap; font-weight: 600; }
.rsvp-card {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--line); border-radius: 1.5rem; background: var(--white); box-shadow: var(--shadow);
}
.rsvp-locked { display: grid; justify-items: center; gap: 1.25rem; padding-block: 2rem; text-align: center; }
.rsvp-locked-icon {
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem;
  border-radius: 50%; background: var(--cream); color: var(--gold-text);
}
.rsvp-locked-icon .icon { width: 1.75rem; height: 1.75rem; }
.guest-welcome { max-width: 26rem; color: var(--ink-soft); font-size: 1.125rem; }
.guest-session-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  margin-block-end: 1.5rem; padding: .75rem 1.1rem; border-radius: 1rem; background: var(--cream);
}
.guest-session-bar p { color: var(--ink-soft); }
.guest-session-bar bdi { color: var(--ink); font-weight: 600; }
.rsvp-form { display: grid; gap: 1.25rem; }
.guest-member-list { display: grid; gap: 1rem; }
.guest-member-card {
  display: grid; gap: 1rem; min-width: 0; margin: 0; padding: 1.25rem;
  border: 1px solid var(--line); border-radius: 1.1rem; background: var(--paper);
  transition: border-color .2s;
}
.guest-member-card[data-invalid] { border-color: var(--decline); box-shadow: 0 0 0 1px var(--decline); }
/* Float trick lets the legend lay out like a normal block inside the fieldset. */
.guest-member-card > legend { float: left; width: 100%; padding: 0; }
.guest-member-card > legend + * { clear: both; }
.member-name { font-size: 1.75rem; }
.member-question { display: block; margin-block-start: .2rem; color: var(--muted); font-size: .95rem; }
.choice-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice-box {
  display: flex; align-items: center; gap: .7rem; height: 100%; min-height: 3.4rem; padding: .7rem 1rem;
  border: 1px solid var(--line-strong); border-radius: .9rem; background: var(--white);
  font-size: .98rem; line-height: 1.3;
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s;
}
.choice:hover .choice-box { border-color: var(--night); }
.choice-mark {
  display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem;
  border: 1.5px solid var(--sand-deep); border-radius: 50%; color: #fff;
  transition: background-color .2s, border-color .2s;
}
.choice-mark .icon { width: .95rem; height: .95rem; stroke-width: 2.5; opacity: 0; transition: opacity .2s; }
.choice input:checked + .choice-box { border-color: var(--accept); background: var(--accept-bg); color: var(--accept); box-shadow: inset 0 0 0 1px var(--accept); }
.choice input:checked + .choice-box .choice-mark { border-color: var(--accept); background: var(--accept); }
.choice input:checked + .choice-box .icon { opacity: 1; }
.choice-no input:checked + .choice-box { border-color: var(--decline); background: var(--decline-bg); color: var(--decline); box-shadow: inset 0 0 0 1px var(--decline); }
.choice-no input:checked + .choice-box .choice-mark { border-color: var(--decline); background: var(--decline); }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--gold-text); outline-offset: 2px; }
/* Progressive enhancement: dietary notes are irrelevant for someone who declines. */
.guest-member-card:has(.choice-no input:checked) .diet-field { display: none; }
.field { display: grid; gap: .45rem; color: var(--ink-soft); font-size: .95rem; font-weight: 500; }
.field textarea {
  width: 100%; min-height: 5.5rem; padding: .8rem .95rem; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: .8rem; background: var(--white);
  color: var(--ink); font-size: 1rem; font-weight: 400; line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea::placeholder { color: #6b736d; }
.field textarea:focus { border-color: var(--night); box-shadow: 0 0 0 3px rgb(44 58 50 / .12); outline: none; }
.rsvp-form .button { justify-self: start; min-width: 12rem; }
.form-notice { display: flex; align-items: flex-start; gap: .6rem; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.form-notice .icon { width: 1rem; height: 1rem; margin-block-start: .2rem; }
.form-result:empty { display: none; }
.form-result { padding: .85rem 1.1rem; border-radius: .9rem; background: var(--accept-bg); color: var(--accept); font-weight: 500; }
.form-result[data-state="error"] { background: var(--decline-bg); color: var(--decline); }

/* ---------- Photo gallery ---------- */
.gallery { background: var(--cream); }
.gallery-grid { columns: 3; column-gap: 1.25rem; max-width: var(--content); margin-inline: auto; }
.gallery-photo {
  display: block; break-inside: avoid; margin-block-end: 1.25rem;
  border-radius: .75rem; background: var(--sand); overflow: hidden;
}
.gallery-photo img { width: 100%; height: auto; transition: filter .25s; }
.gallery-photo:hover img { filter: brightness(1.06); }
.gallery-photo:focus-visible { outline-offset: 4px; }
html.gallery-open { overflow: hidden; }
.photo-viewer {
  width: min(100% - 2rem, 72rem); max-width: none; max-height: calc(100dvh - 2rem);
  padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); overflow: auto;
}
.photo-viewer::backdrop { background: rgb(15 20 17 / .86); }
.photo-toolbar { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-block-end: .75rem; }
.photo-control {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--white); cursor: pointer;
}
.photo-control:hover { background: var(--sand); }
.photo-close { margin-inline-start: auto; }
.photo-counter { min-width: 4rem; text-align: center; font-variant-numeric: tabular-nums; }
.photo-full { width: 100%; height: 70vh; height: 70dvh; object-fit: contain; }
.photo-viewer figcaption { margin-block-start: .75rem; text-align: center; color: var(--muted); }
@media (max-width: 880px) {
  .gallery-grid { columns: 2; }
}
@media (max-width: 640px) {
  .gallery-grid { column-gap: .75rem; }
  .gallery-photo { margin-block-end: .75rem; border-radius: .5rem; }
  .photo-viewer { width: calc(100% - 1rem); padding: .75rem; }
  .photo-full { height: 65vh; height: 65dvh; }
}

/* ---------- Footer ---------- */
.site-footer {
  display: grid; justify-items: center; gap: 1rem; padding: 4rem var(--gutter) 3rem;
  background: var(--night); color: var(--on-night-muted); text-align: center;
}
.footer-mark { color: var(--on-night); font-size: 2.6rem; }
.footer-mark span { color: var(--gold-on-night); }
.site-footer p { font: italic 500 1.2rem var(--serif); }
.back-top { padding: .5rem; font: 600 .75rem var(--sans); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.back-top:hover { color: var(--gold-on-night); }

/* ---------- Arabic ---------- */
/* Arabic letters join cursively: tracking breaks them, and there is no italic to fake. */
:lang(ar) { letter-spacing: 0 !important; font-synthesis: none; }
html:lang(ar) body { font-size: 1.125rem; line-height: 1.9; }
html:lang(ar) .eyebrow, html:lang(ar) .hero-date, html:lang(ar) .button, html:lang(ar) .text-link,
html:lang(ar) .main-nav a, html:lang(ar) .countdown-unit, html:lang(ar) .rsvp-deadline, html:lang(ar) .back-top { text-transform: none; font-size: .95rem; }
html:lang(ar) .section-title { line-height: 1.35; }
html:lang(ar) .story-seal { font-size: .85rem; }

/* ---------- Tablet & phone ---------- */
@media (max-width: 880px) {
  :root { --header-h: 4rem; }
  .site-header { grid-template-columns: auto 1fr; gap: 0 .75rem; height: auto; min-height: var(--header-h); }
  .wordmark { font-size: 1.45rem; }
  /* Fallback for browsers without the popover API: a scrollable row of links. */
  .main-nav {
    grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 1rem;
    overflow-x: auto; padding-block-end: .5rem; scrollbar-width: none;
  }
  .main-nav a { flex: none; font-size: .75rem; letter-spacing: .1em; }

  .story { grid-template-columns: 1fr; justify-items: center; }
  .story-copy { justify-self: stretch; max-width: 36rem; margin-inline: auto; }
  .story-photo { justify-self: center; width: min(100%, 23rem); }
  .story-seal { inset-inline-start: -.25rem; width: 6.75rem; height: 6.75rem; font-size: .62rem; }
  .details-grid { grid-template-columns: 1fr; max-width: 38rem; }
  .rsvp { grid-template-columns: 1fr; max-width: 40rem; }
  .rsvp-intro { position: static; }
}
@media (max-width: 880px) {
  @supports selector(:popover-open) {
    .main-nav { display: none; }
    .menu-button, .menu-close {
      display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
      border: 0; border-radius: 50%; background: transparent; cursor: pointer;
    }
    .menu-button .icon, .menu-close .icon { width: 1.5rem; height: 1.5rem; }
    .menu-close { position: absolute; inset-block-start: .75rem; inset-inline-end: var(--gutter); }
    .main-nav[popover] {
      position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
      flex-direction: column; justify-content: center; gap: .5rem; padding: 5rem var(--gutter);
      overflow: auto; border: 0; background: var(--paper); color: var(--ink);
    }
    .main-nav[popover]:popover-open { display: flex; }
    .main-nav[popover]::backdrop { background: rgb(22 29 25 / .4); }
    .main-nav[popover] a { padding: .5rem 1rem; font: 500 2.4rem/1.2 var(--serif); letter-spacing: 0; text-transform: none; }
    .main-nav[popover] a::after { display: none; }
  }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero { padding-block-end: 6.5rem; }
  .hero-names { flex-direction: column; align-items: center; font-size: clamp(3.9rem, 20vw, 5.5rem); line-height: .92; }
  .hero-names i { margin-block: .05em; font-size: .6em; }
  .hero-date { font-size: .8rem; letter-spacing: .22em; }
  .hero-actions { flex-direction: column; align-items: stretch; width: min(100%, 20rem); margin-inline: auto; }
  .ribbon-group { font-size: 1.2rem; }
  .timeline::before { left: auto; inset-inline-start: 1.5rem; }
  .timeline-item { grid-template-columns: 3rem minmax(0, 1fr); grid-template-areas: "marker time" "marker body"; column-gap: 1.1rem; }
  .timeline-marker { width: 3rem; height: 3rem; }
  .timeline-time { padding-block-start: 0; text-align: start; font-size: 1.3rem; }
  .timeline-body { padding-block-start: .1rem; }
  .timeline-body h3 { font-size: 1.45rem; }
  .countdown-item { min-width: 0; flex: 1; max-width: 7rem; }
  .choice-group { grid-template-columns: 1fr; }
  .rsvp-form .button { justify-self: stretch; }
  .signature { font-size: 2.1rem; }
}
@media (max-width: 380px) {
  .site-header { padding-inline: .9rem; gap: .4rem; }
  .wordmark { font-size: 1.3rem; }
  .language-button { min-width: 2.35rem; padding-inline: .4rem; }
}

/* ---------- Motion (only for people who have not asked to reduce it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: hero-settle 14s var(--ease-out) both; }
  @keyframes hero-settle { from { transform: scale(1.08); } }
  .hero-content > * { animation: rise 1.1s var(--ease-out) both; }
  .hero-content > :nth-child(2) { animation-delay: .12s; }
  .hero-content > :nth-child(3) { animation-delay: .24s; }
  .hero-content > :nth-child(4) { animation-delay: .32s; }
  .hero-content > :nth-child(5) { animation-delay: .4s; }
  @keyframes rise { from { opacity: 0; transform: translateY(1.25rem); } }
  /* Decorative ribbon stays still for touch, keyboard and reduced-motion visitors. */
  @keyframes ribbon { to { transform: translateX(-50%); } }
  @keyframes ribbon-rtl { to { transform: translateX(50%); } }
  /* Sections drift in as they scroll into view (Chrome, Edge, Safari 26+). */
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    @keyframes reveal { from { opacity: 0; transform: translateY(2.5rem); } }
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
}

.phone-contact { color: var(--muted); font-size: .95rem; }
.phone-contact a { display: inline-block; padding: .5rem .25rem; text-underline-offset: .2em; }
.child-label { font: 500 .85rem var(--sans); color: var(--muted); }
.rsvp-locked .button { margin-block-start: 1rem; white-space: normal; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
