/* SGL Scroll 2.0 · structure for every scene. Colours, fonts and spacing come from the site's own theme.
   Nothing here uses filter, backdrop-filter or mix-blend-mode on moving layers (SGL Motion Standard rule 5). */

/* ---------- pinned scenes ---------- */
[data-scene][data-pin] { position: relative; height: calc(var(--len, 3) * 100vh); }
[data-scene][data-pin] > .sm-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sm-land, .sm-lift { position: relative; width: 100%; height: 100%; will-change: transform; }
.sm-fill-abs, .sm-photo, .sm-scrim, .sm-color, .sm-pic-wrap, .sm-chap, .sm-gate-l, .sm-gate-r { position: absolute; inset: 0; }
.sm-photo img, .sm-chap-img img, .sm-slide img, .sm-pic img, .sm-window-in img, .sm-art img, .sm-before img, .sm-after-in img {
  width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- openers ---------- */
[data-scene~="expand"] .sm-photo { transform-origin: 50% 50%; overflow: hidden; will-change: transform; }
[data-scene~="expand"] .sm-scrim { background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.42)); opacity: 0; pointer-events: none; }
[data-scene~="expand"] .sm-title { position: absolute; left: 0; right: 0; top: 18vh; text-align: center; z-index: 3; will-change: transform; }
[data-scene~="expand"] .sm-title > * { display: block; }
[data-scene~="expand"] .sm-t-light { position: absolute; inset: 0; opacity: 0; }

[data-scene~="portal"] .sm-window { position: absolute; left: 50%; top: 50%; width: min(34vw, 46vh); height: min(44vw, 60vh);
  margin: calc(min(44vw, 60vh) / -2) 0 0 calc(min(34vw, 46vh) / -2); overflow: hidden; z-index: 2; will-change: transform; transform-origin: 50% 50%; }
[data-scene~="portal"][data-shape="round"] .sm-window { border-radius: 999px; width: min(44vw, 56vh); height: min(44vw, 56vh);
  margin: calc(min(44vw, 56vh) / -2) 0 0 calc(min(44vw, 56vh) / -2); }
[data-scene~="portal"][data-shape="circle"] .sm-window { border-radius: 50%; width: min(46vw, 52vh); height: min(46vw, 52vh);
  margin: calc(min(46vw, 52vh) / -2) 0 0 calc(min(46vw, 52vh) / -2); }
[data-scene~="portal"] .sm-window-in { position: absolute; width: 100vw; height: 100vh; left: calc(50% - 50vw); top: calc(50% - 50vh); will-change: transform; }
[data-scene~="portal"] .sm-rim { position: absolute; left: 50%; top: 50%; width: min(58vw, 66vh); height: min(58vw, 66vh);
  margin: calc(min(58vw, 66vh) / -2) 0 0 calc(min(58vw, 66vh) / -2); z-index: 3; pointer-events: none; will-change: transform, opacity; }
[data-scene~="portal"] .sm-parts { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .3em; z-index: 4; pointer-events: none; }
[data-scene~="portal"] .sm-part { display: inline-block; will-change: transform, opacity; }

[data-scene~="gate"] .sm-photo { overflow: hidden; }
[data-scene~="gate"] .sm-photo img { will-change: transform; }
[data-scene~="gate"] .sm-gate-l { right: 50%; z-index: 2; will-change: transform; }
[data-scene~="gate"] .sm-gate-r { left: 50%; z-index: 2; will-change: transform; }
[data-scene~="gate"] .sm-title { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 3; pointer-events: none; }

[data-scene~="drift"] .sm-photo { will-change: transform; }
[data-scene~="drift"] .sm-lines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; z-index: 3; pointer-events: none; }
[data-scene~="drift"] .sm-line { display: block; white-space: nowrap; will-change: transform, opacity; }

[data-scene~="pullback"] .sm-lift { display: grid; place-items: center; }
[data-scene~="pullback"] .sm-wall { position: absolute; inset: 0; opacity: 0; }
[data-scene~="pullback"] .sm-art { position: relative; width: min(46vw, 52vh); aspect-ratio: 4 / 5; z-index: 2; will-change: transform; overflow: hidden; }
[data-scene~="pullback"] .sm-title { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 3; pointer-events: none; }

.sm-after { position: absolute; left: 0; right: 0; bottom: 12vh; text-align: center; z-index: 5; opacity: 0; will-change: transform, opacity; }

