/* ==========================================================================
   Isha & Shane — shared event page design system
   One structure for every event page; each page sets its own palette
   through body[data-theme]. Motion follows the emil-design-eng rules:
   transform/opacity only, strong ease-out, reduced-motion respected.
   ========================================================================== */

:root {
  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', 'Scheherazade New', serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* default palette (overridden per theme) */
  --bg: #faf6ee;
  --bg-alt: #f3ede1;
  --surface: #fffdf8;
  --ink: #2a241c;
  --ink-soft: rgba(42, 36, 28, .72);
  --ink-faint: rgba(42, 36, 28, .5);
  --line: rgba(42, 36, 28, .14);
  --accent: #a8853c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(168, 133, 60, .12);
  --hero-bg: var(--bg);
  --hero-ink: var(--ink);
  --hero-ink-soft: var(--ink-soft);
  --nav-bg: rgba(250, 246, 238, .86);

  --wrap: 1080px;
  --measure: 640px;
  --radius: 4px;
}

/* ----- Themes ----------------------------------------------------------- */
body[data-theme="bridal-eve"] {
  --bg: #fbf4f2; --bg-alt: #f6e7e6; --surface: #fffaf8;
  --ink: #3b1f2c; --ink-soft: rgba(59, 31, 44, .74); --ink-faint: rgba(59, 31, 44, .52);
  --line: rgba(59, 31, 44, .13);
  --accent: #a82f63; --accent-ink: #fff; --accent-soft: rgba(168, 47, 99, .09);
  --gold: #a9803a;
  --hero-bg: radial-gradient(ellipse 80% 70% at 50% 0%, #f8dfe2 0%, #fbf4f2 70%);
  --nav-bg: rgba(251, 244, 242, .86);
}
body[data-theme="haldi"] {
  --bg: #faf5ea; --bg-alt: #f3ead6; --surface: #fffcf4;
  --ink: #1e2a44; --ink-soft: rgba(30, 42, 68, .74); --ink-faint: rgba(30, 42, 68, .52);
  --line: rgba(30, 42, 68, .13);
  --accent: #c98a12; --accent-ink: #1e1606; --accent-soft: rgba(201, 138, 18, .12);
  --gold: #c98a12; --teal: #0e7c86;
  --hero-bg: radial-gradient(ellipse 70% 60% at 50% 0%, #26406a 0%, #172641 60%, #121d33 100%);
  --hero-ink: #f6efdc; --hero-ink-soft: rgba(246, 239, 220, .74);
  --nav-bg: rgba(250, 245, 234, .88);
}
body[data-theme="nikkah"] {
  --bg: #f8f5ec; --bg-alt: #efeadb; --surface: #fffdf7;
  --ink: #2f3a2a; --ink-soft: rgba(47, 58, 42, .76); --ink-faint: rgba(47, 58, 42, .54);
  --line: rgba(47, 58, 42, .14);
  --accent: #97772f; --accent-ink: #fff; --accent-soft: rgba(151, 119, 47, .1);
  --gold: #97772f;
  --hero-bg: radial-gradient(ellipse 80% 70% at 50% 0%, #efe8d3 0%, #f8f5ec 72%);
  --nav-bg: rgba(248, 245, 236, .86);
}
body[data-theme="vivah"] {
  --bg: #fdf8f0; --bg-alt: #f6ecdc; --surface: #fffdf8;
  --ink: #2b1b14; --ink-soft: rgba(43, 27, 20, .76); --ink-faint: rgba(43, 27, 20, .54);
  --line: rgba(43, 27, 20, .14);
  --accent: #9b1c2f; --accent-ink: #fff; --accent-soft: rgba(155, 28, 47, .08);
  --gold: #b8892f;
  --hero-bg: #fdf8f0;
  --nav-bg: rgba(253, 248, 240, .88);
}
/* Vivah hero: crimson peacock artwork, with the type kept on clear ivory. */
body[data-theme="vivah"] .hero {
  background-image:
    linear-gradient(180deg, rgba(253,248,240,.94) 0%, rgba(253,248,240,.72) 42%, rgba(253,248,240,.9) 100%),
    url('photos/vivah-peacock.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}
@media (min-width: 900px) {
  body[data-theme="vivah"] .hero {
    background-image:
      linear-gradient(100deg, #fdf8f0 0%, rgba(253,248,240,.96) 34%, rgba(253,248,240,.45) 62%, rgba(253,248,240,.15) 100%),
      url('photos/vivah-peacock.jpg');
    background-position: right center;
  }
  body[data-theme="vivah"] .hero .hero__inner { margin-right: clamp(0px, 22vw, 300px); }
}
body[data-theme="vivah"] .section--alt {
  background-color: var(--bg-alt);
  background-image: linear-gradient(180deg, rgba(155,28,47,.03), rgba(155,28,47,0) 60%);
}
body[data-theme="reception"] {
  --bg: #0b130e; --bg-alt: #0f1a13; --surface: rgba(255, 255, 255, .03);
  --ink: #efe6cf; --ink-soft: rgba(239, 230, 207, .74); --ink-faint: rgba(239, 230, 207, .5);
  --line: rgba(239, 230, 207, .14);
  --accent: #c8a45c; --accent-ink: #14100a; --accent-soft: rgba(200, 164, 92, .12);
  --gold: #c8a45c;
  --hero-bg: #0b130e; --hero-ink: #f4ebd3; --hero-ink-soft: rgba(244, 235, 211, .78);
  --nav-bg: rgba(11, 19, 14, .82);
  color-scheme: dark;
}

body[data-theme="home"] {
  --bg: #0a1510; --bg-alt: #0d1b14; --surface: rgba(255, 255, 255, .035);
  --ink: #f2ecdc; --ink-soft: rgba(242, 236, 220, .76); --ink-faint: rgba(242, 236, 220, .52);
  --line: rgba(242, 236, 220, .13);
  --accent: #e0a444; --accent-ink: #171107; --accent-soft: rgba(224, 164, 68, .13);
  --gold: #e0a444;
  --hero-bg: transparent; --hero-ink: #f5efdf; --hero-ink-soft: rgba(245, 239, 223, .76);
  --nav-bg: rgba(8, 17, 12, .82);
  color-scheme: dark;
}

/* ----- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0;               /* body sits at zero tracking */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

[data-content] { display: none; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ----- Navigation ------------------------------------------------------- */
.ev-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(20px, 4vw, 44px);
  color: var(--hero-ink);
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.ev-nav[data-scrolled] {
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--ink);
}
/* Scroll edge effect: content fades under the floating bar, no hairline rule. */
.ev-nav::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 22px; pointer-events: none;
  background: linear-gradient(180deg, var(--nav-bg), transparent);
  opacity: 0; transition: opacity 200ms ease;
}
.ev-nav[data-scrolled]::after { opacity: 1; }
.ev-brand {
  font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: .06em;
  text-decoration: none; white-space: nowrap;
}
.ev-brand span { color: var(--accent); font-style: italic; padding: 0 .12em; }
body[data-theme="haldi"] .ev-nav:not([data-scrolled]) .ev-brand span { color: #e9b44c; }
.ev-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.ev-links a, .ev-links button {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: inherit; opacity: .78; background: none; border: 0; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center;   /* comfortable tap target */
  transition: opacity 120ms ease, transform 120ms ease-out;
}
.ev-links .ev-pill {
  opacity: 1; padding: 0 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
.ev-links a:active, .ev-links button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .ev-links a:hover, .ev-links button:hover { opacity: 1; }
}
@media (max-width: 640px) {
  .ev-links .hide-sm { display: none; }
  .ev-brand { font-size: 21px; }
}

/* ----- Layout ----------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(20px, 5vw, 40px); }
.measure { max-width: var(--measure); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 120px); }
.section + .section { border-top: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.center { text-align: center; }

/* ----- Type ------------------------------------------------------------- */
.eyebrow {
  display: block; margin: 0 0 14px;
  font-family: var(--font-body); font-size: .72rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--accent);
}
.display {
  margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.02;
  letter-spacing: -.022em;         /* large type reads loose — tighten it */
  font-optical-sizing: auto;
}
.h2 {
  margin: 0 0 20px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.125rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.015em; text-wrap: balance;
}
.h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 500; font-size: 1.625rem; line-height: 1.25; letter-spacing: -.008em; }
.lede { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.6; letter-spacing: -.006em; color: var(--ink-soft); font-style: italic; text-wrap: pretty; }
.prose p { margin: 0 0 1.15em; color: var(--ink-soft); text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-faint); }

.rule {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin: 28px auto; color: var(--accent);
}
.rule::before, .rule::after { content: ""; width: 56px; height: 1px; background: currentColor; opacity: .5; }
.rule i { width: 5px; height: 5px; background: currentColor; transform: rotate(45deg); }

/* ----- Hero ------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100svh, 920px);
  display: grid; place-items: center; text-align: center;
  padding: 140px clamp(20px, 5vw, 40px) 96px;
  background: var(--hero-bg); color: var(--hero-ink);
}
.hero__inner { position: relative; z-index: 1; max-width: 820px; }
.hero__blessing { margin: 0 0 22px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--hero-ink-soft); }
.hero__blessing .arabic { display: block; font-family: var(--font-arabic); font-size: 30px; letter-spacing: 0; text-transform: none; color: var(--accent); margin-bottom: 8px; }
.hero__title { font-size: clamp(56px, 10vw, 112px); }
.hero__names { margin: 18px 0 0; font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-style: italic; color: var(--hero-ink-soft); }
.hero__names .amp { color: var(--accent); }
.hero__meta { margin: 30px 0 0; display: grid; gap: 6px; }
.hero__date { font-size: 13px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.hero__place { font-size: 14px; color: var(--hero-ink-soft); letter-spacing: .02em; }
.hero__actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero__art { position: absolute; pointer-events: none; z-index: 0; }

@media (max-width: 640px) { .hero { min-height: 0; padding-top: 128px; padding-bottom: 80px; } }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border-radius: 999px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 100ms ease-out, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  touch-action: manipulation;      /* no 300ms tap delay */
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .92; }
.btn--ghost.on-accent { border-color: var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { filter: brightness(1.06); }
  .btn--ghost:hover { background: var(--accent-soft); }
}
.text-link {
  display: inline-block; padding: 10px 0; font-size: .75rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; text-decoration: none; color: var(--accent);
  border-bottom: 1px solid currentColor; touch-action: manipulation;
  transition: transform 100ms ease-out;
}
.text-link:active { transform: scale(0.97); }

/* ----- At-a-glance facts ------------------------------------------------ */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fact { padding: 32px 24px; text-align: center; }
.fact + .fact { border-left: 1px solid var(--line); }
@media (max-width: 720px) {
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
}
.fact__label { display: block; margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.fact__value { margin: 0; font-family: var(--font-display); font-size: 23px; line-height: 1.3; }
.fact__note { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.fact .text-link { display: inline-block; margin-top: 12px; }

/* ----- Letter ----------------------------------------------------------- */
.letter { max-width: 620px; margin-inline: auto; }
.letter__salutation { font-family: var(--font-display); font-size: 24px; font-style: italic; margin: 0 0 18px; }
.letter .prose p { font-size: 17px; line-height: 1.85; }
.letter__sign { margin-top: 32px; text-align: center; }
.letter__sign small { display: block; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.letter__sign strong { font-family: var(--font-display); font-weight: 500; font-size: 28px; color: var(--accent); }

/* ----- Cards ------------------------------------------------------------ */
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 4vw, 40px);
}
.card__kicker { display: block; margin-bottom: 12px; font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.card p { margin: 0; color: var(--ink-soft); }
.card p + p { margin-top: 1em; }
.card .when { margin: -2px 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

/* ----- Timeline --------------------------------------------------------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; }
.timeline li {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline time { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.timeline span { font-family: var(--font-display); font-size: 22px; line-height: 1.3; }
@media (max-width: 520px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; text-align: center; }
  .timeline time { text-align: center; }
}

/* ----- Figure ----------------------------------------------------------- */
.figure { margin: 0 auto; max-width: 420px; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 24px 60px -24px rgba(0,0,0,.35); }
.figure figcaption { margin-top: 14px; text-align: center; font-size: 13px; color: var(--ink-faint); }

/* ----- Closing / footer ------------------------------------------------- */
.closing { text-align: center; }
.closing .h2 { margin-bottom: 12px; }
.closing p { margin: 0 auto 32px; max-width: 460px; color: var(--ink-soft); }
.verse { margin-top: 56px; }
.verse .arabic { font-family: var(--font-arabic); font-size: 28px; color: var(--accent); margin: 0 0 8px; direction: rtl; }
.verse p { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--ink-soft); margin: 0; }

.ev-footer {
  border-top: 1px solid var(--line); padding: 36px 20px 44px; text-align: center;
  font-size: 13px; color: var(--ink-faint);
}
.ev-footer .who { margin: 0 0 14px; }
.ev-footer .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; }
.ev-footer a, .ev-footer button {
  font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  touch-action: manipulation; transition: transform 100ms ease-out, color 120ms ease;
}
.ev-footer a:active, .ev-footer button:active { transform: scale(0.97); }

/* ----- Gate states ------------------------------------------------------ */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 120px 24px; text-align: center; }
.gate p { max-width: 440px; margin: 0 auto; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.gate .btn { margin-top: 28px; }
.gate--loading p { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); }

/* ----- Countdown (reception) -------------------------------------------- */
.countdown { display: flex; justify-content: center; gap: clamp(20px, 6vw, 64px); margin-top: 48px; }
.countdown div { text-align: center; min-width: 64px; }
.countdown strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 6vw, 60px); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { display: block; margin-top: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }

/* ----- Reveal ----------------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none; transition: opacity 300ms ease; }
  .btn:active, .text-link:active, .ev-links a:active, .ev-links button:active { transform: none; }
}

/* Translucent chrome becomes solid when the viewer asks for less transparency. */
@media (prefers-reduced-transparency: reduce) {
  .ev-nav[data-scrolled] { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ev-nav[data-scrolled]::after { background: linear-gradient(180deg, var(--bg), transparent); }
}

/* Higher contrast: solid surfaces and defined borders. */
@media (prefers-contrast: more) {
  :root, body { --line: rgba(0, 0, 0, .45); --ink-soft: var(--ink); }
  body[data-theme="reception"], body[data-theme="home"] { --line: rgba(255, 255, 255, .5); }
  .card, .facts, .invite { border-width: 1.5px; }
  .btn--ghost { border-width: 1.5px; }
  .ev-nav[data-scrolled] { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
