/* ==========================================================
   Invitation engine — functional base shared by every template.
   Themes override everything visual through their own theme.css.
   ========================================================== */

/* Numbers everywhere: CMU Serif (Computer Modern) */
@font-face {
  font-family: 'VS Numbers';
  src: url('../../fonts/cmu-serif-500-roman.woff2') format('woff2');
  font-weight: 300 600; font-style: normal; font-display: swap;
  unicode-range: U+0024, U+0025, U+002B, U+0030-0039, U+00A3, U+00D7, U+2013, U+20AC;
}
@font-face {
  font-family: 'VS Numbers';
  src: url('../../fonts/cmu-serif-700-roman.woff2') format('woff2');
  font-weight: 700 900; font-style: normal; font-display: swap;
  unicode-range: U+0024, U+0025, U+002B, U+0030-0039, U+00A3, U+00D7, U+2013, U+20AC;
}
@font-face {
  font-family: 'VS Numbers';
  src: url('../../fonts/cmu-serif-500-italic.woff2') format('woff2');
  font-weight: 300 900; font-style: italic; font-display: swap;
  unicode-range: U+0024, U+0025, U+002B, U+0030-0039, U+00A3, U+00D7, U+2013, U+20AC;
}
/* CMU has no rupee sign: keep it on EB Garamond */
@font-face {
  font-family: 'VS Numbers';
  src: url('../../fonts/eb-garamond.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+20B9;
}
@font-face {
  font-family: 'VS Numbers';
  src: url('../../fonts/eb-garamond-italic.woff2') format('woff2');
  font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+20B9;
}

.vx {
  --col: min(100vw, 480px);
  --vx-bg: #12101c;
  --vx-ink: #f5ecdc;
  --vx-accent: #d8b97f;
  --vx-accent-ink: #1a1326;
  --vx-line: rgba(216, 185, 127, 0.35);
  --vx-field-bg: #fff;
  --vx-field-ink: #2d241c;
  --vx-display: 'VS Numbers', 'Cormorant Garamond', serif;
  --vx-body: 'VS Numbers', 'Jost', sans-serif;
  margin: 0;
  background: var(--vx-bg);
  color: var(--vx-ink);
  font: 300 16px/1.7 var(--vx-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  font-variant-numeric: lining-nums proportional-nums;
}
:where(.vx) *, :where(.vx) *::before, :where(.vx) *::after { box-sizing: border-box; }
:where(.vx) :is(img, video, canvas, svg) { max-width: 100%; display: block; }
:where(.vx) a { color: inherit; text-decoration: none; }
:where(.vx) button { font: inherit; color: inherit; cursor: pointer; }
.vx [hidden] { display: none !important; }
.vx .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.vx.is-locked { overflow: hidden; }

/* The invitation column (phone-width on desktop, full width on phones) */
.vx-col { position: relative; z-index: 1; width: var(--col); margin: 0 auto; overflow: clip; }
.vx-fixed { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--col); transform: translateX(-50%); }

/* ---------- Loader ---------- */
.vx-loader { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--col); transform: translateX(-50%); z-index: 90; display: grid; place-content: center; justify-items: center; gap: 22px; text-align: center; padding: 30px; background: var(--vx-bg); }
.vx-loader-mono { margin: 0; font: 400 3.4rem/1 var(--vx-display); color: var(--vx-accent); }
.vx-loader-line { width: 150px; height: 1px; background: var(--vx-line); overflow: hidden; }
.vx-loader-line span { display: block; height: 100%; background: var(--vx-accent); transform: scaleX(0); transform-origin: left; }
.vx-loader-text { margin: 0; font: italic 300 1.05rem var(--vx-display); opacity: 0.8; }

/* ---------- Buttons ---------- */
.vx-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 26px; border-radius: 999px; border: 1px solid var(--vx-accent); background: var(--vx-accent); color: var(--vx-accent-ink); font: 500 0.7rem/1 var(--vx-body); letter-spacing: 0.22em; text-transform: uppercase; transition: transform 0.4s, background 0.4s, color 0.4s; }
.vx-btn:hover { transform: translateY(-2px); }
.vx-btn--ghost { background: transparent; color: var(--vx-accent); }
.vx-btn--full { width: 100%; }
.vx-btn[disabled] { opacity: 0.7; pointer-events: none; }
.vx-btn.is-busy .arrow { display: inline-block; animation: vx-spin 0.9s linear infinite; }
@keyframes vx-spin { to { transform: rotate(360deg); } }

/* ---------- Countdown ---------- */
.vx-countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vx-unit { text-align: center; padding: 16px 4px 12px; border: 1px solid var(--vx-line); border-radius: 14px; }
.vx-unit b { display: block; font: 400 2.3rem/1 var(--vx-display); color: var(--vx-accent); overflow: hidden; }
.vx-unit > span { display: block; margin-top: 8px; font-size: 0.56rem; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.75; }

