/* ==========================================================================
   CANNONBALL — Pool day party · FLYER (pool poster)
   A splashy, aquatic, bright single-viewport invitation.
   --------------------------------------------------------------------------
   Tokens · Layout shell · Panels · Cover · Gallery + video · Details +
   banner · RSVP · Guestbook · Footer · Nav pills · Photo/video viewer
   Accessibility: reduced motion · print · focus · no-JS fallback
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* palette */
  --lagoon-900: #062d3b;
  --lagoon-800: #0a4353;
  --lagoon-700: #0e5a6e;
  --aqua-500:  #17c3b2;
  --aqua-300:  #5fe0cf;
  --foam-100:  #e6faf5;
  --foam-50:   #f7fffd;
  --coral-500: #ff5d73;
  --coral-300: #ff8fa0;
  --coral-deep: #d63a52;
  --sun-400:   #ffc94d;
  --sun-200:   #ffe9b8;
  --ink:       #072630;

  /* type */
  --font-head: "Arial Black", "Avenir Next Condensed", "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-script: "Snell Roundhand", "Brush Script MT", "Segoe Script", "Apple Chancery", cursive;

  /* layout */
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* motion */
  --move-fast: 220ms ease;
  --move-slow: 700ms ease;

  /* elevation */
  --shadow-card: 0 18px 40px rgba(6, 45, 59, 0.18);
  --shadow-lift: 0 10px 26px rgba(6, 45, 59, 0.22);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--lagoon-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.script { font-family: var(--font-script); font-weight: 500; }

.is-hidden { display: none !important; }

/* ---------- 3. Accessibility helpers ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--sun-400);
  color: var(--lagoon-900);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 12px 12px;
  transition: top var(--move-fast);
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--sun-400);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 4. Single-viewport shell ---------- */
.invite-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  visibility: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.995);
  transition:
    opacity var(--move-fast),
    transform var(--move-slow),
    visibility 0s linear var(--move-fast);
}
.panel.active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity var(--move-fast),
    transform var(--move-slow);
}

.panel-pad {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  width: min(680px, 92%);
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + var(--safe-b) + 28px);
}

/* ---------- 5. Buttons & shared type ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 16px 30px;
  min-height: 52px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--lagoon-900);
  background: var(--sun-400);
  box-shadow: var(--shadow-lift);
  transition: transform var(--move-fast), box-shadow var(--move-fast), background var(--move-fast);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(6, 45, 59, 0.3); }
.btn:active { transform: translateY(0); }
.btn-arrow { font-size: 1.1rem; line-height: 1; }
.btn-block { width: 100%; }

.btn-next {
  align-self: center;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.section-kicker {
  font-size: 2rem;
  color: var(--coral-500);
  line-height: 1.1;
  text-align: center;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-align: center;
}
.section-title-light { color: var(--foam-50); }

/* ---------- 6. Cover — the pool poster ---------- */
.panel-cover {
  background: linear-gradient(180deg, var(--lagoon-700) 0%, var(--lagoon-800) 42%, var(--lagoon-900) 100%);
  color: var(--foam-50);
}

.cover-scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

/* drawn fallback scene — sits UNDER the optional photo, so a user's own
   image becomes the clean hero cover. Only visible when the photo is
   deleted from index.html. */
.scene-art { position: absolute; inset: 0; }

.sun-glow {
  position: absolute;
  top: -14vh; right: -8vw;
  width: 58vmin; height: 58vmin;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--sun-400) 0%, rgba(255, 201, 77, 0.55) 34%, rgba(255, 201, 77, 0) 70%);
  animation: sun-drift 9s ease-in-out infinite alternate;
}
@keyframes sun-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4vmin, 3vmin) scale(1.06); }
}

.floatie {
  position: absolute;
  top: 12vh; left: 8vw;
  width: min(34vw, 190px);
  animation: float-drift 6s ease-in-out infinite;
  filter: drop-shadow(0 14px 18px rgba(6, 45, 59, 0.45));
}
@keyframes float-drift {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(5deg); }
}

