/* Pocket Deck: scenes. One brand colour (graphite + lime, one green wash). Movement comes from
   light that travels with the scroll, a lime progress line, hairlines that draw in at each section,
   and content that enters with stagger and depth. Opt-in by html.sc (set by scenes.js). */

html.sc body { background-color: color-mix(in oklab, var(--p-bg) 90%, #9acd32); }
html.sc .ground-surface { background: color-mix(in oklab, var(--p-surface) 88%, #9acd32); }
html.sc .nav { background: color-mix(in oklab, var(--bg) 93%, #9acd32); }

/* lime light that travels down the page while you scroll (stretches a little with scroll speed) */
.sc-glow, .sc-bar { display: none; }
html.sc .sc-glow { display: block; position: fixed; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: screen; overflow: hidden; }
.sc-glow i { position: absolute; border-radius: 50%; will-change: transform; }
.sc-glow .b1 {
  width: 78vmax; height: 78vmax; left: -26vmax; top: -34vmax;
  background: radial-gradient(closest-side, rgba(154,205,50,.24), rgba(154,205,50,.08) 55%, transparent);
  transform: translate3d(calc(var(--sy, 0) * 52vw), calc(var(--sy, 0) * 78vh), 0) scale(calc(1 + var(--sv, 0) * .22));
}
.sc-glow .b2 {
  width: 62vmax; height: 62vmax; right: -24vmax; bottom: -34vmax;
  background: radial-gradient(closest-side, rgba(212,248,107,.14), transparent);
  transform: translate3d(calc(var(--sy, 0) * -46vw), calc(var(--sy, 0) * -70vh), 0) scale(calc(1 + var(--sv, 0) * .18));
}
html.sc-small .sc-glow { display: none; }

/* progress line */
html.sc .sc-bar { display: block; position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; background: #d4f86b; transform-origin: 0 50%; transform: scaleX(var(--sy, 0)); box-shadow: 0 0 14px rgba(212,248,107,.55); }

/* category change: a small chapter tag at the bottom-left swaps its label when you enter a new category,
   and each section heading is wiped in from a mask */
.sc-tag { display: none; }
/* sits in the left margin, rotated, so it never covers content; only where the margin is wide enough */
@media (min-width: 1200px) {
  html.sc:not(.sc-small) .sc-tag {
    --rot: rotate(-90deg) translateX(-50%);
    display: flex; align-items: center; gap: 12px; position: fixed; left: 16px; top: 50%; transform-origin: 0 0; z-index: 45; pointer-events: none;
    height: 36px; padding: 0 16px 0 6px; border-radius: 999px; background: rgba(17,19,21,.78); color: #f4f5f1; border: 1px solid rgba(212,248,107,.28);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font: 600 12.5px/1 var(--font-body, inherit); letter-spacing: .01em; white-space: nowrap;
    opacity: 0; transform: var(--rot) translateY(-12px); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1);
  }
  html.sc .sc-tag.is-on { opacity: 1; transform: var(--rot); }
}
.sc-tag__n { display: grid; place-items: center; min-width: 28px; height: 24px; padding: 0 7px; border-radius: 999px; background: #d4f86b; color: #111315; font: 700 12px/1 var(--font-body, inherit); font-variant-numeric: tabular-nums; }
.sc-tag__t { display: inline-block; overflow: hidden; height: 1.25em; line-height: 1.25; }
.sc-tag__t > span { display: block; }
.sc-tag__n, .sc-tag__t > span { transition: opacity .22s ease; }
.sc-tag.is-swap .sc-tag__n, .sc-tag.is-swap .sc-tag__t > span { opacity: 0; }
.sc-tag__of { opacity: .5; font-weight: 500; }

/* heading wipe */
html.sc .sc-h { clip-path: inset(0 0 100% 0); transform: translateY(.4em); }
html.sc .sc-h.sc-h-in { clip-path: inset(-.2em -.2em -.2em -.2em); transform: none; transition: clip-path 1s cubic-bezier(.2,.7,.2,1) .1s, transform 1s cubic-bezier(.2,.7,.2,1) .1s; }

/* entrance: stagger + depth */
html.sc .wrap { perspective: 1400px; }
html.sc .sc-i { opacity: 0; transform: translate3d(0, 54px, -70px) scale(.95) rotateX(7deg); transform-origin: 50% 100%; filter: blur(9px); }
html.sc .sc-i.sc-in {
  opacity: 1; transform: none; filter: none;
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1), filter .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--rd, 0) * 110ms);
}
html.sc-small .sc-i { transform: translate3d(0, 34px, 0) scale(.98); filter: blur(4px); }
html.sc-lite .sc-i { transform: translate3d(0, 28px, 0); filter: none; }
html.sc-lite .sc-i.sc-in { transition: opacity .45s ease, transform .5s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--rd, 0) * 40ms); }

/* depth while scrolling: the section recedes as it leaves, the panels move a little faster than the text */
html.sc:not(.sc-small):not(.sc-lite) main > section:not(.hero):not([data-moment]) > .wrap {
  transform: translate3d(0, calc(var(--sp, 0) * 22px), 0) scale(calc(1 - var(--sa, 0) * .035));
  opacity: calc(1 - var(--sa, 0) * .45);
}
html.sc:not(.sc-small):not(.sc-lite) main > section:not(.hero):not([data-moment]) .frame { translate: 0 calc(var(--sp, 0) * -34px); }

/* reduced motion: a short fade only, no travelling light, bar, blur or depth */
html.sc-calm .sc-h { clip-path: none; opacity: 0; transform: none; }
html.sc-calm .sc-h.sc-h-in { clip-path: none; opacity: 1; transform: none; transition: opacity .6s ease .05s; }
html.sc-calm .sc-i { opacity: 0; transform: translate3d(0, 14px, 0); filter: none; }
html.sc-calm .sc-i.sc-in { opacity: 1; transform: none; transition: opacity .55s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--rd, 0) * 60ms); }
@media (prefers-reduced-motion: reduce) {
  html.sc .sc-glow, html.sc .sc-bar { display: none; }
  html.sc .sc-tag, html.sc .sc-tag * { transition: none !important; }
  html.sc main > section > .wrap, html.sc main > section .frame { transform: none !important; translate: none !important; opacity: 1 !important; }
}
