/* Home page — "The Stack" scroll story (Industrial AI · MaaS → Compute, inside Agent OS).
   Markup lives in index.html; behaviour in /assets/stack.js. */
.stk-sec{--bg2:#0C1223;--surface:#111827;--text:#F0F4FF;--muted:#8B9CC0;--dim:#5C6B8A;--accent:#00C4B4;--on-accent:#04231F;--hdr:76px}
.stk-sec *,.stk-sec *::before,.stk-sec *::after{box-sizing:border-box}
@media (max-width:960px){.stk-sec{--hdr:64px}}

/* ---- section ---- */
.stk-sec{background:var(--bg2);border-top:1px solid rgba(139,156,192,.12);border-bottom:1px solid rgba(139,156,192,.12)}
.stk-head{max-width:1280px;margin:0 auto;padding:132px 40px 24px}
.stk-eyebrow{display:block;font-family:Sora,sans-serif;font-weight:500;text-transform:uppercase;color:var(--accent);font-size:11px;letter-spacing:.26em;margin-bottom:26px}
.stk-h2{margin:0;font-family:Sora,sans-serif;font-weight:300;font-size:clamp(32px,3.4vw,50px);line-height:1.12;color:var(--text);max-width:980px}
.stk-h2 b{font-weight:600}

.stk-track{position:relative;height:calc(100vh - var(--hdr) + 300vh)}
.stk-sticky{position:sticky;top:var(--hdr);height:calc(100vh - var(--hdr));display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 40px 18px;overflow:hidden}
.stk-stage{position:relative;width:100%;max-width:1200px;padding:76px 44px 44px;
  --tagw:260px;--tagh:42px;--boxw:196px;--side:44px;--mid:88px}
.stk-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}

/* rows */
.stk-top{display:flex;justify-content:center;align-items:center;gap:var(--mid)}
.stk-grp{display:flex;align-items:center;gap:var(--side);transition:transform .9s cubic-bezier(.22,.61,.36,1)}
.stk-tags{display:flex;flex-direction:column;gap:12px;width:var(--tagw);padding:0;margin:0;list-style:none}
.stk-midrow{display:flex;justify-content:center;margin-top:104px}
.stk-botrow{display:flex;justify-content:center;gap:48px;margin:68px 0 0;padding:0;list-style:none}

/* nodes */
.stk-box{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;width:var(--boxw);min-height:64px;padding:18px 34px;background:var(--surface);border:1px solid color-mix(in oklab,var(--accent) 55%,transparent);text-decoration:none;box-shadow:0 0 0 0 rgba(0,196,180,0);transition:opacity .6s ease,transform .6s ease,box-shadow .3s ease,border-color .3s ease}
.stk-box:hover,.stk-box:focus-visible{border-color:var(--accent);box-shadow:0 0 0 4px rgba(0,196,180,.12);outline:0}
.stk-box strong{font-family:Sora,sans-serif;font-weight:500;font-size:20px;line-height:1.2;color:var(--text)}
.stk-box em{position:absolute;right:14px;top:14px;font-style:normal;font-size:13px;color:var(--accent)}
.stk-tag{display:flex;align-items:center;justify-content:center;text-align:center;width:var(--tagw);height:var(--tagh);padding:0 14px;white-space:nowrap;background:rgba(17,24,39,.9);border:1px solid rgba(139,156,192,.22);font-family:"IBM Plex Sans",sans-serif;font-size:13.5px;line-height:1.3;color:#C9D4EC;transition:opacity .5s ease,transform .5s ease}

/* Agent OS */
.stk-os{position:absolute;left:0;top:0;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;text-align:center;min-width:196px;padding:14px 38px;background:var(--accent);color:var(--on-accent);text-decoration:none;font-family:Sora,sans-serif;white-space:nowrap;transition:opacity .6s ease .35s,transform .6s ease .35s}
.stk-os strong{font-weight:600;font-size:20px}
.stk-os em{position:absolute;right:12px;top:9px;font-style:normal;font-size:13px}
.stk-os:hover,.stk-os:focus-visible{filter:brightness(1.1);outline:0}
.stk-fill{fill:rgba(0,196,180,.035);transition:opacity .8s ease .5s}

/* reveal states */
.js .stk-stage [data-s]:not(.on){opacity:0;transform:translateY(10px)}
.js .stk-stage .stk-os[data-s]:not(.on){transform:translate(-50%,-50%) scale(.9)}
.js .stk-stage .stk-os[data-s].on{transform:translate(-50%,-50%)}
.stk-svg path{fill:none;stroke:rgba(0,196,180,.55);stroke-width:1.4;transition:stroke-dashoffset .8s cubic-bezier(.4,0,.2,1)}
.stk-svg path.frame{stroke:var(--accent);stroke-width:1.6;transition-duration:1.3s}
.stk-svg path.flow{stroke:rgba(127,216,207,.9);stroke-width:2;stroke-dasharray:3 15;opacity:0;transition:opacity .6s ease .8s}
.stk-svg path.flow.on{opacity:1;animation:pour 1.2s linear infinite}
@keyframes pour{to{stroke-dashoffset:18}}
.stk-svg .stk-fill:not(.on){opacity:0}

/* ---- tablet: tighter ---- */
@media (max-width:1180px){
  .stk-stage{--tagw:206px;--tagh:52px;--boxw:172px;--side:34px;--mid:52px;padding:72px 28px 40px}
  .stk-botrow{gap:28px}
  .stk-tag{white-space:normal}
}
/* ---- phone: two mirrored columns, tags under each box ---- */
@media (max-width:860px){
  .stk-head{padding:72px 20px 8px}
  .stk-sticky{padding:0 14px 10px}
  .stk-stage{padding:56px 14px 22px;--tagw:auto;--tagh:46px;--boxw:100%}
  .stk-top{gap:14px;align-items:flex-start}
  .stk-grp{flex:1 1 0;min-width:0;flex-direction:column;align-items:stretch;gap:10px}
  .stk-grp.L .stk-tags{order:2;padding-left:18px}
  .stk-grp.R .stk-tags{padding-right:18px}
  .stk-tags{width:auto;gap:7px}
  .stk-box{min-height:50px;padding:12px 26px}
  .stk-box strong{font-size:16px}
  .stk-box em{right:10px;top:10px}
  .stk-tag{width:auto;padding:0 8px;font-size:12px;white-space:normal}
  .stk-midrow{margin-top:56px}
  .stk-midrow .stk-box{width:58%}
  .stk-botrow{flex-direction:column;align-items:center;gap:12px;margin-top:22px}
  .stk-botrow .stk-tag{width:calc((100% - 14px)/2 - 18px)}
  .stk-os{min-width:150px;padding:10px 28px}
  .stk-os strong{font-size:16px}
}
/* short screens or reduced motion: no scroll-driven pinning, everything shown */
@media (max-height:640px),(prefers-reduced-motion:reduce){
  .stk-track{height:auto}
  .stk-sticky{position:relative;top:0;height:auto;padding-top:24px;padding-bottom:80px}
}
@media (prefers-reduced-motion:reduce){ .stk-svg path.flow{display:none} }