.droplet {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--aqua-300);
  opacity: 0.9;
  animation: drip 4s ease-in-out infinite;
}
.droplet::after {
  content: "";
  position: absolute;
  top: -7px; left: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: inherit;
}
.droplet-a { top: 38%; right: 16%; animation-delay: 0s; }
.droplet-b { top: 46%; right: 26%; width: 9px; height: 9px; animation-delay: 1.3s; }
.droplet-c { top: 33%; right: 34%; width: 8px; height: 8px; animation-delay: 2.2s; }
.droplet-d { top: 52%; right: 9%; width: 10px; height: 10px; animation-delay: 0.7s; }
@keyframes drip {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(18px); opacity: 0.35; }
}

/* optional single hero cover photo (delete <figure class="cover-photo-frame">
   AND .cover-overlay in index.html to restore the drawn scene above) */
.cover-photo-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: auto; /* clickable → opens the full-screen viewer */
}
.cover-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  animation: kenburns 26s ease-in-out infinite alternate;
}
/* the clickable wrapper keeps the whole frame tappable (and the slot
   alive when the engine swaps the img for a <picture>) */
.cover-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
}
html.js .cover-open { cursor: zoom-in; }
.cover-open:focus-visible { outline: 3px solid var(--sun-400); outline-offset: -3px; }
@keyframes kenburns {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.12) translate(-1.5%, 1.5%); }
}
/* soft scrim keeps the cover text readable over ANY photo */
.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 45, 59, 0.55) 0%, rgba(6, 45, 59, 0.25) 42%, rgba(6, 45, 59, 0.85) 100%);
  pointer-events: none;
}

.cover-photo-cap {
  position: absolute;
  left: 24px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--foam-100);
  background: rgba(6, 45, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px -8px rgba(6, 45, 59, 0.6);
}

/* small "view full size" badge on hover / keyboard focus — shows the cover
   photo is clickable. Purely visual; without JS it never appears. */
html.js .cover-photo-frame::before {
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(247, 255, 253, 0.94)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a4353' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  border: 1px solid rgba(10, 67, 83, 0.15);
  box-shadow: 0 4px 12px -4px rgba(6, 45, 59, 0.5);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity var(--move-fast), transform var(--move-fast);
  pointer-events: none;
}
html.js .cover-photo-frame:hover::before,
html.js .cover-photo-frame:focus-within::before { opacity: 1; transform: none; }

.cover-photo:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }
html.js .cover-photo { cursor: zoom-in; }

.cover-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 18px;
  text-align: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(var(--nav-h) + var(--safe-b) + 24px);
  /* let clicks fall through to the cover photo beneath (it opens the
     viewer); only the interactive controls stay clickable */
  pointer-events: none;
}
.cover-content .btn,
.cover-content .guest-greeting { pointer-events: auto; }

.guest-greeting {
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--sun-400);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(6, 45, 59, 0.6);
}
.guest-greeting::before { content: "🏊 "; }

.cover-kicker { font-size: clamp(1.7rem, 6vw, 2.6rem); color: var(--aqua-300); }

.cover-title {
  font-family: var(--font-head);
  font-size: clamp(3.4rem, 15vw, 8.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--foam-50);
  text-shadow: 0 6px 0 rgba(6, 45, 59, 0.35);
}
.t-pop { color: var(--sun-400); }

.cover-sub {
  font-size: clamp(1.05rem, 3.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--foam-50);
  opacity: 0.92;
}

.cover-hosts {
  font-size: 1rem;
  color: var(--aqua-300);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.cover-hosts .host-names { color: var(--foam-50); }

.cover-when {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
  padding: 14px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.date-badge {
  display: grid;
  place-items: center;
  width: 78px; height: 78px;
  border-radius: 18px;
  background: var(--coral-500);
  color: var(--foam-50);
  box-shadow: 0 8px 20px rgba(255, 93, 115, 0.45);
  flex: none;
}
.date-day { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.22em; }
.date-num { font-family: var(--font-head); font-size: 2rem; line-height: 1; }
.date-month { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; }

.cover-when-text { text-align: left; }
.cover-when-text p { line-height: 1.45; }
.event-date { font-weight: 800; }
.event-time { font-weight: 700; color: var(--sun-200); }
.event-place { font-size: 0.92rem; color: var(--foam-100); opacity: 0.9; }

/* ---------- 7. Details panel ---------- */
.panel-details {
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 201, 77, 0.5) 0, rgba(255, 201, 77, 0) 34%),
    radial-gradient(circle at 6% 92%, rgba(23, 195, 178, 0.35) 0, rgba(23, 195, 178, 0) 38%),
    var(--foam-50);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 2px dashed rgba(14, 90, 110, 0.18);
}
/* inner color-coded dashed frame — playful, non-AI look */
.detail-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed rgba(23, 195, 178, 0.35);
  border-radius: 14px;
  pointer-events: none;
}
.detail-card:nth-child(2)::before { border-color: rgba(255, 93, 115, 0.35); }
.detail-card:nth-child(3)::before { border-color: rgba(255, 201, 77, 0.35); }
.detail-card:nth-child(4)::before { border-color: rgba(14, 90, 110, 0.35); }

