/* "The Tale of Two Invites": illustrated scroll story that opens the storefront.
   Comic panels on crumpled paper with torn edges; the hero zooms into the taxi as you scroll. */
:root {
  --paper: #D9D6D2;
  --paper-ink: #1E1A18;
  --night: #7A0A14;
  --display: "Lilita One", "Montserrat", system-ui, sans-serif;
  --tear-top: polygon(0 38px, 4% 17px, 9% 34px, 15% 7px, 21% 29px, 27% 12px, 34% 36px, 41% 10px, 48% 26px, 55% 5px, 61% 31px, 68% 14px, 75% 36px, 82% 11px, 89% 30px, 95% 12px, 100% 31px, 100% 100%, 0 100%);
  --tear-both: polygon(0 38px, 4% 17px, 9% 34px, 15% 7px, 21% 29px, 27% 12px, 34% 36px, 41% 10px, 48% 26px, 55% 5px, 61% 31px, 68% 14px, 75% 36px, 82% 11px, 89% 30px, 95% 12px, 100% 31px, 100% calc(100% - 34px), 94% calc(100% - 12px), 87% calc(100% - 29px), 80% calc(100% - 7px), 73% calc(100% - 31px), 66% calc(100% - 10px), 59% calc(100% - 29px), 52% calc(100% - 6px), 45% calc(100% - 32px), 38% calc(100% - 11px), 31% calc(100% - 30px), 24% calc(100% - 7px), 17% calc(100% - 29px), 10% calc(100% - 10px), 4% calc(100% - 31px), 0 calc(100% - 14px));
}