/* rotator and cycle (time animations) */
.sm-rotator { position: relative; overflow: hidden; }
.sm-rotator .sm-slide { position: absolute; inset: 0; opacity: 0; overflow: hidden; }
.sm-rotator .sm-slide:first-of-type { opacity: 1; }
.sm-rotator .sm-slide img { will-change: transform; }
.sm-rot-count { font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; }
.sm-rot-win { display: inline-block; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: bottom; }
.sm-rot-col { display: flex; flex-direction: column; }
.sm-rot-col > span { height: 1.2em; }
.sm-rot-bar { display: block; height: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.sm-rot-bar i { display: block; height: 100%; background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }
.sm-cycle { display: inline-block; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: bottom; }
.sm-cycle-in { display: flex; flex-direction: column; }
.sm-cycle-in > span { height: 1.15em; white-space: nowrap; }

/* ---------- work ---------- */
[data-scene~="row"] .sm-lift { display: flex; flex-direction: column; justify-content: center; }
[data-scene~="row"] .sm-track { display: flex; gap: clamp(16px, 2.4vw, 36px); padding: 0 8vw; width: max-content; will-change: transform; position: relative; z-index: 2; }
[data-scene~="row"] .sm-track > * { flex: 0 0 auto; width: clamp(260px, 30vw, 460px); }
[data-scene~="row"].sm-feed .sm-track > * { width: clamp(220px, 22vw, 330px); aspect-ratio: 9 / 16; }
[data-scene~="row"] .sm-ghost { position: absolute; top: 50%; left: 0; transform: translate3d(8vw, 0, 0); margin-top: -.55em; font-size: 26vw; line-height: 1;
  white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px currentColor; opacity: .14; z-index: 1; pointer-events: none; will-change: transform; }
[data-scene~="row"] .sm-bar { position: absolute; left: 8vw; right: 8vw; bottom: 8vh; height: 2px; background: currentColor; opacity: .55; transform-origin: 0 50%; transform: scaleX(0); z-index: 3; }

[data-scene~="takeover"] .sm-color { background: var(--c, #ddd); }
[data-scene~="takeover"] .sm-color ~ .sm-color { opacity: 0; }
[data-scene~="takeover"] .sm-take { position: relative; z-index: 2; height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; gap: 5vw; align-items: center; padding: 0 7vw; }
[data-scene~="takeover"] .sm-items { list-style: none; margin: 0; padding: 0; }
[data-scene~="takeover"] .sm-item { will-change: transform, opacity; opacity: .32; }
[data-scene~="takeover"] .sm-item-more { opacity: 0; }
[data-scene~="takeover"] .sm-pics { position: relative; height: min(70vh, 640px); }
[data-scene~="takeover"] .sm-pic { position: absolute; inset: 0; overflow: hidden; opacity: 0; will-change: transform, opacity; }
[data-scene~="takeover"] .sm-pic:first-of-type { opacity: 1; }
@media (max-width: 760px) {
  [data-scene~="takeover"] .sm-take { grid-template-columns: 1fr; grid-template-rows: 42vh auto; padding: 12vh 6vw 6vh; gap: 4vh; align-items: start; }
  [data-scene~="takeover"] .sm-pics { order: -1; height: 40vh; }
}

[data-scene~="chapters"] .sm-chap { overflow: hidden; }
[data-scene~="chapters"] .sm-chap ~ .sm-chap { opacity: 0; }
[data-scene~="chapters"] .sm-chap-img { position: absolute; inset: 0; will-change: transform; }
[data-scene~="chapters"] .sm-chap-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.45)); }
[data-scene~="chapters"] .sm-chap-word { position: absolute; left: 0; right: 0; top: 50%; margin-top: -.5em; line-height: 1; text-align: center; white-space: nowrap;
  font-size: 22vw; z-index: 2; will-change: transform; pointer-events: none; }
[data-scene~="chapters"] .sm-chap-text { position: absolute; left: 0; right: 0; bottom: 10vh; text-align: center; z-index: 3; padding: 0 8vw; opacity: 0; will-change: transform, opacity; }

[data-scene~="flip"] .sm-flip { perspective: 1400px; }
[data-scene~="flip"] .sm-flip-in { position: relative; transform-style: preserve-3d; will-change: transform; height: 100%; }
[data-scene~="flip"] .sm-front, [data-scene~="flip"] .sm-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; position: absolute; inset: 0; overflow: hidden; }
[data-scene~="flip"] .sm-back { transform: rotateY(180deg); }

[data-scene~="board"] .sm-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

