/* ============================================================
   Mike & Xan — Wedding Site
   Mobile-first, minimal styling. Design polish comes later.
   ============================================================ */

:root {
  /* ── Palette ─────────────────────────────────────────────────────────
     Swap any of these and the entire site repaints. RGB triplets are
     used for rgba() (alpha-controlled) tints; the named tokens are used
     wherever a solid color is needed. */
  --color-bg: #efe7d8;             /* page background — cream */
  --color-bg-alt: #ddd2bc;         /* alt section background */
  --color-text: #2b1f1a;           /* primary text — dark brown */
  --color-muted: #7a6e60;          /* secondary / muted text */
  --color-accent: #c8362c;         /* primary accent — tomato red */
  --color-accent-hover: #a02a23;   /* hover state for accent */
  --color-border: #d8c8b0;         /* subtle separator */
  --color-olive: #6e7a4e;          /* secondary accent — used in maps & legends */
  --color-paper: #fefcf6;          /* notecard off-white */
  --color-paper-rule: rgba(70, 100, 180, 0.18);  /* notecard ruled lines */
  --color-paper-margin: rgba(var(--color-accent-rgb), 0.55); /* notecard red left margin */

  /* RGB triplets — use as rgba(var(--color-*-rgb), <alpha>) */
  --color-bg-rgb: 239, 231, 216;
  --color-text-rgb: 43, 31, 26;
  --color-accent-rgb: 200, 54, 44;
  --color-olive-rgb: 110, 122, 78;

  --max-width: 880px;
  --radius: 6px;
  --space-xs: .5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --header-height: 60px;

  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "Special Elite", "Courier Prime", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-hover); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 var(--space-sm);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.8rem, 9vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); margin-bottom: var(--space-md); font-family: "new-kansas-thin", Georgia, serif; font-weight: 700; font-style: normal; }
h3 { font-size: 1.3rem; font-weight: 600; }

p { margin: 0 0 var(--space-sm); }

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: var(--header-height);
  padding: 0 var(--space-sm);
  background: rgba(var(--color-bg-rgb), .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
@media (max-width: 719px) {
  .site-header {
    position: fixed;
    left: 0;
    right: 0;
    padding-top: env(safe-area-inset-top);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
  }
  body.is-scrolled .site-header {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .section-hero {
    min-height: 100vh;
    min-height: 100dvh;
  }
}


.brand {
  font-family: "new-kansas-swash-bold-italic", Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: -.01em;
}
.brand-amp {
  color: var(--color-accent);
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-style: normal;
  -webkit-text-stroke: 0.6px currentColor;
}

/* Every "&" in body text is auto-wrapped in <span class="amp"> by script.js
   so it renders in DM Serif Display Regular — matches the brand mark. */
.amp {
  font-family: "DM Serif Display", serif;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.primary-nav {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  border-top: 0 solid var(--color-border);
}
.primary-nav.is-open {
  max-height: 320px;
  border-top-width: 1px;
}
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.primary-nav a {
  display: block;
  padding: .75rem var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius);
}
.primary-nav a:hover,
.primary-nav a:focus { background: var(--color-bg-alt); }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .primary-nav {
    width: auto;
    max-height: none;
    overflow: visible;
    border-top: 0;
    transition: none;
  }
  .primary-nav ul {
    flex-direction: row;
    padding: 0;
    gap: var(--space-sm);
  }
  .primary-nav a { padding: .25rem .5rem; }
}

/* ---------- Reveal animations ---------- */
.section-hero .kicker,
.hero-name,
.hero-amp,
.hero-info,
.hero-actions,
section:not(#home) h2,
.section-lede,
.details-block,
#faq details,
#registry .registry-text > p {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.anim-in {
  opacity: 1 !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .section-hero .kicker, .hero-name, .hero-amp, .hero-info, .hero-actions,
  section:not(#home) h2, .section-lede, .details-block,
  #faq details, #registry .registry-text > p {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .timeline::before { transform: scaleY(1) !important; animation: none !important; }
  .timeline-event, .timeline-event:nth-child(odd), .timeline-event:nth-child(even) {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .timeline-event::before { opacity: 1 !important; animation: none !important; }
}

/* Timeline slide-in directions */
.timeline-event {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.timeline-event:nth-child(odd)  { transform: translateX(-44px); }
.timeline-event:nth-child(even) { transform: translateX(44px); }

/* ---------- Sections ---------- */

.section { padding: var(--space-lg) var(--space-sm); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-alt { background: var(--color-bg-alt); }
.section-lede { color: var(--color-muted); margin-bottom: var(--space-md); }

/* ==WAVE-START== */

/* Dividers only where color changes: details(cream)→story(green) and story(green)→wedding-party(cream) */
/* Cream-to-cream sections butt cleanly — no divider */

#registry {
  padding: calc(var(--space-lg) * 2.8) var(--space-sm);
}

.registry-text {
  max-width: 60%;
  position: relative;
  z-index: 1;
}
.registry-polaroid {
  position: absolute;
  z-index: 0;
  left: 60%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.registry-polaroid img {
  width: 544px;
  max-width: none;
}
@media (max-width: 640px) {
  .registry-inner {
    display: flex;
    flex-direction: column;
  }
  .registry-text {
    max-width: 100%;
    order: 2;
  }
  .registry-polaroid {
    order: 1;
    position: static;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
    pointer-events: auto;
  }
  .registry-polaroid img {
    width: 100%;
    transform: none !important;
  }
}

#details {
  padding: calc(var(--space-lg) * 2.8) var(--space-sm);
}

.details-text {
  max-width: 50%;
  margin-left: auto;
  position: relative;
  z-index: 1;
}
.details-polaroid {
  position: absolute;
  right: 60%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}
.details-polaroid img {
  width: 544px;
  max-width: none;
}
@media (max-width: 640px) {
  .details-text {
    max-width: 100%;
    margin-left: 0;
  }
  .details-polaroid {
    position: static;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
    pointer-events: auto;
  }
  .details-polaroid img {
    width: 100%;
    transform: none !important;
  }
}

.faq-text {
  max-width: 55%;
  margin-left: auto;
  position: relative;
  z-index: 1;
}
.faq-polaroid {
  position: absolute;
  right: 60%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}
.faq-polaroid img {
  width: 544px;
  max-width: none;
}
@media (max-width: 640px) {
  .faq-text {
    max-width: 100%;
    margin-left: 0;
  }
  .faq-polaroid {
    position: static;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
    pointer-events: auto;
  }
  .faq-polaroid img {
    width: 100%;
    transform: none !important;
  }
}

.details-content { position: relative; }
.venue-map-outer { margin-top: var(--space-lg); }
.venue-map-heading {
  margin: 0 0 var(--space-sm);
  text-align: center;
}
.venue-map-wrap {
  position: relative;
  z-index: 1;
}
#venue-map {
  width: 100%;
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(var(--color-text-rgb), 0.12);
  border: 1.5px solid var(--color-border);
}
.venue-map-legend {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  font-size: .9rem;
}
.venue-map-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 6px;
  transition: background-color 0.18s ease;
}
.venue-map-legend li:hover,
.venue-map-legend li:focus-visible {
  background: rgba(var(--color-olive-rgb), 0.12);
  outline: none;
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  flex: 0 0 auto;
}
.legend-dot-venue { background: var(--color-accent); }
.legend-dot-hotel { background: var(--color-olive); }
.legend-dot-parking { background: #c79232; }

.map-popup {
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.4;
  padding: 2px 4px 4px;
}
.map-popup strong {
  font-family: var(--font-display);
  font-size: 1rem;
  display: block;
  margin-bottom: 2px;
}
.map-popup a { color: var(--color-accent); }

@media (max-width: 640px) {
  #venue-map { height: 320px; }
}

.faq-map {
  width: 100%;
  height: 320px;
  margin-top: var(--space-sm);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(var(--color-text-rgb), 0.12);
  border: 1.5px solid var(--color-border);
}
@media (max-width: 640px) {
  .faq-map { height: 260px; }
}

#story {
  position: relative; z-index: 1; margin-top: -42px;
  background:
    url("assets/divider-top.svg") top left / 100% 42px no-repeat,
    url("assets/divider-bottom.svg") bottom left / 100% 42px no-repeat,
    url("assets/Tile-green.webp") left 42px / 500px 500px repeat,
    var(--color-olive);
  padding: calc(var(--space-lg) * 2.8 + 30px) var(--space-sm);
}

#story h2, #story h3, #story .timeline-label,
#story .timeline-date, #story a {
  color: rgba(var(--color-bg-rgb), 0.88);
}
#story p, #story .timeline-desc {
  color: rgba(var(--color-bg-rgb), 0.62);
}

