/* =========================================================
   Named animation kit · v2.2 (2026-11-01; v1 2026-10-31)
   Apply with data-anim="<name>" (space-separate to combine).
   Names and usage: README.md in this folder.
   ========================================================= */
:root {
  --a-ease: cubic-bezier(.2, .7, .2, 1);
  --a-sweep: #1B1815;        /* Fill Sweep: colour that sweeps in */
  --a-sweep-text: #F3F0EA;   /* Fill Sweep: text colour once filled */
  --a-ticker-dur: 38s;       /* Ticker: one full loop */
  --a-tilt: 7deg;            /* Cursor Tilt: strongest lean */
  --a-gate-bg: rgba(5, 6, 10, .88); /* Sound Gate: overlay colour */
  --a-loader-bg: #0B0B0E;    /* Logo Loader: screen colour */
  --a-loader-ink: #FFFFFF;   /* Logo Loader: logo colour */
  --a-reel-w: min(72%, 300px); /* Video Reel: width of one clip */
  --a-reel-ratio: 9 / 16;    /* Video Reel: clip shape (9/16 = phone video) */
  --a-replay-bg: rgba(247, 247, 244, .92); /* Replay Tab: tab colour */
  --a-replay-ink: #0A0A0C;   /* Replay Tab: text colour */
  --a-replay-hover: #1F4BFF; /* Replay Tab: colour on hover */
}

/* ---------- ON LOAD ---------- */

/* Curtain Rise: each line of a heading rises out from behind a mask */
[data-anim~="curtain"] .a-line { display: block; overflow: hidden; padding: 0 .12em .1em; margin: 0 -.12em -.1em; }
[data-anim~="curtain"] .a-line > span { display: inline-block; animation: a-curtain 1.1s var(--a-ease) backwards; animation-delay: calc(var(--i, 0) * 130ms + 80ms); }
@keyframes a-curtain { from { transform: translateY(105%); } }

/* Panel Cascade: children unveil top-down, one after another */
[data-anim~="cascade"] > * { animation: a-cascade 1s var(--a-ease) backwards; animation-delay: calc(var(--i, 0) * 140ms + 250ms); }
@keyframes a-cascade { from { clip-path: inset(100% 0 0 0); transform: translateY(30px); } to { clip-path: inset(0 0 0 0); } }

/* ---------- ON SCROLL ---------- */

/* Drift Up: a block fades up as it scrolls into view */
[data-anim~="drift"].a-wait { opacity: 0; transform: translateY(28px); }
[data-anim~="drift"].a-in { animation: a-drift .9s var(--a-ease) backwards; }

/* Card Deal: children of a list or grid drift up one by one */
[data-anim~="deal"].a-wait > * { opacity: 0; transform: translateY(28px); }
[data-anim~="deal"].a-in > * { animation: a-drift .8s var(--a-ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes a-drift { from { opacity: 0; transform: translateY(28px); } }

/* Tally: numbers count up from zero (JS does the counting) */
[data-anim~="tally"] { font-variant-numeric: tabular-nums; }

/* Bar Rise: bars of a chart grow up from the baseline */
[data-anim~="bars"] .a-bar { transform-origin: 50% 100%; }
[data-anim~="bars"].a-wait .a-bar { transform: scaleY(0); }
[data-anim~="bars"].a-in .a-bar { animation: a-bar .9s var(--a-ease) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes a-bar { from { transform: scaleY(0); } }

/* Slow Pan: an image drifts slower than the page (parallax) */
[data-anim~="pan"] { translate: 0 var(--a-pan, 0px); scale: calc(1.12 * var(--a-hov, 1)); transition: scale .9s var(--a-ease); will-change: translate; }

/* ---------- ON HOVER ---------- */

/* Lens Push: the image inside a frame zooms in gently */
[data-anim~="lens"] { overflow: hidden; }
[data-anim~="lens"] > :is(img, canvas, video, picture, .a-media):not([data-anim~="pan"]) { scale: var(--a-hov, 1); transition: scale .9s var(--a-ease); }
[data-anim~="lens"]:hover, [data-anim~="lens"]:focus-visible { --a-hov: 1.05; }

/* Ink Line: an underline draws in from the left */
[data-anim~="ink"] { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--a-ease); padding-bottom: 2px; }
[data-anim~="ink"]:hover, a:hover [data-anim~="ink"], a:focus-visible [data-anim~="ink"] { background-size: 100% 1px; }

/* Fill Sweep: a button fills with colour from left to right */
[data-anim~="sweep"] { position: relative; overflow: hidden; isolation: isolate; transition: color .45s var(--a-ease), border-color .45s var(--a-ease); }
[data-anim~="sweep"]::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--a-sweep); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--a-ease); }
[data-anim~="sweep"]:hover, [data-anim~="sweep"]:focus-visible { color: var(--a-sweep-text) !important; border-color: var(--a-sweep) !important; }
[data-anim~="sweep"]:hover::before, [data-anim~="sweep"]:focus-visible::before { transform: scaleX(1); }

