:root {
  --cream: #fbf1dc;
  --gold: #e9c27a;
  --gold-deep: #c9953f;
  --ink-dark: #4a1607;
  --night: #121633;
  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cinzel", "Times New Roman", serif;
  --gutter: clamp(20px, 6vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #0c1040;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- shared type ---------- */
.kicker {
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: .9;
}
.title-caps {
  font-family: var(--caps);
  font-weight: 400;
  font-size: clamp(30px, 9vw, 56px);
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}
.script {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 13vw, 80px);
  line-height: 1;
}
.script.small { font-size: clamp(26px, 7vw, 38px); }
.lead { font-size: clamp(19px, 5vw, 24px); line-height: 1.45; }

/* ---------- START OVERLAY ---------- */
#gate {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,170,70,.18), rgba(10,12,40,0) 60%);
  pointer-events: auto;
}
.gate-top {
  position: absolute; left: 0; right: 0; top: max(28px, env(safe-area-inset-top));
  text-align: center; text-shadow: 0 1px 12px rgba(0,0,0,.6);
}
.gate-btn {
  position: absolute; left: 50%; bottom: max(56px, calc(env(safe-area-inset-bottom) + 40px));
  transform: translateX(-50%);
  display: grid; place-items: center;
  width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,140,.28), rgba(60,30,90,.35) 70%);
  border: 1px solid rgba(255,225,170,.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 36px rgba(255,180,80,.4);
}
.gate-btn .label {
  font-family: var(--caps); font-size: 11px; line-height: 1.6; letter-spacing: .22em; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.gate-btn .ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(255,225,170,.6);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }

#petals { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* ---------- music button ---------- */
.music {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: #d9480f;
  box-shadow: 0 4px 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.25);
}
.music[hidden] { display: none; }
.music .play { width: 20px; height: 20px; fill: #fff; display: none; margin-left: 2px; }
.music .bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.music .bars i { width: 3px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.music .bars i:nth-child(2) { animation-delay: -.3s; }
.music .bars i:nth-child(3) { animation-delay: -.6s; }
.music .bars i:nth-child(4) { animation-delay: -.15s; }
.music.paused .bars { display: none; }
.music.paused .play { display: block; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }

/* ---------- HERO: one painted world, moved by a camera ---------- */
.hero { position: relative; }
.stage { position: relative; height: 100vh; height: 100lvh; overflow: hidden; background: #0c1040; --bar: 0px; }
@supports (height: 100lvh) { .stage { --bar: calc(100lvh - 100svh); } }
.world { position: absolute; left: 0; top: 0; width: 1024px; height: 1535px; transform-origin: 0 0; will-change: transform; }
#skyWorld { z-index: 1; }
.sky-ext { position: absolute; left: 0; top: -1400px; width: 1024px; height: 1408px; max-width: none; } /* overlaps 8px under the facade: no seam */
.courtyard-layer { position: absolute; left: 0; top: 0; z-index: 2; transform-origin: 0 0; will-change: transform; }
.courtyard-layer img { width: 100%; height: 100%; max-width: none; }
#facadeWorld { z-index: 3; }
.facade { position: absolute; left: 0; top: 0; width: 1024px; height: 1535px; max-width: none; }
.gate-doors { position: absolute; perspective: 1100px; transform-style: preserve-3d; }
.leaf { position: absolute; top: 0; height: 100%; max-width: none; backface-visibility: visible; will-change: transform, filter; }
.leaf.left { left: 0; transform-origin: 0 50%; }
.leaf.right { right: 0; transform-origin: 100% 50%; }
.gate-light {
  position: absolute; inset: -30% -40%; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 62%, rgba(255,236,190,.95) 0%, rgba(255,190,90,.55) 28%, rgba(255,150,60,0) 62%);
  mix-blend-mode: screen;
}
#lanterns { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }

.hero-title {
  position: absolute; z-index: 6; left: 0; right: 0; top: 17svh;
  text-align: center; padding: 0 var(--gutter);
  text-shadow: 0 2px 20px rgba(10,10,40,.6);
  will-change: transform, opacity;
}
.hero-sub { font-style: italic; font-size: 22px; margin-top: 10px; }
.hero-title h1 {
  font-family: var(--caps); font-weight: 400;
  font-size: clamp(46px, 14vw, 96px);
  letter-spacing: .06em; line-height: 1.02; text-transform: uppercase;
  margin: 10px 0 12px;
}
.hero-title h1 span { letter-spacing: .1em; }
.hero-tag { font-style: italic; font-size: clamp(19px, 5vw, 26px); }

.court-shade { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: linear-gradient(to top, rgba(20,8,2,.92) 0%, rgba(20,8,2,.72) 24%, rgba(20,8,2,0) 52%); }
.courtyard-cap {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: calc(9svh + var(--bar)); text-align: center;
  font-style: italic; font-size: 24px; text-shadow: 0 2px 18px rgba(0,0,0,.9), 0 0 40px rgba(0,0,0,.6);
  opacity: 0;
}
.courtyard-cap .big { font-family: var(--caps); font-style: normal; font-size: clamp(30px, 8.5vw, 50px); letter-spacing: .08em; text-transform: uppercase; }

.scroll-hint {
  position: absolute; z-index: 8; left: 50%; bottom: calc(22px + var(--bar)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--caps); font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  opacity: 0; transition: opacity .8s;
}
.ready .scroll-hint { opacity: .85; }
.stage.scrolled .scroll-hint { opacity: 0; }
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--cream), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- PANELS ---------- */
.panel {
  position: relative; text-align: center;
  padding: 96px var(--gutter) 110px;
  background-size: 720px auto; background-repeat: repeat;
  overflow: hidden;
}
.panel .wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.teal { background-color: #0f4f52; background-image: url(assets/tex_teal.webp); }
.rose { background-color: #7a1d3f; background-image: url(assets/tex_rose.webp); }
.marigold { background-color: #e9a321; background-image: url(assets/tex_marigold.webp); color: var(--ink-dark); }
.panel::before { /* soft vignette for depth */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.28) 100%);
}
.panel > * { position: relative; }

.toran { position: absolute !important; top: 0; left: 0; right: 0; height: 90px; pointer-events: none; z-index: 2; }
.toran svg { width: 100%; height: 100%; overflow: visible; }

.ganesha { width: 180px; height: 180px; object-fit: contain; mix-blend-mode: screen; margin-top: 10px; }
.blessing { font-style: italic; font-size: 18px; opacity: .9; }
.teal .script { color: var(--gold); margin-top: 14px; }
.teal .title-caps { color: var(--gold); }
.ornament { color: var(--gold); width: 200px; }

.datebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: 100%; max-width: 380px; margin: 6px 0 10px;
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .18em; font-size: 13px;
}
.datebar > div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; }
.datebar > div:first-child, .datebar > div:last-child { border-top: 1px solid rgba(233,194,122,.6); border-bottom: 1px solid rgba(233,194,122,.6); }
.datebar .day { padding: 0 18px; }
.datebar .day b { font-weight: 400; font-size: 64px; line-height: 1; color: var(--gold); letter-spacing: 0; }
.datebar .day span { font-size: 12px; margin-top: 4px; }
.datebar small { font-size: 10px; letter-spacing: .2em; opacity: .8; margin-top: 2px; }

