/* ============================================================================
   "Backstage Pass" — Fan Invitation Card · Konser / Music category (Kundangan)
   assets/css/styles.css

   Design language: matte-black premium card with holographic foil. Where the
   gig poster shouts, this one leans in — chrome accents, a foil-gradient
   palette (violet → cyan → pink → gold), and a personalized backstage pass
   as the hero. Mobile-first; 100dvh app shell with internally-scrolling
   panels.

   Customize: edit the :root palette, the --font-display stack, and the
   section blocks below. Everything is plain CSS — no build step.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Palette — tune these to re-theme the whole card */
  --bg-0:   #0c0c12;            /* page black */
  --bg-1:   #16161f;            /* panel black */
  --ink:    #f4f2fa;            /* headline ink */
  --muted:  #9a95ad;            /* secondary text */
  --violet: #a78bfa;            /* accent: electric violet */
  --cyan:   #67e8f9;            /* accent: ice cyan */
  --pink:   #f472b6;            /* accent: neon pink */
  --gold:   #fbbf24;            /* accent: foil gold */
  --line:   rgba(255, 255, 255, .13);

  --font-display: Impact, Haettenschweiler, "Arial Narrow Bold",
                  "Franklin Gothic Bold", "Arial Black", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --radius: 16px;
}

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

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;               /* the .app shell owns the viewport */
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .btn, .kicker, .flash-badge, .count-cell span, .stub-title,
.pass-heading, .pass-holder, .pass-foot, .event-title, .closing-title,
.lineup-rank, .artist-time {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .01em;
}

p { overflow-wrap: break-word; }

/* Accessible focus */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
.panel h1:focus, .panel h2:focus, .panel h3:focus { outline: none; }

/* Foil-gradient text (closing headline) */
.foil-text {
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan), var(--violet), var(--gold));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil 8s linear infinite;
}
@supports not (-webkit-background-clip: text) {
  .foil-text { color: var(--violet); background: none; -webkit-text-fill-color: initial; }
}

/* ── App shell (single-viewport) ─────────────────────────────────────────── */
.app {
  position: relative;
  height: 100vh;                  /* fallback for older browsers */
  height: 100dvh;                 /* real mobile viewport */
  overflow: hidden;
}

.stage { position: absolute; inset: 0; }

.panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-y: auto;               /* ONLY the active panel scrolls */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .32s ease, transform .32s ease, visibility .32s ease;
  background:
    radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(circle at 12% 8%, rgba(167, 139, 250, .14), transparent 44%),
    radial-gradient(circle at 90% 92%, rgba(103, 232, 249, .10), transparent 46%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }

.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  z-index: 2;
}

.panel-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(20px, 4.5vh, 44px) clamp(18px, 5vw, 30px) 128px; /* bottom clears the nav */
}

/* ── Buttons & chips ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 14px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-color: rgba(255, 255, 255, .65);
  color: #fff;
  box-shadow: 0 10px 26px rgba(167, 139, 250, .35);
}
.btn-primary:hover { filter: brightness(1.12); }

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .5);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-block { width: 100%; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .06);
}
.chip .star { color: var(--gold); }
.chip-date  { border-color: var(--pink); }
.chip-venue { border-color: var(--cyan); }

/* ── Cover / the pass ─────────────────────────────────────────────────────── */
/* Static occasion line above the pass — hides with the whole cover-top when
   every editable line is empty (no gap left behind). */
.cover-occasion {
  margin: 0;
}
.cover-top:empty,
.pass-event:empty,
.closing-meta:empty {
  display: none;
}

.cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  min-height: 100%;
}

.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.event-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.event-brand b { color: var(--pink); }

.flash-badge {
  font-size: 11px;
  letter-spacing: .14em;
  padding: 7px 12px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .7);
  border-radius: 6px;
  transform: rotate(3deg);
  box-shadow: 0 6px 18px rgba(167, 139, 250, .4);
  white-space: nowrap;
}

.guest-greeting {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
  text-shadow: 0 2px 16px rgba(251, 191, 36, .3);
}

/* The pass card */
.pass {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(330px, 84vw);
}