#wedding-party {
  position: relative;
  background: var(--color-bg);
  padding: calc(var(--space-lg) * 2.8) var(--space-sm);
}

/* Paper divider for hero (photo) → rsvp (cream) transition */
#rsvp {
  margin-top: -42px;
  background:
    url("assets/divider-bottom.svg") top left / 100% 42px no-repeat,
    var(--color-bg);
  padding-top: calc(var(--space-lg) + 42px);
}

#faq {
  padding: calc(var(--space-lg) * 2.8) var(--space-sm);
}

#gallery {
  background:
    url("assets/divider-top.svg") top left / 100% 42px no-repeat,
    url("assets/divider-bottom.svg") bottom left / 100% 42px no-repeat,
    url("assets/Tile-green.webp") left 42px / 500px 500px repeat,
    var(--color-olive);
  padding: calc(var(--space-lg) + 12px) clamp(12px, 2.5vw, 28px);
}
#gallery .gallery-grid {
  max-width: none;
  gap: clamp(8px, 1.4vw, 18px);
}
/* Slight per-photo rotation + position jitter — 7-step cycle keeps it varied */
#gallery .gallery-grid .polaroid {
  transition: transform .25s ease;
}
#gallery .gallery-grid .polaroid:nth-child(7n+1) { transform: rotate(-1.1deg) translate(-2px, 1px); }
#gallery .gallery-grid .polaroid:nth-child(7n+2) { transform: rotate(0.7deg)  translate(1px, -2px); }
#gallery .gallery-grid .polaroid:nth-child(7n+3) { transform: rotate(-0.4deg) translate(2px, 2px); }
#gallery .gallery-grid .polaroid:nth-child(7n+4) { transform: rotate(1.3deg)  translate(-1px, -1px); }
#gallery .gallery-grid .polaroid:nth-child(7n+5) { transform: rotate(-0.9deg) translate(2px, -2px); }
#gallery .gallery-grid .polaroid:nth-child(7n+6) { transform: rotate(0.5deg)  translate(-2px, 2px); }
#gallery .gallery-grid .polaroid:nth-child(7n)   { transform: rotate(-0.6deg) translate(1px, 1px); }