.ico {
  width: 40px; height: 40px;
  color: var(--aqua-500);
  margin-bottom: 10px;
}
/* icon badges — give icons a colorful pool noodle background */
.detail-card .ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  background: var(--foam-50);
  border: 2px dashed rgba(23, 195, 178, 0.4);
  border-radius: 12px;
  filter: none;
}
.detail-card:nth-child(2) .ico { border-color: rgba(255, 93, 115, 0.4); }
.detail-card:nth-child(3) .ico { border-color: rgba(255, 201, 77, 0.4); }
.detail-card:nth-child(4) .ico { border-color: rgba(14, 90, 110, 0.4); }
/* keep icon colors */
.detail-card:nth-child(2) .ico { color: var(--coral-500); }
.detail-card:nth-child(3) .ico { color: var(--sun-400); }
.detail-card:nth-child(4) .ico { color: var(--lagoon-700); }

/* hand-placed splashy tilt — pool floatie aesthetic */
.detail-card:nth-child(odd) { transform: rotate(-0.6deg); }
.detail-card:nth-child(even) { transform: rotate(0.6deg); }

/* droplet corner accent — water-themed */
.detail-card::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(23, 195, 178, 0.5) 0%, rgba(23, 195, 178, 0.2) 50%, transparent 70%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
}
.detail-card:nth-child(2)::after { background: radial-gradient(circle at 30% 30%, rgba(255, 93, 115, 0.5) 0%, rgba(255, 93, 115, 0.2) 50%, transparent 70%); }
.detail-card:nth-child(3)::after { background: radial-gradient(circle at 30% 30%, rgba(255, 201, 77, 0.5) 0%, rgba(255, 201, 77, 0.2) 50%, transparent 70%); }
.detail-card:nth-child(4)::after { background: radial-gradient(circle at 30% 30%, rgba(14, 90, 110, 0.5) 0%, rgba(14, 90, 110, 0.2) 50%, transparent 70%); }

.detail-title {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  color: var(--lagoon-700);
  margin-bottom: 8px;
}
.detail-main { font-weight: 800; color: var(--ink); }
.detail-sub { font-weight: 600; color: var(--lagoon-700); }
.detail-note { margin-top: 8px; font-size: 0.9rem; color: #55707a; }

.bring-list { margin-top: 8px; display: grid; gap: 6px; }
.bring-item {
  position: relative;
  padding-left: 28px;
  font-size: 0.92rem;
  color: var(--ink);
}
/* playful pool noodle rings instead of plain dots */
.bring-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0.35em;
  width: 14px; height: 14px;
  border: 2px dashed var(--aqua-300);
  border-radius: 50%;
  background: var(--foam-50);
}
.bring-item:nth-child(2)::before {
  border-color: var(--coral-300);
  background: #fff0f3;
}
.bring-item:nth-child(3)::before {
  border-color: var(--sun-400);
  background: #fff9e6;
}
.bring-item:nth-child(4)::before {
  border-color: var(--lagoon-700);
  background: var(--foam-100);
}

/* ---------- 7b. Optional official banner (Details panel) ----------
   Shows the event's own flyer/banner so guests confirm they're in the
   right place. Clicking opens it in the full-screen viewer. Hide it by
   deleting the .banner-wrap block or `display:none` on it. */
.banner-wrap { text-align: center; }
.banner-title {
  font-size: 1.7rem;
  color: var(--coral-500);
  margin-bottom: 12px;
}
.banner-card {
  position: relative;
  margin: 0;
  padding: 10px 10px 14px;
  background: #ffffff;
  border-radius: 18px;
  border: 2px dashed rgba(14, 90, 110, 0.18);
  transform: rotate(-0.7deg);
  box-shadow: var(--shadow-card);
  transition: transform var(--move-fast), box-shadow var(--move-fast);
}
html.js .banner-card:hover,
html.js .banner-card:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-lift); }
.banner-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}
/* the clickable wrapper keeps the whole card tappable (and the slot
   alive when the engine swaps the img for a <picture>) */
