/* Preview v3 — story first (captions over the 3D scene), then a solid invitation page. */
:root {
  --cream: #FFF6E6; --surface: #F7E6C7; --walnut: #3B2416; --muted-brown: #5F3E24; --cranberry: #8A1C2E; --focus: #7A4210;
  --font-display: "Fraunces", Georgia, serif; --font-body: "Nunito", system-ui, sans-serif; --bar-h: 64px;
}
* { box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
body { margin: 0; background: var(--walnut); color: var(--walnut); font: 18px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; }
body.gl-ready #stage { opacity: 1; }
#poster { position: fixed; inset: 0; }
#poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
#poster img.on { opacity: 1; }
body.gl-ready #poster { visibility: hidden; transition: visibility 0s .7s; }
html { overflow-x: hidden; } body { overflow-x: clip; overscroll-behavior-y: none; }
.veil { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(28, 14, 6, .7), rgba(28, 14, 6, 0) 42%); }
.preview-tag { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); z-index: 20;
  background: rgba(59, 36, 22, .78); color: var(--cream); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; white-space: nowrap; }

/* ---------- part 1: story ---------- */
#story { position: relative; z-index: 2; }
.chapter { height: 100vh; height: 100svh; position: relative; }
.chapter--last { height: 80vh; height: 80svh; }
.caption { position: sticky; top: calc(100vh - var(--bar-h) - env(safe-area-inset-bottom) - 26px); top: calc(100svh - var(--bar-h) - env(safe-area-inset-bottom) - 26px); transform: translateY(-100%);
  padding: 0 22px; max-width: 640px; color: var(--cream); text-shadow: 0 2px 14px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .7);
  opacity: 0; translate: 0 14px; transition: opacity .45s ease, translate .45s ease; }
.chapter.is-on .caption { opacity: 1; translate: 0 0; }
.caption p { margin: 4px 0; font-size: clamp(20px, 5.4vw, 30px); font-weight: 700; line-height: 1.25; }
.caption .time { font-family: var(--font-display); font-size: clamp(40px, 12vw, 72px); line-height: 1; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 4px; font-size: 13px !important; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #FFD9A0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(40px, 11.5vw, 76px); line-height: 1; margin: 0; }
.caption .sub { font-family: var(--font-display); font-size: clamp(22px, 6vw, 34px); color: #FFD9A0; }

.rail { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 15; display: grid; gap: 12px; transition: opacity .3s; }
.rail i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 246, 230, .45); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); transition: transform .2s, background .2s; }
.rail i.on { background: var(--cream); transform: scale(1.5); }
body.on-page .rail { opacity: 0; }

/* ---------- part 2: the invitation page (solid, normal flow) ---------- */
#page { position: relative; z-index: 3; background: var(--cream); border-radius: 22px 22px 0 0; box-shadow: 0 -18px 40px rgba(0, 0, 0, .35);
  padding: 28px 20px calc(var(--bar-h) + env(safe-area-inset-bottom) + 28px); max-width: 720px; margin: 0 auto; }
