:root {
  color-scheme: dark;
  --obsidian: #050716;
  --midnight: #0b0e24;
  --gold: #d4af37;
  --amber: #ff9900;
  --saffron: #ff4500;
  --honey: #ffd78b;
  --ivory: #fff1db;
  --muted: #c6bdc9;
  --gold-line: rgba(212, 175, 55, .25);
  --glass: rgba(15, 15, 35, .77);
  --whatsapp: #25d366;
  --display: 'Rozha One', Georgia, serif;
  --body: 'Poppins', system-ui, sans-serif;
  --gutter: clamp(1rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-inline-size: 0;
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  color: var(--ivory);
  background: radial-gradient(ellipse at 69% 29%, var(--midnight), var(--obsidian) 74%);
  font: 400 1rem/1.6 var(--body);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--honey); outline-offset: 4px; }
::selection { color: var(--obsidian); background: var(--honey); }
h1, h2, h3, p { margin: 0; }

.shell {
  inline-size: min(75rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

#ad-slot-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  min-block-size: 50px;
  background: var(--obsidian);
  border-block-end: 1px solid var(--gold-line);
}

#ad-slot-header:empty { display: none; }
#ad-slot-header iframe, #ad-slot-native iframe { max-inline-size: 100%; }

.scene, .burst-layer, .firework-show {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene { z-index: -1; }
.burst-layer { z-index: 30; }
.firework-show { z-index: 31; inline-size: 100%; block-size: 100%; }

.scene::before {
  position: absolute;
  inset: 0;
  content: '';
  background:
    radial-gradient(ellipse at 21% 44%, #5b263c44, transparent 53%),
    radial-gradient(ellipse at 79% 40%, #39326f49, transparent 57%);
}

.scene-rangoli {
  position: absolute;
  inline-size: clamp(18rem, 34vw, 35rem);
  color: var(--gold);
  opacity: .12;
  filter: drop-shadow(0 0 6px #d4af3750);
}

.scene-rangoli-left { inset: auto auto -13rem -11rem; transform: rotate(14deg); }
.scene-rangoli-right { inset: -14rem -13rem auto auto; transform: rotate(25deg); }

.ambient-spark {
  position: absolute;
  inset: var(--y) auto auto var(--x);
  inline-size: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--honey);
  opacity: var(--opacity);
  box-shadow: 0 0 7px #ff99008c;
  animation: drift var(--duration) var(--delay) ease-in-out infinite alternate;
}

.burst-spark {
  position: absolute;
  inset: var(--y) auto auto var(--x);
  inline-size: var(--size);
  aspect-ratio: 1;
  background: var(--spark-color);
  border-radius: 45%;
  box-shadow: 0 0 8px var(--spark-color);
  animation: scatter var(--duration) ease-out both;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.welcome-stage {
  --cover-width: min(100%, 55rem, max(27rem, calc((100svh - 8.8rem) * 1199 / 1312)));
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: .45rem;
  min-block-size: 100vh;
  min-block-size: 100svh;
  padding-block: .45rem .5rem;
  overflow: hidden;
}

.welcome-stage::before {
  position: absolute;
  z-index: -1;
  inset: -2rem;
  content: '';
  background:
    radial-gradient(ellipse at 50% 46%, #310d1b4d, #1a0915dc 82%),
    url('./diwali-poster.webp') center / cover no-repeat;
  filter: blur(24px);
  opacity: .87;
}

.festival-strip {
  --ribbon-step: 11.25rem;
  position: relative;
  inline-size: var(--cover-width);
  padding-block: .42rem;
  overflow: hidden;
  color: #ffe0a3;
  background: linear-gradient(90deg, #2a0c18, #661922 46%, #2a0c18);
  border-block: 1px solid #f5b96394;
  box-shadow: inset 0 1px #ffe0a826, 0 0 22px #ed882c22;
}

.festival-strip::after {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  background: linear-gradient(90deg, #2a0c18, transparent 9%, transparent 91%, #2a0c18);
}

.festival-track {
  display: flex;
  inline-size: max-content;
  animation: ribbon-slide 4.85s linear both;
}

.festival-track span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--ribbon-step);
  inline-size: var(--ribbon-step);
  gap: .9rem;
  font: 700 .75rem/1.15 Georgia, 'Times New Roman', serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.festival-track span::before { content: '✦'; color: #ffba58; font-size: .7rem; }
.festival-strip-bottom .festival-track { animation-direction: reverse; }

.poster-area {
  display: grid;
  align-content: center;
  gap: .45rem;
  inline-size: var(--cover-width);
  min-inline-size: 0;
}

.poster {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  inline-size: 100%;
  aspect-ratio: 1199 / 1312;
  background: #330d1d;
  box-shadow: 0 14px 72px #080207c9, 0 0 64px #b65c283d;
}

.poster-art, .flame-overlay {
  position: absolute;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.flame-overlay { pointer-events: none; }

.sender-plaque {
  position: absolute;
  z-index: 1;
  inset: 28.55% 27.8% auto;
  block-size: 13.85%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  text-align: center;
  pointer-events: none;
  animation: name-arrive .68s cubic-bezier(.2, .74, .24, 1.12) both;
}

#page-title {
  max-inline-size: 100%;
  padding-block: .07em .12em;
  color: #ffdc98;
  font: 700 7.85cqw/.91 Georgia, 'Times New Roman', serif;
  letter-spacing: -.024em;
  overflow-wrap: anywhere;
  background: linear-gradient(177deg, #fff3ce 8%, #ffe5aa 47%, #ffc771 88%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: scaleX(.94);
  filter: drop-shadow(0 .045em .115em #ff922bbd);
}

.flame-ignite, .flame-flicker {
  transform-box: view-box;
  transform-origin: 600px 839px;
}

.flame-ignite { opacity: 0; visibility: hidden; }
.flame-halo { mix-blend-mode: screen; }
.oil-shadow { transition: opacity .7s ease-out; }
.oil-light { opacity: 0; mix-blend-mode: screen; transition: opacity .85s; }
#wick { opacity: 0; }
.is-lit #wick { animation: wick-light .7s ease-out both; }
.is-lit .flame-ignite { visibility: visible; opacity: 1; animation: ignite 1.02s cubic-bezier(.19, .67, .27, 1) both; }
.is-lit .flame-flicker { animation: flame-sway 2.4s ease-in-out infinite; }
.is-lit .flame-halo { animation: firelight 2.9s ease-in-out infinite; }
.is-lit .oil-shadow { opacity: 0; }
.is-lit .oil-light { opacity: .82; animation: firelight 2.9s .4s ease-in-out infinite; }

.diya-button {
  position: absolute;
  z-index: 2;
  inset: 53% 19.6% 10.2%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 3rem;
  -webkit-tap-highlight-color: transparent;
}

.diya-button::after {
  position: absolute;
  inset: auto 2% 1%;
  block-size: 25%;
  content: '';
  border-radius: 99rem;
  transition: box-shadow .24s;
}

.diya-button:focus-visible { outline: none; }
.diya-button:focus-visible::after { outline: 2px solid #fff2ba; outline-offset: 3px; }
.diya-button:hover::after, .diya-button:focus-visible::after { box-shadow: 0 0 29px #ffab44a3; }

.blessing-button-label {
  position: absolute;
  inset: 78.6% 24.1% 6.4% 29.1%;
  display: grid;
  place-items: center;
  isolation: isolate;
  color: #ffe0a0;
  font: 400 3.29cqw/1 Georgia, 'Times New Roman', serif;
  text-shadow: 0 .06em .12em #210809;
  white-space: nowrap;
}

.blessing-button-label::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: linear-gradient(112deg, #601318, #4d0c13 70%, #4f0f16);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent),
    linear-gradient(0deg, transparent, #000 13%, #000 87%, transparent);
  mask-composite: intersect;
}

.poster-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-block-size: 44px;
}

.sound-toggle {
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding-inline: .85rem;
  color: var(--ivory);
  background: #240b16e6;
  border: 1px solid #e3ae6663;
  border-radius: 99rem;
  font-size: .76rem;
  transition: border-color .2s, background .2s;
}

.sound-toggle:hover { border-color: #ffcc80; background: #44141d; }
.sound-toggle svg { inline-size: 1.05rem; color: var(--honey); }
.sound-cross, .sound-toggle[aria-pressed="false"] .sound-waves { display: none; }
.sound-toggle[aria-pressed="false"] .sound-cross { display: inline; }
.sound-hint { color: #ffe0ae; font-size: .75rem; }

main { flex: 1 0 auto; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--honey);
  font-size: .73rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.diamond {
  display: inline-block;
  inline-size: .39rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  transform: rotate(45deg);
  background: var(--honey);
  box-shadow: 0 0 9px #ff990078;
}

.blessing {
  max-inline-size: 59rem;
  margin: 0 auto clamp(2.5rem, 7vw, 5rem);
  scroll-margin-block-start: 1.25rem;
  animation: unfold .7s ease-out both;
}

body:has(#ad-slot-header:not(:empty)) .blessing { scroll-margin-block-start: calc(50px + 1.25rem); }

.gift-card {
  position: relative;
  isolation: isolate;
  padding: clamp(1.35rem, 5vw, 3.25rem);
  border: 1px solid #ffc778a3;
  border-radius: 2rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, #631c28a3, transparent 56%),
    linear-gradient(156deg, #2c0b19ef, #160b1af2);
  box-shadow: 0 24px 85px #06030ab0, 0 0 40px #f1912c22;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.gift-card::before {
  position: absolute;
  inset: .38rem;
  content: '';
  border: 1px solid #f8bc6c42;
  border-radius: 1.64rem;
  pointer-events: none;
}

.greeting .eyebrow { justify-content: center; }
.gold-flourish { display: block; inline-size: 8.5rem; margin: .42rem auto 0; color: #ffc16b; }
.greeting h2 {
  margin-block: .55rem .32rem;
  color: var(--honey);
  font: 400 clamp(3.35rem, 9vw, 6.5rem)/.95 var(--display);
  text-shadow: 0 0 37px #ff990034;
}

.greeting h2:focus-visible { outline: 2px solid var(--honey); outline-offset: 6px; border-radius: .3rem; }
.greeting h2 + p { max-inline-size: 48ch; margin-inline: auto; color: var(--ivory); font-size: clamp(.95rem, 2.4vw, 1.08rem); }

.greeting-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block-start: 1rem;
}

.compose-link, .replay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .36rem;
  min-block-size: 44px;
  padding-inline: .85rem;
  color: var(--honey);
  background: #26192b;
  border: 1px solid #ebbe7770;
  border-radius: 99rem;
  font-size: .77rem;
  font-weight: 600;
}

.compose-link {
  color: #fff0c7;
  border-color: #ffd691c2;
  background: radial-gradient(ellipse at 50% 100%, #8a3225, #490d1e 74%);
  box-shadow: 0 0 15px #ffad3b34, inset 0 0 0 2px #fbb96b36;
  text-decoration: none;
}

.compose-link:hover { background: #71252a; }
.replay-button:hover { background: #3a2332; }
.replay-button:disabled { cursor: wait; opacity: .66; }

#ad-slot-native {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  width: 100%;
  margin: 20px 0;
  padding: .8rem;
  border-block: 1px solid #d4af371d;
  background: radial-gradient(ellipse at center, #221e305c, transparent 72%);
}

.ad-placeholder {
  padding: 20px;
  border: 1px dashed #d4af374d;
  border-radius: 8px;
  color: #b9afbf;
  font-size: 12px;
}

.share {
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr);
  align-items: center;
  gap: clamp(1.5rem, 4.2vw, 3.1rem);
  margin-block-start: 1.6rem;
  scroll-margin-block-start: 1.25rem;
  text-align: start;
}

body:has(#ad-slot-header:not(:empty)) .share { scroll-margin-block-start: calc(50px + 1.25rem); }

.share h3 { margin-block: .45rem .55rem; font: 400 clamp(2.25rem, 5vw, 3.35rem)/.99 var(--display); }
.share-invite > p:last-child { max-inline-size: 28ch; color: var(--muted); font-size: .9rem; }
.share form { display: grid; gap: .65rem; text-align: start; }
.share label { color: var(--muted); font-size: .87rem; }
.share input {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 3.35rem;
  padding: .75rem .9rem;
  color: var(--ivory);
  background: #080a1c;
  border: 1px solid #d4af3766;
  border-radius: .75rem;
  font-size: 1rem;
}

.share input::placeholder { color: #a29aab; }
.share input[aria-invalid="true"] { border-color: #ff9d8d; }

.name-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  padding: .6rem .8rem;
  border: 1px solid #d4af3748;
  border-radius: .75rem;
  background: radial-gradient(ellipse at 3% 50%, #5c2633, #280e1c 73%);
  color: var(--honey);
}

.preview-seal {
  display: grid;
  place-items: center;
  inline-size: 2.3rem;
  aspect-ratio: 1;
  border: 1px solid #e8b76d71;
  border-radius: 50%;
  font-size: 1.25rem;
}

.preview-label { display: block; color: #f1c99e; font-size: .61rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
#name-preview { display: block; font: 700 1.38rem/1.17 Georgia, 'Times New Roman', serif; overflow-wrap: anywhere; }
.share-feedback { color: #ffb8ac; font-size: .8rem; }
.share-feedback:empty { margin-block-start: -.65rem; }

.share-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  inline-size: 100%;
  min-block-size: 3.45rem;
  padding: .75rem .8rem;
  border: 1px solid #b1ffc48f;
  border-radius: .75rem;
  color: #061e13;
  background: var(--whatsapp);
  box-shadow: 0 6px 26px #25d36635;
  font-size: clamp(.85rem, 3vw, 1rem);
  font-weight: 700;
  transition: background .2s, box-shadow .2s;
  animation: nudge 7s 2s ease-in-out infinite;
}

.share-button svg { inline-size: 1.35rem; flex: 0 0 auto; }
.share-button::after {
  position: absolute;
  inset: -1px;
  content: '';
  pointer-events: none;
  border: 1px solid var(--whatsapp);
  border-radius: inherit;
  animation: pulse 2.4s ease-out infinite;
}

.share-button:hover { background: #49e483; box-shadow: 0 6px 28px #25d3665c; }
.share-button:is(:hover, :focus-visible), .share-button:is(:hover, :focus-visible)::after { animation: none; }
.no-script { margin-block: 0 2rem; color: var(--honey); text-align: center; }

.footer-inner {
  padding-block: 1.02rem;
  border-block-start: 1px solid var(--gold-line);
  color: #bdb1c1;
  text-align: center;
}

.footer-wish {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .8rem;
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.footer-wish span { color: var(--gold); font-size: .65rem; }

@keyframes drift {
  from { transform: translate3d(0, 5px, 0); }
  to { transform: translate3d(9px, -17px, 0); }
}

@keyframes ribbon-slide {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--ribbon-step))); }
}

@keyframes name-arrive {
  from { opacity: 0; transform: translateY(.45rem) scale(.89); }
  74% { opacity: 1; transform: translateY(0) scale(1.013); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ignite {
  0% { opacity: 0; transform: scale(.12, .05); }
  19% { opacity: .9; transform: scale(.66, .47) rotate(-3deg); }
  53% { opacity: 1; transform: scale(1.22, 1.17) rotate(2deg); }
  100% { opacity: 1; transform: scale(1, 1); }
}

@keyframes wick-light {
  0%, 100% { opacity: 0; }
  16% { opacity: .95; }
  52% { opacity: .35; }
}

@keyframes flame-sway {
  0%, 100% { transform: rotate(-1.4deg) scale(.98, 1.01); }
  18% { transform: rotate(1.6deg) scale(1.045, .975); }
  39% { transform: rotate(-2.35deg) scale(.964, 1.036); }
  58% { transform: rotate(.45deg) scale(1.019, .99); }
  75% { transform: rotate(2.3deg) scale(.965, 1.024); }
  89% { transform: rotate(-.15deg) scale(1.036, .97); }
}

@keyframes firelight {
  0%, 100% { opacity: .81; }
  29% { opacity: .96; }
  62% { opacity: .68; }
  84% { opacity: .9; }
}

@keyframes scatter {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  10% { opacity: 1; }
  66% { opacity: .92; transform: translate(var(--travel-x), var(--travel-y)) rotate(140deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--fall-x), var(--fall-y)) rotate(240deg) scale(.3); }
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { opacity: .8; transform: scale(1); }
  65%, 100% { opacity: 0; transform: scale(1.035, 1.19); }
}

@keyframes nudge {
  0%, 84%, 100% { transform: translateX(0); }
  87%, 94% { transform: translateX(-2px); }
  90%, 97% { transform: translateX(2px); }
}

@media (max-width: 46rem) {
  .welcome-stage {
    --cover-width: min(100%, 36rem);
    padding-block: 0;
  }
  .welcome-stage::before {
    inset: -.75rem;
    background:
      linear-gradient(180deg, #210c186b, #1c0a17d9 28%, #1a0915d4 74%, #2a0e1882),
      url('./diwali-poster.webp') center / 100% 100% no-repeat;
    filter: blur(16px);
  }
  .festival-strip { inline-size: 100%; }
  .greeting h2 { font-size: clamp(2.2rem, 11vw, 4.45rem); }
  .share { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .share-invite { text-align: center; }
  .share-invite .eyebrow { justify-content: center; }
  .share-invite > p:last-child { margin-inline: auto; }
  .scene-rangoli-left { inset: auto auto -8rem -9rem; }
  .scene-rangoli-right { inset: -8rem -8rem auto auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .festival-track { inline-size: 100%; justify-content: center; }
  .festival-track span:not(:first-child) { display: none; }
  .share-button::after { display: none; }
}

@media (forced-colors: active) {
  #page-title { background: none; -webkit-text-fill-color: currentColor; }
}
