/* ============================================================
   BiBird — Invitations · shared mechanics
   Each template overrides the THEME tokens in its own <style>.
   Identity lives in the page; mechanics live here.
   ============================================================ */

:root {
  /* Theme tokens — overridden per template */
  --bg:      oklch(0.165 0.035 285);
  --bg-2:    oklch(0.21 0.038 286);
  --panel:   oklch(0.235 0.040 287 / 0.6);
  --ink:     oklch(0.97 0.012 285);
  --muted:   oklch(0.76 0.022 285);
  --faint:   oklch(0.6 0.022 285);
  --line:    oklch(1 0 0 / 0.12);
  --accent:  oklch(0.78 0.16 62);
  --accent-2:oklch(0.63 0.25 350);

  --serif: "Bodoni Moda", "Frank Ruhl Libre", Georgia, serif;
  --sans:  "Hanken Grotesk", "Heebo", system-ui, sans-serif;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 350;
  line-height: 1.65;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-2); color: #fff; }

em { font-style: italic; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ---------- background scene photo (behind the hero band) ----------
   Atmospheric, never a portrait: a strong scrim + text-shadow keep every
   word legible (zero-legibility standard), while the brand auroras above
   it tint each photo toward the BiBird palette so they feel like one site. */
.scene { position: absolute; top: 0; left: 0; right: 0; height: var(--scene-h, min(108svh, 880px)); z-index: -3; overflow: hidden; }
.scene img { width: 100%; height: 100%; object-fit: cover; object-position: var(--scene-pos, 50% 32%); }
.scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    var(--scrim-top, oklch(0.12 0.03 285 / 0.55)) 0%,
    var(--scrim-mid, oklch(0.12 0.03 285 / 0.42)) 34%,
    var(--scrim-mid, oklch(0.12 0.03 285 / 0.42)) 52%,
    var(--bg) 100%);
}
.has-scene { position: relative; }
.has-scene .invite :is(h1, h2, .kicker, .lead, .crown, .soft, .edition, .org, .who, .big-day, .vow, .cause, .num, .name, .title, .heb, .gala-title, .ringline) {
  text-shadow: 0 1px 2px oklch(0.1 0.02 285 / 0.6), 0 8px 34px oklch(0.1 0.02 285 / 0.5);
}
/* light templates: a soft light halo instead of a dark shadow */
.has-scene.light .invite :is(h1, h2, .kicker, .lead, .crown, .soft, .edition, .org, .who, .big-day, .vow, .cause, .num, .name, .title) {
  text-shadow: 0 1px 16px oklch(1 0 0 / 0.75), 0 2px 4px oklch(1 0 0 / 0.6);
}

/* ---------- ambient atmosphere ---------- */
.atmos { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.atmos__glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.5; mix-blend-mode: screen; will-change: transform;
}
.atmos__grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(oklch(1 0 0 / 0.022) 1px, transparent 1px);
  background-size: 3px 3px;
}
@keyframes float-a { to { transform: translate(7vw, 9vh) scale(1.15); } }
@keyframes float-b { to { transform: translate(-8vw, 6vh) scale(1.12); } }

/* ---------- shell ---------- */
.invite {
  max-width: 56rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 2rem + 8vw, 7rem) clamp(1.4rem, 0.5rem + 5vw, 4rem);
  text-align: center;
}
.block { padding-block: clamp(2.5rem, 1.5rem + 5vw, 4.5rem); }

/* ---------- shared type ---------- */
.kicker {
  font-size: 0.72rem; letter-spacing: 0.4em; text-transform: uppercase;
  font-weight: 600; color: var(--accent);
}
.hr {
  width: 1px; height: clamp(2.5rem, 6vw, 4rem); margin: 1.6rem auto;
  background: linear-gradient(var(--accent), transparent);
}
.lead { color: var(--muted); max-width: 38ch; margin-inline: auto; }

/* ---------- countdown ---------- */
.count { display: flex; justify-content: center; gap: clamp(0.6rem, 2vw, 1.6rem); flex-wrap: wrap; }
.count__cell {
  min-width: 4.4rem; padding: 0.9rem 0.4rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); backdrop-filter: blur(8px);
}
.count__n {
  font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 3vw, 2.6rem);
  line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink);
}
.count__l {
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint); margin-top: 0.5rem;
}

/* ---------- detail rows ---------- */
.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.fact { background: var(--bg-2); padding: 1.3rem 1.5rem; text-align: left; display: grid; gap: 0.2rem; }
.fact__k { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); }
.fact__v { color: var(--ink); }
.fact__s { color: var(--faint); font-size: 0.9rem; }
@media (min-width: 640px) { .facts--2 { grid-template-columns: 1fr 1fr; } }

/* ---------- RSVP ---------- */
.rsvp { max-width: 26rem; margin-inline: auto; display: grid; gap: 0.9rem; text-align: left; }
.rsvp input, .rsvp select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.85rem 1rem;
}
.rsvp input::placeholder { color: var(--faint); }
.rsvp input:focus, .rsvp select:focus { outline: none; border-color: var(--accent); }
.choice { display: flex; gap: 0.6rem; }
.choice label {
  flex: 1; text-align: center; padding: 0.8rem; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); transition: border-color 0.2s, background 0.2s;
}
.choice input { position: absolute; opacity: 0; }
.choice input:checked + label { border-color: var(--accent); background: oklch(0.78 0.16 62 / 0.12); }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; color: #fff;
  border: none; border-radius: 999px; padding: 0.95rem 1.5rem;
  background: var(--accent); transition: transform 0.25s var(--ease), filter 0.25s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.rsvp__ok { display: none; text-align: center; color: var(--accent); font-family: var(--serif); font-size: 1.3rem; }
.rsvp.sent form { display: none; }
.rsvp.sent .rsvp__ok { display: block; }

/* ---------- footer ---------- */
.invite-foot {
  text-align: center; padding: 3rem 1.5rem 4rem; color: var(--faint);
  display: grid; gap: 0.7rem; justify-items: center;
}
.invite-foot img { width: 34px; height: 34px; opacity: 0.9; }
.invite-foot a { color: var(--muted); }
.invite-foot small { font-size: 0.72rem; letter-spacing: 0.14em; }

/* ---------- reveal on scroll ---------- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rise.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .rise { opacity: 1; transform: none; }
}