#contact {
  padding: calc(var(--space-lg) * 2.8) var(--space-sm);
}
/* ==WAVE-END== */

/* ---------- Hero ---------- */

.section-hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  overflow: hidden;
}
/* Xerox / halftone hero photo — heavy contrast B&W with a dot screen overlay */
.section-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("assets/old-apartment-altcrop.webp") var(--hero-bg-x-d, 39%) var(--hero-bg-y-d, 83%) / auto var(--hero-bg-size-d, 120%) no-repeat;
  filter: grayscale(1) contrast(2.3) brightness(0.8);
  opacity: .75;
}
.section-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 55% at center, rgba(var(--color-text-rgb), .15) 0%, rgba(var(--color-text-rgb), .06) 60%, rgba(var(--color-text-rgb), 0) 100%),
    radial-gradient(circle, rgba(var(--color-text-rgb), .55) 1px, transparent 1.5px) 0 0 / 4px 4px,
    radial-gradient(circle, rgba(var(--color-text-rgb), .55) 1px, transparent 1.5px) 2px 2px / 4px 4px,
    linear-gradient(rgba(var(--color-bg-rgb), .35), rgba(var(--color-bg-rgb), .55));
  mix-blend-mode: multiply;
  pointer-events: none;
}
.hero-inner { max-width: 640px; display: flex; flex-direction: column; align-items: center; position: relative; }

.hero-title {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6em;
  line-height: 1;
  margin-bottom: calc(var(--space-md) * 1.6);
}
.hero-name {
  position: relative;
  z-index: 2;
  display: block;
  font-family: "new-kansas-extraswash-smbold", Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: clamp(4.0rem, 14.0vw, 6.9rem);
  letter-spacing: -.01em;
  color: #f9eed5;
}
.hero-amp {
  position: absolute;
  inset: .15em 0 0 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(10.7rem, 35.6vw, 17.8rem);
  line-height: 1;
  translate: 0 -2rem;
}
.hero-amp[data-glyph="and"] { font-size: clamp(5.4rem, 18vw, 9rem); }
.hero-amp[data-glyph="plus"] { font-size: clamp(10.7rem, 35.6vw, 17.8rem); }
.hero-amp[data-glyph="long"] { font-size: clamp(3.4rem, 11vw, 5.7rem); }
.hero-amp[data-font="nk"] { top: calc(.15em + 0.3em); }
.hero-amp {
  color: #ff3a2c;
  pointer-events: none;
  /* JS swaps font-family at ~3fps to cycle ampersand styles */
  font-family: var(--font-display);
  font-size-adjust: cap-height 0.55;
  will-change: transform, font-family;
  transform-origin: center;
  mix-blend-mode: multiply;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin-top: var(--space-md);
}
.hero-strip {
  display: inline-block;
  margin: 0;
  padding: .35em .9em;
  font-family: var(--font-mono);
  font-size: .95rem;
  letter-spacing: .01em;
  line-height: 1.3;
  color: var(--color-text);
  background: #fffaf0;
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, .04),
    0 6px 12px -4px rgba(var(--color-text-rgb), .25),
    0 2px 4px rgba(var(--color-text-rgb), .15);
}
.hero-strip.kicker      { transform: rotate(-1.6deg); color: var(--color-accent); margin-top: var(--space-md); margin-bottom: var(--space-xs); }
.hero-strip.hero-date   { transform: rotate(.9deg); }
.hero-strip.hero-time   { transform: rotate(-.7deg); font-size: 1.13rem; }
.hero-strip.hero-place  { transform: rotate(1.3deg); }
.hero-note {
  font-size: .9rem;
  color: var(--color-muted);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: .95rem 2.5rem;
  border-radius: 100px;
  border: 0;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .025em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.rsvp-form .btn { margin-top: var(--space-md); }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--color-accent-rgb), .28);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  box-shadow: 0 4px 18px rgba(var(--color-accent-rgb), .38);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 18px rgba(var(--color-accent-rgb), .28);
}

.cal-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.details-datestamp {
  display: inline-block;
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
  transform: rotate(-1.1deg);
}