.banner-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 12px;
}
html.js .banner-open { cursor: zoom-in; }
.banner-open:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }
html.js .banner-card img { cursor: zoom-in; }
.banner-card img:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }
.banner-caption {
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lagoon-700);
}

.note-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff9e6 0%, #ffe9b8 100%);
  border: 2px dashed rgba(201, 138, 27, 0.3);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
/* sunny inner glow frame */
.note-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(255, 201, 77, 0.5);
  border-radius: 14px;
  pointer-events: none;
}
.ico-note {
  flex: none;
  margin: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed rgba(201, 138, 27, 0.4);
  border-radius: 10px;
}
.note-title {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: #7a5a12;
  margin-bottom: 4px;
}
.note-text { font-size: 0.92rem; color: #6b5518; }
.note-strong { font-weight: 700; color: #5c470e; }

.host-strip { text-align: center; }
.host-label { font-size: 1.6rem; color: var(--coral-500); margin-bottom: 8px; }
.host-list { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.host {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.host-avatar {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aqua-500), var(--lagoon-700));
  color: var(--foam-50);
  font-family: var(--font-head);
  font-size: 1.5rem;
  box-shadow: var(--shadow-lift);
  border: 3px solid var(--foam-50);
}
.host-avatar.avatar-alt { background: linear-gradient(135deg, var(--coral-500), #ff8fa0); }
.host-name { font-weight: 700; color: var(--ink); }

/* ---------- 8. RSVP panel ---------- */
.panel-rsvp {
  background:
    radial-gradient(circle at 12% 14%, rgba(23, 195, 178, 0.4) 0, rgba(23, 195, 178, 0) 34%),
    radial-gradient(circle at 90% 86%, rgba(255, 93, 115, 0.32) 0, rgba(255, 93, 115, 0) 36%),
    linear-gradient(180deg, var(--lagoon-700), var(--lagoon-900));
}

.rsvp-wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  width: min(640px, 92%);
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + var(--safe-b) + 28px);
}

/* The section also carries .rsvp-wrap as the platform's strip hook (so an
   RSVP-off render removes the whole panel, not just this inner wrapper).
   Neutralise the wrapper layout on the section itself — it must stay a
   full-bleed .panel scroll container; the inner .rsvp-wrap keeps the
   centered column. */
.panel.rsvp-wrap {
  width: auto;
  margin: 0;
  padding: 0;
  gap: 0;
  display: block;
  min-height: 0;
  justify-content: initial;
}

.rsvp-head { text-align: center; }
.rsvp-description,
.rsvp-deadline-note {
  margin-top: 12px;
  color: var(--foam-100);
  opacity: 0.92;
  font-size: 1rem;
}
.rsvp-deadline { color: var(--sun-400); font-weight: 700; }

/* optional countdown — hidden until the platform provides a deadline
   (main.js reveals it; never a row of zeros) */
.rsvp-countdown { text-align: center; }
.rsvp-countdown[hidden] { display: none; }
.countdown-label {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aqua-300);
  margin-bottom: 12px;
}
.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.count-box {
  display: grid;
  gap: 2px;
  place-items: center;
  min-width: 72px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  backdrop-filter: blur(6px);
}
.count-box span {
  font-family: var(--font-head);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--sun-400);
}
.count-box small {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foam-100);
  opacity: 0.85;
}

.rsvp-declined-note {
  text-align: center;
  font-weight: 700;
  color: var(--foam-100);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px 18px;
}

.rsvp-form {
  background: var(--foam-50);
  border-radius: 26px;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 18px;
}

.form-group { display: grid; gap: 7px; }
.form-group label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--lagoon-800);
}
.req { color: var(--coral-500); }
.opt-tag {
  font-weight: 600;
  font-size: 0.78rem;
  color: #6d8a94;
  background: var(--foam-100);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 6px;
}
.field-hint, .contact-hint { font-size: 0.83rem; color: #5c7a85; }
.contact-hint { margin-top: -6px; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  border: 2px solid #d3e6e1;
  border-radius: 14px;
  background: #ffffff;
  padding: 13px 15px;
  min-height: 50px;
  transition: border-color var(--move-fast), box-shadow var(--move-fast);
}
.form-group textarea { min-height: 84px; resize: vertical; }
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%230e5a6e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--aqua-500);
  box-shadow: 0 0 0 4px rgba(23, 195, 178, 0.22);
}

