/**
 * WOW_POSTSCROLL — post-hero visual layer (index.html only)
 * Accent tokens: site-accent.css (:root --site-accent*).
 * UNDO: Remove data-wow-postscroll from <html>, delete this file + wow-postscroll.js, remove <link> and <script>.
 */

/* ── Scroll progress rail (desktop+) ───────────────────────────────── */
#wowps-scroll-rail {
    display: none;
}
@media (min-width: 768px) {
    html[data-wow-postscroll="on"] #wowps-scroll-rail {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 10050;
        width: 3px;
        height: 100vh;
        height: 100dvh;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
    }
    html[data-wow-postscroll="on"] #wowps-scroll-rail-inner {
        width: 100%;
        height: var(--wowps-scroll-pct, 0%);
        max-height: 100%;
        background: linear-gradient(180deg, var(--site-accent), var(--site-accent-deep));
        box-shadow: 0 0 12px var(--site-accent-glow);
        /* No transition — height tracks scroll 1:1 (updates are rAF-batched in wow-postscroll.js) */
        transition: none;
    }
}

/* ── Chapter shells: watermarks + surface shifts (hero untouched) ─── */
html[data-wow-postscroll="on"] .wowps-chapter {
    position: relative;
    overflow: hidden;
}

html[data-wow-postscroll="on"] .wowps-chapter::before {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.06em;
    line-height: 0.78;
    white-space: nowrap;
    user-select: none;
    opacity: 0.045;
    color: var(--ink, #1a1a1c);
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) rotate(-9deg);
    font-size: clamp(3.5rem, 22vw, 16rem);
}

html[data-wow-postscroll="on"] .wowps-chapter--capabilities::before {
    content: none;
}

html[data-wow-postscroll="on"] .wowps-chapter--capabilities {
    background-image:
        linear-gradient(180deg, var(--site-accent-wash) 0%, transparent 42%),
        repeating-linear-gradient(
            -11deg,
            transparent,
            transparent 47px,
            rgba(0, 0, 0, 0.035) 47px,
            rgba(0, 0, 0, 0.035) 48px
        );
    background-color: var(--surface-elevated, #fff);
}

html[data-wow-postscroll="on"] .wowps-chapter--capabilities .layout-inner {
    position: relative;
    z-index: 1;
}

html[data-wow-postscroll="on"] .wowps-chapter--capabilities .bento-featured {
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
        inset 3px 0 0 0 var(--site-accent),
        0 28px 50px -18px rgba(0, 0, 0, 0.35);
}
html[data-wow-postscroll="on"] .wowps-chapter--capabilities .bento-featured:hover {
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
        inset 3px 0 0 0 var(--site-accent),
        0 32px 56px -20px rgba(0, 0, 0, 0.4);
}

/* Let the headline block settle before the dark tile animates in */
html[data-wow-postscroll="on"] .wowps-stagger > .bento-featured.step-reveal:nth-child(1) {
    transition-delay: 0.1s;
}

html[data-wow-postscroll="on"] .wowps-chapter--execution::before {
    content: none;
}

html[data-wow-postscroll="on"] .wowps-chapter--execution {
    background-color: #f4f4f3;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 244, 243, 1) 48%, rgba(237, 235, 232, 0.9) 100%);
}

html[data-wow-postscroll="on"] .wowps-chapter--execution .layout-inner {
    position: relative;
    z-index: 1;
}

html[data-wow-postscroll="on"] .wowps-chapter--execution .protocol-stack {
    box-shadow:
        0 0 0 1px var(--site-accent-soft),
        0 20px 50px -28px rgba(0, 0, 0, 0.12);
}

html[data-wow-postscroll="on"] .wowps-chapter--signals::before {
    content: none;
}

html[data-wow-postscroll="on"] .wowps-chapter--signals {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

html[data-wow-postscroll="on"] .wowps-chapter--signals .layout-inner {
    position: relative;
    z-index: 1;
}

html[data-wow-postscroll="on"] .wowps-chapter--signals .review-card {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 0 0 var(--site-accent-line);
}

html[data-wow-postscroll="on"] .wowps-chapter--signals .review-card:hover {
    box-shadow:
        0 18px 40px -22px rgba(0, 0, 0, 0.12),
        0 0 0 1px var(--site-accent-ring);
}

/* ── Staggered step-reveal delays in grids ─────────────────────────── */
html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal:nth-child(1) {
    transition-delay: 0.02s;
}
html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal:nth-child(2) {
    transition-delay: 0.05s;
}
html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal:nth-child(3) {
    transition-delay: 0.09s;
}
html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal:nth-child(4) {
    transition-delay: 0.13s;
}
html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal:nth-child(5) {
    transition-delay: 0.17s;
}

@media (prefers-reduced-motion: reduce) {
    html[data-wow-postscroll="on"] .wowps-stagger > .step-reveal {
        transition-delay: 0s !important;
    }
    html[data-wow-postscroll="on"] #wowps-scroll-rail-inner {
        transition: none;
    }
    html[data-wow-postscroll="on"] #wowps-scroll-rail {
        display: none !important;
    }
}