.cal-btns-label {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: rotate(-1.2deg);
  margin: var(--space-md) 0 calc(var(--space-sm) * 0.75);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

/* ---------- Countdown / flip clock ---------- */
/* Hidden 2026-05-03 — Mike not feeling it. Remove the next rule to bring back. */
.countdown { display: none !important; }

.countdown {
  display: flex;
  gap: .55rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: var(--space-sm) 0 var(--space-md);
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.flip-card {
  position: relative;
  width: 76px;
  height: 96px;
  perspective: 400px;
  border-radius: 10px;
  box-shadow:
    0 6px 18px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -2px 4px rgba(0,0,0,.4);
}
.flip-card > div {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #1a1a1a;
  color: #fff;
  overflow: hidden;
}
.flip-card > div > span {
  position: absolute;
  left: 0;
  right: 0;
  height: 96px;
  line-height: 96px;
  text-align: center;
  font-size: 3.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f4f1e8;
}
.flip-static-top, .flip-flap-top {
  top: 0;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid rgba(0,0,0,.55);
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}
.flip-static-top > span, .flip-flap-top > span { top: 0; }
.flip-static-bottom, .flip-flap-bottom {
  bottom: 0;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0c0c0c 100%);
}
.flip-static-bottom > span, .flip-flap-bottom > span { bottom: 0; }
.flip-flap-top, .flip-flap-bottom {
  visibility: hidden;
  z-index: 2;
}
.flip-card.is-flipping .flip-flap-top {
  visibility: visible;
  transform-origin: bottom;
  animation: flap-top-down .3s ease-in forwards;
  box-shadow: 0 4px 8px rgba(0,0,0,.3);
}
.flip-card.is-flipping .flip-flap-bottom {
  visibility: visible;
  transform-origin: top;
  transform: rotateX(90deg);
  animation: flap-bottom-up .3s .3s ease-out forwards;
  box-shadow: 0 -4px 8px rgba(0,0,0,.3);
}
@keyframes flap-top-down {
  from { transform: rotateX(0deg); }
  to   { transform: rotateX(-90deg); }
}
@keyframes flap-bottom-up {
  from { transform: rotateX(90deg); }
  to   { transform: rotateX(0deg); }
}
.flip-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-top: .4rem;
  color: var(--color-muted);
}
@media (max-width: 480px) {
  .flip-card { width: 58px; height: 76px; }
  .flip-card > div > span { height: 76px; line-height: 76px; font-size: 2.6rem; }
  .flip-label { font-size: .65rem; letter-spacing: .12em; }
  .section-hero::before {
    background: url("assets/old-apartment-altcrop.webp") var(--hero-bg-x-m, 43%) var(--hero-bg-y-m, 90%) / cover no-repeat;
    transform: scale(var(--hero-bg-scale-m, 1));
    transform-origin: var(--hero-bg-x-m, 43%) var(--hero-bg-y-m, 90%);
  }
}

/* ---------- Photo break (parallax full-bleed image) ---------- */
.photo-break {
  position: relative;
  isolation: isolate;
  min-height: 60vh;
  overflow: hidden;
}
.photo-break::before {
  content: "";
  position: absolute;
  top: -12%;
  left: 0;
  right: 0;
  bottom: -12%;
  z-index: -2;
  background: var(--break-img) var(--break-pos, 50% 50%) / cover no-repeat;
  filter: grayscale(1) contrast(var(--break-contrast, 1.15)) brightness(1.05);
  opacity: 0.7;
  transform: translateY(var(--parallax-offset, 0)) scale(var(--break-scale, 1));
  transform-origin: var(--break-pos, 50% 50%);
  will-change: transform;
}
.photo-break::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 55% at center, rgba(var(--color-bg-rgb), .85) 0%, rgba(var(--color-bg-rgb), .35) 60%, rgba(var(--color-bg-rgb), 0) 100%),
    radial-gradient(circle, rgba(var(--color-text-rgb), .3) 1px, transparent 1.5px) 0 0 / 4px 4px,
    radial-gradient(circle, rgba(var(--color-text-rgb), .3) 1px, transparent 1.5px) 2px 2px / 4px 4px,
    linear-gradient(rgba(var(--color-bg-rgb), .35), rgba(var(--color-bg-rgb), .55));
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* Paper-stack dividers at top + bottom of every photo break */
.break-divider {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  z-index: 5;
  pointer-events: none;
}
.break-divider-top {
  top: 0;
  background: url("assets/divider-top.svg") top left / 100% 42px no-repeat;
}
.break-divider-bottom {
  bottom: 0;
  background: url("assets/divider-bottom.svg") bottom left / 100% 42px no-repeat;
}
.photo-break.into-alt > .break-divider-bottom {
  background: url("assets/divider-bottom-alt.svg") bottom left / 100% 42px no-repeat;
}
@media (max-width: 720px) {
  .photo-break {
    min-height: 45vh;
  }
}

/* ── Heart-eyes overlay (cartoon style, draws in on scroll) ── */
.has-heart-eyes { overflow: hidden; }

/* For .has-heart-eyes breaks the photo + hearts share a single fixed-aspect
   "stage" so the hearts stay pinned to image content as the viewport reshapes.
   The default ::before/::after photo+halftone are suppressed in favor of
   real child elements inside the stage. */
.photo-break.has-heart-eyes::before,
.photo-break.has-heart-eyes::after {
  display: none;
}
.photo-break-stage {
  position: absolute;
  top: calc(50% + var(--break-pan-y, 0%));
  left: calc(50% + var(--break-pan-x, 0%));
  transform: translate(-50%, -50%) translateY(var(--parallax-offset, 0));
  aspect-ratio: 3 / 4;
  min-width: calc(100% * var(--break-scale, 1));
  min-height: calc(100% * var(--break-scale, 1));
  width: auto;
  height: auto;
  will-change: transform;
}
.photo-break-photo {
  position: absolute;
  inset: 0;
  background: var(--break-img) center / cover no-repeat;
  filter: grayscale(1) contrast(var(--break-contrast, 1.15)) brightness(1.05);
  opacity: 0.7;
}
.photo-break-halftone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 55% at center, rgba(var(--color-bg-rgb), .85) 0%, rgba(var(--color-bg-rgb), .35) 60%, rgba(var(--color-bg-rgb), 0) 100%),
    radial-gradient(circle, rgba(var(--color-text-rgb), .3) 1px, transparent 1.5px) 0 0 / 4px 4px,
    radial-gradient(circle, rgba(var(--color-text-rgb), .3) 1px, transparent 1.5px) 2px 2px / 4px 4px,
    linear-gradient(rgba(var(--color-bg-rgb), .35), rgba(var(--color-bg-rgb), .55));
  mix-blend-mode: multiply;
}
.has-heart-eyes .heart-pin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: none;
}
.photo-break.has-heart-eyes {
  --break-pan-x: var(--break-pan-x-d, 0%);
  --break-pan-y: var(--break-pan-y-d, 0%);
  --break-scale: var(--break-scale-d, 1);
}
@media (max-width: 720px) {
  .photo-break.has-heart-eyes {
    --break-pan-x: var(--break-pan-x-m, var(--break-pan-x-d, 0%));
    --break-pan-y: var(--break-pan-y-m, var(--break-pan-y-d, 0%));
    --break-scale: var(--break-scale-m, var(--break-scale-d, 1));
  }
}

