/*
 * modules.css — Styles for #platform/core modules storytelling section.
 * Extracted from modules.blade.php. Do not add @push('styles') there.
 */

/* ===== 9-stage screenshot story ===== */
/* Consolidate common panel backgrounds to be DRY */
.neural-panel-solid,
.wg9-external-caption {
    background:
        radial-gradient(circle at top left,
            rgba(255, 255, 255, 0.05),
            transparent),
        rgba(8, 17, 31, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.wg9-story-wrap.reveal,
.wg9-story-wrap.reveal.visible {
    opacity: 1 !important;
    transform: none !important;
}

.wg9-story-wrap {
    position: relative;
    padding: clamp(32px, 5vh, 56px) 0;
    overflow: clip;
}

.wg9-story-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 14%,
            rgba(255, 102, 0, 0.16),
            transparent 16%),
        radial-gradient(circle at 86% 12%,
            rgba(99, 169, 255, 0.14),
            transparent 18%),
        radial-gradient(circle at 50% 84%,
            rgba(141, 99, 255, 0.12),
            transparent 22%);
    filter: blur(26px);
}

.wg9-story-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 96%);
    opacity: 0.34;
}

.wg9-story-head {
    margin-bottom: 12px;
    align-items: flex-start;
}

.wg9-story-head .premium-icon {
    box-shadow:
        0 0 36px rgba(255, 102, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.wg9-story-head h2.title {
    font-size: clamp(32px, 5vmin, 64px) !important;
    letter-spacing: -0.06em !important;
    line-height: 1.05 !important;
    margin-top: 8px !important;
}

.wg9-story-intro {
    max-width: 1040px;
    margin-top: 10px;
    font-size: 19px !important;
}

.wg9-story-stage {
    position: relative;
    min-height: 450vh;
}

.wg9-story-pin {
    position: sticky;
    top: 96px;
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    display: grid;
    grid-template-columns: 27.5% 72.5% !important;
    padding-top: 4vh;
}

.wg9-story-rail {
    position: absolute;
    left: -4px !important;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 64vh;
    z-index: 5;
    pointer-events: none;
}

.wg9-story-rail-line {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.wg9-story-rail-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--orange), var(--blue));
    box-shadow: 0 0 24px rgba(255, 102, 0, 0.24);
    transform: scaleY(0);
    transform-origin: top center;
    will-change: transform;
}

.wg9-story-rail-dots {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.wg9-story-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
    position: relative;
    pointer-events: auto !important;
    cursor: pointer;
    transition: all 0.28s ease;
}

.wg9-story-dot::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.wg9-story-dot.active {
    border-color: rgba(255, 102, 0, 0.24);
    box-shadow:
        0 0 0 6px rgba(255, 102, 0, 0.05),
        0 0 24px rgba(255, 102, 0, 0.16);
    transform: scale(1.06);
}

.wg9-story-dot.active::after {
    background: linear-gradient(180deg, var(--orange2), var(--orange));
}

.wg9-story-copy {
    padding-right: 10px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
}

.wg9-copy-step {
    grid-area: 1 / 1 / -1 / -1;
    position: relative;
    padding-left: 64px !important;
    opacity: 0;
    transform: translateY(28px);
    pointer-events: none;
    transition:
        opacity 0.42s var(--ease),
        transform 0.42s var(--ease);
    padding: 6px 0 6px 0;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.wg9-copy-step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wg9-copy-step p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(14px, 1.1vw, 17px);
    line-height: clamp(1.4, 2vh, 1.82);
    max-width: 100%;
    text-align: justify;
}

