/* dnzFX site v6: scroll-driven scenes.
   One system for every scrubbed effect:
   - .sc elements run a keyframe animation over a slice of a scroll range: start --a, length --l (0..1), range name --rn.
   - Chrome/Edge/Safari 26 scrub it natively with animation-timeline. Children of a [data-scene] use that scene's timeline.
   - Other browsers (html.nosdt) pause the same animation and site.js writes the progress to --p.
   - Calm mode (reduced motion) keeps only the unblur fades (.ub) and removes everything that travels, scales or tilts. */

.sc { animation-timing-function: linear; animation-fill-mode: both; animation-duration: 1ms; }
@supports (animation-timeline: view()) {
  .sc { animation-duration: auto; animation-timeline: view();
    animation-range: var(--rn, cover) calc(var(--a, 0) * 100%) var(--rn, cover) calc((var(--a, 0) + var(--l, 1)) * 100%); }
  [data-scene] { view-timeline: --scene block; }
  [data-scene] .sc { animation-timeline: --scene; }
}
[data-scene] { --rn: contain; }
[data-scene="exit"] { --rn: exit; }
.nosdt .sc { animation-duration: 1s; animation-play-state: paused; animation-delay: calc(clamp(0, (var(--p, 0) - var(--a, 0)) / var(--l, 1), 1) * -1s); }

/* text and blocks unblur as they enter */
.ub { animation-name: unblur; --rn: entry; --a: .1; --l: .9; }
@keyframes unblur { from { opacity: 0; filter: blur(12px); transform: translateY(28px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes unblur-calm { from { opacity: 0; filter: blur(10px); } to { opacity: 1; filter: none; } }

/* ================= home hero: reel, floating cards, headline ================= */
.hero { position: relative; min-height: 100svh; padding: 92px 0 40px; display: flex; flex-direction: column; justify-content: center; overflow-x: clip; }
.hero-stage { position: relative; width: min(980px, 78vw, calc((100svh - 350px) * 1.7778)); min-width: min(100%, 320px); margin: 0 auto; perspective: 1400px; }
.hero .reel { animation-name: hero-reel; --a: 0; --l: 1; box-shadow: 0 60px 120px -60px rgba(23, 21, 26, .6); }
@keyframes hero-reel { to { transform: translate3d(16vw, -4vh, 0) scale(.62) rotateY(-16deg) rotateZ(2deg); } }
.reel-cap { position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.reel-cap span { display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px; border-radius: 99px; font: 600 13px/1 var(--sans); letter-spacing: 0; color: #fff; background: rgba(20, 10, 40, .42); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 28px -10px rgba(0, 0, 0, .55); }
.reel-cap .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; animation: cap-ping 2.2s ease-out infinite; }
@keyframes cap-ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); } }
.float { position: absolute; z-index: -1; width: clamp(110px, 13vw, 250px); border-radius: 4px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(23, 21, 26, .55); }
.float img { width: 100%; height: auto; }
.float.f1 { right: calc(100% + 18px); top: 6%; transform: rotate(-7deg); animation-name: float-a; --a: 0; --l: 1; }
.float.f2 { left: calc(100% + 18px); bottom: 2%; transform: rotate(6deg); animation-name: float-b; --a: 0; --l: 1; }
@keyframes float-a { from { transform: rotate(-7deg); } to { transform: translate3d(-4vw, -34vh, 0) rotate(-16deg); } }
@keyframes float-b { from { transform: rotate(6deg); } to { transform: translate3d(6vw, -58vh, 0) rotate(14deg); } }
.hero-copy { display: grid; grid-template-columns: 1fr minmax(0, 400px); gap: 18px 56px; align-items: start; margin-top: clamp(26px, 4vh, 48px); }
.hero h1 { font-size: clamp(38px, 4.6vw, 78px); }
.hero h1 .l1, .hero h1 .l2 { display: block; } .hero h1 .w { display: inline-block; }
.hero h1 .l2 { padding-left: 1em; }
.hero h1 .l1 { animation-name: drift-l; --a: .1; --l: .9; } .hero h1 .l2 { animation-name: drift-r; --a: .1; --l: .9; }
@keyframes drift-l { to { transform: translateX(-5vw); opacity: .15; } }
@keyframes drift-r { to { transform: translateX(7vw); opacity: .15; } }
.hero-side .lead { font-size: 17px; max-width: 36ch; }
.hero-side .cta { margin-top: 20px; }
/* first paint: the headline and reel settle in once */
.hero h1 .w, .hero-side, .hero-stage, .settle, .page-head .kicker { animation: settle 1.2s var(--ease) both; }
.page-head .sub { animation-delay: .15s; }
.hero-side { animation-delay: .25s; } .hero h1 .w2 { animation-delay: .12s; }
@keyframes settle { from { opacity: 0; filter: blur(14px); transform: translateY(24px); } }

/* hero pictures grow when hovered (the individual `scale` property stacks with the scroll animation's transform) */
@media (hover: hover) and (pointer: fine) {
  .float, .hero .reel { transition: scale .55s var(--ease), box-shadow .55s var(--ease); cursor: zoom-in; }
  .float:hover { z-index: 4; scale: 1.38; box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .7); }
  .hero .reel:hover { scale: 1.035; z-index: 3; }
}
@media (max-width: 1100px) { .float { display: none; } }
@media (max-width: 900px) {
  .hero-copy { grid-template-columns: 1fr; }
  .float { display: none; }
  .hero-stage { width: calc(100% - 2 * var(--gut)); }
  .hero h1 .l2 { padding-left: .6em; }
}

