/* Shared by website-scroll and website-flip. Built by tools/build_site_v2.py (edit here, not in the output). */
:root {
  --maroon: #7a1a24;
  --maroon-d: #5c111b;
  --gold: #c99a3e;
  --gold-l: #ecc97f;
  --ink: #4e2418;
  --paper: #fbf2e6;
  --line: #d9bb8c;
  --col: 700px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--ink);
  background: #f1dfcf radial-gradient(ellipse 120% 70% at 50% 0%, #fff7ee 0%, #f6e4d3 45%, #ecd2bd 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.script { font-family: "Great Vibes", cursive; font-weight: 400; color: var(--maroon); line-height: 1.1; }

/* ---------- pages ---------- */
/* a page: the picture in a 9:16 frame; around the frame (phone edges), a soft blurred copy of the same picture */
.pg { position: relative; container-type: inline-size; background: var(--paper) var(--fill, none) center / cover no-repeat; }
.frame { position: relative; aspect-ratio: 9 / 16; overflow: hidden; }
.art { position: relative; aspect-ratio: var(--ar); }
.frame .art { position: absolute; top: 0; left: 50%; height: 100%; transform: translateX(-50%); }
.art > img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.shade { display: none; }

/* behind everything on wider screens: the current page, softly blurred */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop i {
  position: absolute; inset: -60px; background: center / cover no-repeat; opacity: 0; transition: opacity 1.1s ease;
  filter: blur(26px) saturate(1.08); transform: scale(1.08);
}
.backdrop i.on { opacity: .92; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255, 248, 238, .1), rgba(60, 22, 12, .22)); }

/* opening screen while the first picture loads */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #fffaf2 0%, #f8ead9 55%, #efd6bf 100%); transition: opacity .7s ease, visibility .7s;
}
.splash.gone { opacity: 0; visibility: hidden; }
.sp-ring {
  width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px;
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7.5px rgba(201, 154, 62, .55), 0 10px 30px rgba(122, 26, 36, .15);
  animation: ring-in 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.sp-ring .script { font-size: 58px; line-height: 1; }
.sp-ring em { font-style: normal; font-size: 30px; margin: 0 2px; color: var(--gold); }
.sp-names { font-size: 46px; margin: 0; animation: rise .9s .25s ease both; }
.sp-date { margin: 0; letter-spacing: .3em; color: var(--maroon); font-size: 15px; animation: rise .9s .4s ease both; }
.sp-line { width: 120px; height: 2px; margin-top: 18px; background: rgba(201, 154, 62, .25); overflow: hidden; border-radius: 2px; }
.sp-line i { display: block; width: 40%; height: 100%; background: var(--gold); animation: load 1.2s ease-in-out infinite; }
@keyframes ring-in { from { transform: scale(.7) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* petals that burst from the button when an RSVP is sent */
.burst { position: fixed; z-index: 70; width: 0; height: 0; pointer-events: none; }
.burst i {
  position: absolute; left: -6px; top: -4px; width: 12px; height: 8px; border-radius: 80% 10% 80% 10%;
  animation: burst 1.6s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 140px)) rotate(var(--r)); opacity: 0; }
}

/* invisible tap areas over the buttons drawn into the pictures */
.hot {
  position: absolute; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  border-radius: 26px; transition: background-color .2s;
}
.hot:hover { background-color: rgba(255, 236, 200, .14); }
.hot:active { background-color: rgba(255, 228, 180, .3); box-shadow: inset 0 0 0 2px rgba(214, 170, 82, .8); }
.hot:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.hot-open { border-radius: 44px; }
.hot-open::before {
  content: ""; position: absolute; left: 3%; right: 7%; top: 4%; height: 48%; border-radius: 999px;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(236, 201, 127, .8); }
  70% { box-shadow: 0 0 0 18px rgba(236, 201, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(236, 201, 127, 0); }
}