.pass-strap {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  margin-bottom: -6px;
}
.pass-clip {
  width: 34px;
  height: 18px;
  border-radius: 9px;
  border: 2px solid rgba(255, 255, 255, .55);
  background: linear-gradient(180deg, #3a3a46, #232330);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .35);
}
.pass-lanyard {
  width: 16px;
  height: 52px;
  background: repeating-linear-gradient(45deg, var(--violet) 0 6px, var(--pink) 6px 12px);
  box-shadow: inset -3px 0 6px rgba(0, 0, 0, .35);
}

.pass-card {
  position: relative;
  width: 100%;
  padding: 0 20px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1d1d28, #14141c);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pass-foil {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--pink), var(--gold), var(--violet));
  background-size: 200% 100%;
  animation: foil 6s linear infinite;
}
@keyframes foil { to { background-position: -200% 0; } }

.pass-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 20px 0 4px;
  margin-top: 9px;
}
.pass-heading {
  font-size: 21px;
  letter-spacing: .12em;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil 8s linear infinite;
}
.pass-year {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--muted);
}

.pass-photo-wrap {
  margin: 12px 0 12px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--violet), var(--cyan), var(--pink));
}
.pass-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid #12121a;
  cursor: zoom-in;
  transition: filter .15s ease;
}
.pass-photo-wrap:hover .pass-photo { filter: brightness(1.1); }

.pass-holder {
  margin: 0;
  font-size: 22px;
  letter-spacing: .06em;
  line-height: 1.1;
  color: var(--ink);
}
.pass-role {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--violet);
  font-weight: 800;
}

.pass-event {
  width: 100%;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 255, 255, .28);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}
.event-title {
  display: block;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--ink);
}
.event-meta {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.pass-barcode {
  width: 100%;
  height: 30px;
  margin-top: 14px;
  opacity: .85;
  background:
    repeating-linear-gradient(90deg,
      var(--ink) 0 2px, transparent 2px 4px,
      var(--ink) 4px 5px, transparent 5px 8px,
      var(--ink) 8px 11px, transparent 11px 13px,
      var(--ink) 13px 14px, transparent 14px 18px);
}

.pass-foot {
  margin: 12px 0 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
}

/* ── Panel headers ────────────────────────────────────────────────────────── */
.panel-head { margin-bottom: 26px; }

.kicker {
  display: inline-block;
  padding: 5px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--violet);
  border: 1.5px solid rgba(167, 139, 250, .4);
  border-radius: 999px;
}

.panel-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1.04;
}

.panel-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
}

/* ── The vibe ─────────────────────────────────────────────────────────────── */
.vibe-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vibe-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  transition: border-color .15s ease, transform .15s ease;
}
.vibe-card:hover { border-color: var(--violet); transform: translateX(4px); }

.vibe-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  color: #101018;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  box-shadow: 0 6px 16px rgba(244, 114, 182, .3);
}
.vibe-card:nth-child(2) .vibe-icon { background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.vibe-card:nth-child(3) .vibe-icon { background: linear-gradient(135deg, var(--violet), var(--gold)); }

.vibe-title {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .05em;
}
.vibe-text { margin: 0; font-size: 14px; line-height: 1.55; color: #d5d1e6; }

/* Link from the vibe panel into the gallery */
.vibe-to-gallery { margin: 20px 0 0; text-align: center; }
.gallery-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(251, 191, 36, .45);
  padding-bottom: 3px;
  transition: border-color .15s ease, color .15s ease;
}
.gallery-link:hover { color: var(--pink); border-color: var(--pink); }

/* ── Photo gallery ────────────────────────────────────────────────────────── */
/* Photo grid: 2 columns; each photo keeps a fixed crop ratio
   (3:4 portrait tiles, 16:9 wide tiles). The tile sizes follow the
   image, so photos are cropped cleanly instead of stretched. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gallery-item {
  margin: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
}
.gallery-item--wide {
  grid-column: 1 / -1;
}
.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform .35s ease;
}
.gallery-item--wide .gallery-thumb img { aspect-ratio: 16 / 9; }
.gallery-item:hover .gallery-thumb img { transform: scale(1.05); }
.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 26px 12px 10px;
  background: linear-gradient(transparent, rgba(8, 8, 12, .88));
}
.gallery-caption {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.gallery-tag {
  flex: none;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  color: #101018;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  border-radius: 999px;
  padding: 3px 8px;
}

/* ── Photo lightbox (built by main.js on first open) ─────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 10, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  touch-action: none; /* the viewer owns all gestures while open */
}
.photo-lightbox.is-open { opacity: 1; pointer-events: auto; }