.heart-eye {
  position: absolute;
  width: var(--heart-base-w, 9%);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--hs, 1));
}
@media (max-width: 720px) {
  .heart-eye { width: var(--heart-base-w-m, 6%); }
}
.heart-eye[data-heart="1"] { left: var(--h1x, 26%); top: var(--h1y, 38%); --rot: -7deg; --hs: var(--h1s, 1); }
.heart-eye[data-heart="2"] { left: var(--h2x, 38%); top: var(--h2y, 38%); --rot:  5deg; --hs: var(--h2s, 1); }
.heart-eye[data-heart="3"] { left: var(--h3x, 68%); top: var(--h3y, 36%); --rot: -5deg; --hs: var(--h3s, 1); }
.heart-eye[data-heart="4"] { left: var(--h4x, 78%); top: var(--h4y, 36%); --rot:  8deg; --hs: var(--h4s, 1); }

.heart-eye path {
  fill: none;
  stroke: var(--color-accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.heart-eye .he-outline  { stroke-width: 5; }
.heart-eye .he-scribble { stroke-width: 2.5; }

@media (max-width: 720px) {
  .heart-eye { width: 60px; height: 60px; }
  .heart-eye .he-outline  { stroke-width: 4; }
  .heart-eye .he-scribble { stroke-width: 2.5; }
}

/* Localhost-only slider panel for placing each heart */
.heart-panel {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 60;
  width: 360px;
  padding: 10px 12px;
  background: rgba(var(--color-text-rgb), 0.85);
  color: #faf3e4;
  font: 12px var(--font-body);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
}
.heart-panel-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 1fr;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.heart-panel-row label { font-weight: 700; color: var(--color-accent); }
.heart-panel-row input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.heart-panel-row .hp-val { font-size: 10px; opacity: 0.6; min-width: 30px; text-align: right; }
.heart-panel-note {
  font-size: 11px;
  margin-top: 4px;
  min-height: 14px;
}

/* ---------- Details sub-blocks ---------- */
.details-block + .details-block {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}
.details-block h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1.15em;
}
.details-block p {
  margin-bottom: 0.25rem;
}

.story-accent {
  color: var(--color-bg);
  font-weight: 700;
}

/* ---------- Our Story timeline ---------- */
@keyframes timeline-line-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes dot-pop {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.35); }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.timeline {
  list-style: none;
  margin: var(--space-lg) 0 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(var(--color-bg-rgb), 0.45);
  transform: scaleY(0);
  transform-origin: top center;
}
.timeline.line-drawn::before {
  animation: timeline-line-grow 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.timeline-event {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  position: relative;
  margin-bottom: var(--space-xl);
}
.timeline-event:nth-child(even) .timeline-content { order: 2; text-align: left; }
.timeline-event:nth-child(even) .timeline-photo   { order: 1; justify-self: end; }

.timeline-event::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 2.5rem;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px #fff;
  z-index: 2;
  opacity: 0;
}
.timeline-event.anim-in::before {
  animation: dot-pop 0.45s ease calc(var(--reveal-delay, 0s) + 0.2s) forwards;
}

