:root {
  --pink: #e22e67;
  --purple: #554596;
  --gold: #b4a269;
  --gold-text: #7d6e3f;
  --green: #3f7a52;
  --ink: #1d1d1b;
  --cream: #f8f3ec;
  --cream-2: #f1e9dd;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: auto;
  overflow-x: clip;
}

body {
  margin: 0;
  padding-bottom: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 12% 8%, rgba(226,46,103,0.10), transparent 60%),
    radial-gradient(ellipse 55% 45% at 92% 12%, rgba(85,69,150,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 15% 95%, rgba(180,162,105,0.14), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(85,69,150,0.08), transparent 60%);
}

/* ---------- Stage section (hero + assembly, pinned) ---------- */

.stage-section {
  position: relative;
  height: 620vh;
}

.stage-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.scroll-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(29,29,27,0.08);
  z-index: 10;
  opacity: 0;
  will-change: opacity;
}

.scroll-progress-fill {
  width: 100%;
  height: 0%;
  background: var(--purple);
}

/* ---------- Hero content ---------- */

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6vh 6vw 4vh;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Centers in the space above the scroll cue via auto margins, so the cue
   below it always stays flush with the bottom of the screen instead of
   risking overlap or being pushed off-screen on short mobile viewports. */
.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

.eyebrow {
  margin: 0 0 0.9rem;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--purple);
}

.eyebrow-line2 { white-space: nowrap; }

.hero-title {
  margin: 0;
  font-family: var(--serif);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.hero-title .line {
  display: block;
  font-size: clamp(3rem, 9vw, 6.4rem);
  font-weight: 600;
}

.hero-title .line-1 { color: var(--ink); }
.hero-title .line-2 {
  color: var(--green);
  font-style: italic;
  font-weight: 500;
}

.hero-subtitle {
  margin: 0.6rem 0 1.6rem;
  font-family: var(--sans);
  font-size: clamp(0.95rem, 2.3vw, 1.15rem);
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0.88;
}

.hero-meta {
  margin-top: clamp(1.4rem, 3vh, 2.4rem);
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.hero-portrait {
  width: clamp(102px, 13vw, 172px);
  height: clamp(102px, 13vw, 172px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(29,29,27,0.2);
  flex-shrink: 0;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.32);
  transform-origin: 50% 35%;
}

.hero-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--serif);
  color: var(--ink);
  text-align: left;
}

.hero-date-range {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.hero-date-day {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 700;
  color: var(--gold-text);
  line-height: 1;
}

.hero-date-unit {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
  margin-right: 0.35rem;
}

.hero-date-dash {
  font-size: 1.2rem;
  color: var(--gold-text);
  opacity: 0.55;
}

.hero-date-year {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

.scroll-cue {
  margin: 0;
  text-align: center;
  flex-shrink: 0;
}

.scroll-cue span {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--purple);
  animation: cueBob 2.6s ease-in-out infinite;
  display: inline-block;
}

@keyframes cueBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Stage group (collage + card + footer, centered as a unit) ---------- */

.stage-group {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh 4vw;
  transform-origin: 50% 50%;
  will-change: transform;
}

.collage-stage {
  position: relative;
  width: min(70vw, 560px);
  aspect-ratio: 2576 / 2460;
  flex-shrink: 0;
}

.stage-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0;
  box-shadow: 0 30px 70px rgba(29,29,27,0.22);
  will-change: opacity;
}

.patch {
  position: absolute;
  left: var(--bl);
  top: var(--bt);
  width: var(--bw);
  height: var(--bh);
  object-fit: cover;
  opacity: 0;
  z-index: 2;
  will-change: opacity;
}

.piece {
  position: absolute;
  left: var(--bl);
  top: var(--bt);
  width: var(--bw);
  height: var(--bh);
  z-index: 3;
  opacity: 0;
  will-change: transform, opacity;
}

.piece-float {
  width: 100%;
  height: 100%;
  animation: pieceIdle 5.5s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  --floatY: -10px;
  --floatR: 2deg;
}