/* Card Lift: a card rises and casts a soft shadow */
[data-anim~="lift"] { transition: transform .4s var(--a-ease), box-shadow .4s var(--a-ease); }
[data-anim~="lift"]:hover, [data-anim~="lift"]:focus-within { transform: translateY(-6px); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .35); }

/* ---------- AMBIENT ---------- */

/* Ticker: a strip of words scrolls sideways forever */
[data-anim~="ticker"] { overflow: hidden; white-space: nowrap; }
[data-anim~="ticker"] .a-track { display: inline-flex; width: max-content; animation: a-ticker var(--a-ticker-dur) linear infinite; }
[data-anim~="ticker"] .a-set { display: inline-flex; flex: none; }
[data-anim~="ticker"]:hover .a-track { animation-play-state: paused; }
@keyframes a-ticker { to { transform: translateX(-50%); } }

/* ---------- NAVIGATION ---------- */

/* Page Turn: a page or tab fades up each time it is shown */
[data-anim~="page"] { animation: a-page .6s var(--a-ease) backwards; }
@keyframes a-page { from { opacity: 0; transform: translateY(14px); } }

/* Masthead Tuck: the sticky header slims down and gains a shadow once you scroll */
[data-anim~="tuck"] { transition: box-shadow .35s var(--a-ease), background-color .35s var(--a-ease); }
[data-anim~="tuck"].a-tucked { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .35); }

/* ---------- IMMERSIVE (v2) ---------- */

/* Iris Open: the element opens from a small blurred circle to full size */
[data-anim~="iris"] { animation: a-iris 1.7s var(--a-ease) backwards; }
@keyframes a-iris {
  from { clip-path: circle(3% at 50% 50%); filter: blur(10px) brightness(.5); }
  45% { filter: blur(1px) brightness(.85); }
  to { clip-path: circle(80% at 50% 50%); filter: none; }
}
html.a-gated [data-anim~="iris"] { animation: none; clip-path: circle(0 at 50% 50%); } /* waits behind a Sound Gate */

/* Depth Dive: a pinned 3D scene the visitor scrolls through.
   Section (data-anim="depth") > .a-depth-stage > .a-depth-cam > .a-layer ... plus .a-act overlays.
   Layer vars: --x and --z in % of the scene's width, --y in % of its height, --t = how far it travels toward you,
   --s = growth, --rx/--ry/--rz = fixed tilt. JS sets --a-p (0 to 1) as you scroll. */
[data-anim~="depth"] { position: relative; }
[data-anim~="depth"].a-live { height: var(--a-depth-len, 320vh); }
.a-depth-stage { position: relative; height: 100svh; overflow: hidden; container-type: size; }
[data-anim~="depth"].a-live .a-depth-stage { position: sticky; top: 0; }
[data-anim~="depth"][data-depth-manual] { height: 100%; }
[data-anim~="depth"][data-depth-manual] .a-depth-stage { position: relative; height: 100%; }
.a-depth-cam { position: absolute; inset: 0; perspective: 100cqw; transform-style: preserve-3d;
  transform: rotateX(calc(var(--a-my, 0) * -1.6deg)) rotateY(calc(var(--a-mx, 0) * 1.6deg)); }