.timeline-content {
  text-align: right;
}
.timeline-photo {
  justify-self: start;
}
.photo-stack {
  position: relative;
  display: inline-block;
}
.stack-photo {
  display: block;
  width: 450px;
  max-width: 100%;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@media (hover: hover) {
  .photo-stack { cursor: pointer; }
}
.stack-expand {
  position: absolute;
  top: 8%;
  right: 8%;
  z-index: 20;
  width: 30px;
  height: 30px;
  background: rgba(var(--color-accent-rgb), 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  padding: 0;
}
.stack-expand svg {
  width: 14px;
  height: 14px;
  display: block;
}
@media (hover: hover) {
  .photo-stack:hover .stack-expand {
    opacity: 1;
    pointer-events: auto;
  }
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}
.timeline-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15em;
  color: var(--color-bg);
}
.timeline-content p {
  margin: 0 0 0.4rem;
  font-size: 0.95em;
}

@media (max-width: 640px) {
  .timeline::before { left: 6px; width: 2px; background: rgba(var(--color-bg-rgb),0.45); }
  .timeline-event {
    grid-template-columns: 1fr;
    padding-left: 28px;
  }
  .timeline-event::before { left: 7px; top: 1.5rem; }
  .timeline-event .timeline-photo   { order: 1; justify-self: start; }
  .timeline-event .timeline-content { order: 2; text-align: left; }
  .photo-stack { display: block; width: 100%; margin-top: 1.25rem; margin-bottom: 0; }
  .timeline-event .timeline-content { padding-bottom: 4rem; }
  .stack-photo { width: 100%; }
}

/* ---------- Highlights strip (When / Where / What) ---------- */

.section-highlights {
  padding: var(--space-xs) var(--space-sm) 5rem;
  background: var(--color-bg);
  text-align: center;
}
.section-highlights .info-cards {
  text-align: left;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.info-card {
  border-radius: 2px;
  padding: calc(var(--space-md) + 38px) var(--space-md) var(--space-md) calc(var(--space-md) + 18px);
  position: relative;
  z-index: 1;
  margin-top: 38px;
  background:
    /* red header stripe (top 3px) */
    linear-gradient(to bottom, var(--color-accent) 0 3px, transparent 3px) no-repeat,
    /* vertical red margin line on the left */
    linear-gradient(to right, transparent 0 14px, var(--color-paper-margin) 14px 15px, transparent 15px) no-repeat,
    /* subtle ruled lines */
    repeating-linear-gradient(
      to bottom,
      transparent 0 27px,
      var(--color-paper-rule) 27px 28px
    ),
    var(--color-paper);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.05);
}
.info-cards .info-card:nth-child(1) { transform: rotate(-1.1deg); }
.info-cards .info-card:nth-child(2) { transform: rotate(0.6deg); }
.info-cards .info-card:nth-child(3) { transform: rotate(-0.4deg); }

.info-card-scribble {
  position: absolute;
  top: -28px;
  left: 50%;
  width: 96px;
  height: auto;
  pointer-events: none;
  /* Recolor the dark scribble to tomato red — matches other accent scribbles. */
  filter: brightness(0) invert(24%) sepia(72%) saturate(1300%) hue-rotate(342deg) brightness(97%) contrast(104%);
}
.info-cards .info-card:nth-child(1) .info-card-scribble { transform: translateX(-50%) rotate(-6deg); }
.info-cards .info-card:nth-child(2) .info-card-scribble { transform: translateX(-50%) rotate(4deg); }
.info-cards .info-card:nth-child(3) .info-card-scribble { transform: translateX(-50%) rotate(-3deg); }

.info-card-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--color-accent);
  margin: 0 0 .5rem;
}

.info-card-main {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5rem;
  color: var(--color-text);
}

.info-card-detail {
  font-size: .88rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin: 0;
}

.info-card-detail a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.highlights-more-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: var(--space-md) 0 0;
  color: var(--color-muted);
  opacity: .55;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity .2s ease, transform .2s ease;
}
.highlights-more-arrow:hover {
  opacity: .9;
  transform: translateY(2px);
  color: var(--color-muted);
}
.highlights-more-arrow svg {
  width: 10px;
  height: auto;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .info-cards { grid-template-columns: 1fr; }
}

/* ---------- Wedding Party ---------- */

.party-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}
@media (max-width: 540px) {
  .party-grid { grid-template-columns: 1fr; }
  /* Mobile-only reorder: Alexandria, Michael, Steve, Francie, Ron, Jenny, Sam, Ady, Jack */
  .party-grid .party-card:nth-child(1) { order: 1; } /* Alexandria */
  .party-grid .party-card:nth-child(2) { order: 2; } /* Michael */
  .party-grid .party-card:nth-child(4) { order: 3; } /* Steve */
  .party-grid .party-card:nth-child(6) { order: 4; } /* Francie */
  .party-grid .party-card:nth-child(3) { order: 5; } /* Ron */
  .party-grid .party-card:nth-child(5) { order: 6; } /* Jenny */
  .party-grid .party-card:nth-child(9) { order: 7; } /* Sam */
  .party-grid .party-card:nth-child(7) { order: 8; } /* Ady */
  .party-grid .party-card:nth-child(8) { order: 9; } /* Jack */
}
@media (min-width: 541px) {
  /* Desktop reorder: Alexandria, Michael / Steve, Francie / Ron, Jenny / Ady, Jack / Sam */
  .party-grid .party-card:nth-child(1) { order: 1; } /* Alexandria */
  .party-grid .party-card:nth-child(2) { order: 2; } /* Michael */
  .party-grid .party-card:nth-child(4) { order: 3; } /* Steve */
  .party-grid .party-card:nth-child(6) { order: 4; } /* Francie */
  .party-grid .party-card:nth-child(3) { order: 5; } /* Ron */
  .party-grid .party-card:nth-child(5) { order: 6; } /* Jenny */
  .party-grid .party-card:nth-child(7) { order: 7; } /* Ady */
  .party-grid .party-card:nth-child(8) { order: 8; } /* Jack */
  .party-grid .party-card:nth-child(9) { order: 9; } /* Sam */
}

.party-card {
  position: relative;
  z-index: 1;
  border-radius: 2px;
  padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 18px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  text-align: left;
  background:
    linear-gradient(to bottom, var(--color-accent) 0 3px, transparent 3px) no-repeat,
    linear-gradient(to right, transparent 0 14px, var(--color-paper-margin) 14px 15px, transparent 15px) no-repeat,
    repeating-linear-gradient(
      to bottom,
      transparent 0 27px,
      var(--color-paper-rule) 27px 28px
    ),
    var(--color-paper);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.05);
}
.party-grid .party-card:nth-child(5n+1) { transform: rotate(-0.9deg); }
.party-grid .party-card:nth-child(5n+2) { transform: rotate(0.5deg); }
.party-grid .party-card:nth-child(5n+3) { transform: rotate(-0.4deg); }
.party-grid .party-card:nth-child(5n+4) { transform: rotate(0.8deg); }
.party-grid .party-card:nth-child(5n)   { transform: rotate(-0.6deg); }