/* ================= compare: tilts flat as it arrives ================= */
.cmp { perspective: 1600px; }
.cmp .compare { animation-name: lay-flat; --rn: entry; --a: 0; --l: 1; transform-origin: 50% 100%; }
@keyframes lay-flat { from { transform: rotateX(26deg) scale(.86) translateY(60px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ================= poster row: drifts sideways, every card straightens ================= */
.posters { overflow-x: clip; }
.prow { display: flex; gap: clamp(12px, 1.6vw, 24px); width: max-content; padding-inline: var(--gut); animation-name: row-drift; --a: 0; --l: 1; }
@keyframes row-drift { from { transform: translateX(6vw); } to { transform: translateX(calc(100vw - 100% - 6vw)); } }
.poster { display: block; width: clamp(200px, 21vw, 330px); text-decoration: none; color: var(--fg); }
.poster .pimg { overflow: hidden; border-radius: 4px; aspect-ratio: 3 / 4; background: #1a1816; animation-name: straighten; --rn: entry; --a: 0; --l: 1; }
.poster:nth-child(even) .pimg { --t: -1; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.poster:hover img { transform: scale(1.04); }
.poster span { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13.5px; color: var(--mut); }
@keyframes straighten { from { transform: perspective(1000px) rotateY(calc(var(--t, 1) * -32deg)) rotateZ(calc(var(--t, 1) * -4deg)) translateY(50px) scale(.9); } to { transform: none; } }
.more { margin-top: 44px; }

/* tilted cards that straighten (Optimizer app shots, showcase teaser) */
.tilts { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 3vw, 40px); perspective: 1400px; }
.tilts.three { grid-template-columns: repeat(3, 1fr); }
.tilts figure, .tilts a { margin: 0; display: block; text-decoration: none; animation-name: tilt-in; --rn: entry; --a: 0; --l: 1; }
.tilts > :nth-child(even) { --t: -1; }
.tilts img { border-radius: 4px; width: 100%; }
.tilts figcaption { margin-top: 12px; color: var(--mut); font-size: 14.5px; }
@keyframes tilt-in { from { transform: rotateX(32deg) rotateZ(calc(var(--t, 1) * 3deg)) translateY(80px) scale(.9); opacity: .3; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .tilts, .tilts.three { grid-template-columns: 1fr; } }

/* ================= full-bleed scene: a photo grows to fill the screen, the page goes dark, the list arrives ================= */
.scene { position: relative; height: 340vh; padding: 0; }
.scene .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.bleed { position: absolute; inset: 0; animation-name: bleed; --a: 0; --l: .42; }
.bleed img { width: 100%; height: 100%; object-fit: cover; }
@keyframes bleed { from { transform: scale(.34) rotate(-3deg); } to { transform: none; } }
.shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 9, 12, .9) 0%, rgba(10, 9, 12, .78) 42%, rgba(10, 9, 12, .2) 78%, rgba(10, 9, 12, .05)); animation-name: fade-in; --a: .4; --l: .14; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.scene-copy { position: relative; color: #efe9df; --fg: #efe9df; --mut: #b9b2a8; --line: rgba(239, 233, 223, .2); }
.scene-copy > * { max-width: 640px; }
.scene-copy h2 { font-size: clamp(32px, 3.8vw, 56px); }
.scene .stage { padding-top: 64px; }
.scene-copy .ub { --rn: contain; }
.scene-copy h2 { --a: .44; --l: .1; }
.scene-copy .kicker { --a: .42; --l: .1; }
.scene-copy .flist { grid-template-columns: 1fr; border-top: 0; }
.scene-copy .flist li { padding: 12px 0 13px; --l: .08; }
.scene-copy .flist b { font-size: 17px; } .scene-copy .flist span { font-size: 14.5px; }
.scene-copy .flist li:nth-child(1) { --a: .5; } .scene-copy .flist li:nth-child(2) { --a: .55; } .scene-copy .flist li:nth-child(3) { --a: .6; }
.scene-copy .flist li:nth-child(4) { --a: .65; } .scene-copy .flist li:nth-child(5) { --a: .7; } .scene-copy .flist li:nth-child(6) { --a: .75; }
.scene-tag { position: absolute; right: var(--gut); bottom: 22px; font-size: 13px; color: rgba(239, 233, 223, .85); animation-name: fade-in; --a: .4; --l: .1; }
@media (max-height: 940px) and (min-width: 761px) { .scene-copy .flist span { display: none; } }
/* phones: same pinned scene as desktop; the shade covers the whole photo and the list is compact so it fits one screen */
@media (max-width: 760px) {
  .shade { background: linear-gradient(180deg, rgba(10, 9, 12, .72), rgba(10, 9, 12, .86) 45%, rgba(10, 9, 12, .8)); }
  .scene-copy h2 { font-size: 30px; margin-bottom: 8px; }
  .scene-copy .kicker { margin-bottom: 10px; }
  .scene-copy .flist li { padding: 9px 0 10px; }
  .scene-copy .flist b { font-size: 16px; margin-bottom: 2px; } .scene-copy .flist span { font-size: 13px; line-height: 1.4; }
  .scene-tag { bottom: 12px; }
}
@media (max-width: 760px) and (max-height: 859px) { .scene-copy .flist span { display: none; } }

/* phones and touch screens: the poster row is swiped by hand instead of drifting with the scroll */
@media (max-width: 760px), (pointer: coarse) {
  .posters .prow { width: auto; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); overscroll-behavior-x: contain; scrollbar-width: none; animation: none; }
  .posters .prow::-webkit-scrollbar { display: none; }
  .posters .poster { flex: none; width: min(68vw, 330px); scroll-snap-align: start; }
  .posters .pimg { animation: none; }
}

/* ================= Optimizer scene (deep blue) ================= */
.opt-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px 72px; align-items: center; }
.opt-media { position: relative; perspective: 1400px; }
.opt-media .reel { animation-name: opt-tilt; --rn: entry; --a: 0; --l: 1; box-shadow: 0 50px 100px -50px rgba(40, 26, 8, .6); }
@keyframes opt-tilt { from { transform: rotateY(-24deg) rotateX(8deg) translateX(8vw) scale(.88); } to { transform: none; } }
.opt-copy p { color: var(--mut); max-width: 44ch; }
@media (max-width: 900px) { .opt-grid { grid-template-columns: 1fr; } }

@keyframes rise { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

/* gallery pictures settle as they scroll in */
.shot img.sc { animation-name: settle-img; --rn: entry; --a: 0; --l: 1; }
@keyframes settle-img { from { transform: scale(1.18); } to { transform: none; } }

/* ================= calm mode ================= */
@media (prefers-reduced-motion: reduce) {
  .sc:not(.ub), .reel-cap .live::before { animation: none !important; }
  .float:hover, .hero .reel:hover { scale: none; }
  .ub { animation-name: unblur-calm; }
  .hero h1 .w, .hero-side, .hero-stage, .settle, .page-head .kicker { animation-name: unblur-calm; }
  .scene { height: 220vh; }
}
