/* Look and feel. Colors and fonts are placeholders until the vision form is back;
   change them here in :root and everything follows. */
:root {
  --ink: #1f1a17;          /* text on light backgrounds */
  --paper: #f7f3ee;        /* details section background */
  --on-film: #fffaf3;      /* text over the film */
  --accent: #9a6b3f;       /* buttons, links */
  --line: rgba(31, 26, 23, 0.15);
  /* Pale veil over the garden picture behind the details. The last number is its strength:
     1 hides the picture, 0 shows it fully. */
  --wash: rgba(247, 243, 238, 0.8);
  --petal: #e7a3b3;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-content: center; gap: 14px;
  background: var(--paper);
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-label {
  margin: 0; font: italic 1.25rem var(--font-display); text-align: center;
}
.loader-bar { width: 180px; height: 1px; background: var(--line); }
.loader-fill { height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.2s; }

/* ---------- Film ---------- */
.film { position: relative; height: 900vh; } /* overwritten by app.js from the film length */
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #111; }
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 45%),
              linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 20%);
}

.chapters { position: absolute; inset: 0; color: var(--on-film); pointer-events: none; }
.chapter {
  position: absolute; left: 0; right: 0; bottom: 14vh;
  padding-inline: var(--gutter);
  text-align: center; opacity: 0;
  text-shadow: 0 1px 18px rgba(0,0,0,0.35);
}
.chapter.hero { top: 12vh; bottom: auto; }
.chapter h2, .names {
  margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.05; text-wrap: balance;
}
.chapter h2 { font-size: clamp(2.2rem, 7vw, 4rem); }
.chapter h2 em { display: block; }
.names { font-size: clamp(3.2rem, 13vw, 6.5rem); display: flex; flex-direction: column; align-items: center; }
.amp { font-style: italic; font-size: 0.45em; margin: 0.15em 0; }
.eyebrow {
  margin: 0 0 12px; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
}
.tagline, .chapter .body {
  margin: 14px auto 10px; max-width: 34ch; font-family: var(--font-display); font-size: 1.2rem;
}

.hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
  color: var(--on-film); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.hud p { margin: 0; }
.hud-next { color: inherit; text-decoration: none; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,0.2); }
.progress-fill { height: 100%; background: var(--on-film); transform: scaleX(0); transform-origin: left; }

/* ---------- Details ---------- */
.details { position: relative; background: var(--paper); }
/* One screen tall and sticky, with a negative margin so the details scroll over it. Sized to
   the screen with the browser bars hidden (lvh), so no strip shows when phones slide them away. */
.backdrop {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh; margin-bottom: -100vh; margin-bottom: -100lvh;
  overflow: hidden; pointer-events: none;
  background: linear-gradient(var(--wash), var(--wash)), url("images/garden.webp") center / cover;
}
.petal {
  position: absolute; top: -20px; left: var(--x);
  width: 11px; height: 8px; border-radius: 0 100% 0 100%;
  background: var(--petal); opacity: 0.7;
  animation: petal-fall var(--t) linear var(--w) infinite;
}
@keyframes petal-fall {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(var(--sway), 52vh, 0) rotate(190deg); }
  to { transform: translate3d(0, calc(100vh + 40px), 0) rotate(380deg); }
}
.details-inner {
  position: relative;
  max-width: 560px; margin: 0 auto;
  padding: 72px var(--gutter) calc(72px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 18px;
}
.details h2 { margin: 24px 0 0; font: 400 2.4rem/1.1 var(--font-display); }

/* Meet the couple and the countdown: centered, after the reference invite. */
.feature { display: grid; justify-items: center; text-align: center; padding-bottom: 40px; }
.kicker {
  margin: 0; font: 500 0.7rem var(--font-body); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
}
.details h2.display {
  margin: 12px 0 0; font: italic 400 clamp(2.5rem, 11vw, 3.4rem)/1.05 var(--font-display);
  text-wrap: balance;
}
.lede { margin: 14px 0 0; max-width: 34ch; font-size: 1.05rem; opacity: 0.75; text-wrap: balance; }

.portrait { margin: 34px 0 0; width: min(100%, 340px); }
/* The photo sits in a gold arch: the border is the inner line, the outline the outer one. */
.portrait-frame {
  aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--accent); border-radius: 999px 999px 0 0;
  outline: 1px solid var(--accent); outline-offset: 7px;
  background: linear-gradient(165deg, #efe6da, #dfd2bf);
}
.portrait-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait-placeholder {
  height: 100%; margin: 0; display: grid; place-content: center;
  font: italic 1.3rem var(--font-display); color: var(--accent);
}
.portrait-names { margin-top: 26px; font: italic 400 clamp(2rem, 9vw, 2.6rem)/1.1 var(--font-display); }

.countdown-units {
  list-style: none; margin: 26px 0 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2.5vw, 14px);
}
.countdown-units li {
  display: grid; justify-items: center; gap: 10px; padding: 28px 2px 18px;
  border: 1px solid rgba(154, 107, 63, 0.45);
  border-radius: 50% 50% 14px 14px / 34px 34px 14px 14px;
  background: rgba(255, 252, 247, 0.75);
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.countdown-units span {
  font: 500 clamp(1.9rem, 8vw, 2.6rem)/1 var(--font-body); letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* The venue map, in the same double gold line as the photo, warmed slightly to match the page. */
.map-frame {
  margin-top: 30px; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border: 1px solid var(--accent); border-radius: 18px;
  outline: 1px solid var(--accent); outline-offset: 6px;
  background: #e9e1d4;
}
.map-frame iframe {
  display: block; width: 100%; height: 100%; border: 0;
  filter: sepia(0.25) saturate(0.85);
}
.feature .button { justify-self: center; margin-top: 24px; }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.event { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.event:last-child { border-bottom: 1px solid var(--line); }
.event-when { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.event-name { font: 500 1.5rem/1.2 var(--font-display); }
.event-venue, .event-note { margin: 0; font-size: 0.95rem; }
.event-note { opacity: 0.7; }

.button {
  justify-self: start; display: inline-block; padding: 12px 22px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: 500 0.8rem var(--font-body); letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.button-quiet { background: transparent; color: var(--accent); }
.button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rsvp { display: grid; gap: 10px; }
.rsvp label, .rsvp legend { font-size: 0.9rem; }
.rsvp input:not([type=radio]), .rsvp textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: #fff;
  font: inherit; color: inherit;
}
.rsvp fieldset { border: 0; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.choice { display: flex; gap: 8px; align-items: center; }
.rsvp .button { margin-top: 8px; }
.rsvp-status { margin: 0; min-height: 1.6em; }

@media (prefers-reduced-motion: reduce) {
  .loader, .loader-fill { transition: none; }
  .petal { display: none; }
}