.page-head { text-align: center; padding: 6px 0 10px; border-bottom: 1px solid rgba(59, 36, 22, .15); }
.page-head .logo { display: block; width: 88px; height: 88px; margin: 4px auto 6px; filter: drop-shadow(0 3px 6px rgba(59, 36, 22, .25)); }
.page-head .eyebrow { color: var(--cranberry); }
.page-head h2 { font-size: clamp(30px, 8vw, 46px); line-height: 1.05; margin: 0; }
.page-head .sub { font-family: var(--font-display); font-weight: 700; color: var(--cranberry); font-size: 22px; margin: 4px 0 0; }
.block { padding: 22px 0; border-bottom: 1px solid rgba(59, 36, 22, .12); }
.block h3 { font-size: 28px; margin: 0 0 10px; }
.opt { font-family: var(--font-body); font-size: 14px; font-weight: 800; color: var(--muted-brown); background: var(--surface); border-radius: 99px; padding: 3px 10px; vertical-align: middle; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: baseline; }
.facts dt { font-weight: 800; color: var(--muted-brown); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 700; font-size: 19px; }
address { font-style: normal; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn { min-height: 48px; padding: 0 18px; border-radius: 10px; font: 700 17px/1 var(--font-body); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--cranberry); color: var(--cream); border: 0; }
.btn--ghost { background: transparent; color: var(--walnut); border: 2px solid var(--walnut); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.potluck { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 18px; font-size: 16px; }
.potluck li { break-inside: avoid; padding: 4px 0; }
.potluck .cat { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-brown); font-weight: 800; padding-top: 10px; }
.mock-form { display: grid; gap: 12px; }
.mock-form label { display: grid; gap: 5px; font-weight: 700; font-size: 16px; min-width: 0; }
.mock-form input, .mock-form select { width: 100%; min-width: 0; box-sizing: border-box; min-height: 48px; border-radius: 10px; border: 1px solid rgba(59, 36, 22, .3); padding: 0 12px; font: 16px var(--font-body); background: #fff; color: var(--walnut); }
.mock-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock-form .btn { opacity: 1; }
.mock-form .btn[disabled] { opacity: .5; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 0; font-weight: 700; font-size: 16px; min-height: 1.2em; }
.form-msg.err { color: var(--cranberry); }
.form-msg.ok { color: #2f6b3a; }
.potluck .gone { color: #8a7765; text-decoration: line-through; }
.potluck .left { color: #8a7765; font-size: 13px; }
.allergy { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #FBE3D6; border-left: 5px solid var(--cranberry); font-size: 16px; }
.allergy strong { color: var(--cranberry); }
.small-allergy { margin: 0; font-size: 14px; font-weight: 700; }
.small { font-size: 14px; color: var(--muted-brown); font-weight: 700; }
.page-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-top: 22px; }

.rsvp-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 -6px 20px rgba(20, 10, 4, .25); transition: transform .3s ease; }
.rsvp-bar span { background: var(--cranberry); color: var(--cream); font-weight: 800; font-size: 18px; min-width: 160px; height: 48px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .06em; }
body.at-rsvp .rsvp-bar { transform: translateY(110%); }

@media (min-width: 900px) {
  .caption { padding-left: 80px; }
  #page { margin-bottom: 0; padding: 40px 48px 120px; }
  .rsvp-bar { left: auto; right: 24px; bottom: 24px; height: 64px; width: 176px; border-radius: 14px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .caption { transition: none; translate: none; } }

/* mobile-first refinements (2026-10-23) */
.skip { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; padding: 0 16px; border-radius: 99px; background: rgba(255, 246, 230, .16);
  border: 1px solid rgba(255, 246, 230, .45); color: var(--cream); font: 800 15px/1 var(--font-body); text-decoration: none; text-shadow: none; backdrop-filter: blur(6px); pointer-events: auto; }
.caption { pointer-events: none; } .caption a { pointer-events: auto; }
.glance { margin: 8px 0 0; font-weight: 800; font-size: 17px; color: var(--walnut); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.qa { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; min-height: 64px; border-radius: 12px; border: 1.5px solid rgba(59, 36, 22, .25); background: #fff;
  color: var(--walnut); font: 800 14px/1.1 var(--font-body); text-decoration: none; cursor: pointer; }
.qa span { font-size: 22px; line-height: 1; }
.qa--primary { background: var(--cranberry); color: var(--cream); border-color: var(--cranberry); }
.meet { width: 100%; border-radius: 14px; background: #1c0e06; aspect-ratio: 16 / 9; display: block; margin-top: 10px; }
.page-foot .btn { flex: 1 1 140px; }
.sign-off { flex-basis: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 0; font-size: 14px; color: var(--muted-brown); }
.sign-off img { width: 40px; height: 40px; }
@media (max-width: 380px) { .potluck { columns: 1; } .facts div { grid-template-columns: 64px 1fr; } #page { padding-left: 16px; padding-right: 16px; } }
@media (orientation: landscape) and (max-height: 500px) {
  .chapter { height: 120svh; } .caption .time { font-size: 44px; } h1 { font-size: 40px; } .caption p { font-size: 18px; }
  .rail { display: none; } .rsvp-bar { left: auto; right: 16px; bottom: 12px; width: 150px; height: 56px; border-radius: 14px; padding: 0; }
}

/* capture mode for the still pictures: only the 3D canvas */
body.poster-mode > *:not(#stage) { visibility: hidden !important; }
body.poster-mode #stage { opacity: 1; filter: none !important; }

/* the RSVP form is a preview until the real one ships: make that obvious (DeepSeek review) */
.preview-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface); font-weight: 800; font-size: 15px; }
.mock-form input:disabled, .mock-form select:disabled { background: #F3EDE3; color: #8a7765; }