.wg9-copy-step .eyebrow {
    box-shadow:
        0 0 28px rgba(255, 102, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.wg9-copy-step h3 {
    margin: 18px 0 12px;
    font-size: clamp(26px, 4vmin, 46px);
    line-height: 1.03;
    letter-spacing: -0.055em;
    max-width: 20ch;
}

.wg9-kpis {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px;
    margin-top: 22px;
    cursor: pointer;
}

.wg9-kpi {
    flex: 1 1 auto !important;
    min-width: 140px !important;
    white-space: normal !important;
    padding: clamp(8px, 1.5vh, 16px) clamp(10px, 1vw, 16px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.03));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.wg9-kpi strong {
    display: block;
    font-size: clamp(14px, 2.5vmin, 18px);
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.wg9-kpi span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.wg9-copy-actions {
    margin-top: auto !important;
    padding-top: 32px !important;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
}

.wg9-copy-actions .btn {
    border-radius: 18px !important;
    min-width: 236px !important;
    padding: 15px 20px !important;
    box-shadow: 0 18px 36px rgba(255, 102, 0, 0.24) !important;
}

.wg9-screen-col {
    position: relative;
    height: 100%;
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: none !important;
    width: 100%;
}

.wg9-screen-glow {
    position: absolute;
    inset: 2% -8% !important;
    display: block !important;
    background:
        radial-gradient(circle at 18% 24%,
            rgba(255, 102, 0, 0.18),
            transparent 22%),
        radial-gradient(circle at 82% 18%,
            rgba(99, 169, 255, 0.18),
            transparent 20%),
        radial-gradient(circle at 52% 82%,
            rgba(141, 99, 255, 0.12),
            transparent 24%);
    filter: blur(86px) !important;
    opacity: 0.92;
    pointer-events: none;
}

.wg9-screen-shell {
    position: relative;
    width: min(100%, 1150px) !important;
    height: auto !important;
    max-height: 50vh !important;
    max-height: 50dvh !important;
    border-radius: 38px !important;
    padding: 20px !important;
    background:
        radial-gradient(circle at top left,
            rgba(255, 255, 255, 0.05),
            transparent),
        rgba(8, 17, 31, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 42px 130px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 90px rgba(255, 102, 0, 0.08) !important;
    overflow: hidden;
}

.wg9-screen-shell::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 102, 0, 0.3),
            rgba(255, 255, 255, 0.08),
            rgba(99, 169, 255, 0.18)) !important;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.wg9-header-chip {
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: #ffd8bf;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    position: absolute !important;
    top: -8% !important;
    left: 10% !important;
    bottom: auto !important;
    right: auto !important;
    z-index: 10 !important;
}

.wg9-stage-label {
    position: absolute !important;
    right: 12% !important;
    top: -8% !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 10 !important;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffe0cb;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wg9-screen-stack {
    position: absolute !important;
    inset: 0 !important;
}

.wg9-laptop-real {
    position: relative;
    width: 100% !important;
    max-width: min(1300px, calc(45vh * 16 / 9)) !important;
    margin: 0 auto;
    aspect-ratio: 16/9;
    flex-shrink: 1;
}

.wg9-shot {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    transform: none !important;
    z-index: 1;
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.wg9-shot.active {
    opacity: 1;
    z-index: 2;
}

.wg9-shot::before,
.wg9-shot::after {
    display: none !important;
}

.wg9-shot img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    filter: none !important;
    mix-blend-mode: screen !important;
}

.wg9-shot-thumbs {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 24px auto 0 !important;
    max-width: 1300px !important;
    width: 100% !important;
    z-index: 10 !important;
    padding: 0 20px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: clamp(2px, 0.4vw, 10px) !important;
}

.wg9-thumb {
    flex: 1 1 0 !important;
    white-space: nowrap !important;
    min-height: 46px !important;
    border-radius: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(6px, 1vh, 8px) clamp(2px, 0.4vw, 10px);
    font-size: clamp(7.5px, 0.65vw, 10px) !important;
    letter-spacing: clamp(0.01em, 0.03vw, 0.1em);
    color: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035) !important;
    cursor: pointer;
    transition:
        background 0.24s ease,
        border-color 0.24s ease,
        color 0.24s ease,
        box-shadow 0.24s ease;
}

.wg9-thumb.active {
    color: #fff;
    background: linear-gradient(90deg, var(--orange), var(--blue)) no-repeat !important;
    border: none !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 0 24px rgba(255, 102, 0, 0.24),
        0 8px 16px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-2px);
    transition: all 0.25s var(--ease) !important;
}

/* ── External caption ── */
.wg9-external-caption {
    margin: 24px auto 0;
    padding: 16px 20px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22) !important;
    width: 100%;
    max-width: 1300px !important;
    text-align: left;
    position: relative;
    z-index: 10;
}