/* ---------- Scratch to reveal ---------- */
.vx-scratch { position: relative; width: min(100%, 320px); aspect-ratio: 1.45; margin: 0 auto; border-radius: 18px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.vx-scratch-content { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 16px; }
.vx-scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.vx-scratch-hint { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; pointer-events: none; color: rgba(40, 28, 10, 0.75); transition: opacity 0.6s; }
.vx-scratch.is-done .vx-scratch-hint { opacity: 0; }

/* ---------- Map, share, QR ---------- */
.vx-map { height: 230px; margin: 0 0 18px; border-radius: 18px; overflow: hidden; border: 1px solid var(--vx-line); background: rgba(0, 0, 0, 0.15); }
.vx-map iframe { width: 100%; height: 100%; border: 0; }
.lenis.lenis-smooth .vx-map iframe { pointer-events: auto; }
.vx-share { text-align: center; }
.vx-qr { width: 132px; height: 132px; margin: 26px auto 10px; padding: 10px; border-radius: 14px; background: #fff; }
.vx-qr svg { width: 100%; height: 100%; }
.vx-share small { font-size: 0.78rem; opacity: 0.65; }
.vx-credit { display: inline-flex; align-items: center; gap: 10px; margin-top: 46px; font-size: 0.7rem; letter-spacing: 0.14em; opacity: 0.7; }
.vx-credit img { width: 24px; }

/* ---------- RSVP ---------- */
.vx-rsvp { display: grid; gap: 14px; text-align: left; }
.vx-rsvp .field { display: grid; gap: 7px; }
.vx-rsvp .field > span, .vx-choices legend, .vx-checks legend { font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--vx-accent); }
.vx-rsvp input:not([type=radio]):not([type=checkbox]), .vx-rsvp select, .vx-rsvp textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--vx-line); border-radius: 12px; background: var(--vx-field-bg); color: var(--vx-field-ink); font: 300 1rem/1.4 var(--vx-body); }
.vx-rsvp input:focus, .vx-rsvp select:focus, .vx-rsvp textarea:focus { outline: none; border-color: var(--vx-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--vx-accent) 25%, transparent); }
.vx-rsvp .field.is-invalid input { border-color: #b24a4a; }
.vx-choices, .vx-checks { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.vx-choices { grid-template-columns: repeat(3, 1fr); }
.vx-checks { grid-template-columns: 1fr 1fr; }
.vx-choices legend, .vx-checks legend { margin-bottom: 8px; }
.vx-choices label, .vx-checks label { position: relative; cursor: pointer; }
.vx-choices input, .vx-checks input { position: absolute; opacity: 0; }
.vx-choices label > span { display: grid; place-items: center; min-height: 58px; height: 100%; padding: 8px; border: 1px solid var(--vx-line); border-radius: 14px; background: var(--vx-field-bg); color: var(--vx-field-ink); font-size: 0.82rem; line-height: 1.25; text-align: center; transition: all 0.35s; }
.vx-choices input:checked + span { background: var(--vx-accent); border-color: var(--vx-accent); color: var(--vx-accent-ink); }
.vx-checks label > span { display: block; padding: 10px 12px; border: 1px solid var(--vx-line); border-radius: 999px; background: var(--vx-field-bg); color: var(--vx-field-ink); font-size: 0.8rem; text-align: center; transition: all 0.3s; }
.vx-checks input:checked + span { border-color: var(--vx-accent); box-shadow: inset 0 0 0 1px var(--vx-accent); }
.vx-choices input:focus-visible + span, .vx-checks input:focus-visible + span { outline: 2px solid var(--vx-accent); outline-offset: 2px; }
.vx-if-yes { display: grid; gap: 14px; }
.vx-thanks { text-align: center; padding: 10px 0; }
.vx-thanks-title { margin: 0 0 8px; font: 400 2.6rem/1 var(--vx-display); color: var(--vx-accent); }

/* ---------- Floating controls ---------- */
.vx-ui { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--col); transform: translateX(-50%); z-index: 40; pointer-events: none; opacity: 0; visibility: hidden; }
.vx-ui > * { pointer-events: auto; }
.vx-music { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(12, 10, 22, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.vx-music svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vx-music circle { fill: currentColor; }
.vx-music-slash { opacity: 0; stroke-width: 2.4; }
.vx-music[aria-pressed='false'] .vx-music-slash { opacity: 1; }
.vx-music[aria-pressed='true'] svg { animation: vx-note 1.6s ease-in-out infinite; }
.vx-music-label { font: 600 0.74rem/1 var(--vx-body); letter-spacing: 0.04em; }
@keyframes vx-note { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-1px); } }
/* "Keep scrolling" cue, bottom centre */
.vx-cue { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; justify-items: center; padding: 8px 16px 6px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; background: rgba(12, 10, 22, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; opacity: 0; visibility: hidden; transition: bottom 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vx-cue span { font: 600 0.74rem/1.2 var(--vx-body); letter-spacing: 0.06em; white-space: nowrap; }
.vx-cue i { width: 9px; height: 9px; margin-top: -2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); animation: vx-cue 1.4s ease-in-out infinite; }
.vx-cue i:last-child { animation-delay: 0.18s; opacity: 0.6; }
@keyframes vx-cue { 0%, 100% { transform: translateY(-2px) rotate(45deg); } 50% { transform: translateY(4px) rotate(45deg); } }
.vx-ui.has-dock .vx-cue { bottom: calc(76px + env(safe-area-inset-bottom)); }
.vx-dock { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translate(-50%, 160%); display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: rgba(10, 8, 18, 0.62); backdrop-filter: blur(14px); border: 1px solid var(--vx-line); transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vx-dock.is-visible { transform: translate(-50%, 0); }
.vx-dock a { padding: 10px 14px; border-radius: 999px; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.86); white-space: nowrap; }
.vx-dock a.is-rsvp { background: var(--vx-accent); color: var(--vx-accent-ink); }

/* ---------- Particles & shader canvases ---------- */
.vx-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Toasts (same system as the main site) ---------- */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: grid; gap: 12px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast { position: relative; display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: start; padding: 18px 18px 20px; border-radius: 16px; background: rgba(251, 247, 240, 0.97); backdrop-filter: blur(12px); border: 1px solid rgba(168, 132, 79, 0.28); box-shadow: 0 24px 60px -24px rgba(42, 27, 44, 0.5); overflow: hidden; pointer-events: auto; color: #3a2a1f; font-family: 'VS Numbers', 'Jost', sans-serif; }
.toast-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.toast-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.toast-icon path { stroke-dasharray: 30; stroke-dashoffset: 30; }
.toast--success .toast-icon, .toast--success .toast-timer { background: #4f8a5b; }
.toast--error .toast-icon, .toast--error .toast-timer { background: #b24a4a; }
.toast--info .toast-icon, .toast--info .toast-timer { background: #a8844f; }
.toast-title { margin: 2px 0; font: 500 1.2rem/1.25 'VS Numbers', 'Cormorant Garamond', serif; }
.toast-msg { margin: 0; font-size: 0.9rem; line-height: 1.5; color: #6d5b4c; }
.toast-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: #6d5b4c; padding: 0 2px; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; }

/* ---------- Gallery + viewer ---------- */
.vx-gallery { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 132px; grid-auto-flow: dense; gap: 8px; margin: 0 0 22px; }
.vx-gallery-item { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, 0.08); cursor: zoom-in; }
.vx-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vx-gallery-item:hover img { transform: scale(1.06); }
.vx-gallery-item--0 { grid-row: span 2; }
.vx-gallery-item--3 { grid-column: span 2; }
.vx-viewer { position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: 1fr auto; background: rgba(8, 6, 14, 0.94); color: #fff; }
.vx-viewer[hidden] { display: none; }
.vx-viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 64px 12px 10px; overflow: hidden; }
.vx-viewer-stage img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.vx-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); }
.vx-viewer-bar p { margin: 0; flex: 1; text-align: center; font: 500 1rem/1.4 var(--vx-body); }
.vx-viewer button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.3rem; line-height: 1; }
.vx-viewer-close { position: absolute; top: 12px; right: 12px; }

/* ---------- Program timeline ---------- */
.vx-program { margin: 0 0 26px; text-align: left; }
.vx-program-title { margin: 0 0 14px; text-align: center; font: 500 1.55rem/1.2 var(--vx-display); color: var(--vx-program-title, var(--vx-accent)); }
.vx-program-date { display: table; margin: 6px 0 12px; padding: 6px 14px; border-radius: 999px; background: var(--vx-accent); color: var(--vx-accent-ink); font: 700 0.86rem/1.2 var(--vx-body); letter-spacing: 0.02em; }
.vx-program-list { position: relative; list-style: none; margin: 0 0 14px; padding: 0 0 0 24px; }
.vx-program-list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--vx-line); }
.vx-program-item { position: relative; display: grid; gap: 5px; margin: 0 0 12px; }
.vx-program-item::before { content: ''; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--vx-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--vx-accent) 25%, transparent); }
.vx-program-time { font: 700 1rem/1.2 var(--vx-body); color: var(--vx-program-time, var(--vx-accent)); }
.vx-program-card { padding: 12px 14px; border-radius: 14px; background: var(--vx-card, #fffdf8); color: var(--vx-card-ink, #2b2230); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.45); }
.vx-program-card h4 { margin: 0 0 3px; font: 700 1.08rem/1.3 var(--vx-body); }
.vx-program-card p { margin: 0; font: 400 1rem/1.5 var(--vx-body); }
.vx-program-card .vx-program-place { margin-bottom: 2px; font-weight: 600; font-size: 0.9rem; opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
  .vx-music svg, .vx-cue i { animation: none; }
}