.lb-stage {
  position: relative;
  max-width: min(92vw, 600px);
  max-height: 82dvh;
}
.lb-stage img {
  display: block;
  width: 100%;
  max-height: 82dvh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  cursor: zoom-in;
  transition: transform .18s ease;
}
.photo-lightbox.is-zoomed .lb-stage img { transition: none; cursor: grab; }
.photo-lightbox.is-zoomed .lb-stage img:active { cursor: grabbing; }
.photo-lightbox.is-zoomed .lb-caption { display: none; }
.lb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 34px 16px 12px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent, rgba(8, 8, 12, .9));
}
.lb-text { font-size: 14px; font-weight: 700; color: #fff; }
.lb-count {
  flex: none;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}

.lb-btn {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(18, 18, 26, .8);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.lb-btn:hover { background: var(--violet); }
.lb-close {
  top: max(calc(env(safe-area-inset-top, 0px) + 14px), 16px);
  right: max(calc(env(safe-area-inset-right, 0px) + 14px), 16px);
}
.lb-zoom {
  top: max(calc(env(safe-area-inset-top, 0px) + 14px), 16px);
  left: max(calc(env(safe-area-inset-left, 0px) + 14px), 16px);
  font-size: 20px;
  font-weight: 700;
}
.lb-zoom.is-zoomed { background: var(--violet); color: #fff; }
.lb-prev { left: max(calc(env(safe-area-inset-left, 0px) + 12px), 12px); top: 50%; transform: translateY(-50%); }
.lb-next { right: max(calc(env(safe-area-inset-right, 0px) + 12px), 12px); top: 50%; transform: translateY(-50%); }

body.lb-lock { overflow: hidden; }

.fine-print {
  margin: 22px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ── Optional official flyer / banner (Details panel) ─────────────────────
   A framed slot for hosts who already have a designed poster or banner for
   the event. Shown in FULL (object-fit: contain — never cropped, so a
   portrait flyer or a wide banner both read correctly). Clicking it opens
   the full-screen viewer like any other photo. Delete the block to hide. */
.banner-flyer {
  margin: 28px auto 0;
  max-width: 380px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  max-height: min(62vh, 520px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(160deg, #1d1d28, #14141c);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
  cursor: zoom-in;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.banner-flyer img:hover { border-color: var(--pink); box-shadow: 0 22px 48px rgba(0, 0, 0, .5), 0 0 0 1px rgba(244, 114, 182, .35); }
.banner-flyer figcaption {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

/* ── Optional film feature (Gallery panel) — video URL embed ──────────────
   A poster + play button that lazy-loads an <iframe> from the URL in
   data-video-url (YouTube / Vimeo / any embeddable URL). Nothing loads
   until the guest taps play — fast, and consent-friendly. With no URL it
   shows a gentle hint instead of a dead button. Delete the block to hide. */
.film-card {
  margin-top: 30px;
  text-align: center;
}
.film-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gold);
}
.film-frame {
  position: relative;
  width: 100%;
  margin: 14px auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #10101a;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.film-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.film-open:hover img { transform: scale(1.04); }
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(54px, 12vmin, 72px);
  height: clamp(54px, 12vmin, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #101018;
  background: radial-gradient(circle at 32% 28%, #fff, var(--gold) 55%, var(--pink));
  border: 1.5px solid rgba(255, 255, 255, .7);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform .2s ease;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play { transform: translate(-50%, -50%) scale(1.08); }
.film-open:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 14px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(12, 12, 18, .6);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  background: #10101a;
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 191, 36, .45);
  padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease;
}
.film-external:hover { color: var(--pink); border-color: var(--pink); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(0, 0, 0, .55), 0 0 0 0 rgba(251, 191, 36, .4); }
  50% { box-shadow: 0 12px 28px rgba(0, 0, 0, .55), 0 0 0 14px rgba(251, 191, 36, 0); }
}

/* ── Details / meta list ──────────────────────────────────────────────────── */
.meta-list {
  margin: 0;
  display: grid;
  gap: 10px;
}
.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}
.meta-label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}
.meta-value { font-size: 15px; font-weight: 600; text-align: right; }

/* Guest-list stub with punched notches */
.ticket-stub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 22px;
  border: 2px dashed rgba(255, 255, 255, .3);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(167, 139, 250, .12), rgba(103, 232, 249, .08)),
    var(--bg-1);
  -webkit-mask:
    radial-gradient(circle 10px at 0 50%, transparent 9px, #000 10px) left,
    radial-gradient(circle 10px at 100% 50%, transparent 9px, #000 10px) right;
  -webkit-mask-size: 51% 100%;
  -webkit-mask-repeat: no-repeat;
  mask:
    radial-gradient(circle 10px at 0 50%, transparent 9px, #000 10px) left,
    radial-gradient(circle 10px at 100% 50%, transparent 9px, #000 10px) right;
  mask-size: 51% 100%;
  mask-repeat: no-repeat;
}
.stub-body { flex: 1; min-width: 220px; }
.stub-top {
  display: block;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 6px;
}
.stub-title {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.stub-sub { font-size: 13px; color: var(--muted); }

/* ── RSVP ─────────────────────────────────────────────────────────────────── */
.rsvp-form-display {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.form-group label small { text-transform: none; letter-spacing: 0; font-weight: 500; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(12, 12, 18, .55);
  color: var(--ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .2);
}
input::placeholder, textarea::placeholder { color: rgba(244, 242, 250, .32); }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.error {
  display: block;
  color: #ff8fbb;
  font-size: 12px;
  margin-top: 6px;
  min-height: 1em;
}

.form-hint {
  margin: -4px 0 16px;
  font-size: 12px;
  color: var(--muted);
}
.form-hint em { color: var(--cyan); font-style: normal; font-weight: 700; }

.rsvp-note {
  display: none;
  margin: -6px 0 14px;
  font-size: 13px;
  font-weight: 700;
}
.rsvp-note-yes { color: var(--gold); }
.rsvp-note-no  { color: var(--muted); }
.rsvp-form-display.is-declining .rsvp-note-yes { display: none; }
.rsvp-form-display.is-declining .rsvp-note-no  { display: block; }
.rsvp-form-display.is-declining .form-group--guests { opacity: .45; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; gap: 14px; }
}

.loading {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}

/* RSVP deadline countdown */
.rsvp-countdown {
  text-align: center;
  margin: 0 0 22px;
}
.countdown-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.countdown-cells { display: flex; justify-content: center; gap: 10px; }
.count-cell {
  min-width: 66px;
  padding: 12px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.count-cell span {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  color: var(--violet);
}
.count-cell small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Guestbook (styling the platform-injected markup) ─────────────────────── */
.guestbook-body .guestbook-form {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
#guestbookForm { margin: 0; }
#guestbookForm .form-group label { margin-bottom: 8px; }
#guestbookForm input, #guestbookForm textarea { margin-bottom: 0; }

.guestbook-chapta {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

/* Injected form uses utility classes — match the theme */
.d-flex { display: flex; justify-content: center; }
.badge-pill { border-radius: 999px; }
.bg-kundangan { background: linear-gradient(90deg, var(--violet), var(--pink)); border-color: rgba(255, 255, 255, .65); color: #fff; box-shadow: 0 10px 26px rgba(167, 139, 250, .35); }
.bg-kundangan:hover { filter: brightness(1.12); }
.text-white { color: #fff; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.mt-2 { margin-top: .5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-inline-flex { display: inline-flex; }
.ph { vertical-align: middle; }

.guestbook-wrap {
  display: block;
  border-top-color: var(--line) !important;
  margin-top: 22px !important;
}
.guestbook-entry {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-size: 16px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.guestbook-entry p { margin: 0 0 4px; color: #d5d1e6; }
.guestbook-entry small { color: var(--muted); font-size: 12px; }

.loading-guestbook {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}
.more-guestbook-wrap { text-align: center; margin-top: 16px; }
#load-more {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
#load-more:hover { border-color: var(--gold); color: var(--gold); }

/* Platform "thank you / closed" state injected into #rsvp-form */
.thank-you-message h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 26px;
  margin: 0 0 10px;
  color: var(--gold);
}
.thank-you-message p { color: var(--ink); }
.thank-you-message small { color: var(--muted); }

/* ── Closing ──────────────────────────────────────────────────────────────── */
.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  min-height: 100%;
}
.closing-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.04;
}
.closing-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.socials {
  margin: 0;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ── Optional free page (Halaman Bebas) ────────────────────────────────
   A host-written page of repeatable free blocks — each with a free
   title, free text and an OPTIONAL photo (clicking it opens the same
   full-screen viewer). The cockpit's Free Page group fills .free-blocks;
   leave it empty (or toggle the section off) to hide the whole page —
   and with it the nav tab main.js builds. To reorder the page among the
   tabs, move the .panel-free <section> in index.html — the tab bar
   follows DOM order. */
.free-blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.free-block {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}
.free-title {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: .05em;
  color: var(--ink);
}
.free-title:focus { outline: none; }
.free-content {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #d5d1e6;
}
.free-figure {
  margin: 16px 0 0;
  text-align: center;
}
.free-figure:not(:has(img)) { display: none; } /* no-photo fallback (engine removes the figure too) */
.free-figure img {
  display: block;
  width: 100%;
  max-height: min(56vh, 460px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(160deg, #1d1d28, #14141c);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
  cursor: zoom-in;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.free-figure img:hover { border-color: var(--pink); box-shadow: 0 22px 48px rgba(0, 0, 0, .5), 0 0 0 1px rgba(244, 114, 182, .35); }
.free-cap {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

/* ── Floating navigation: prev / labeled tabs / next ─────────────────────── */
.panel-nav {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 20px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(18, 18, 26, .78);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-arrow {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.nav-arrow:hover { background: var(--violet); }
.nav-arrow:disabled { opacity: .3; cursor: default; }

/* Labeled tabs — text chips, horizontally scrollable so every label stays
   reachable on small phones. Built by main.js from the panels that exist. */
.nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 2px;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  flex: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  scroll-snap-align: center;
}
.nav-tab:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.nav-tab.is-active {
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-color: rgba(255, 255, 255, .65);
  color: #fff;
  box-shadow: 0 6px 18px rgba(167, 139, 250, .35);
}
.nav-tab:active { transform: translateY(1px) scale(.98); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.sr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Brand footer placeholder ──────────────────────────────────────────────
   Written after </main> so it survives the no-JS stacked document. With JS,
   initFooter() tucks it into the last panel that actually exists — it reads
   as the closing brand line and survives RSVP/Guestbook being stripped. */
.app-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-brand {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.15em;
  text-transform: none;
  letter-spacing: .02em;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Powered-by brand strip (full width) ──────────────────────────────
   A slim full-width line above the bottom tabs: "Powered by Kundangi".
   The engine swaps the brand token for the platform name at render; the
   cockpit's Free Powered By field can override the whole line. Lives
   inside .app (absolute), pinned just above the floating nav bar. */
.powered-by {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
  z-index: 29;
  text-align: center;
  padding: 6px 16px 8px;
  border-top: 1px solid var(--line);
  background: rgba(12, 12, 18, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.powered-by .link-footer { color: var(--gold); }

/* ── Small / short screens ────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .chip { font-size: 12px; padding: 8px 12px; }
  .pass { width: 90vw; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .cover-wrap { gap: 10px; }
  .pass-photo-wrap { width: 72px; height: 72px; margin: 8px 0; }
  .pass { width: min(280px, 60vw); }
  .pass-lanyard { height: 34px; }
}

/* ── Reduced motion: honour user preference ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .panel { transform: none; }
  .vibe-card:hover { transform: none; }
  .gallery-item:hover .gallery-thumb img { transform: none; }
  .film-open:hover img { transform: none; }
  .film-play { animation: none; }
  .lb-stage img { transform: none !important; }
}

/* ── Print: turn the shell into a flowable card set ───────────────────────── */
@media print {
  :root { color-scheme: light; }
  @page { size: A4 portrait; margin: 10mm; }

  body { background: #fff !important; overflow: visible; }
  .app { height: auto; overflow: visible; }
  .stage { position: static; }

  .panel {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none;
    overflow: visible;
    height: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff !important;
  }
  .panel.is-active { z-index: auto; }
  .panel-inner { max-width: none; padding: 18px; }

  .panel-nav { display: none !important; }
  .powered-by { display: none !important; }
  .pass-strap { display: none !important; }
  .photo-lightbox { display: none !important; }
  .film-frame iframe { display: none !important; } /* a playing video can't print — the poster prints instead */
  .film-note { display: none !important; }
  .film-hint { display: none !important; }

  * { color: #111 !important; text-shadow: none !important; -webkit-text-stroke-color: #111 !important; }
  .outline { color: transparent; -webkit-text-stroke: 1.4px #111; }
  .foil-text, .pass-heading {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #111 !important;
  }

  .pass-card { background: #f6f6f6 !important; border-color: #999 !important; box-shadow: none !important; }
  .pass-photo { border-color: #ccc !important; }
  .pass-barcode { background-image: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px, #111 8px 11px, transparent 11px 13px, #111 13px 14px, transparent 14px 18px) !important; }

  .btn, #load-more {
    background: #fff !important;
    border-color: #111 !important;
    color: #111 !important;
    box-shadow: none !important;
  }
  .chip, .meta-item, .vibe-card, .ticket-stub, .rsvp-form-display, .guestbook-body .guestbook-form {
    background: #f4f4f4 !important;
    border-color: #999 !important;
  }
  .banner-flyer img, .film-frame { background: #f4f4f4 !important; border-color: #999 !important; }
  .app-footer { border-top-color: #999 !important; }
  .footer-brand-name {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #111 !important;
  }
  .gallery-item { border-color: #999 !important; }
  .gallery-item figcaption { background: #f4f4f4 !important; }
  .gallery-caption { color: #111 !important; text-shadow: none; }
  .gallery-tag { color: #fff !important; }
  .cover-wrap, .closing { min-height: auto; justify-content: flex-start; }
  input, select, textarea { background: #fff !important; border-color: #666 !important; color: #111 !important; }
}
