/* Shared Web Effects kit ("fx") v1, 2026-10-10. Plain CSS + fx.js, no dependencies.
   Five effects: hero video, smooth reveals, scroll storyline, hover reveal, object breakdown.
   Theme by overriding the --fx-* tokens on :root (or any ancestor). Docs: /root/shared_web_effects/README.md */
:root{
  --fx-accent:#1f7a55; --fx-accent-soft:rgba(31,122,85,.12); --fx-ink:#1d2a22; --fx-muted:#5d6b62;
  --fx-card:#fff; --fx-line:#dde6de; --fx-hero-ink:#fff; --fx-radius:16px;
  --fx-ease:cubic-bezier(.2,.7,.2,1); --fx-dur:.8s; --fx-rise:28px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --fx-ink:#e7efe9; --fx-muted:#9fb0a5; --fx-card:#1a221d; --fx-line:#2b3830; --fx-accent:#4cc38a; --fx-accent-soft:rgba(76,195,138,.14)}}
:root[data-theme="dark"]{--fx-ink:#e7efe9; --fx-muted:#9fb0a5; --fx-card:#1a221d; --fx-line:#2b3830; --fx-accent:#4cc38a; --fx-accent-soft:rgba(76,195,138,.14)}

/* Full-bleed helper: lets a section break out of a centered column without horizontal scroll */
.fx-page{overflow-x:clip}
.fx-bleed{width:100vw;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw)}
.fx-inner{max-width:1100px;margin:0 auto;padding:0 16px}

/* ── 1. Hero video ─────────────────────────────────────────────── */
.fx-hero{position:relative;isolation:isolate;overflow:hidden;min-height:min(88svh,820px);display:flex;align-items:flex-end;
  color:var(--fx-hero-ink);background:#0f2a1f}
.fx-hero-media{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;display:block}
.fx-hero::after{content:"";position:absolute;inset:0;z-index:-1;
  background:linear-gradient(180deg,rgba(0,0,0,.05) 0%,rgba(0,0,0,.15) 45%,rgba(0,0,0,.62) 100%)}
.fx-hero-content{width:100%;max-width:1100px;margin:0 auto;padding:32px 16px clamp(40px,8vh,88px)}
.fx-hero h1{color:inherit;font-size:clamp(34px,7vw,72px);line-height:1.02;margin:8px 0 14px;max-width:16ch;text-wrap:balance}
.fx-hero p{max-width:56ch;font-size:clamp(17px,2.2vw,20px);opacity:.92}
.fx-hero-toggle{position:absolute;right:16px;bottom:16px;z-index:2;width:44px;height:44px;border-radius:50%;
  border:1px solid rgba(255,255,255,.45);background:rgba(0,0,0,.35);color:#fff;font:600 15px/1 system-ui;cursor:pointer;
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.fx-hero-toggle:focus-visible{outline:3px solid #fff;outline-offset:2px}
.fx-scroll-cue{display:inline-block;margin-top:18px;font-size:14px;letter-spacing:.08em;text-transform:uppercase;opacity:.8}
.fx-scroll-cue::after{content:"";display:block;width:1px;height:34px;margin:8px auto 0;background:currentColor;
  transform-origin:top;animation:fx-cue 2.2s var(--fx-ease) infinite}
@keyframes fx-cue{0%{transform:scaleY(0)}50%{transform:scaleY(1)}100%{transform:scaleY(1);opacity:0}}

/* ── 2. Smooth animations: reveal on scroll + split headline ───── */
/* Hidden only when JS is running (html.fx-js), so no-JS visitors always see everything. */
.fx-js [data-fx~="reveal"]{opacity:0;transform:translate3d(0,var(--fx-rise),0);
  transition:opacity var(--fx-dur) var(--fx-ease),transform var(--fx-dur) var(--fx-ease);transition-delay:var(--fx-delay,0s)}
.fx-js [data-fx~="reveal"].fx-in{opacity:1;transform:none}
.fx-js [data-fx~="reveal"][data-fx-from="left"]{transform:translate3d(calc(var(--fx-rise) * -1),0,0)}
.fx-js [data-fx~="reveal"][data-fx-from="scale"]{transform:scale(.94)}
.fx-js [data-fx~="reveal"].fx-in[data-fx-from]{transform:none}
.fx-word{display:inline-block;white-space:pre}
.fx-js [data-fx~="split"] .fx-word{opacity:0;transform:translate3d(0,.6em,0);filter:blur(6px);
  transition:opacity .7s var(--fx-ease),transform .7s var(--fx-ease),filter .7s var(--fx-ease);transition-delay:calc(var(--i) * 55ms)}
.fx-js [data-fx~="split"].fx-in .fx-word{opacity:1;transform:none;filter:none}

/* ── 3. Scroll-based storyline ─────────────────────────────────── */
.fx-story{display:grid;grid-template-columns:1fr 1fr;gap:clamp(20px,5vw,64px);align-items:start}
.fx-story-visual{position:sticky;top:max(12vh,72px);height:min(70vh,560px);border-radius:calc(var(--fx-radius) + 8px);
  background:var(--fx-card);border:1px solid var(--fx-line);overflow:hidden}
.fx-story-scene{position:absolute;inset:0;display:grid;place-items:center;padding:24px;opacity:0;transform:scale(.97);
  transition:opacity .6s var(--fx-ease),transform .6s var(--fx-ease)}
.fx-story-scene.is-active{opacity:1;transform:none}
.fx-story-bar{position:absolute;left:0;top:0;height:4px;width:100%;transform-origin:left;transform:scaleX(var(--fx-p,0));
  background:var(--fx-accent)}
.fx-story-step{min-height:62vh;display:flex;flex-direction:column;justify-content:center;opacity:.32;
  transition:opacity .5s var(--fx-ease)}
.fx-story-step.is-active{opacity:1}
.fx-story-step:last-child{min-height:72vh}
.fx-story-num{font:700 13px/1 system-ui;letter-spacing:.12em;color:var(--fx-accent);text-transform:uppercase}
@media (max-width:760px){
  .fx-story{grid-template-columns:1fr;gap:0}
  .fx-story-visual{top:64px;height:38vh;z-index:1;box-shadow:0 10px 30px rgba(0,0,0,.12)}
  .fx-story-step{min-height:58vh;padding-top:2vh}
}
/* No JS: show every scene inline instead of a sticky stage */
html:not(.fx-js) .fx-story-scene{position:static;opacity:1;transform:none}
html:not(.fx-js) .fx-story-visual{position:static;height:auto}
html:not(.fx-js) .fx-story-step{opacity:1;min-height:0}

/* ── 4. Hover-based reveal ─────────────────────────────────────── */
.fx-hover{position:relative;overflow:hidden;border-radius:var(--fx-radius);background:var(--fx-card);border:1px solid var(--fx-line);
  padding:20px;transition:transform .35s var(--fx-ease),box-shadow .35s var(--fx-ease),border-color .35s}
.fx-hover::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .3s;
  background:radial-gradient(320px circle at var(--mx,50%) var(--my,50%),var(--fx-accent-soft),transparent 70%)}
.fx-hover-more{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .45s var(--fx-ease),opacity .45s var(--fx-ease)}
.fx-hover-more>*{overflow:hidden;min-height:0}
.fx-hover-cue{display:inline-block;font-size:13px;color:var(--fx-accent);font-weight:700;margin-top:6px;transition:opacity .3s}
.fx-hover:focus-visible{outline:3px solid var(--fx-accent);outline-offset:3px}
@media (hover:hover){
  .fx-hover:hover,.fx-hover:focus-within,.fx-hover:focus-visible{transform:translateY(-4px);border-color:var(--fx-accent);
    box-shadow:0 18px 40px -18px rgba(0,0,0,.35)}
  .fx-hover:hover::before,.fx-hover:focus-within::before,.fx-hover:focus-visible::before{opacity:1}
  .fx-hover:hover .fx-hover-more,.fx-hover:focus-within .fx-hover-more,.fx-hover:focus-visible .fx-hover-more{grid-template-rows:1fr;opacity:1}
  .fx-hover:hover .fx-hover-cue,.fx-hover:focus-visible .fx-hover-cue{opacity:0}
}
/* Touch screens have no hover: tap toggles (fx.js adds .is-open); without JS details are simply shown */
@media (hover:none){
  .fx-hover.is-open .fx-hover-more{grid-template-rows:1fr;opacity:1}
  .fx-hover.is-open .fx-hover-cue{opacity:0}
  html:not(.fx-js) .fx-hover-more{grid-template-rows:1fr;opacity:1}
}

/* ── 5. Object breakdown (exploded view on scroll) ─────────────── */
.fx-explode{position:relative;height:260vh}
.fx-explode-stage{position:sticky;top:0;height:100vh;height:100svh;display:grid;grid-template-columns:1.2fr 1fr;align-items:center;
  gap:24px;overflow:hidden}
.fx-explode-obj{position:relative;height:min(70vh,520px);perspective:1400px;display:grid;place-items:center}
.fx-explode-rig{position:relative;width:min(300px,62vw);aspect-ratio:3/4;transform-style:preserve-3d;
  transform:rotateX(calc(52deg * var(--fx-tilt,1))) rotateZ(calc(-38deg * var(--fx-tilt,1)))}
.fx-layer{position:absolute;inset:0;border-radius:14px;transform-style:preserve-3d;will-change:transform;
  transform:translate3d(calc(var(--fx-x,0px) * var(--fx-e,0) * var(--fx-s,1)),calc(var(--fx-y,0px) * var(--fx-e,0) * var(--fx-s,1)),
    calc(var(--fx-z,0px) * var(--fx-e,0) * var(--fx-s,1))) rotateZ(calc(var(--fx-r,0deg) * var(--fx-e,0)))}
.fx-explode-labels{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.fx-explode-labels li{opacity:.25;transform:translateX(12px);transition:opacity .45s var(--fx-ease),transform .45s var(--fx-ease);
  border-left:2px solid var(--fx-line);padding-left:14px}
.fx-explode-labels li.is-on{opacity:1;transform:none;border-color:var(--fx-accent)}
@media (max-width:760px){
  .fx-explode{height:240vh}
  .fx-explode-stage{grid-template-columns:1fr;grid-template-rows:1fr auto;padding:64px 0 20px;gap:4px}
  .fx-explode-obj{height:46vh}
  .fx-explode-rig{width:min(200px,48vw);--fx-s:.62}
  .fx-explode-labels{gap:8px;font-size:15px}
  .fx-explode-labels li{display:none}
  .fx-explode-labels li.is-current{display:block}
}
/* No JS or reduced motion: a static, already-exploded diagram with every label shown */
html:not(.fx-js) .fx-explode,.fx-reduced .fx-explode{height:auto}
html:not(.fx-js) .fx-explode-stage,.fx-reduced .fx-explode-stage{position:relative;height:auto;padding:40px 0}
html:not(.fx-js) .fx-explode-stage{--fx-e:1}
html:not(.fx-js) .fx-explode-labels li,.fx-reduced .fx-explode-labels li{opacity:1;transform:none;display:block}

/* ── Reduced motion: everything visible, nothing moves ─────────── */
@media (prefers-reduced-motion:reduce){
  .fx-js [data-fx~="reveal"],.fx-js [data-fx~="split"] .fx-word{opacity:1!important;transform:none!important;filter:none!important;transition:none!important}
  .fx-story-scene,.fx-story-step,.fx-hover,.fx-hover-more,.fx-explode-labels li{transition:none!important}
  .fx-hover:hover{transform:none!important}
  .fx-scroll-cue::after{animation:none}
}