.a-layer { position: absolute; will-change: transform;
  transform: translate3d(calc(var(--x, 0) * var(--a-p, 0) * 1cqw), calc(var(--y, 0) * var(--a-p, 0) * 1cqh), calc((var(--z, 0) + var(--a-p, 0) * var(--t, 50)) * 1cqw))
             scale(calc(1 + var(--s, 0) * var(--a-p, 0))) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--rz, 0deg)); }
[data-anim~="depth"] [data-show] { opacity: var(--a-o, 1); }
[data-anim~="depth"] [data-show].a-off { visibility: hidden; }
.a-act { position: absolute; z-index: 5; translate: 0 calc((1 - var(--a-o, 1)) * 4cqh); scale: calc(.96 + var(--a-o, 1) * .04); }
.a-depth-bar { transform-origin: 0 50%; transform: scaleX(var(--a-p, 0)); }
/* Without the script (or with reduce motion) only the opening act shows */
[data-anim~="depth"]:not(.a-live) [data-show]:not([data-show^="0 "]):not([data-show="0"]) { display: none; }

/* Cursor Tilt: leans toward the pointer in 3D (mouse and trackpad only). Add data-glare for a moving shine. */
[data-anim~="tilt"] { transform: perspective(900px) rotateX(var(--a-rx, 0deg)) rotateY(var(--a-ry, 0deg)); transition: transform .7s var(--a-ease); }
[data-anim~="tilt"].a-tilting { transition-duration: .15s; will-change: transform; }
[data-anim~="tilt"][data-glare] { position: relative; overflow: hidden; }
[data-anim~="tilt"][data-glare]::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--a-gx, 50%) var(--a-gy, 50%), rgba(255, 255, 255, .28), transparent 55%); opacity: 0; transition: opacity .5s; }
[data-anim~="tilt"][data-glare].a-tilting::after { opacity: 1; }

/* Outline Type: huge outlined lettering that slides sideways as you scroll (parent should clip) */
[data-anim~="outline"] { -webkit-text-fill-color: transparent; -webkit-text-stroke: var(--a-stroke, 1px) currentColor; white-space: nowrap; line-height: .8;
  pointer-events: none; user-select: none; translate: var(--a-shift, 0px) 0; }

