/* "See what your guests see": the button in the hero, and the live demo that opens over the page.
   The demo is a native <dialog>, built by demo.js on first open, so the visitor never leaves the page.
   Everything is prefixed ad- so it can't clash with the page's own styles. */

/* ---------- The button: a softer second button with a tiny live phone ---------- */
.peek {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  background: transparent; color: inherit; border: 1.5px solid rgba(255, 250, 243, .4); border-radius: 999px;
  padding: 7px 20px 7px 7px; font: 600 16px/1.1 var(--body); text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.peek:hover { border-color: var(--off-white); background: rgba(255, 250, 243, .06); }
.peek:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.peek__phone { position: relative; width: 34px; height: 44px; border-radius: 8px; background: var(--off-white); padding: 3px; flex: none; overflow: hidden; }
.peek__phone i { display: block; width: 100%; height: 100%; border-radius: 5px; background: center/cover url("img/demo/peek-register.jpg"); animation: ad-peek 6s infinite; }
.peek small { display: block; font-weight: 400; font-size: 13px; opacity: .7; margin-top: 2px; }
@keyframes ad-peek {
  0%, 30% { background-image: url("img/demo/peek-register.jpg"); }
  33%, 63% { background-image: url("img/demo/peek-cheer-close.jpg"); }
  66%, 100% { background-image: url("img/demo/peek-confetti-couple.jpg"); }
}
[data-variant="cloud-nine"] .peek { border-color: rgba(23, 23, 23, .28); background: rgba(255, 255, 255, .55); }
[data-variant="cloud-nine"] .peek:hover { border-color: var(--ink); background: #fff; }
[data-variant="cloud-nine"] .peek:focus-visible { outline-color: var(--ink); }
[data-variant="cloud-nine"] .peek__phone { background: var(--ink); }
[data-variant="cloud-nine"] .hero .peek { margin-top: 14px; }
@media (max-width: 900px) {
  .hero__ctas .peek { width: 100%; justify-content: center; }
  [data-variant="cloud-nine"] .page-hero .hero__ctas { gap: 12px; }
  [data-variant="after-party"] .page-hero .hero__ctas { gap: 14px; }
}

/* ---------- The dialog ---------- */
dialog.ad {
  --ad-bg: #222120; --ad-text: #FFFAF3; --ad-muted: rgba(255, 250, 243, .72); --ad-line: rgba(255, 250, 243, .14);
  --ad-soft: rgba(255, 250, 243, .08); --ad-accent: #FEEA9A; --ad-hi: #F797E9; --ad-bar: #171717;
  width: min(1080px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px);
  margin: auto; padding: 0; border: 0; border-radius: 32px;
  background: var(--ad-bg); color: var(--ad-text); font: 400 17px/1.5 var(--body);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6); overflow: hidden;
}
[data-variant="cloud-nine"] dialog.ad {
  --ad-bg: #FFFAF3; --ad-text: #171717; --ad-muted: #5E5952; --ad-line: rgba(23, 23, 23, .16);
  --ad-soft: rgba(23, 23, 23, .06); --ad-accent: #171717; --ad-hi: #171717; --ad-bar: #FFFAF3;
  background-image: radial-gradient(ellipse 50% 220px at 12% 0, rgba(180, 212, 234, .75), transparent 70%), radial-gradient(ellipse 45% 200px at 70% 0, rgba(255, 210, 238, .7), transparent 70%);
  box-shadow: 0 40px 120px rgba(90, 120, 150, .35);
}
dialog.ad::backdrop { background: rgba(10, 10, 10, .62); backdrop-filter: blur(6px); }
[data-variant="cloud-nine"] dialog.ad::backdrop { background: rgba(40, 60, 80, .35); }
dialog.ad[open] { animation: ad-rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes ad-rise { from { transform: translateY(24px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
/* Resets carry no extra weight (:where), so the demo's own classes below always win. */
:where(dialog.ad) *, :where(dialog.ad) *::before, :where(dialog.ad) *::after { box-sizing: border-box; }
:where(dialog.ad) img { display: block; max-width: 100%; }
:where(dialog.ad) button { font: inherit; color: inherit; cursor: pointer; }
:where(dialog.ad) p { margin: 0; }
:where(dialog.ad) h2, :where(dialog.ad) h3 { font-family: var(--head); font-weight: 900; line-height: .98; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
dialog.ad :focus-visible { outline: 2px solid var(--ad-accent); outline-offset: 3px; }

.ad-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "phone side" "phone cta"; column-gap: 48px; row-gap: 22px; align-content: center; padding: 36px 48px 36px 40px; max-height: calc(100dvh - 48px); overflow: auto; }
.ad-close { position: absolute; top: 18px; right: 18px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: var(--ad-soft); padding: 10px 16px; font-size: 14px !important; font-weight: 600 !important; }
.ad-close:hover { background: var(--ad-line); }

.ad-side { grid-area: side; align-self: end; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 440px; }
.ad-kicker { font: 600 13px/1 var(--mono, ui-monospace, Menlo, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--ad-accent); }
[data-variant="cloud-nine"] .ad-kicker { font: 600 12.5px/1.2 var(--body); letter-spacing: .22em; }
.ad-side h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.ad-side h2 em { font-style: normal; color: var(--ad-hi); }
[data-variant="cloud-nine"] .ad-side h2 { font-weight: 400; }
[data-variant="cloud-nine"] .ad-side h2 em { font-weight: 900; }
.ad-side > p { color: var(--ad-muted); font-size: 17px; }
.ad-seg { display: inline-flex; background: var(--ad-soft); border-radius: 999px; padding: 4px; align-self: flex-start; }
.ad-seg button { border: 0; background: transparent; border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 600; color: var(--ad-muted); }
.ad-seg button[aria-pressed="true"] { background: var(--ad-text); color: var(--ad-bg); }
.ad-looks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--ad-muted); }
.ad-look { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--ad-line); background: transparent; border-radius: 999px; padding: 7px 14px 7px 8px; font-size: 14px; font-weight: 600; }
.ad-look i { width: 18px; height: 18px; border-radius: 50%; display: block; }
.ad-look[aria-pressed="true"] { border-color: var(--ad-text); }
.ad-hint { font-size: 13px; color: var(--ad-muted); display: flex; align-items: center; gap: 8px; }
.ad-hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6BD48E; box-shadow: 0 0 0 4px rgba(107, 212, 142, .2); }
.ad-cta { grid-area: cta; align-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ad-cta .btn { cursor: pointer; }
.ad-cta .ad-fine { font-size: 14px; color: var(--ad-muted); }

/* ---------- The phone and the guest page inside it ---------- */
.ad-phone { grid-area: phone; width: 340px; height: 690px; border-radius: 48px; background: #0d0d0d; padding: 10px; box-shadow: 0 30px 70px rgba(0, 0, 0, .45), inset 0 0 0 1.5px #333; flex: none; }
.ad-screen {
  --g-bg: #171717; --g-surface: #222120; --g-text: #FFFAF3; --g-muted: rgba(255, 250, 243, .64);
  --g-primary: #FEEA9A; --g-on-primary: #171717; --g-line: rgba(255, 250, 243, .14); --g-accent: #F797E9;
  position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden;
  background: var(--g-bg); color: var(--g-text); font-size: 15px; line-height: 1.45; text-align: left;
}
.ad-screen[data-look="cloud"] {
  --g-bg: #FFFAF3; --g-surface: #FFFFFF; --g-text: #171717; --g-muted: #6B655D;
  --g-primary: #171717; --g-on-primary: #FFFAF3; --g-line: rgba(90, 130, 170, .18); --g-accent: #B4D4EA;
  background-image: radial-gradient(ellipse 70% 120px at 20% 0, rgba(180, 212, 234, .7), transparent 70%), radial-gradient(ellipse 60% 110px at 85% 0, rgba(255, 210, 238, .7), transparent 70%);
}
.ad-view { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; padding-bottom: 28px; }
.ad-view::-webkit-scrollbar { display: none; }
.ad-view[hidden] { display: none !important; }
.ad-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 10px; }
.ad-bar img { width: 52px; }
.ad-screen:not([data-look="cloud"]) .ad-bar img { filter: invert(1); }
.ad-bar button { border: 0; background: var(--g-surface); color: var(--g-text); width: 34px; height: 34px; border-radius: 50%; font-size: 17px; display: grid; place-items: center; }
.ad-bar h3 { font-size: 18px; font-weight: 700; white-space: nowrap; }
.ad-tag { font: 700 10px/1 var(--mono, ui-monospace, Menlo, monospace); letter-spacing: .14em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: var(--g-accent); color: #171717; white-space: nowrap; }

.ad-cover { position: relative; margin: 0 14px; height: 210px; border-radius: 22px; overflow: hidden; }
.ad-cover img { width: 100%; height: 100%; object-fit: cover; }
.ad-screen:not([data-look="cloud"]) .ad-cover { border-radius: 4px; background: #fff; padding: 7px 7px 26px; transform: rotate(-1.5deg); height: 230px; box-shadow: 0 16px 30px rgba(0, 0, 0, .5); }
.ad-screen:not([data-look="cloud"]) .ad-cover::after { content: "'26 06 14"; position: absolute; right: 16px; bottom: 34px; font: 600 11px/1 var(--mono, ui-monospace, Menlo, monospace); color: #FFB547; text-shadow: 0 0 6px rgba(255, 140, 40, .6); }
.ad-screen[data-look="cloud"] .ad-cover { border-radius: 999px 999px 22px 22px; margin: 0 40px; height: 230px; }
.ad-who { text-align: center; padding: 16px 22px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad-who h2 { font-size: 28px; }
.ad-screen[data-look="cloud"] .ad-who h2 { font-weight: 400; }
.ad-screen[data-look="cloud"] .ad-who h2 b { font-weight: 900; }
.ad-date { font: 600 12px/1 var(--mono, ui-monospace, Menlo, monospace); letter-spacing: .12em; color: var(--g-primary); border: 1.5px solid currentColor; padding: 5px 8px; border-radius: 4px; }
.ad-screen[data-look="cloud"] .ad-date { font: 600 11px/1.2 var(--body); letter-spacing: .2em; text-transform: uppercase; border: 0; padding: 0; color: var(--g-muted); }
.ad-who p { color: var(--g-muted); font-size: 14px; max-width: 30ch; }
.ad-actions { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 0; }
.ad-g-btn { border: 0; border-radius: 999px; padding: 15px 18px; font-weight: 600; font-size: 15px; background: var(--g-primary); color: var(--g-on-primary) !important; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ad-g-btn--ghost { background: transparent; color: var(--g-text) !important; box-shadow: inset 0 0 0 1.5px var(--g-line); }
.ad-g-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--g-text); }

.ad-album-head { padding: 0 18px 12px; }
.ad-album-head p { color: var(--g-muted); font-size: 13px; }
.ad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
.ad-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; overflow: hidden; background: var(--g-surface); max-width: 100%; }
.ad-tile img { width: 100%; height: 100%; object-fit: cover; }
.ad-tile.is-new { animation: ad-pop .5s ease; }
.ad-tile.is-new::after { content: "Just now"; position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; background: var(--g-primary); color: var(--g-on-primary); padding: 3px 6px; border-radius: 999px; }
@keyframes ad-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.ad-viewer { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; z-index: 4; }
.ad-viewer[hidden] { display: none; }
.ad-viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.ad-viewer__bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: #FFFAF3; font-size: 14px; }
.ad-viewer__bar button { border: 0; background: rgba(255, 255, 255, .14); color: #fff !important; border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.ad-heart.on { background: #F797E9 !important; color: #171717 !important; }

.ad-notes { display: flex; flex-direction: column; gap: 10px; padding: 0 14px; }
.ad-card { background: var(--g-surface); border-radius: 18px; padding: 14px 16px; box-shadow: 0 0 0 1px var(--g-line); }
.ad-card b { display: block; font-size: 13px; margin-bottom: 4px; }
.ad-card p { font-size: 14px; }
.ad-card small { color: var(--g-muted); font-size: 12px; }
.ad-card--voice { display: flex; align-items: center; gap: 12px; }
.ad-wave { flex: 1; height: 22px; background: repeating-linear-gradient(90deg, var(--g-text) 0 2px, transparent 2px 5px); opacity: .5; border-radius: 2px; clip-path: polygon(0 40%, 8% 10%, 16% 60%, 24% 20%, 32% 70%, 40% 0, 48% 50%, 56% 15%, 64% 80%, 72% 30%, 80% 60%, 88% 20%, 100% 50%, 100% 100%, 0 100%); }
.ad-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--g-primary); color: var(--g-on-primary) !important; flex: none; }

.ad-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 12px; }
.ad-stat { background: var(--g-surface); border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: 0 0 0 1px var(--g-line); }
.ad-stat b { display: block; font: 900 20px/1 var(--head); font-variant-numeric: tabular-nums; }
.ad-stat span { font-size: 10.5px; color: var(--g-muted); }
.ad-host-actions { display: flex; gap: 8px; padding: 0 14px 12px; }
.ad-host-actions .ad-g-btn { flex: 1; padding: 12px 10px; font-size: 14px; }
.ad-chips { display: flex; gap: 6px; padding: 0 14px 12px; overflow-x: auto; scrollbar-width: none; }
.ad-chips span { flex: none; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--g-line); color: var(--g-muted); }
.ad-chips span:first-child { background: var(--g-text); color: var(--g-bg); box-shadow: none; }

.ad-show { position: absolute; inset: 0; background: #000; z-index: 4; display: grid; }
.ad-show[hidden] { display: none; }
.ad-show img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.ad-show img.on { opacity: 1; }
.ad-show__cap { grid-area: 1 / 1; align-self: end; padding: 60px 18px 26px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #FFFAF3; font-size: 14px; display: flex; justify-content: space-between; align-items: end; }
.ad-show__cap button { border: 0; background: rgba(255, 255, 255, .16); color: #fff !important; border-radius: 999px; padding: 8px 14px; font-weight: 600; }

.ad-toast { position: absolute; left: 14px; right: 14px; bottom: 18px; z-index: 6; background: var(--g-text); color: var(--g-bg); border-radius: 16px; padding: 12px 14px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); transition: transform .3s ease, opacity .3s ease; }
.ad-toast[hidden] { display: flex !important; transform: translateY(20px); opacity: 0; pointer-events: none; }

/* ---------- Phone width: a full-screen sheet, with the button always in reach ---------- */
@media (max-width: 760px) {
  dialog.ad { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
  dialog.ad[open] { animation: ad-sheet .34s cubic-bezier(.2, .8, .2, 1); }
  @keyframes ad-sheet { from { transform: translateY(100%); } to { transform: none; } }
  .ad-inner { display: flex; flex-direction: column; gap: 0; height: 100dvh; max-height: none; padding: 0; overflow: hidden; }
  .ad-side { order: -1; max-width: none; gap: 10px; padding: calc(14px + env(safe-area-inset-top, 0px)) 68px 10px max(16px, env(safe-area-inset-left, 0px)); }
  .ad-side .ad-kicker, .ad-side h2, .ad-side > p, .ad-hint, .ad-looks .ad-label { display: none; }
  .ad-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 16px !important; }
  .ad-close span { display: none; }
  .ad-seg button { padding: 10px 14px; font-size: 14px; }
  .ad-phone { flex: 1; width: 100%; height: auto; min-height: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
  .ad-screen { border-radius: 0; }
  .ad-cta { position: relative; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--ad-bar); border-top: 1px solid var(--ad-line); }
  .ad-cta .btn { padding: 15px 22px; font-size: 16px; white-space: nowrap; flex: none; }
  .ad-cta .ad-fine { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .peek__phone i, dialog.ad[open], .ad-tile.is-new { animation: none !important; }
  .ad-show img, .ad-toast { transition: none !important; }
}