.sm-marquee { overflow: hidden; }
.sm-marquee-in { display: flex; width: max-content; animation: sm-mq var(--sm-mq, 40s) linear infinite; will-change: transform; }
.sm-marquee:hover .sm-marquee-in { animation-play-state: paused; }
@keyframes sm-mq { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- process ---------- */
[data-scene~="stack"], [data-scene~="curtain"] { position: relative; display: grid; }
[data-scene~="stack"] > .sm-card { position: sticky; top: 13vh; transform-origin: 50% 0; }
[data-scene~="stack"] .sm-card-in { position: relative; will-change: transform; }
.sm-shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 5; border-radius: inherit; }
[data-scene~="curtain"] > .sm-card { position: sticky; top: 0; min-height: 100vh; overflow: hidden; transform-origin: 50% 0; }
[data-scene~="curtain"] .sm-card-in { position: relative; min-height: 100vh; }

[data-scene~="timeline"] .sm-tl { position: relative; }
[data-scene~="timeline"] .sm-line { position: absolute; top: 0; bottom: 0; left: 18px; width: 2px; background: rgba(127,127,127,.25); }
[data-scene~="timeline"] .sm-line-fill { position: absolute; inset: 0; background: currentColor; transform-origin: 50% 0; transform: scaleY(0); will-change: transform; }
[data-scene~="timeline"] .sm-step { position: relative; padding-left: 56px; }
[data-scene~="timeline"] .sm-step-in { opacity: .3; will-change: transform, opacity; }
[data-scene~="timeline"] .sm-dot { position: absolute; left: 10px; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: currentColor; transform: scale(.55); will-change: transform; }

[data-scene~="assemble"] .sm-piece { will-change: transform, opacity; }
[data-scene~="assemble"] .sm-fill { display: block; height: 4px; background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }

[data-scene~="rewrite"] .sm-old { position: relative; display: inline-block; }
[data-scene~="rewrite"] .sm-strike { position: absolute; left: -2%; right: -2%; top: 54%; height: .09em; background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }
[data-scene~="rewrite"] .sm-new { display: block; opacity: 0; will-change: transform, opacity; }

/* ---------- proof ---------- */
[data-scene~="wipe"] .sm-wipe { position: relative; overflow: hidden; }
[data-scene~="wipe"][data-pin] .sm-lift { display: grid; place-items: center; }
[data-scene~="wipe"] .sm-before { position: absolute; inset: 0; }
[data-scene~="wipe"] .sm-after { position: absolute; inset: 0; overflow: hidden; transform: translate3d(100%, 0, 0); will-change: transform; }
[data-scene~="wipe"] .sm-after-in { position: absolute; inset: 0; transform: translate3d(-100%, 0, 0); will-change: transform; }
[data-scene~="wipe"] .sm-scan { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.7); z-index: 4; will-change: transform, opacity; }
[data-scene~="wipe"] .sm-label-before, [data-scene~="wipe"] .sm-label-after { position: absolute; top: 16px; z-index: 5; }
[data-scene~="wipe"] .sm-label-before { left: 16px; } [data-scene~="wipe"] .sm-label-after { right: 16px; opacity: 0; }

.sm-count { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.sm-digit { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; }
.sm-digit-in { display: flex; flex-direction: column; will-change: transform; }
.sm-digit-in > span { height: 1em; }

/* ---------- breathers ---------- */
.sm-words .sm-word { opacity: .14; }
[data-scene~="ghost"] { overflow: hidden; }
.sm-ghost-word { display: block; white-space: nowrap; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px currentColor; position: relative; will-change: transform; }
.sm-ghost-fill { position: absolute; inset: 0; color: currentColor; -webkit-text-stroke: 0; opacity: 0; }

/* ---------- accents (pure CSS) ---------- */
[data-speed] { will-change: transform; }
.sm-lw { display: inline-block; white-space: nowrap; }
.sm-l { display: inline-block; }
html.sm-on [data-letters]:not([data-letters="view"]) .sm-l { animation: sm-letter .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 26ms + .15s); }
@keyframes sm-letter { from { opacity: 0; transform: translate3d(0, .5em, 0) rotate(4deg); } to { opacity: 1; transform: none; } }
html.sm-sda [data-letters="view"] .sm-l { animation: sm-letter cubic-bezier(.45,0,.25,1) both; animation-timeline: view(); animation-range: entry calc(10% + var(--i) * 0.8%) cover calc(32% + var(--i) * 0.8%); }
html.sm-on:not(.sm-sda) [data-letters="view"] .sm-l { opacity: 0; transform: translate3d(0, .5em, 0); transition: opacity .6s, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i) * 22ms); }
html.sm-on:not(.sm-sda) [data-letters="view"].sm-in .sm-l { opacity: 1; transform: none; }