/* Sound Gate: full-screen "Enter with sound / without sound" overlay. Hidden until the script shows it. */
[data-anim~="gate"] { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; text-align: center; color: #fff;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: var(--a-gate-bg); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); transition: opacity .8s var(--a-ease), visibility .8s; }
[data-anim~="gate"]:not(.a-show) { display: none; }
[data-anim~="gate"].a-gone { opacity: 0; visibility: hidden; }
[data-anim~="gate"].a-inline { position: absolute; z-index: 20; }
html.a-gate-lock { overflow: hidden; }
/* Sound toggle bars: put <span class="a-eq"></span> inside a [data-sound-toggle] button */
.a-eq { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.a-eq i { width: 2px; height: 4px; background: currentColor; animation: a-eq .8s ease-in-out infinite paused; }
.a-eq i:nth-child(2) { height: 11px; animation-delay: -.3s; } .a-eq i:nth-child(3) { height: 7px; animation-delay: -.5s; } .a-eq i:nth-child(4) { height: 12px; animation-delay: -.15s; }
[aria-pressed="true"] .a-eq i { animation-play-state: running; }
@keyframes a-eq { 50% { height: 14px; } }

/* Logo Loader: a branded loading screen. Letters arrive one by one, a line fills, then the screen lifts away.
   If the script never runs, it fades out by itself after 4 seconds. */
[data-anim~="loader"] { position: fixed; inset: 0; z-index: 9500; display: grid; place-content: center; justify-items: center; gap: 26px;
  background: var(--a-loader-bg); color: var(--a-loader-ink); animation: a-loader-failsafe .6s 4s forwards; }
@keyframes a-loader-failsafe { to { opacity: 0; visibility: hidden; } }
[data-anim~="loader"] .a-ch { display: inline-block; white-space: pre; animation: a-ch .8s var(--a-ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
@keyframes a-ch { from { opacity: 0; transform: translateY(.4em); filter: blur(6px); } }
[data-anim~="loader"] :is(img, svg).a-logo { animation: a-logo-in 1s var(--a-ease) backwards; }
@keyframes a-logo-in { from { opacity: 0; transform: scale(.92); filter: blur(6px); } }
.a-load-bar { position: relative; display: block; width: min(180px, 40vw); height: 1px; overflow: hidden; background: color-mix(in srgb, currentColor 22%, transparent); }
.a-load-bar i { position: absolute; inset: 0; background: currentColor; transform-origin: 0 50%; transform: scaleX(var(--a-load, 0)); transition: transform .4s var(--a-ease); }
[data-anim~="loader"].a-done { animation: a-loader-out .9s var(--a-ease) forwards; pointer-events: none; }
@keyframes a-loader-out { to { clip-path: inset(0 0 100% 0); } }
[data-anim~="loader"].a-gone { display: none; }
[data-anim~="loader"].a-inline { position: absolute; z-index: 20; } /* inside a box instead of full screen (demos) */
html.a-loading { overflow: hidden; }
html.a-loading :is([data-anim~="curtain"] .a-line > span, [data-anim~="cascade"] > *, [data-anim~="iris"]) { animation-play-state: paused; } /* hero waits for the loader */

/* Video Reel: a row of clips you swipe, drag or step through with arrows and dots. Tap one to play it big with sound.
   On a computer, hovering a clip previews it silently. */
[data-anim~="reel"] { position: relative; }
.a-reel-track { position: relative; display: flex; gap: var(--a-reel-gap, 14px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.a-reel-track::-webkit-scrollbar { display: none; }
.a-reel-track.a-drag { scroll-snap-type: none; cursor: grabbing; }
.a-reel-slide { position: relative; flex: 0 0 var(--a-reel-w); margin: 0; overflow: hidden; scroll-snap-align: start; background: #000; }
.a-reel-slide :is(video, img, canvas) { display: block; width: 100%; aspect-ratio: var(--a-reel-ratio); object-fit: cover; pointer-events: none; transition: scale .9s var(--a-ease); }
.a-reel-slide:hover :is(video, img, canvas) { scale: 1.04; }
.a-reel-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 40px 14px 14px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); pointer-events: none; }
.a-reel-play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: pointer; }
.a-reel-play::before { content: ""; width: 62px; height: 62px; border-radius: 50%; background: rgba(0, 0, 0, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 24px no-repeat;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .5); transition: transform .35s var(--a-ease); }
.a-reel-play:hover::before, .a-reel-play:focus-visible::before { transform: scale(1.1); }
.a-reel-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.a-reel-dots { display: flex; flex-wrap: wrap; }
.a-reel-dots button { position: relative; width: 28px; height: 44px; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; }
.a-reel-dots button::before { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; background: currentColor; opacity: .25; transition: opacity .3s; }
.a-reel-dots button[aria-current="true"]::before { opacity: 1; }
.a-reel-arrows { display: flex; gap: 8px; }
.a-reel-arrows button { width: 48px; height: 48px; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; cursor: pointer; transition: background-color .3s, color .3s, opacity .3s; }
.a-reel-arrows button:disabled { opacity: .3; cursor: default; }
/* Pop-up player (one per page, built by the script) */
.a-lightbox { position: fixed; inset: 0; z-index: 9200; display: grid; place-items: center; padding: 64px 16px max(24px, env(safe-area-inset-bottom)); background: rgba(0, 0, 0, .92);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
.a-lightbox.a-open { opacity: 1; visibility: visible; }
.a-lightbox video { display: block; max-width: 100%; max-height: calc(100dvh - 100px); background: #000; transform: scale(.94); transition: transform .45s var(--a-ease); }
.a-lightbox.a-open video { transform: none; }
.a-lb-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* Replay Tab: a small tab on the right edge, shown once the visitor has scrolled past the intro. Tapping it jumps back and plays the intro again.
   On phones it sits bottom-left. data-target="#hero" names the intro section. */
[data-anim~="replay"] { position: fixed; z-index: 100; right: 0; top: 68%; display: flex; align-items: center; gap: 12px; padding: 18px 11px; writing-mode: vertical-rl;
  border: 1px solid rgba(0, 0, 0, .14); border-right: 0; background: var(--a-replay-bg); color: var(--a-replay-ink); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transform: translate(100%, -50%); opacity: 0; visibility: hidden; transition: transform .45s var(--a-ease), opacity .45s, visibility .45s, background-color .25s, color .25s; }
[data-anim~="replay"] b { font-weight: inherit; }
[data-anim~="replay"].a-show { transform: translate(0, -50%); opacity: 1; visibility: visible; }
[data-anim~="replay"]:hover, [data-anim~="replay"]:focus-visible { background: var(--a-replay-hover); color: #fff; }
html:is(.a-gate-lock, .a-loading) [data-anim~="replay"] { opacity: 0; visibility: hidden; }
[data-anim~="replay"].a-inline { position: absolute; } /* inside a box instead of the window edge (demos) */
.a-replay-icon { position: relative; display: block; width: 14px; height: 14px; flex: none; }
.a-replay-icon::before { content: ""; position: absolute; inset: 1px; border: 1.4px solid currentColor; border-left-color: transparent; border-radius: 50%; }
.a-replay-icon::after { content: ""; position: absolute; left: 0; top: 2px; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-right: 5px solid currentColor; }
[data-anim~="replay"]:hover .a-replay-icon { animation: a-spin .7s var(--a-ease); }
@keyframes a-spin { to { rotate: -360deg; } }
@media (max-width: 700px) {
  [data-anim~="replay"] { top: auto; right: auto; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 14px;
    writing-mode: horizontal-tb; border-right: 1px solid rgba(0, 0, 0, .14); transform: translateY(160%); }
  [data-anim~="replay"].a-show { transform: none; }
}

/* Scroll Volume has no styles: data-anim="volume" data-media="#id" on a section makes the sound follow it (script only). */

/* ---------- Image Trail (24): photos appear along the cursor path, then fade away ----------
   Markup: <section data-anim="trail"> <div class="a-trail-pool"><img ...>…</div> <div class="a-trail-content">…</div> </section>
   The pool images are the photos that get dealt out, in order, as the pointer moves.
   Without the script (or with reduce motion) the first five show as a still scatter. */
:root {
  --a-trail-h: clamp(120px, 24vh, 260px);  /* Image Trail: height of each photo (width follows the photo's shape) */
}
[data-anim~="trail"] { position: relative; overflow: hidden; isolation: isolate; touch-action: pan-y; }
.a-trail-pool, .a-trail-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.a-trail-pool { z-index: 0; }
.a-trail-layer { z-index: 1; }
.a-trail-content { position: relative; z-index: 2; }
.a-trail-pool img { position: absolute; height: var(--a-trail-h); width: auto; max-width: none; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .35); }
.a-trail-pool img:nth-child(1) { left: 5%;  top: 16%; rotate: -4deg; }
.a-trail-pool img:nth-child(2) { left: 72%; top: 10%; rotate: 3deg; }
.a-trail-pool img:nth-child(3) { left: 20%; top: 60%; rotate: 2deg; }
.a-trail-pool img:nth-child(4) { left: 64%; top: 56%; rotate: -3deg; }
.a-trail-pool img:nth-child(5) { left: 42%; top: 28%; rotate: 4deg; }
.a-trail-pool img:nth-child(n+6) { display: none; }
[data-anim~="trail"].a-trail-live .a-trail-pool { display: none; }
.a-trail-img { position: absolute; left: 0; top: 0; height: var(--a-trail-h); width: auto; max-width: none; opacity: 0; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .45); will-change: transform, opacity, clip-path; }

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-anim], [data-anim] *, [data-anim]::before { animation: none !important; transition: none !important; }
  [data-anim].a-wait, [data-anim].a-wait > *, [data-anim].a-wait .a-bar { opacity: 1 !important; transform: none !important; }
  [data-anim~="pan"] { translate: none; scale: 1.12; }
  [data-anim~="iris"] { clip-path: none !important; filter: none !important; }
  .a-depth-cam, .a-layer, [data-anim~="tilt"] { transform: none !important; }
  [data-anim~="depth"] .a-layer:not(.a-bg) { display: none; }
  [data-anim~="outline"] { translate: none; }
  .a-eq i { animation: none !important; }
  [data-anim~="loader"]:not(.a-done) { animation: a-loader-failsafe .01s 4s forwards !important; }
}