.wg9-external-caption span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ffd8bf;
    margin-bottom: 4px;
}

.wg9-external-caption strong {
    display: block;
    font-size: clamp(14px, 1.2vw, 17px);
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 8px;
}

.wg9-external-caption p {
    font-size: clamp(11px, 1vw, 13px);
    line-height: clamp(1.4, 2vh, 1.65);
    color: var(--muted);
    margin: 0;
    height: auto;
    max-height: 85px;
    overflow-y: auto;
    scrollbar-width: none;
}

.wg9-external-caption p::-webkit-scrollbar {
    display: none;
}

.module-card {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

/* ── Skip button ── */
.wg9-skip-btn {
    position: absolute;
    left: -9px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
}

.wg9-skip-btn--first {
    top: calc(50% - 32vh - 56px);
}

.wg9-skip-btn--last {
    top: calc(50% + 32vh + 24px);
}

.wg9-skip-btn:hover {
    border-color: rgba(255, 102, 0, 0.3);
    color: #fff;
    background: linear-gradient(180deg,
            rgba(255, 102, 0, 0.15),
            rgba(255, 102, 0, 0.05));
    box-shadow: 0 0 16px rgba(255, 102, 0, 0.18);
}

.wg9-skip-btn--first:hover {
    transform: translateY(-3px);
}

.wg9-skip-btn--last:hover {
    transform: translateY(3px);
}

/* ── Horizontal Progress Rail ── */
.wg9-horizontal-rail {
    position: relative;
    width: 100%;
    max-width: 1300px;
    height: 24px;
    margin: 20px auto 0;
    padding: 0 10px;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.wg9-h-rail-line {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.wg9-h-rail-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--orange), var(--blue));
    box-shadow: 0 0 24px rgba(255, 102, 0, 0.24);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.wg9-h-rail-dots {
    position: absolute;
    inset: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wg9-h-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.28s ease;
}

.wg9-h-dot.active {
    border-color: rgba(255, 102, 0, 0.24);
    background: linear-gradient(180deg, var(--orange2), var(--orange));
    box-shadow:
        0 0 0 6px rgba(255, 102, 0, 0.05),
        0 0 18px rgba(255, 102, 0, 0.3);
    transform: scale(1.15);
}

.story-mobile-grid {
    display: none;
}

/* Safari Elastic Bounce Kill */
.no-bounce {
    overscroll-behavior: none !important;
}

/* ── Responsive Mobile (Pivot) ── */
/* Condensing all mobile handling into a single max-width: 1180px block for complete DRYness */
@media (max-width: 1200px) {
    .wg9-story-pin {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
    }

    /* Natural mobile expansion handling (combined from 1024px) */
    .wg9-story-copy {
        height: auto !important;
        min-height: 0 !important;
        padding-left: 0 !important;
    }

    .wg9-copy-step {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        padding-left: 56px !important;
        padding-right: 0 !important;
    }

    .wg9-copy-step:not(.active) {
        display: none !important;
    }

    .wg9-screen-shell {
        width: 100% !important;
        min-height: 720px !important;
    }

    .wg9-laptop-real {
        width: 100%;
    }

    /* Fallback grid implementation */
    .wg9-story-stage {
        display: none !important;
        content-visibility: hidden; /* zero layout/paint cost for hidden subtree — lifts cleanly on return to desktop */
    }

    .story-mobile-grid {
        display: grid !important;
        margin-top: 32px !important;
    }

    .wg9-story-head {
        margin-bottom: 24px !important;
    }

    .wg9-story-head h2.title {
        font-size: clamp(34px, 7vw, 46px) !important;
    }

    .wg9-story-intro {
        font-size: 17px !important;
    }

    .wg9-horizontal-rail {
        display: none !important;
    }
}

/* ── Touch devices: kill the 450vh scroll-jacked track entirely ────────────
   Without this, .wg9-story-stage { min-height: 450vh } and the inner sticky
   pin exist in CSS from first paint — phones/tablets get 450vh of empty
   scroll-track until story-motion.js loads and inline-overrides them.
   This block makes the section flow as a normal block with no JS dependency
   and sidesteps iOS Safari's sticky+momentum-scroll repaint glitches. The
   stage stays visible (not display:none) on iPad landscape where it's still
   the canonical view — JS flips it into the time-based carousel using the
   same media query. Scoped above the 1200px mobile pivot so phones still
   fall through to that block's display:none rule. */
@media (hover: none) and (pointer: coarse) and (min-width: 1201px) {
    .wg9-story-stage {
        min-height: auto !important;
    }
    .wg9-story-pin {
        position: static !important;
        top: auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
}

/* ── Responsive Widescreen ── */
@media (min-height: 1200px) and (min-width: 1180px) {
    .wg9-story-wrap {
        padding: 2vh 0 !important;
    }

    .wg9-story-pin {
        grid-template-columns: minmax(320px, 0.4fr) minmax(500px, 1.6fr) !important;
        align-items: center !important;
        padding: 2vh 0 !important;
    }

    .wg9-screen-col {
        min-height: 480px !important;
        align-items: center !important;
        width: 100% !important;
    }

    .wg9-screen-shell {
        min-height: auto !important;
        padding: 1.5vh !important;
    }

    .wg9-laptop-real {
        width: min(90%, 75vh) !important;
        margin: 0 auto !important;
    }

    .wg9-story-rail {
        height: 70vh !important;
        height: 70dvh !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .wg9-skip-btn--first {
        top: calc(50% - 35vh - 56px) !important;
    }

    .wg9-skip-btn--last {
        top: calc(50% + 35vh + 24px) !important;
    }

    .wg9-thumb {
        min-height: 32px !important;
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    .wg9-external-caption {
        margin: 1.5vh auto 0 !important;
        padding: 10px 14px !important;
        max-width: min(90%, 75vh) !important;
    }

    .wg9-external-caption p {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin: 0 !important;
    }

    .wg9-copy-step h3 {
        margin: 6px 0 10px !important;
    }

    .wg9-kpis {
        margin-top: 14px !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }

    .wg9-kpi {
        min-width: 0 !important;
    }

    .wg9-kpi span {
        font-size: 9px !important;
    }

    .wg9-copy-actions .btn {
        min-width: 140px !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

/* ── Enforce Vertical KPIs on Narrow Desktop ── */
@media (max-width: 1445px) and (min-width: 1180px) {
    .wg9-kpi {
        flex-basis: 100% !important;
    }
}

/* ── Ultra-Wide Lock ── */
@media (min-width: 1600px) {
    .wg9-story-pin {
        max-width: 1600px;
        margin: 0 auto;
        column-gap: 80px;
        justify-content: center;
    }
}

/* ── Responsive Short Screens ── */
@media (max-height: 900px) and (min-width: 1180px) {
    .wg9-story-pin {
        padding-top: 1vh !important;
    }

    .wg9-copy-step h3 {
        margin: 10px 0 8px !important;
        font-size: clamp(22px, 3.5vmin, 36px) !important;
    }

    .wg9-copy-step p {
        font-size: clamp(12px, 1vw, 14px) !important;
        line-height: 1.4 !important;
    }

    .wg9-kpis {
        margin-top: 12px !important;
        gap: 10px !important;
    }

    .wg9-kpi {
        padding: 8px 12px !important;
        min-width: 110px !important;
    }

    .wg9-copy-actions {
        padding-top: 10px !important;
        padding-bottom: 0 !important;
    }

    

    .wg9-screen-col {
        min-height: 0 !important;
        padding-bottom: 2vh !important;
    }

    .wg9-shot-thumbs {
        margin-top: -20px !important;
    }

    .wg9-horizontal-rail {
        margin-top: 8px !important;
    }

    .wg9-external-caption {
        margin-top: 8px !important;
        padding: 8px 12px !important;
    }

    .wg9-external-caption p {
        font-size: clamp(12px, 1.2vmin, 12px) !important;
        line-height: 1.3 !important;
        max-height: clamp(50px, 6vh, 65px) !important;
    }

    .wg9-laptop-real {
        max-width: 80% !important;
    }
}