html.sm-sda [data-reveal] { animation: sm-reveal cubic-bezier(.45,0,.25,1) both; animation-timeline: view(); animation-range: entry 10% cover 36%; }
@keyframes sm-reveal { from { opacity: 0; transform: translate3d(0, 34px, 0); } to { opacity: 1; transform: none; } }
html.sm-on:not(.sm-sda) [data-reveal] { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
html.sm-on:not(.sm-sda) [data-reveal].sm-in { opacity: 1; transform: none; }

.sm-uline { position: relative; display: inline-block; }
.sm-uline::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .08em; background: var(--sm-uline, currentColor); transform-origin: 0 50%; transform: scaleX(0); }
html.sm-sda .sm-uline::after { animation: sm-uline cubic-bezier(.45,0,.25,1) both; animation-timeline: view(); animation-range: entry 30% cover 50%; }
html.sm-on:not(.sm-sda) .sm-uline::after { transition: transform .9s cubic-bezier(.2,.7,.2,1) .2s; }
html.sm-on:not(.sm-sda) .sm-uline.sm-in::after, html.sm-still .sm-uline::after { transform: scaleX(1); }
@keyframes sm-uline { to { transform: scaleX(1); } }

/* ---------- still layout: reduced motion, ?still, data-motion="off" ---------- */
html.sm-still [data-pin] { height: auto !important; }
html.sm-still .sm-stage { position: relative; height: auto; min-height: 100vh; }
html.sm-still .sm-after, html.sm-still .sm-item, html.sm-still .sm-item-more, html.sm-still .sm-chap-text,
html.sm-still .sm-step-in, html.sm-still .sm-new, html.sm-still .sm-word, html.sm-still .sm-t-light { opacity: 1; }
html.sm-still .sm-t-dark, html.sm-still .sm-parts, html.sm-still .sm-rim, html.sm-still .sm-gate-l, html.sm-still .sm-gate-r,
html.sm-still .sm-scan, html.sm-still .sm-label-before { display: none; }
html.sm-still [data-scene~="expand"] .sm-scrim { opacity: 1; }
html.sm-still [data-scene~="portal"] .sm-window { position: absolute; inset: 0; width: auto; height: auto; margin: 0; border-radius: 0; }
html.sm-still [data-scene~="portal"] .sm-window-in { inset: 0; left: 0; top: 0; width: 100%; height: 100%; }
html.sm-still [data-scene~="pullback"] .sm-wall { opacity: 1; }
html.sm-still [data-scene~="row"] { height: auto !important; }
html.sm-still [data-scene~="row"] .sm-stage { min-height: 0; padding: 12vh 0; }
html.sm-still [data-scene~="row"] .sm-track { width: auto; flex-wrap: wrap; justify-content: center; }
html.sm-still [data-scene~="row"] .sm-ghost, html.sm-still [data-scene~="row"] .sm-bar { display: none; }
html.sm-still [data-scene~="takeover"] .sm-color ~ .sm-color, html.sm-still [data-scene~="takeover"] .sm-pic ~ .sm-pic { display: none; }
html.sm-still [data-scene~="chapters"] .sm-stage { min-height: 0; }
html.sm-still [data-scene~="chapters"] .sm-chap { position: relative; height: 100vh; opacity: 1 !important; }
html.sm-still [data-scene~="board"] .sm-stage { overflow: visible; }
html.sm-still [data-scene~="board"] .sm-board { position: relative; width: auto !important; height: auto !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; padding: 10vh 6vw; }
html.sm-still [data-scene~="board"] .sm-panel { position: relative !important; left: auto !important; top: auto !important; width: auto !important; }
html.sm-still [data-scene~="wipe"] .sm-after { transform: none; width: 50%; left: 50%; }
html.sm-still [data-scene~="wipe"] .sm-after-in { transform: translate3d(-50%, 0, 0); width: 200%; }
html.sm-still [data-scene~="wipe"] .sm-label-after { opacity: 1; }
html.sm-still .sm-marquee-in { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
html.sm-still .sm-rotator .sm-slide ~ .sm-slide { display: none; }
html.sm-still .sm-cycle-in { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .sm-marquee-in, .sm-rotator *, .sm-cycle-in, .sm-l { animation: none !important; } }