/* ---------- Crumpled paper sections with torn edges ---------- */
.paper {
  position: relative; color: var(--paper-ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255,255,255,.35), rgba(0,0,0,.04));
  clip-path: var(--tear-both);
  margin-top: -36px; padding-block: clamp(80px, 10vw, 140px);
}
.paper.first { clip-path: var(--tear-top); margin-top: -36px; z-index: 4; }
.paper, .night { padding-inline: 0; }
.night { background: var(--night); color: #F4EDE6; clip-path: var(--tear-both); margin-top: -36px; padding-block: clamp(80px, 10vw, 140px); position: relative; }

.chapter { font: 700 12px var(--sans); letter-spacing: .24em; text-transform: uppercase; margin: 0 0 6px; color: var(--sindoor); }
.night .chapter { color: #F2A65A; }
.comic-h { font-family: var(--display); font-weight: 400; font-size: clamp(2.1rem, 5.4vw, 4rem); line-height: 1; margin: 0 0 clamp(28px, 4vw, 48px); text-transform: uppercase; text-wrap: balance; }
.narration { max-width: 56ch; margin: clamp(28px, 4vw, 44px) auto 0; text-align: center; font-size: 1.05rem; }

/* Comic panels: hand-torn white outline, slight tilt, speech bubble hanging off one side */
.panels { display: grid; gap: clamp(36px, 6vw, 72px); }
.panel { position: relative; margin: 0 auto; width: min(100%, 980px); }
.panel img { width: 100%; height: auto; aspect-ratio: 1376 / 768; object-fit: cover; outline: 3px solid #fff; outline-offset: 10px; box-shadow: 0 0 0 12px rgba(255,255,255,.0); }
.panel.l { transform: rotate(-1.2deg); }
.panel.r { transform: rotate(1deg); }
.bubble {
  position: absolute; z-index: 2; max-width: 240px; padding: 22px 26px;
  background: #fff; color: #1E1A18; font: 800 clamp(14px, 1.6vw, 18px)/1.25 var(--sans); text-align: center;
  border-radius: 52% 48% 46% 54% / 55% 45% 55% 45%; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.bubble::after { content: ""; position: absolute; width: 18px; height: 18px; background: #fff; bottom: -6px; border-radius: 2px 0 14px 0; }
.bubble.br { right: -18px; bottom: -26px; } .bubble.br::after { left: 26%; transform: rotate(18deg); }
.bubble.tl { left: -18px; top: -26px; } .bubble.tl::after { right: 30%; transform: rotate(-24deg) scaleX(-1); }

/* Two invites: the turning point */
.two { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.two img { width: 100%; height: auto; border-radius: 50% 50% 8px 8px / 36% 36% 8px 8px; outline: 3px solid rgba(255,255,255,.85); outline-offset: 10px; }
.two .comic-h { margin-bottom: 18px; }
.two p { font-size: 1.08rem; max-width: 48ch; color: #E5DCD3; }
.two .btn { margin-top: 18px; }

/* The storefront continues on ivory after the story */
.after-story { position: relative; margin-top: -36px; padding-top: 3vw; }

@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  .two img { max-width: 360px; margin-inline: auto; }
  .bubble { position: relative; inset: auto !important; display: block; margin: -14px auto 0; max-width: 80%; }
  .bubble::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .panel.l, .panel.r { transform: none; } }

/* ---------- Hero: the invitation opens like a gift ---------- */
.gift { position: relative; padding: 0; background: #3A1A12; color: #fff; overflow: clip; }
.g-stage { position: relative; height: calc(100svh - var(--hdr, 68px)); min-height: 600px; overflow: hidden; display: grid; }
.g-stage > * { grid-area: 1 / 1; }
.g-street { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; transform-origin: 50% 70%; will-change: transform; }
.g-stage::before { content: ""; position: absolute; inset: 0; z-index: 7; background: linear-gradient(180deg, rgba(43,16,20,.62) 0%, rgba(43,16,20,.18) 34%, rgba(43,16,20,0) 60%, rgba(43,16,20,.35) 100%); pointer-events: none; }
.g-glow { position: absolute; left: 50%; top: 64%; width: min(1300px, 170vw); height: auto; z-index: 2; transform: translate(-50%, -50%); mix-blend-mode: soft-light; pointer-events: none; }
.g-center { position: absolute; left: 50%; top: 64%; z-index: 3; width: min(54vh, 78vw); aspect-ratio: 1; translate: -50% -50%; }
.g-env, .g-couple { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform, opacity; }
.g-env { animation: g-burst 1.1s cubic-bezier(.2,.9,.3,1.3) .15s both; }
@keyframes g-burst { from { opacity: 0; scale: .6; rotate: -8deg; } }
.g-couple { opacity: 0; height: 125%; top: -12%; }
.g-bubble { position: absolute; z-index: 8; width: min(28vh, 34vw); height: auto; top: 40%; opacity: 0; filter: drop-shadow(0 14px 24px rgba(0,0,0,.35)); }
.g-dida { left: max(2vw, 8px); } .g-rohan { right: max(2vw, 8px); }
.g-story { position: absolute; z-index: 5; left: 50%; bottom: 2%; width: min(1100px, 104vw); height: auto; opacity: 0; transform: translate(-50%, 70vh); }
.g-people { position: absolute; z-index: 6; left: 50%; bottom: 0; width: min(1500px, 140vw); height: auto; translate: -50% 0; pointer-events: none; }
.g-petals { position: absolute; inset: -4%; z-index: 5; width: 108%; height: 108%; object-fit: cover; opacity: .35; pointer-events: none; }
.g-copy { position: relative; z-index: 9; align-self: start; justify-self: center; text-align: center; margin: 0; padding: clamp(28px, 6vh, 64px) max(16px, env(safe-area-inset-left, 0px)) 0; text-shadow: 0 2px 0 rgba(58,20,24,.55), 0 6px 26px rgba(58,20,24,.55); }
.g-kicker { font: 800 13px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--taxi); margin: 0 0 12px; }
.g-c1 h1 { font: 400 clamp(2.4rem, 6.4vw, 5.6rem)/.98 var(--display); max-width: 15ch; margin: 0 auto; text-wrap: balance; }
.g-sub { font: 600 clamp(16px, 2vw, 20px)/1.4 var(--sans); margin: 14px auto 0; max-width: 40ch; }
.g-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; text-shadow: none; }
.g-c2, .g-c3, .g-c4 { font: 400 clamp(1.8rem, 4.6vw, 3.6rem)/1.02 var(--display); opacity: 0; max-width: 20ch; text-wrap: balance; }
.g-cue { position: absolute; z-index: 8; bottom: 14px; left: 50%; translate: -50% 0; margin: 0; font: 800 11px var(--sans); letter-spacing: .24em; text-transform: uppercase; color: #fff; opacity: .9; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* Static fallback (no JS or reduced motion): one composed frame */
.gift:not(.anim) .g-couple, .gift:not(.anim) .g-bubble, .gift:not(.anim) .g-story, .gift:not(.anim) .g-c2, .gift:not(.anim) .g-c3, .gift:not(.anim) .g-c4, .gift:not(.anim) .g-cue { display: none; }

/* Scroll-driven: the stage sticks while the invitation opens */
.gift.anim { height: 460vh; }
.gift.anim .g-stage { position: sticky; top: var(--hdr, 0px); }

/* Closing illustration */
.ending { padding: clamp(40px, 6vw, 80px) 0 0; }
.ending-art { position: relative; margin: 0 auto; width: min(1280px, 100% - 32px); border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 8px 8px 0 var(--ink); }
.ending-art img { width: 100%; height: auto; aspect-ratio: 1915 / 821; object-fit: cover; display: block; }
.ending-art figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 24px 22px; text-align: center; background: linear-gradient(transparent, rgba(43,16,20,.82)); color: #fff; }
.ending-art figcaption b { display: block; font: 400 clamp(2rem, 5vw, 4rem)/1 var(--display); }
.ending-art .chapter { color: var(--taxi); }

@media (max-width: 760px) {
  .g-center { top: 60%; width: 70vw; }
  .g-bubble { width: 44vw; top: 30%; }
  .g-people { width: 175vw; max-width: none; }
  .gift.anim { height: 400vh; }
  .ending-art img { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) { .g-env { animation: none; } }

/* Desktop composition: words on the left, the invitation bursting on the right */
@media (min-width: 900px) {
  .g-c1 { justify-self: start; text-align: left; align-self: center; margin-left: max(5vw, 32px); padding-top: 0; margin-top: -8vh; max-width: 46vw; }
  .g-c1 h1 { margin: 0; }
  .g-c1 .g-sub { margin-left: 0; }
  .g-c1 .g-ctas { justify-content: flex-start; }
  .g-center { left: 70%; top: 48%; width: min(66vh, 44vw); }
  .g-glow { left: 70%; top: 48%; }
  .g-people { left: 0; right: 0; translate: 0 0; width: 100%; height: auto; }
  .g-c2, .g-c3, .g-c4 { justify-self: start; text-align: left; align-self: start; margin-left: max(5vw, 32px); padding-top: 9vh; max-width: 38vw; }
  .g-dida { left: 6vw; top: 52%; width: min(30vh, 22vw); }
  .g-rohan { right: 3vw; top: 56%; width: min(30vh, 22vw); }
  .g-story { left: 50%; width: min(1180px, 92vw); }
  .g-stage::before { background: linear-gradient(90deg, rgba(43,16,20,.7) 0%, rgba(43,16,20,.35) 42%, rgba(43,16,20,0) 62%), linear-gradient(180deg, rgba(43,16,20,0) 70%, rgba(43,16,20,.35) 100%); }
}
/* Short phones: tighter copy so the envelope and crowd still fit under it */
@media (max-width: 760px) and (max-height: 720px) {
  .g-c1 { padding-top: 18px; }
  .g-c1 h1 { font-size: 2rem; }
  .g-kicker { font-size: 11px; margin-bottom: 8px; }
  .g-sub { font-size: 14px; margin-top: 8px; }
  .g-ctas { flex-wrap: nowrap; gap: 8px; margin-top: 14px; }
  .g-ctas .btn { padding-inline: 16px; min-height: 44px; font-size: 14px; }
  .g-center { top: 66%; width: 56vw; }
  .g-people { width: 150vw; }
}