/* platform validation states */
.error {
  display: none;
  color: #d7263d;
  font-size: 0.84rem;
  font-weight: 600;
}
.error:not(:empty) { display: block; }
.form-group .has-error,
.form-group input.has-error,
.form-group select.has-error,
.form-group textarea.has-error {
  border-color: #d7263d;
  box-shadow: 0 0 0 4px rgba(215, 38, 61, 0.14);
}

.btn-submit {
  width: 100%;
  background: linear-gradient(120deg, var(--coral-500), #ff477e);
  color: var(--foam-50);
  margin-top: 4px;
}
.btn-submit:hover { background: linear-gradient(120deg, #ff6b80, #ff5d9c); }

.loading {
  display: none;
  text-align: center;
  font-weight: 700;
  color: var(--lagoon-700);
  padding: 8px 0;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  border-radius: 50%;
  border: 3px solid var(--aqua-300);
  border-top-color: var(--aqua-500);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 9. Guestbook panel ---------- */
.panel-guestbook {
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 201, 77, 0.4) 0, rgba(255, 201, 77, 0) 32%),
    linear-gradient(180deg, var(--lagoon-800), var(--lagoon-900));
}

.guestbook-section {
  min-height: 100%;
  width: min(640px, 92%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + var(--safe-b) + 28px);
}

/* Same strip-hook pattern as .panel.rsvp-wrap above: the section carries
   .guestbook-section so a guestbook-off render removes the whole panel;
   layout stays on the inner wrapper. */
.panel.guestbook-section {
  width: auto;
  margin: 0;
  padding: 0;
  gap: 0;
  display: block;
  min-height: 0;
  justify-content: initial;
}
.guestbook-head { text-align: center; }
.guestbook-description {
  margin-top: 10px;
  color: var(--foam-100);
  opacity: 0.9;
}

/* the platform injects its form + list into .guestbook-body — style it to match */
.guestbook-body {
  background: var(--foam-50);
  border-radius: 26px;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow-card);
}
.guestbook-body #guestbookForm { display: grid; gap: 14px; }
.guestbook-body input,
.guestbook-body textarea {
  width: 100%;
  border: 2px solid #d3e6e1;
  border-radius: 14px;
  background: #ffffff;
  padding: 13px 15px;
  font: inherit;
  color: inherit;
}
.guestbook-body input:focus,
.guestbook-body textarea:focus {
  outline: none;
  border-color: var(--aqua-500);
  box-shadow: 0 0 0 4px rgba(23, 195, 178, 0.22);
}
.guestbook-body button[type="submit"] {
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  min-height: 50px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--foam-50);
  background: linear-gradient(120deg, var(--aqua-500), var(--lagoon-700));
  cursor: pointer;
}
.guestbook-body .error:not(:empty) { display: block; }

.guestbook-wrap { display: grid; gap: 14px; margin-top: 20px; }
.guestbook-entry {
  background: #ffffff;
  border: 1px solid #d3e6e1;
  border-radius: 16px;
  padding: 16px 18px;
}
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  color: var(--lagoon-800);
}
.guestbook-entry p { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink); }
.guestbook-entry small { color: #6d8a94; font-size: 0.8rem; }

.more-guestbook-wrap { text-align: center; margin-top: 18px; }
#load-more {
  border: 2px solid var(--aqua-500);
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 700;
  color: var(--lagoon-700);
  background: #ffffff;
  cursor: pointer;
}

/* ---------- 9b. Gallery panel (optional party photos + video) ---------- */
.panel-gallery {
  background:
    radial-gradient(circle at 90% 10%, rgba(23, 195, 178, 0.3) 0, rgba(23, 195, 178, 0) 34%),
    radial-gradient(circle at 8% 92%, rgba(255, 201, 77, 0.4) 0, rgba(255, 201, 77, 0) 36%),
    var(--foam-50);
}

