:root {
  color-scheme: dark;
  --ink: #080907;
  --ink-soft: #11140f;
  --ivory: #f6efdf;
  --muted: #c9bea9;
  --gold: #c99a35;
  --gold-soft: #e0bd6d;
  --green: #0c3b29;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #030403; }

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ivory);
  overflow-x: hidden;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 58, 42, .3), transparent 42%),
    #030403;
}

.invitation {
  position: relative;
  isolation: isolate;
  width: min(100%, 31rem);
  height: 100svh;
  min-height: 42rem;
  max-height: 62rem;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr minmax(13rem, 31vh) auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.35rem max(.8rem, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(8, 9, 7, .98) 0%, rgba(8, 9, 7, .93) 54%, rgba(5, 8, 6, .7) 100%),
    radial-gradient(circle at 50% 58%, rgba(12, 59, 41, .28), transparent 48%),
    var(--ink);
  box-shadow: 0 0 80px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(224, 189, 109, .12);
}

.invitation::before {
  content: "";
  position: absolute;
  inset: .65rem;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(201, 154, 53, .22);
  border-radius: 1.4rem;
}

.opening-play-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 50% 47%, rgba(25,53,37,.4), transparent 34%), rgba(2,4,3,.66); backdrop-filter: blur(4px); transition: opacity .6s ease, visibility .6s ease; }
.opening-play-overlay.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.opening-play-halo { position: absolute; left: 50%; top: 50%; width: 13rem; height: 13rem; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgba(224,189,109,.18), rgba(201,154,53,.06) 46%, transparent 70%); animation: opening-halo 3.2s ease-in-out infinite; pointer-events: none; }
.opening-play-button { position: relative; display: flex; align-items: center; gap: 1rem; min-width: min(19rem,84vw); padding: 1rem 1.35rem; color: var(--ivory); border: 1px solid rgba(224,189,109,.76); border-radius: 999px; background: linear-gradient(135deg,rgba(10,18,13,.96),rgba(4,9,6,.94)); box-shadow: 0 0 0 1px rgba(201,154,53,.13) inset,0 0 2.2rem rgba(201,154,53,.24),0 .8rem 2rem rgba(0,0,0,.55); cursor: pointer; touch-action: manipulation; }
.opening-play-button:hover,.opening-play-button:focus-visible { outline: none; border-color: #f0cf78; box-shadow: 0 0 0 1px rgba(239,203,112,.24) inset,0 0 2.8rem rgba(224,189,109,.38),0 .8rem 2rem rgba(0,0,0,.55); }
.opening-play-button:disabled { cursor: default; }
.opening-play-icon { flex: 0 0 auto; width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border: 1px solid rgba(224,189,109,.72); border-radius: 50%; color: #efcf7a; background: radial-gradient(circle,rgba(201,154,53,.18),rgba(5,9,6,.72)); box-shadow: 0 0 1rem rgba(224,189,109,.2); }
.opening-play-icon svg { width: 1.65rem; height: 1.65rem; fill: currentColor; filter: drop-shadow(0 0 .35rem rgba(224,189,109,.45)); }
.opening-play-copy { display: block; text-align: left; }
.opening-play-copy strong,.opening-play-copy small { display: block; }
.opening-play-copy strong { color: #f2dfad; font: 500 1.05rem/1.2 Georgia,"Times New Roman",serif; letter-spacing: .16em; text-transform: uppercase; }
.opening-play-copy small { margin-top: .3rem; color: #cdbf9f; font: 400 .72rem/1.2 Arial,sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.awaiting-start .reveal,.awaiting-start .ambient .glow,.awaiting-start .toast-light,.awaiting-start .toast-atmosphere,.awaiting-start .toast-atmosphere::before,.awaiting-start .toast-atmosphere::after,.awaiting-start .toast-spark,.awaiting-start .arrow { animation-play-state: paused!important; }
.awaiting-start .reveal { opacity: 1; transform: none; }
.awaiting-start .play-control,.awaiting-start .continue-cue { pointer-events: none; }

.ambient { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(3px); opacity: 0; animation: bokeh 9s ease-in-out infinite; }
.glow-one { width: 5.5rem; height: 5.5rem; right: -1rem; top: 23%; background: rgba(224, 189, 109, .13); }
.glow-two { width: 2rem; height: 2rem; left: 8%; top: 48%; background: rgba(201, 154, 53, .18); animation-delay: 1.4s; }
.glow-three { width: 3.4rem; height: 3.4rem; right: 13%; top: 53%; background: rgba(255, 226, 164, .1); animation-delay: 3s; }

.identity { text-align: center; padding-top: .4rem; }
.official-logo { width: clamp(3.8rem, 11vh, 5.2rem); aspect-ratio: 1; object-fit: contain; border-radius: 22%; filter: drop-shadow(0 .3rem .65rem rgba(0,0,0,.35)); }
.organization { margin: .35rem 0 0; color: var(--gold-soft); font-size: clamp(.6rem, 1.8vh, .76rem); letter-spacing: .18em; text-transform: uppercase; }

.title-block { align-self: center; text-align: center; padding: .25rem .25rem 0; }
.presents { margin: 0 0 .28rem; color: var(--muted); font-size: clamp(.58rem, 1.6vh, .72rem); letter-spacing: .42em; text-transform: uppercase; }
.story { margin: 0 0 .55rem; color: var(--gold-soft); font-family: "Snell Roundhand", "Segoe Script", cursive; font-size: clamp(1.2rem, 3.1vh, 1.65rem); font-style: italic; }
.event-title { margin: 0; text-transform: uppercase; font-weight: 400; line-height: .92; }
.event-title span { display: block; color: var(--ivory); font-size: clamp(1.5rem, 4.3vh, 2.15rem); letter-spacing: .13em; }
.event-title strong { display: block; margin-top: .22rem; color: var(--gold-soft); font-size: clamp(2.15rem, 6vh, 3.2rem); letter-spacing: .035em; font-weight: 500; }
.dress { margin: .55rem auto .65rem; display: table; padding: .28rem .8rem; border-top: 1px solid rgba(201,154,53,.45); border-bottom: 1px solid rgba(201,154,53,.45); color: var(--ivory); font-size: clamp(.72rem, 1.8vh, .88rem); font-style: italic; letter-spacing: .14em; }
.honoree p { margin: 0; color: var(--muted); font-size: clamp(.68rem, 1.7vh, .83rem); line-height: 1.45; letter-spacing: .08em; }
.honoree h2 { margin: .22rem 0 0; color: var(--ivory); font-size: clamp(1.5rem, 4vh, 2.05rem); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 0 18px rgba(224,189,109,.16); }

.toast-scene { position: relative; align-self: stretch; width: calc(100% + 2.7rem); height: 100%; min-height: 13rem; margin: 0 -1.35rem; overflow: hidden; }
.toast-scene::before { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, var(--ink) 0%, transparent 29%, rgba(5,8,6,.1) 68%, rgba(5,8,6,.96) 100%); pointer-events: none; }
.toast-light { position: absolute; width: 12rem; height: 6rem; left: 50%; top: 27%; translate: -50% -50%; background: rgba(224,189,109,.2); filter: blur(32px); border-radius: 50%; animation: candle 5s ease-in-out infinite; }
.toast-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; opacity: .92; animation: none; transform: none; }
.toast-atmosphere { position: absolute; inset: -.55rem 0 -.35rem; z-index: 2; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(255,215,126,.42) 0%, rgba(226,164,56,.18) 30%, rgba(180,112,22,.06) 55%, transparent 72%); mix-blend-mode: screen; animation: toast-candle-flicker 3.8s ease-in-out infinite; }
.toast-atmosphere::before { content: ""; position: absolute; top: 1%; bottom: 10%; left: -48%; width: 38%; background: linear-gradient(104deg, transparent 0%, rgba(255,202,79,.08) 24%, rgba(255,231,160,.76) 49%, rgba(255,193,55,.22) 67%, transparent 100%); filter: blur(9px); transform: skewX(-12deg); animation: toast-shimmer 6.4s ease-in-out infinite; }
.toast-atmosphere::after { content: ""; position: absolute; inset: -3% -5% 8%; background: radial-gradient(circle at 10% 36%, rgba(255,188,55,.7) 0 1rem, transparent 2.5rem), radial-gradient(circle at 28% 14%, rgba(255,222,145,.66) 0 .72rem, transparent 2rem), radial-gradient(circle at 76% 22%, rgba(255,198,75,.72) 0 1.15rem, transparent 2.75rem), radial-gradient(circle at 92% 54%, rgba(230,151,34,.64) 0 .82rem, transparent 2.2rem), radial-gradient(circle at 69% 76%, rgba(255,218,125,.58) 0 .62rem, transparent 1.8rem), radial-gradient(circle at 21% 78%, rgba(211,132,25,.6) 0 .7rem, transparent 2rem); filter: blur(5px); opacity: .82; animation: toast-bokeh-drift 8.5s ease-in-out infinite alternate; }
.toast-spark { --dx: 0rem; --rise: -4.8rem; position: absolute; left: 50%; top: 55%; width: .26rem; height: .26rem; border-radius: 50%; background: #ffe8ad; box-shadow: .7rem .45rem 0 -.06rem rgba(255,203,91,.9), -.65rem .8rem 0 -.09rem rgba(255,225,153,.84), 0 0 .42rem .11rem rgba(255,190,55,.88); opacity: 0; animation: toast-sparkle-rise 4.8s ease-out infinite; }
.toast-spark::before, .toast-spark::after { content: ""; position: absolute; left: 50%; top: 50%; background: rgba(255,239,195,.95); border-radius: 999px; transform: translate(-50%,-50%); }
.toast-spark::before { width: 1.1rem; height: .075rem; }
.toast-spark::after { width: .075rem; height: 1.1rem; }
.spark-1 { --dx: -1.1rem; --rise: -5.2rem; margin: -1.4rem 0 0 -2.9rem; animation-delay: .15s; }
.spark-2 { --dx: .85rem; --rise: -4.6rem; margin: -.7rem 0 0 2.6rem; animation-delay: .8s; }
.spark-3 { --dx: -.45rem; --rise: -5.5rem; margin: .35rem 0 0 -1.5rem; animation-delay: 1.45s; }
.spark-4 { --dx: 1.2rem; --rise: -4.2rem; margin: 1.2rem 0 0 1.8rem; animation-delay: 2.05s; }
.spark-5 { --dx: .25rem; --rise: -5rem; margin: -2rem 0 0 .55rem; animation-delay: 2.65s; }
.spark-6 { --dx: -1.35rem; --rise: -4.4rem; margin: 2rem 0 0 -3.6rem; animation-delay: 3.2s; }
.spark-7 { --dx: 1.45rem; --rise: -5.35rem; margin: .75rem 0 0 3.65rem; animation-delay: 3.7s; }
.cinematic-controls { position: absolute; z-index: 4; right: 1.2rem; top: 1.15rem; display: flex; gap: .42rem; }
.cinematic-control { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; padding: 0; color: var(--gold-soft); background: rgba(4,7,5,.58); border: 1px solid rgba(224,189,109,.42); border-radius: 50%; backdrop-filter: blur(6px); cursor: pointer; transition: border-color .2s ease, background .2s ease, opacity .2s ease; }
.cinematic-control:hover, .cinematic-control:focus-visible { background: rgba(12,59,41,.76); border-color: rgba(224,189,109,.82); outline: none; }
.cinematic-control svg { width: 1rem; height: 1rem; fill: currentColor; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; fill-rule: evenodd; }
.play-icon { display: none; }
.cinematic-paused .pause-icon { display: none; }
.cinematic-paused .play-icon { display: block; }
.cinematic-paused .toast-placeholder, .cinematic-paused .toast-light, .cinematic-paused .toast-atmosphere, .cinematic-paused .toast-atmosphere::before, .cinematic-paused .toast-atmosphere::after, .cinematic-paused .toast-spark, .cinematic-paused .ambient .glow, .cinematic-paused .arrow { animation-play-state: paused; }
.legacy-line { position: absolute; z-index: 3; left: 0; right: 0; bottom: .55rem; margin: 0; text-align: center; color: var(--ivory); font-size: clamp(.62rem, 1.6vh, .74rem); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.legacy-line span { display: block; }

.continue-cue { display: flex; justify-content: center; align-items: center; gap: .55rem; min-height: 2rem; color: var(--gold-soft); font-family: Arial, sans-serif; font-size: .62rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.arrow { display: inline-block; font-size: 1rem; animation: arrow 1.8s ease-in-out infinite; }

.reveal { opacity: 0; transform: translateY(.5rem); animation: reveal 1.1s cubic-bezier(.22,.7,.28,1) forwards; }
.reveal-1 { animation-delay: .25s; } .reveal-2 { animation-delay: .9s; }
.reveal-3 { animation-delay: 1.25s; } .reveal-4 { animation-delay: 1.7s; }
.reveal-5 { animation-delay: 2.15s; } .reveal-6 { animation-delay: 2.55s; }
.reveal-7 { animation-delay: 2.95s; } .reveal-8 { animation-delay: 3.55s; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-meet {
  0%, 12% { transform: scale(1); }
  58%, 70% { transform: scale(.975); }
  100% { transform: scale(1); }
}
@keyframes bokeh { 0%, 100% { opacity: .18; transform: translateY(0) scale(.9); } 50% { opacity: .72; transform: translateY(-.6rem) scale(1.06); } }
@keyframes candle { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes toast-candle-flicker { 0%, 100% { opacity: .68; } 20% { opacity: .96; } 43% { opacity: .74; } 68% { opacity: 1; } 84% { opacity: .8; } }
@keyframes toast-shimmer { 0%, 12% { left: -48%; opacity: 0; } 23% { opacity: .88; } 58% { left: 116%; opacity: .72; } 70%, 100% { left: 116%; opacity: 0; } }
@keyframes toast-bokeh-drift { 0% { transform: translate3d(-1rem,.65rem,0) scale(.92); opacity: .62; } 48% { opacity: .95; } 100% { transform: translate3d(1.15rem,-.85rem,0) scale(1.1); opacity: .76; } }
@keyframes toast-sparkle-rise { 0%, 8% { opacity: 0; transform: translate3d(0,.4rem,0) scale(.35); } 18% { opacity: 1; transform: translate3d(0,0,0) scale(1); } 52% { opacity: .9; } 100% { opacity: 0; transform: translate3d(var(--dx),var(--rise),0) scale(.42); } }
@keyframes arrow { 0%, 100% { transform: translateX(0); opacity: .55; } 50% { transform: translateX(.35rem); opacity: 1; } }
@keyframes opening-halo { 0%,100% { opacity: .45; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.07); } }

@media (min-width: 32rem) and (min-height: 44rem) {
  .stage { padding: 1.25rem; }
  .invitation { height: min(58rem, calc(100svh - 2.5rem)); border-radius: 1.8rem; }
}

@media (max-height: 47rem) {
  .invitation { grid-template-rows: auto 1fr minmax(10rem, 27vh) auto; }
  .toast-scene { min-height: 10rem; }
  .identity { display: flex; align-items: center; justify-content: center; gap: .65rem; }
  .official-logo { width: 3rem; }
  .organization { margin: 0; font-size: .55rem; }
  .story { margin-bottom: .35rem; }
  .dress { margin-top: .38rem; margin-bottom: .42rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .play-control { display: none; }
  .toast-placeholder { transform: none; }
  .toast-atmosphere, .toast-atmosphere::before, .toast-atmosphere::after, .toast-spark { animation: none !important; }
  .toast-atmosphere { opacity: .22; }
  .toast-atmosphere::before, .toast-spark { opacity: 0; }
}