.party-card-scribble {
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: 38px;
  height: auto;
  pointer-events: none;
  filter: brightness(0) invert(24%) sepia(72%) saturate(1300%) hue-rotate(342deg) brightness(97%) contrast(104%);
  opacity: .7;
  transform: rotate(-8deg);
}
.party-grid .party-card:nth-child(2n) .party-card-scribble { transform: rotate(7deg); }
.party-grid .party-card:nth-child(3n) .party-card-scribble { transform: rotate(-12deg); }
.party-grid .party-card:nth-child(1) .party-card-scribble { width: 76px; }

.party-card-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-bg-alt);
  flex-shrink: 0;
}

.party-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1) contrast(1.08) brightness(1.04);
}


.party-card-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.party-initials {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-border);
  font-variation-settings: "SOFT" 100, "opsz" 144;
}

.party-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.party-name { margin: 0 0 .2rem; }
.party-role { margin: 0; }

.party-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--color-text);
  margin: 0 0 .3rem;
}

.party-role {
  font-size: .82rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin: 0;
}


/* ---------- RSVP form ---------- */

#rsvp h2,
#rsvp .section-lede { text-align: center; }

.rsvp-form {
  max-width: var(--max-width);
  margin: 0 auto;
}

.rsvp-form label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-muted);
  margin: 1.8rem 0 .5rem;
}

.rsvp-form .hint {
  font-weight: 400;
  font-size: .85em;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
}

.rsvp-form input[type="text"],
.rsvp-form input[type="email"],
.rsvp-form input[type="tel"],
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  padding: .85rem .5rem;
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.55);
  border: none;
  border-bottom: 1.5px solid var(--color-border);
  border-radius: 4px 4px 0 0;
  min-height: 44px;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.rsvp-form input[type="text"]:focus,
.rsvp-form input[type="email"]:focus,
.rsvp-form input[type="tel"]:focus,
.rsvp-form textarea:focus,
.rsvp-form select:focus {
  border-bottom-color: var(--color-accent);
}

.rsvp-form textarea { resize: vertical; }

.rsvp-form .form-status {
  min-height: 1.5em;
  margin-top: .5rem;
  font-size: .9em;
  color: var(--color-muted);
}
.rsvp-form .form-status.is-error { color: #b00020; }
.rsvp-form .form-status.is-ok { color: #2c7a3a; }

.household-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  display: block;
}

.form-step[data-step="1"] {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.form-step:not([hidden]) {
  animation: form-step-in 0.32s ease both;
}
@keyframes form-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

input::placeholder,
textarea::placeholder {
  opacity: 0.4;
}

.lookup-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 var(--space-sm);
  display: block;
}

.lookup-name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.lookup-sub-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-muted);
  margin: 0 0 .4rem;
}


#household-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}
.household-pick-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: .85rem 1rem;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.household-pick-btn:hover,
.household-pick-btn:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), .1);
  outline: none;
}
.picker-back-btn,
.picker-contact-link {
  margin-top: var(--space-sm);
  font-style: italic;
  color: var(--color-muted);
  text-decoration: none;
}
.picker-contact-link { display: block; }

.email-popover {
  position: absolute;
  z-index: 100;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xs);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.email-popover-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-sm);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.email-popover-option:hover,
.email-popover-option:focus {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
}

/* ---------- Dev copy editor (localhost only) ---------- */
.dev-editing {
  outline: 2px dashed #ff8c00;
  outline-offset: 2px;
  background: rgba(255, 240, 200, 0.5);
  cursor: text;
}
#dev-edit-widget {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  background: #fff;
  border: 2px solid #ff8c00;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: #222;
  max-width: 380px;
  max-height: 70vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#dev-edit-widget .dev-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #ff8c00;
}
#dev-edit-widget .dev-edit-count {
  color: #555;
  font-size: 12px;
}
#dev-edit-widget .dev-edit-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#dev-edit-widget button {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}
#dev-edit-widget button:hover {
  background: #f5f5f5;
  border-color: #999;
}
#dev-edit-widget #dev-edit-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  color: #666;
}
#dev-edit-output {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#dev-edit-output textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px;
  padding-right: 28px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.dev-output-close {
  position: absolute !important;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: #b00 !important;
  border: 1px solid #fcc !important;
  background: #fff5f5 !important;
  z-index: 1;
}
.dev-output-close:hover {
  background: #ffe3e3 !important;
  border-color: #f88 !important;
}
.dev-edit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.dev-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: #fff8ef;
  border: 1px solid #ffd9a8;
  border-radius: 4px;
}
.dev-edit-row-undo {
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: #b00 !important;
  border: 1px solid #fcc !important;
  background: #fff5f5 !important;
  flex-shrink: 0;
}
.dev-edit-row-undo:hover {
  background: #ffe3e3 !important;
  border-color: #f88 !important;
}
.dev-edit-row-label {
  font-size: 11px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.dev-edit-row-deleted {
  background: #fff0f0;
  border-color: #f88;
}
.dev-edit-row-deleted .dev-edit-row-label {
  color: #b00;
  text-decoration: line-through;
}

.dev-delete-badge {
  position: absolute;
  z-index: 10000;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #d62828;
  color: #fff;
  font: 700 14px/1 -apple-system, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dev-delete-badge:hover {
  background: #ff3b30;
  transform: scale(1.1);
}

#household-members {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.household-member {
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  background: #fff;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.household-member .member-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.household-member .attending-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-sm);
}

.household-member .attending-toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.household-member .attending-toggle label:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
}