.gallery-wrap {
  min-height: 100%;
  width: min(860px, 94%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + var(--safe-b) + 28px);
}
.gallery-head { text-align: center; }
.gallery-description {
  margin-top: 10px;
  color: #55707a;
  font-size: 0.98rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
/* safety: never show an empty grid if every photo is removed */
.gallery-grid:empty { display: none; }

.gallery-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.gallery-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-card);
  transition: transform var(--move-fast), box-shadow var(--move-fast);
}
/* hand-placed playful tilt, matching the detail cards */
.gallery-item:nth-child(odd) .gallery-photo { transform: rotate(-0.8deg); }
.gallery-item:nth-child(even) .gallery-photo { transform: rotate(0.8deg); }
html.js .gallery-item:hover .gallery-photo,
html.js .gallery-item:focus-within .gallery-photo {
  transform: rotate(0deg) scale(1.03);
  box-shadow: var(--shadow-lift);
}
html.js .gallery-photo { cursor: zoom-in; }
.gallery-photo:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }

/* small "view full size" badge on hover / keyboard focus — shows a photo
   is clickable. Purely visual; without JS it never appears. */
html.js .gallery-item::after {
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(247, 255, 253, 0.94)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a4353' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  border: 1px solid rgba(10, 67, 83, 0.15);
  box-shadow: 0 4px 12px -4px rgba(6, 45, 59, 0.5);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity var(--move-fast), transform var(--move-fast);
  pointer-events: none;
}
html.js .gallery-item:hover::after,
html.js .gallery-item:focus-within::after { opacity: 1; transform: none; }

.gallery-caption {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lagoon-700);
  background: #ffffff;
  border: 2px dashed rgba(14, 90, 110, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  text-align: center;
}

/* ---------- 9b2. Free page (optional host-defined page) ----------
   Repeatable .free-block cards: a free title, free text and an OPTIONAL
   photo (a block renders as title + text without its photo — the engine
   drops the img when the host leaves it blank and the :has() rule below
   removes the whole figure). Leaving every block empty removes the whole
   page (and its pill) at render; main.js drops the pill when the panel
   is gone. */
.panel-free {
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 201, 77, 0.45) 0, rgba(255, 201, 77, 0) 34%),
    radial-gradient(circle at 6% 94%, rgba(23, 195, 178, 0.32) 0, rgba(23, 195, 178, 0) 36%),
    var(--foam-50);
}

.free-wrap {
  min-height: 100%;
  width: min(860px, 94%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(var(--nav-h) + var(--safe-b) + 28px);
}
.free-blocks {
  display: grid;
  gap: 22px;
}
.free-block {
  padding: clamp(24px, 4vw, 38px);
  background: #ffffff;
  border: 1px solid rgba(14, 90, 110, 0.14);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.free-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--lagoon-900);
}
.free-content {
  margin: 12px auto 0;
  max-width: 52ch;
  color: #55707a;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;              /* host line breaks are kept */
}
.free-figure {
  margin: 18px auto 0;
  max-width: 560px;
}
.free-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-card);
}
/* a block with no photo (the engine removed its img) drops the whole
   figure — caption and frame included, so no floating caption is left */
.free-figure:not(:has(img)) { display: none; }
html.js .free-figure img { cursor: zoom-in; }
.free-cap {
  margin: 10px 0 0;
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--coral-500);
}

/* ---------- 9c. Optional party video (aftermovie card, Gallery panel) ----------
   Hidden by default; main.js reveals it only when data-video-embed holds
   a URL. Clicking plays it full-screen in the viewer. Hide it by deleting
   the .video-card block, leaving data-video-embed empty, or `display:none`
   on .video-card. */
.video-card { text-align: center; }
.video-card[hidden] { display: none; }
.video-title {
  font-size: 1.7rem;
  color: var(--coral-500);
  margin-bottom: 12px;
}
.video-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--lagoon-800);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--move-fast), box-shadow var(--move-fast);
}
.video-open:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.video-open:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }
.video-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* A photo whose file is missing entirely (even the shipped placeholder art)
   hides its <img> so the button/panel shows the on-palette tile + caption
   instead of a broken-image icon (see main.js initPhotoFallback). */