.medallion { position: relative; width: min(78vw, 360px); aspect-ratio: 1; margin-top: 30px; }
.medallion-ring {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 8px rgba(233,194,122,.15), 0 0 0 9px rgba(233,194,122,.5), 0 20px 50px rgba(0,0,0,.4);
}
.medallion-ring img { width: 100%; height: 100%; object-fit: cover; }
.marigolds { position: absolute; width: 46%; height: 46%; pointer-events: none; }
.marigolds svg { width: 100%; height: 100%; overflow: visible; }
.marigolds.tl { left: -14%; top: -12%; }
.marigolds.br { right: -14%; bottom: -12%; transform: rotate(180deg); }

/* arch frame */
.arch { width: min(76vw, 340px); margin: 24px 0 18px; }
.arch-frame {
  aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 50% 50% 8px 8px / 34% 34% 8px 8px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 8px rgba(233,194,122,.14), 0 0 0 9px rgba(233,194,122,.5), 0 24px 60px rgba(0,0,0,.45);
}
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.rose .title-caps { color: var(--gold); }
.quote { font-style: italic; font-size: 20px; opacity: .85; margin-top: 10px; }

/* route */
.marigold .title-caps { color: #7a1d0b; }
.address { font-size: 21px; line-height: 1.4; max-width: 340px; }
.map {
  width: 100%; max-width: 440px; aspect-ratio: 4 / 3; margin-top: 8px;
  border-radius: 200px 200px 14px 14px / 120px 120px 14px 14px; overflow: hidden;
  border: 3px solid #7a1d0b;
  box-shadow: 0 0 0 7px rgba(122,29,11,.15), 0 18px 40px rgba(90,30,0,.35);
  background: #f3dfb0;
}
.map iframe { width: 100%; height: 100%; border: 0; filter: sepia(.25) saturate(1.1); }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  background: #7a1d0b; color: var(--cream);
  font-family: var(--caps); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(90,20,0,.3);
  transition: transform .2s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.ghost { background: transparent; color: #7a1d0b; box-shadow: inset 0 0 0 1.5px #7a1d0b; }

/* guest list */
.guest-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.guest-form input, .guest-form select {
  width: 100%; font: inherit; font-size: 20px; color: var(--cream);
  background: rgba(0,0,0,.18); border: 1px solid rgba(233,194,122,.6); border-radius: 12px;
  padding: 12px 16px;
}
.guest-form input::placeholder { color: rgba(251,241,220,.6); }
.guest-form .count { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 19px; }
.guest-form .count select { width: 90px; }
.guest-form .btn { justify-content: center; background: var(--gold); color: #3a1405; }
.form-msg { min-height: 1.4em; font-style: italic; }
.guest-total { font-family: var(--caps); letter-spacing: .14em; font-size: 13px; text-transform: uppercase; color: var(--gold); margin-top: 18px; }
.guest-list ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.guest-list li { padding: 6px 14px; border-radius: 999px; background: rgba(233,194,122,.16); border: 1px solid rgba(233,194,122,.4); font-size: 17px; }

/* ---------- NIGHT ---------- */
.night { position: relative; min-height: 100lvh; display: flex; flex-direction: column; justify-content: space-between; text-align: center; overflow: hidden; padding: 0 var(--gutter); }
.night-bg, .night-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.night-bg img { transform-origin: 50% 70%; }
.night-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,12,40,.85) 0%, rgba(10,12,40,0) 38%, rgba(10,6,2,0) 62%, rgba(10,6,2,.85) 100%); }
.night .wrap { position: relative; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.night-top { padding-top: 80px; }
.night-bottom { padding-bottom: 90px; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.night .script { color: var(--gold); }
.countdown { display: flex; gap: clamp(10px, 4vw, 26px); justify-content: center; margin-top: 6px; }
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.countdown b { font-family: var(--caps); font-weight: 400; font-size: clamp(36px, 11vw, 60px); line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.countdown span { font-family: var(--caps); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; margin-top: 6px; opacity: .85; }
.countdown.done { font-style: italic; font-size: 26px; }

/* reveal default (JS animates); without JS everything is visible */
.js .reveal { opacity: 0; transform: translateY(28px); }

/* ---------- desktop: the phone-shaped invite in the centre, decorated sides ---------- */
.side { display: none; }
@media (min-width: 820px) {
  :root { --col: min(460px, 100vw); --gutter: 32px; }
  body {
    background:
      radial-gradient(ellipse at 50% 120%, rgba(217,90,20,.35), rgba(217,90,20,0) 60%),
      radial-gradient(ellipse at 50% -20%, #2b2f6b, rgba(43,47,107,0) 70%),
      #0f1230;
    background-attachment: fixed;
  }
  main { position: relative; z-index: 1; width: var(--col); margin: 0 auto; box-shadow: 0 0 0 1px rgba(233,194,122,.25), 0 0 90px rgba(0,0,0,.7); }
  #gate { left: 50%; right: auto; width: var(--col); transform: translateX(-50%); }
  .music { right: calc(50vw - var(--col) / 2 + 16px); }

  .side {
    display: flex; position: fixed; top: 0; bottom: 0; z-index: 0;
    width: calc(50vw - var(--col) / 2);
    align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
  }
  .side-left { left: 0; }
  .side-right { right: 0; }
  .side-text { position: relative; z-index: 1; padding: 0 24px; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
  .side-title { font-family: var(--caps); font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
  .side-meta { font-size: 19px; line-height: 1.5; opacity: .9; }
  .side-meta em { opacity: .75; }
  .qr { width: 150px; height: 150px; padding: 12px; background: var(--cream); border-radius: 14px; box-shadow: 0 0 0 1px rgba(233,194,122,.6), 0 0 0 7px rgba(233,194,122,.12); }
  .qr img, .qr canvas { width: 100% !important; height: 100% !important; }
  .strands { position: absolute; inset: 0; pointer-events: none; }
  .strands svg { position: absolute; top: -10px; transform-origin: 50% 0; animation: sway 6s ease-in-out infinite alternate; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); }
  @keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
}
@media (min-width: 820px) and (max-width: 1050px) { .side-text { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .gate-btn .ring, .scroll-hint i, .music .bars i { animation: none; }
}
body.locked .hero-title > * { opacity: 0; }
/* soft dusk haze behind the title so lanterns drifting behind it don't fight the text */
.hero-title::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
  width: 150%; height: 150%; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(10,14,56,.62) 0%, rgba(10,14,56,.35) 40%, rgba(10,14,56,0) 70%);
  pointer-events: none;
}