/* ---------- music button ---------- */
.music {
  position: fixed; z-index: 40; right: max(14px, calc(50vw - var(--col) / 2 + 14px));
  bottom: calc(16px + env(safe-area-inset-bottom)); width: 50px; height: 50px; border-radius: 50%;
  border: 1.5px solid var(--gold-l); background: rgba(122, 26, 36, .94); color: #fbe7c0; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(70, 15, 20, .35);
}
.music:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.music .bars { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.music .bars i { display: block; width: 3px; height: 6px; background: currentColor; border-radius: 2px; }
.music.on .bars i { animation: eq .9s ease-in-out infinite alternate; }
.music.on .bars i:nth-child(2) { animation-delay: -.3s; }
.music.on .bars i:nth-child(3) { animation-delay: -.6s; }
.music.on .bars i:nth-child(4) { animation-delay: -.15s; }
.music:not(.on)::after {
  content: ""; position: absolute; width: 28px; height: 2px; background: #fbe7c0; transform: rotate(-45deg); border-radius: 2px;
}
@keyframes eq { from { height: 4px; } to { height: 18px; } }

/* ---------- overlays: event details and gallery ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px;
  background: rgba(40, 12, 10, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.card {
  position: relative; width: min(100%, 460px); background: var(--paper); border-radius: 22px; padding: 34px 26px 28px;
  text-align: center; box-shadow: 0 24px 60px rgba(40, 10, 10, .35); border: 1.5px solid var(--line);
  background-image: radial-gradient(ellipse at 50% 0%, #fffaf2, var(--paper) 70%);
}
.card::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(201, 154, 62, .45); border-radius: 16px; pointer-events: none; }
.card h3 { font-size: 46px; margin: 0 0 6px; }
.card .when { font-size: 17px; letter-spacing: .14em; text-transform: uppercase; color: var(--maroon); margin: 0 0 4px; font-weight: 600; }
.card .time { font-size: 18px; font-style: italic; margin: 0 0 14px; }
.card .venue { font-size: 18px; line-height: 1.5; margin: 0 0 18px; }
.card .venue b { color: var(--maroon); font-weight: 700; }
.card .soon { font-style: italic; margin: 8px 0 14px; }
.x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--maroon); font-size: 28px; line-height: 1; cursor: pointer; z-index: 2;
}
.x:focus-visible { outline: 3px solid var(--gold); }

.lightbox { background: rgba(20, 6, 6, .88); padding: 0; }
.lb-figure { margin: 0; display: grid; place-items: center; width: 100%; height: 100%; touch-action: pan-y; }
.lb-figure img { max-width: min(92vw, 760px); max-height: 78vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); border: 6px solid #fff; }
.lightbox .x { color: #fbe7c0; top: 14px; right: 14px; position: fixed; }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 240, 210, .5);
  background: rgba(122, 26, 36, .75); color: #fbe7c0; font-size: 26px; cursor: pointer;
}
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-count { position: fixed; bottom: 22px; left: 0; right: 0; text-align: center; color: #fbe7c0; letter-spacing: .2em; font-size: 14px; }

/* ---------- RSVP page: your picture's top and bottom, a real form between ---------- */
.pg-rsvp { background: var(--paper); }
.rsvp-scroll { background: var(--paper) url("assets/img/rsvp-band.webp") repeat-y center top / 100% auto; }
.rsvp-top { width: 100%; height: auto; }
.rsvp-bottom { width: 100%; height: auto; margin-top: -4%; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%); mask-image: linear-gradient(to bottom, transparent, #000 20%); }
.rsvp-form { position: relative; padding: 2cqw 12.5% 2cqw; }
.rsvp-form h2 { font-size: clamp(36px, 9.4cqw, 64px); text-align: center; margin: 0 0 3cqw; }
.fld { display: block; margin: 0 0 3.4cqw; }
.lbl, .rsvp-form legend {
  display: block; font-size: clamp(12px, 2.4cqw, 15px); letter-spacing: .16em; text-transform: uppercase; color: var(--maroon);
  margin: 0 0 7px; font-weight: 700; padding: 0;
}
.lbl em { text-transform: none; letter-spacing: 0; font-weight: 400; color: #8a6a55; }
.rsvp-form input[type="text"], .rsvp-form input[type="tel"], .rsvp-form textarea {
  width: 100%; font: inherit; font-size: max(16px, min(3.2cqw, 19px)); color: var(--ink); background: rgba(255, 251, 244, .94);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.rsvp-form textarea { resize: vertical; min-height: 110px; line-height: 1.45; }
.rsvp-form ::placeholder { font-style: italic; color: #a88a74; }
.rsvp-form input:focus, .rsvp-form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 62, .25); }
.rsvp-form [aria-invalid="true"] { border-color: #b3263a !important; }
fieldset { border: 0; padding: 0; margin: 0 0 3.4cqw; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: rgba(255, 251, 244, .94); font-size: max(15px, min(2.9cqw, 17px)); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.chip span::before { content: "○"; font-size: .9em; color: var(--gold); }
.chip input:checked + span { background: var(--maroon); border-color: var(--maroon); color: #fff3dc; }
.chip input:checked + span::before { content: "✓"; color: #ecc97f; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: rgba(255, 251, 244, .94); }
.stepper button { width: 46px; height: 46px; border: 0; background: transparent; font-size: 24px; color: var(--maroon); cursor: pointer; border-radius: 50%; }
.stepper button:focus-visible { outline: 3px solid var(--gold); }
.stepper output { min-width: 44px; text-align: center; font-size: 20px; font-weight: 700; color: var(--maroon); }
.if-yes[hidden] { display: none; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--maroon); margin: 5cqw 0 2cqw; font-size: 20px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--maroon-d), transparent); }
.hint { text-align: center; font-size: max(15px, min(3cqw, 18px)); margin: 0 0 3cqw; line-height: 1.5; }
.err { color: #a3142a; font-size: 14px; margin: 6px 2px 0; }
.err:empty { display: none; }
.actions { text-align: center; margin-top: 1cqw; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; text-decoration: none;
  background: linear-gradient(180deg, #8f2230, #6a1520); color: #fff3dc; font-size: max(16px, min(3.4cqw, 20px)); padding: 14px 30px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(110, 20, 30, .28), inset 0 1px 0 rgba(255, 255, 255, .18); border: 1px solid #b8873a;
}
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.note { text-align: center; font-size: 14px; color: #7d5c48; margin: 10px 0 0; font-style: italic; }
.ok-msg {
  text-align: center; margin: 14px 0 0; padding: 14px 16px; border-radius: 14px; background: rgba(255, 251, 244, .94);
  border: 1.5px solid var(--gold); color: var(--maroon); font-size: 17px; line-height: 1.45;
}
.ok-msg[hidden] { display: none; }

/* a soft gold glow on the tappable rows and buttons when their page comes into view */
.seen .hot-hint, .cur .hot-hint { animation: glow 1.9s ease-in-out .6s 2; }
@keyframes glow {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(236, 201, 127, 0), 0 0 0 0 rgba(236, 201, 127, 0); background-color: transparent; }
  50% { box-shadow: inset 0 0 0 2.5px rgba(214, 170, 82, .95), 0 0 22px 2px rgba(236, 201, 127, .55); background-color: rgba(255, 240, 205, .18); }
}

/* falling petals, over the page but never in the way */
.petals {
  position: fixed; top: 0; bottom: 0; left: 50%; width: min(var(--col), 100vw); transform: translateX(-50%);
  overflow: hidden; pointer-events: none; z-index: 15;
}
.petals i { position: absolute; top: -40px; animation: fall var(--d) linear var(--delay) infinite; }
.petals b {
  display: block; width: calc(12px * var(--s)); height: calc(8px * var(--s)); background: var(--c); opacity: .78;
  border-radius: 80% 10% 80% 10%; animation: sway var(--sw) ease-in-out infinite alternate;
}
@keyframes fall { to { transform: translateY(calc(100vh + 80px)) rotate(400deg); } }
@keyframes sway { from { transform: translateX(-18px) rotate(-20deg); } to { transform: translateX(18px) rotate(25deg); } }

@media (prefers-reduced-motion: reduce) {
  .hot-open::before, .music.on .bars i, .seen .hot-hint, .cur .hot-hint, .sp-ring, .sp-names, .sp-date, .sp-line i { animation: none; }
  .petals, .burst { display: none; }
}

/* Page-flip version: one page at a time. On a computer the whole page fits the screen (9:16, centred, up to 700 px
   wide) over a blurred copy of it. On a phone the page fills the screen: the picture zooms in a little (at most 10%,
   so no text is lost) and any sliver left shows a blurred copy of the same picture. Scrolling turns the page; the RSVP
   page scrolls inside and turns at its end. Swipes and arrow keys work too. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #e7cbb1 radial-gradient(ellipse 90% 70% at 50% 35%, #fbeee1 0%, #efd6bf 55%, #d7b393 100%); }
.stage {
  position: fixed; inset: 0; z-index: 1; display: flex; justify-content: center; align-items: center; touch-action: none;
  user-select: none; -webkit-user-select: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.book {
  position: relative; aspect-ratio: 9 / 16; perspective: 2400px;
  width: min(var(--col), 100vw, calc(100vh * 9 / 16));
  width: min(var(--col), 100vw, calc((100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16));
}
.pg {
  position: absolute; inset: 0; overflow: hidden; visibility: hidden; transform-origin: left center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 0 40px rgba(70, 20, 15, .3);
}
.pg.cur, .pg.under, .pg.turning { visibility: visible; }
.pg.under { z-index: 1; }
.pg.cur { z-index: 2; }
.pg.turning { z-index: 3; }
.scroll {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }
.pg:not(.pg-rsvp) .scroll { overflow: hidden; }
.pg:not(.pg-rsvp) .frame { position: absolute; inset: 0; aspect-ratio: auto; }
.rsvp-scroll { background-attachment: local; }

/* phones: fill the whole screen */
@media (max-aspect-ratio: 9 / 16) {
  .stage { padding: 0; }
  .book { aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
  .pg { box-shadow: none; }
  .pg:not(.pg-rsvp) .frame {
    inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: 9 / 16;
    width: min(110vw, calc(100vh * 9 / 16)); width: min(110vw, calc(100dvh * 9 / 16));
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
  .rsvp-scroll { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

.shade {
  display: block; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(40, 10, 5, .45), rgba(40, 10, 5, .1) 35%, rgba(255, 255, 255, .12) 65%, rgba(40, 10, 5, .35));
}
.music { bottom: calc(14px + env(safe-area-inset-bottom)); }
.hint-chip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 35; background: rgba(122, 26, 36, .92); color: #fff3dc; padding: 10px 18px; border-radius: 999px; font-size: 15px;
  box-shadow: 0 6px 16px rgba(70, 15, 20, .3); white-space: nowrap; transition: opacity .5s; pointer-events: none;
}
.hint-chip[hidden] { display: none; }
.hint-chip.fade { opacity: 0; }