.household-member .attending-toggle input[type="radio"] { display: none; }

.household-member .dietary-row { margin-top: var(--space-sm); }
.household-member .dietary-other {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.3s ease;
}
.household-member .dietary-other.is-shown {
  max-height: 200px;
  opacity: 1;
  margin-top: .5rem;
}

.household-member-plusone {
  border-style: dashed;
  background: var(--color-bg-alt);
}
.household-member-plusone.is-bringing {
  background: #fff;
}
.household-member-plusone .member-name {
  font-style: italic;
  color: var(--color-muted);
}

.plusone-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px dashed var(--color-border);
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease, padding-top 0.35s ease;
}
.plusone-details.is-open {
  max-height: 600px;
  opacity: 1;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
}
.plusone-details .plusone-name {
  display: block;
  width: 100%;
  margin-bottom: .5rem;
}

.form-extras {
  border: 0;
  padding: 0;
  margin: var(--space-md) 0 0;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.household-address {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 1.05rem;
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  border-radius: 8px;
  text-align: center;
}

.contact-method {
  border: 0;
  padding: 0;
  margin: 0;
  margin-top: var(--space-md);
  background: transparent;
}

.contact-method legend {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-muted);
  margin-bottom: .45rem;
  padding: 0;
}

.contact-method label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px 8px 0;
  padding: .55rem 1.2rem;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  text-transform: none;
  letter-spacing: 0;
}

.contact-method label:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
}

.contact-method input[type="radio"] { display: none; }

/* ---------- Details / FAQ ---------- */

.callout {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: #fff;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  font-weight: 500;
}

#faq details {
  border-top: 1px solid var(--color-border);
}
#faq details:last-child {
  border-bottom: 1px solid var(--color-border);
}
#faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--color-text);
  user-select: none;
}
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  color: var(--color-accent);
  flex-shrink: 0;
  transition: transform .25s ease;
}
#faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-body p {
  margin: 0 0 var(--space-sm);
  padding: 0;
  color: var(--color-muted);
}
.faq-body p:last-child {
  margin-bottom: var(--space-md);
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-items: start;
}

.gallery-grid .polaroid {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

/* ---------- Polaroid lightbox ---------- */

.polaroid-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(var(--color-text-rgb), .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity .2s ease;
  cursor: zoom-out;
}
.polaroid-lightbox.is-open { opacity: 1; }
.lb-stack {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-card {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: min(90vw, 1350px);
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  cursor: pointer;
  transform-origin: center center;
  transition: transform .4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity .35s ease;
  will-change: transform, opacity;
}
.lb-card-incoming {
  transform: translateX(120%) rotate(var(--rot, 0deg));
  opacity: 0;
  transition: none;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(var(--color-accent-rgb), 0.85);
  border: none;
  color: #efe7d8;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.lb-nav:hover { background: #c8362c; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
@media (max-width: 540px) {
  .lb-prev, .lb-next {
    top: auto;
    bottom: 60px;
    left: 50%;
    right: auto;
  }
  .lb-prev { transform: translateX(-52px); }
  .lb-next { transform: translateX(8px); }
  .lb-card { max-height: 72vh; }
  .lb-dots { bottom: 20px; }
}
.lb-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--color-bg-rgb), 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.lb-dot.is-active { background: #efe7d8; }
.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--color-bg-rgb), 0.18);
  border: none;
  color: #efe7d8;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background 0.2s;
}
.lb-close:hover { background: rgba(var(--color-bg-rgb), 0.32); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  font-size: .9rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}
.footer-scribble {
  display: block;
  margin: 0 auto var(--space-sm);
  max-width: 160px;
  height: auto;
  opacity: 0.75;
}

@media (max-width: 600px) {
  .lookup-name-fields,
  #household-members,
  .form-row-2col { grid-template-columns: 1fr; }
}

/* ---------- Scribbles ---------- */
#rsvp, #highlights, #registry, #details, #faq { position: relative; }

.scribble {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}
.scribble path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset var(--sd, 0.7s) cubic-bezier(.4,0,.2,1) var(--dd, 0s);
}
.scribble.is-drawn path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .scribble path { stroke-dashoffset: 0 !important; transition: none !important; }
}

.deco-amp {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  font-family: "DM Serif Display", serif;
  font-style: italic;
  color: var(--color-text);
  line-height: 1;
  opacity: 0;
  transition: opacity var(--sd, 1.6s) ease var(--dd, 0s);
}
.deco-amp.is-drawn { opacity: var(--amp-opacity, 0.28); }
@media (prefers-reduced-motion: reduce) {
  .deco-amp { opacity: var(--amp-opacity, 0.28) !important; transition: none !important; }
}

/* ---------- Individual scribble art (SVGs from Scribbles folder) ---------- */
.scr {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--sd, 1.5s) ease var(--dd, 0s);
}
.scr.is-drawn { opacity: var(--sco, 0.5); }
.scr-red { filter: invert(24%) sepia(72%) saturate(1300%) hue-rotate(342deg) brightness(97%) contrast(104%); }
#rsvp .scr { display: none; }
.scr-story { filter: invert(1); }
.scr-hero-hearts { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: -4rem; filter: invert(1); }
@media (prefers-reduced-motion: reduce) {
  .scr { opacity: var(--sco, 0.5) !important; transition: none !important; }
}
