/* Premium motion layer. Loaded after the page styles. Everything here is decoration:
   the site is fully usable if this file or fx.js fails, and calm when "reduce motion" is on. */

/* ---------- opening moment (CSS only, never blocks taps) ---------- */
html.js { --id: 0s; }
html.js:not(.no-intro) { --id: 1.05s; }
#intro { display: none; }
html.js:not(.no-intro) #intro {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, #2a1810 0%, #0c0705 70%);
  animation: introOut .75s ease 1.05s forwards;
}
#intro .in { text-align: center; }
#intro .w { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 9vw, 3rem); color: var(--gold-hi); text-transform: uppercase;
  letter-spacing: .9em; margin-right: -.9em; opacity: 0; animation: introWord 1.2s cubic-bezier(.2,.7,.2,1) .1s forwards; }
#intro i { display: block; height: 1px; width: 0; margin: 16px auto 14px; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); animation: introLine 1s ease .35s forwards; }
#intro em { display: block; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted); opacity: 0; animation: introFade .8s ease .65s forwards; }
@keyframes introWord { from { opacity: 0; letter-spacing: 1.1em; } to { opacity: 1; letter-spacing: .28em; } }
@keyframes introLine { to { width: min(260px, 60vw); } }
@keyframes introFade { to { opacity: 1; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }

/* ---------- hero entrance (individual transform properties so scroll parallax can still use "transform") ---------- */
.hero-img { animation: pcPortrait 1.5s cubic-bezier(.2,.7,.2,1) var(--id, 0s) both; }
.top > *, .hero > * { animation: pcUp .95s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--id, 0s) + .2s + var(--n, 0) * .12s); }
.top > :nth-child(2), .hero > :nth-child(2) { --n: 1; } .hero > :nth-child(3) { --n: 2; } .hero > :nth-child(4) { --n: 3; } .hero > :nth-child(5) { --n: 4; }
@keyframes pcPortrait { from { opacity: 0; scale: 1.05; } to { opacity: 1; scale: 1; } }
@keyframes pcUp { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }

/* ---------- scroll parallax targets ---------- */
.hero-img img { transform: translate3d(0, var(--py, 0px), 0) scale(1.08); will-change: transform; }
/* living portrait: slow camera push-in, pulsing glow around the swirl, flickering lamp, rising embers */
.hero-img { position: relative; }
.hero-img img { animation: pcBreath 18s ease-in-out infinite alternate; }
@keyframes pcBreath { from { scale: 1; translate: -1% 0; } to { scale: 1.055; translate: 1% -1.2%; } }
.hero-img .lv, .reel-frame .lv { position: absolute; pointer-events: none; mix-blend-mode: screen; }
.hero-img .lv.glow { inset: 0; background: radial-gradient(ellipse 46% 30% at 50% 64%, rgba(255,176,64,.30), rgba(255,140,40,.10) 55%, transparent 75%); animation: lvPulse 5.5s ease-in-out infinite; }
.hero-img .lv.lamp { left: 38%; top: 14%; width: 24%; height: 20%; background: radial-gradient(circle, rgba(255,214,140,.55), rgba(255,190,90,.18) 45%, transparent 70%); animation: lvFlicker 3.7s ease-in-out infinite; }
.hero-img canvas.lv, .reel-frame canvas.lv { inset: 0; width: 100%; height: 100%; }
@keyframes lvPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* hero frame, game-skin style. Built only from small pieces that move (transform), which is cheap on phones. */
.hero-img .lv.ring { inset: 0; overflow: hidden; mix-blend-mode: normal; }
.hero-img .lv.ring i { position: absolute; box-shadow: 0 0 9px 1px rgba(255,200,100,.75); }
.hero-img .lv.ring i.t { top: 0; left: 0; height: 3px; width: 46%; background: linear-gradient(90deg, transparent, #ffd682 70%, #fff7dc); animation: runT 6.5s linear infinite; }
.hero-img .lv.ring i.r { top: 0; right: 0; width: 3px; height: 38%; background: linear-gradient(180deg, transparent, #ffd682 70%, #fff7dc); animation: runR 6.5s linear infinite; }
.hero-img .lv.ring i.b { bottom: 0; left: 0; height: 3px; width: 46%; background: linear-gradient(270deg, transparent, #ffd682 70%, #fff7dc); animation: runB 6.5s linear infinite; }
.hero-img .lv.ring i.l { bottom: 0; left: 0; width: 3px; height: 38%; background: linear-gradient(0deg, transparent, #ffd682 70%, #fff7dc); animation: runL 6.5s linear infinite; }
@keyframes runT { 0% { translate: -100% 0; } 25%, 100% { translate: 217% 0; } }
@keyframes runR { 0%, 25% { translate: 0 -100%; } 50%, 100% { translate: 0 263%; } }
@keyframes runB { 0%, 50% { translate: 217% 0; } 75%, 100% { translate: -100% 0; } }
@keyframes runL { 0%, 75% { translate: 0 263%; } 100% { translate: 0 -100%; } }
.hero-img .lv.sheen { inset: 0; overflow: hidden; mix-blend-mode: normal; }
.hero-img .lv.sheen i { position: absolute; top: -25%; bottom: -25%; left: 0; width: 42%; background: linear-gradient(100deg, transparent 0, rgba(255,236,190,.10) 30%, rgba(255,248,224,.22) 50%, rgba(255,236,190,.10) 70%, transparent 100%);
  transform: skewX(-18deg); translate: -160% 0; animation: lvSheen 9s ease-in-out infinite; }
.hero-img .lv.flow { left: 10%; width: 80%; top: 54%; aspect-ratio: 1; translate: 0 -50%; scale: 1 .46; mix-blend-mode: normal; }
.hero-img .lv.flow i.o { position: absolute; inset: 0; animation: lvSpin var(--sp, 8s) linear infinite var(--dir, normal); animation-delay: var(--dl, 0s); }
.hero-img .lv.flow i.o b { position: absolute; left: 100%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; scale: 1 2.17;
  background: radial-gradient(circle, #fff 0 25%, #ffd98a 45%, rgba(255,170,60,0) 75%); box-shadow: 0 0 10px 3px rgba(255,190,80,.7); }
.hero-img .lv.glint { left: var(--x); top: var(--y); width: var(--s); height: var(--s); translate: -50% -50%; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(circle, #fff 0 7%, rgba(255,230,160,.9) 11%, transparent 34%),
              linear-gradient(90deg, transparent 8%, rgba(255,240,200,.95) 50%, transparent 92%) center / 100% 2px no-repeat,
              linear-gradient(0deg, transparent 8%, rgba(255,240,200,.95) 50%, transparent 92%) center / 2px 100% no-repeat;
  animation: lvTwinkle 4.8s ease-in-out infinite; animation-delay: var(--d); }
@keyframes lvSpin { to { rotate: 360deg; } }
@keyframes lvSheen { 0%, 58% { translate: -160% 0; } 100% { translate: 520% 0; } }
@keyframes lvTwinkle { 0%, 55%, 100% { opacity: 0; scale: .2; rotate: 0deg; } 70% { opacity: 1; scale: 1; rotate: 25deg; } 85% { opacity: .4; scale: .6; rotate: 45deg; } }
@keyframes lvFlicker { 0%, 100% { opacity: .5; } 18% { opacity: .85; } 34% { opacity: .6; } 52% { opacity: 1; } 71% { opacity: .55; } }
.hero h1 { transform: translate3d(0, var(--hy, 0px), 0); }

/* ---------- floating playing cards around the hero ---------- */
main.col { position: relative; }
.fx { position: absolute; left: 0; right: 0; top: 84px; height: min(760px, 195vw); z-index: 3; pointer-events: none; overflow: hidden; }
.pc { position: absolute; will-change: transform; perspective: 700px; }
.pc.d0 { filter: drop-shadow(0 16px 20px rgba(0,0,0,.6)); }
.pc.d1 { filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); opacity: .92; }
.pc.d2 { filter: blur(1.2px) drop-shadow(0 7px 10px rgba(0,0,0,.45)); opacity: .78; }
.pci { width: 100%; height: 100%; transform-style: preserve-3d; animation: pcTurn var(--dur, 12s) ease-in-out infinite alternate; animation-delay: var(--fd, 0s); }
.pci svg { display: block; width: 100%; height: 100%; }
@keyframes pcTurn {
  from { transform: rotateY(calc(var(--ry, 20deg) * -1)) rotateX(7deg) translateY(2px); }
  to { transform: rotateY(var(--ry, 20deg)) rotateX(-5deg) translateY(-11px); }
}
@media (min-width: 900px) { .fx { right: auto; width: 460px; height: 560px; } }

/* ---------- reveal on scroll ---------- */
.rv { opacity: 0; translate: 0 28px; transition: opacity .9s cubic-bezier(.2,.7,.2,1), translate .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); will-change: opacity, translate; }
.rv.in { opacity: 1; translate: 0 0; will-change: auto; }
.row h2 { position: relative; }
.row h2::after { content: ""; display: block; height: 1px; width: 0; margin-top: 8px; background: linear-gradient(90deg, var(--gold), transparent); transition: width 1.1s cubic-bezier(.2,.7,.2,1) .25s; }
.rv.in h2::after, .rv.in > h2::after, h2.rv.in::after { width: 64px; }

/* ---------- header: stronger glass + gold progress line ---------- */
.toprow { transition: background .3s, box-shadow .3s; }
.toprow .logo { transition: transform .3s; transform-origin: left center; }
.toprow.scrolled { background: rgba(12,7,5,.97); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.toprow.scrolled .logo { transform: scale(.88); }
.toprow::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- gold button shimmer ---------- */
.book-btn, .hbook, .cbtn.bk, .btn2, .submit { position: relative; overflow: hidden; }
.book-btn::after, .hbook::after, .cbtn.bk::after, .btn2::after, .submit::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); animation: shine 6s ease-in-out infinite;
}
.hbook::after { animation-delay: 2.4s; } .cbtn.bk::after { animation-delay: 1.2s; }
@keyframes shine { 0%, 68% { left: -70%; } 100% { left: 140%; } }

/* ---------- gallery: tilt + glow (mouse only) ---------- */
.gal .tile { transition: transform .25s ease, box-shadow .25s ease, border-color .25s; transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.gal .tile::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(240,196,106,.24), transparent 62%); }
@media (hover: hover) { .gal .tile:hover { border-color: var(--gold); box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(240,196,106,.35); } .gal .tile:hover::before { opacity: 1; } }
.gal .tile span { z-index: 2; }

/* ---------- photo viewer: card-flip open ---------- */
.lb { perspective: 1400px; }
.lb img.flip { animation: cardFlip .6s cubic-bezier(.2,.7,.2,1); }
@keyframes cardFlip { from { opacity: 0; transform: rotateY(88deg) scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- testimonials as a slider ---------- */
.row.quotes { grid-template-columns: minmax(0, 1fr); }
.row.quotes > div { min-width: 0; }
.quotes .qlist.slider { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 0 6px; overscroll-behavior-x: contain; }
.quotes .qlist.slider::-webkit-scrollbar { display: none; }
.quotes .qlist.slider figure { flex: 0 0 88%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; }
.quotes .qlist.slider blockquote { font-size: 1.3rem; }
@media (min-width: 700px) { .quotes .qlist.slider figure { flex-basis: calc(50% - 7px); } }
@media (min-width: 900px) { .quotes .qlist.slider figure { flex-basis: calc(33.333% - 10px); } }
.qdots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.qdots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid var(--gold); background: transparent; cursor: pointer; transition: background .25s, transform .25s; }
.qdots button[aria-current="true"] { background: var(--gold-hi); transform: scale(1.25); }

/* ---------- sparkle canvas ---------- */
.spk { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 150; pointer-events: none; }

/* ---------- calm version ---------- */
@media (prefers-reduced-motion: reduce) {
  #intro, html.js:not(.no-intro) #intro { display: none; }
  .hero-img, .top > *, .hero > * { animation: none; }
  .rv { opacity: 1; translate: none; transition: none; }
  .pci, .book-btn::after, .hbook::after, .cbtn.bk::after, .btn2::after, .submit::after { animation: none; }
  .hero-img img { transform: none; animation: none; }
  .hero-img .lv, .reel-frame .lv { display: none; }
  .reel-frame::after { animation: none; }
  .lb img.flip { animation: none; }
  .fx { display: none; }
}