img.is-broken { display: none; }
/* poster file missing → soft gradient tile (still clickable, still plays) */
.video-open.video-open-plain {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: linear-gradient(135deg, var(--lagoon-700), var(--lagoon-900));
}
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(247, 255, 253, 0.95);
  color: var(--lagoon-800);
  font-size: 26px;
  padding-left: 5px;              /* optical centering of ▶ */
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(6, 45, 59, 0.45);
  transition: transform var(--move-fast);
}
.video-open:hover .video-play { transform: translate(-50%, -50%) scale(1.08); }
.video-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--foam-50);
  background: rgba(6, 45, 59, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.video-hint { margin: 12px 0 0; font-size: 0.85rem; color: #55707a; }

/* ---------- 9d. Footer (brand placeholder) ----------
   Tucked into the last panel that survives by main.js; the platform fills
   .footer-brand. */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px dashed rgba(14, 90, 110, 0.3);
}
.app-footer p { margin: 0; font-size: 0.85rem; color: #55707a; }
.footer-brand {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral-500);
}
/* the footer can land on the dark RSVP/Guestbook panels too — keep it legible */
.panel-rsvp .app-footer,
.panel-guestbook .app-footer,
.panel-free .app-footer { border-top-color: rgba(255, 255, 255, 0.16); }
.panel-rsvp .app-footer p,
.panel-guestbook .app-footer p,
.panel-free .app-footer p { color: var(--foam-100); opacity: 0.75; }
.panel-rsvp .footer-brand,
.panel-guestbook .footer-brand,
.panel-free .footer-brand { color: var(--sun-400); }
.shell-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--aqua-500);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--lagoon-700), inset 0 0 0 4px var(--sun-400);
}

/* ---------- 9e. Powered-by brand strip (full width) ----------
   A slim "Powered by Kundangi" line that reads at the end of the
   invitation. main.js tucks it into the last panel that survives, like
   the .app-footer; the engine swaps the literal Kundangi token inside
   .link-footer for the app name at render. This strip is STATIC platform
   HTML — never registered as a morph/field, so it stays unbound.
   Full-bleed across the viewport even after it is tucked inside a
   centred panel wrapper. */
.powered-by {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 26px;
  padding: 14px 16px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--lagoon-900);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(247, 255, 253, 0.62);
}
.powered-by .link-footer { color: var(--sun-400); }

/* ---------- 10. Navigation chrome (text-labelled pills) ----------
   Built by main.js from the panels that survive platform processing.
   Labels are short section names so the nav reads clearly; on narrow
   phones the bar scrolls horizontally instead of shrinking the pills. */
.panel-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 20px);
  padding: 6px;
  background: rgba(6, 45, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(6, 45, 59, 0.45);
  overflow-x: auto;               /* many sections → swipe, never clipped */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav[hidden] { display: none; }

.panel-nav button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;               /* comfortable touch target */
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--foam-100);
  opacity: 0.82;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--move-fast), background var(--move-fast), box-shadow var(--move-fast), opacity var(--move-fast);
}
.panel-nav button:hover { opacity: 1; color: var(--foam-50); }
.panel-nav button.is-current {
  opacity: 1;
  background: var(--coral-500);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--coral-deep);
}
.panel-nav button:focus-visible { outline: 2px solid var(--sun-400); outline-offset: 2px; }
.panel-nav .nav-label { white-space: nowrap; }

/* ---------- 10a. Mobile prev/next section arrows ----------
   The pill bar swipes horizontally on narrow screens; these icon buttons
   give an explicit previous/next control too (same wrap-around behaviour
   as the arrow keys). Armed by main.js only when 2+ panels exist and
   shown on narrow screens only — the pill bar stays the primary
   navigation everywhere. */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;                        /* below the photo viewer (z 100) */
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(6, 45, 59, 0.82);
  color: var(--foam-50);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(6, 45, 59, 0.45);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--move-fast), background var(--move-fast);
}
.nav-arrow:hover { transform: translateY(-50%) scale(1.06); background: var(--lagoon-700); }
.nav-arrow:focus-visible { outline: 2px solid var(--sun-400); outline-offset: 2px; }
.nav-arrow--prev { left: calc(10px + env(safe-area-inset-left)); }
.nav-arrow--next { right: calc(10px + env(safe-area-inset-right)); }
@media (max-width: 640px) {
  .nav-arrow:not([hidden]) { display: flex; }
}