.piece[data-piece="flowers"] .piece-float     { --floatY: -9px;  --floatR: 2deg;    animation-duration: 5.4s; }
.piece[data-piece="tarantula"] .piece-float   { --floatY: -13px; --floatR: -2.5deg; animation-duration: 6.1s; }
.piece[data-piece="leopard"] .piece-float     { --floatY: -8px;  --floatR: 1.6deg;  animation-duration: 4.8s; }
.piece[data-piece="butterflies"] .piece-float { --floatY: -6px;  --floatR: 1deg;    animation-duration: 5.6s; }
.piece[data-piece="lotus"] .piece-float       { --floatY: -7px;  --floatR: -1.8deg; animation-duration: 5.9s; }
.piece[data-piece="car"] .piece-float         { animation: none; }
.piece[data-piece="bunny"] .piece-float       { --floatY: -9px;  --floatR: -2deg;   animation-duration: 6.4s; }
.piece[data-piece="dog"] .piece-float         { --floatY: -11px; --floatR: 1.8deg;  animation-duration: 5.3s; }
.piece[data-piece="textbox"] .piece-float     { --floatY: -6px;  --floatR: -1.2deg; animation-duration: 6.6s; }

.piece-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(29,29,27,0.32)) drop-shadow(0 2px 5px rgba(29,29,27,0.18));
}

@keyframes pieceIdle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(var(--floatY)) rotate(var(--floatR)); }
}

.piece[data-piece="butterflies"] .piece-img {
  animation: wingFlap 0.34s ease-in-out infinite;
  transform-origin: 50% 50%;
}

.piece[data-piece="butterflies"].is-landed .piece-img {
  animation: none;
  transform: scaleX(1);
}

@keyframes wingFlap {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.42); }
}

.stage-caption {
  position: absolute;
  left: 50%;
  top: 12.5vh;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(92vw, 780px);
  z-index: 4;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  line-height: 1.28;
  font-size: clamp(1.35rem, 3.4vw, 2.15rem);
  color: var(--purple);
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ---------- Reveal card ---------- */

.reveal-card {
  position: relative;
  flex-shrink: 0;
  text-align: center;
  background: rgba(248,243,236,0.9);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 1.1rem 2.2rem 1.3rem;
  width: max-content;
  max-width: 90vw;
  height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  will-change: height, margin-top, opacity;
  box-shadow: 0 16px 40px rgba(29,29,27,0.14);
}

.reveal-eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.reveal-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  line-height: 1.15;
  color: var(--pink);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.reveal-subtitle {
  margin: 0 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  opacity: 0.85;
}

.reveal-date {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.reveal-address {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
  opacity: 0.78;
}

.reveal-note {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.68;
  font-style: italic;
}

.reveal-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--purple);
  padding: 0.6rem 1.6rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.reveal-cta[aria-disabled="true"] {
  background: #6f6597;
  cursor: not-allowed;
}

.reveal-cta:not([aria-disabled="true"]):hover { background: var(--ink); transform: translateY(-2px); }

@keyframes ctaShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.reveal-cta.is-shaking { animation: ctaShake 0.4s ease-in-out; }

.cta-toast {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--ink);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.cta-toast.is-visible {
  opacity: 0.75;
  transform: translateY(0);
}

/* ---------- Stage footer (logo + credit line, folded into the same centered group) ---------- */

.stage-footer {
  position: relative;
  flex-shrink: 0;
  text-align: center;
  height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  will-change: height, margin-top, opacity;
}

.footer-mark {
  width: 84px;
  aspect-ratio: 500 / 354;
  margin: 0 auto 0.5rem;
  opacity: 0.85;
}

.stage-footer p {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.65;
}

.footer-credit {
  margin-top: 0.35rem !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  opacity: 0.62 !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .hero-title .line { font-size: clamp(2.4rem, 12vw, 3.6rem); }
  .collage-stage { width: 88vw; }
  .reveal-card { padding: 1rem 1.4rem 1.2rem; }
  .reveal-card h2 { font-size: 1.25rem; }
  .hero-meta { gap: 0.8rem; }
  .hero-portrait { width: clamp(128px, 30vw, 172px); height: clamp(128px, 30vw, 172px); }
  .eyebrow-sep { display: none; }
  .eyebrow-line1, .eyebrow-line2 { display: block; }
  .eyebrow-line2 { margin-top: 0.3em; letter-spacing: 0.18em; }
  .piece[data-piece] { --fx-m: 0.55; }
  .mobile-hide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .piece-float, .scroll-cue span, .reveal-cta { animation: none !important; }
  .hero-content, .piece, .patch, .stage-base, .reveal-card, .stage-footer, .stage-caption {
    transition: none !important;
  }
}