/* ---------- 10b. Full-screen photo & video viewer (lightbox) ----------
   Markup built by main.js only while a [data-lightbox] or
   [data-video-open] slot exists, so hiding a media feature never leaves
   orphaned UI. */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(6, 45, 59, 0.93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.photo-viewer.is-open { display: flex; }
.photo-viewer figure {
  margin: 0;
  max-width: min(92vw, 960px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  width: auto;
  height: auto;
  border: 6px solid var(--foam-50);
  border-radius: 16px;
  background: var(--lagoon-800); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.75);
}
.photo-viewer figcaption {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--foam-100);
}
.photo-viewer .pv-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(72vw, 520px);
  height: min(46vh, 360px);
  border: 6px solid var(--foam-50);
  border-radius: 16px;
  background: var(--lagoon-800);
  color: var(--foam-100);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.pv-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: var(--foam-50);
  color: var(--lagoon-800);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  transition: transform var(--move-fast), background var(--move-fast);
}
.pv-btn:hover { transform: scale(1.06); background: #ffffff; }
.pv-close { top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
.pv-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.pv-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.photo-viewer :focus-visible { outline: 2px solid var(--sun-400); outline-offset: 3px; }

/* video mode inside the viewer (opened from the video card) */
.pv-video {
  display: none;
  width: 100%;
  max-width: min(94vw, 940px);
}
.photo-viewer.is-video .pv-video { display: block; }
.photo-viewer.is-video figure { display: none; }
.photo-viewer.is-video .pv-prev,
.photo-viewer.is-video .pv-next { display: none; }
.pv-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 6px solid var(--foam-50);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.75);
}

/* Narrow screens: prev/next drop below the photo so they never cover it. */
@media (max-width: 520px) {
  .photo-viewer { flex-direction: column; gap: 10px; }
  .photo-viewer img { max-height: 62vh; max-height: 62dvh; }
  .pv-prev, .pv-next { position: static; transform: none; }
  .pv-prev:hover, .pv-next:hover { transform: scale(1.06); }
  .pv-prev, .pv-next { width: 40px; height: 40px; }
  .photo-viewer figure { flex: 1 1 auto; justify-content: center; }
  .photo-viewer .pv-close { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
}

/* ---------- 11. No-JS fallback: stacked panels ---------- */
.no-js .invite-shell { height: auto; overflow: visible; }
.no-js .panel {
  position: static;
  visibility: visible;
  opacity: 1;
  transform: none;
  overflow: visible;
  min-height: 100vh;
  min-height: 100dvh;
}
.no-js .panel-nav { display: none; }
.no-js .skip-link { display: none; }
.no-js .cover-content { pointer-events: auto; }

/* ---------- 12. Responsive tweaks ---------- */
@media (max-width: 560px) {
  .detail-grid { grid-template-columns: 1fr; }
  .cover-when { flex-direction: row; gap: 14px; padding: 12px 14px; }
  .date-badge { width: 64px; height: 64px; }
  .floatie { top: 8vh; width: 30vw; }
}

@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 420px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (max-height: 640px) {
  .cover-title { font-size: clamp(2.6rem, 13vw, 4.4rem); }
  .panel-pad, .rsvp-wrap, .guestbook-section, .gallery-wrap, .free-wrap { justify-content: flex-start; }
}

/* ---------- 13. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .panel { transition: none; }
  .floatie, .sun-glow, .droplet, .btn-next, .cover-photo { animation: none; }
  .btn:hover { transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 14. Print: show every panel, one page each ---------- */
@page { margin: 12mm; }

@media print {
  .invite-shell {
    height: auto;
    overflow: visible;
    display: block;
  }
  .panel {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    overflow: visible;
    min-height: 0;
    height: auto;
    page-break-after: always;
    break-after: page;
  }
  .panel.active { transition: none; }
  .panel-pad, .rsvp-wrap, .guestbook-section, .gallery-wrap, .free-wrap {
    justify-content: flex-start;
    width: 100%;
    padding: 0;
  }
  .panel-nav, .skip-link, .floatie, .droplet, .cover-photo-cap, .nav-arrow { display: none !important; }
  .cover-content { justify-content: center; min-height: 88vh; }
  .btn { box-shadow: none; }
  body { background: #ffffff; }
  .cover-title { text-shadow: none; }
  .panel-cover, .panel-rsvp, .panel-guestbook { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* cover photo prints as a framed hero, not a full-page bleed */
  .cover-photo-frame { position: relative; height: 320px; margin-bottom: 24px; border-radius: 16px; overflow: hidden; }
  .gallery-item, .banner-card, .video-card, .free-block { page-break-inside: avoid; }
  .photo-viewer { display: none !important; }
}
