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

/* ── RF-02 shared utility: solid dark panel replaces backdrop-filter: blur ── */
.neural-panel-solid {
    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.08);
}

/* ── Story Shell ── */
.story-shell {
    position: relative;
    min-height: 300vh;
}
.story-pin {
    position: sticky;
    top: 78px;
    min-height: calc(100vh - 78px);
    min-height: calc(100dvh - 78px);
    display: grid;
    align-items: center;
}
.story-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 34px;
    align-items: center;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
}
.story-copy {
    position: relative;
    padding-left: 56px;
    padding-right: 18px;
}

/* ── Skip buttons for Pain section ── */
.pain-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;
}
.pain-skip-btn--first {
    top: calc(50% - 40px);
}
.pain-skip-btn--last {
    top: calc(50% + 16px);
}
.pain-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);
}
.pain-skip-btn--first:hover {
    transform: translateY(-3px);
}
.pain-skip-btn--last:hover {
    transform: translateY(3px);
}

.story-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #ffe2cf;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.story-meter {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    max-width: 420px;
}
.story-meter .meter-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 14px;
    align-items: center;
    color: rgba(232, 239, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.story-meter .bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.story-meter .bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(255, 102, 0, 0.35),
        rgba(255, 138, 51, 0.95)
    );
    box-shadow: 0 0 18px rgba(255, 102, 0, 0.18);
    /* Pay the compositor-layer cost up front, not on first scroll-into-view. */
    will-change: transform;
}

/* ── Story Stage ── */
.story-stage {
    position: relative;
    min-height: 680px;
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(
            circle at 20% 22%,
            rgba(255, 102, 0, 0.12),
            transparent 18%
        ),
        radial-gradient(
            circle at 78% 20%,
            rgba(99, 169, 255, 0.12),
            transparent 22%
        ),
        radial-gradient(
            circle at 50% 78%,
            rgba(141, 99, 255, 0.08),
            transparent 20%
        ),
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.05),
            transparent
        ),
        rgba(8, 17, 31, 0.94); /* RF-02: Neural Surface gradient */
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}
.story-grid {
    position: absolute;
    inset: 0;
    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;
    opacity: 0.22;
    mask-image: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 1),
        rgba(0, 0, 0, 0.3) 68%,
        transparent 100%
    );
}
.story-glow {
    position: absolute;
    width: 46vw;
    height: 46vw;
    max-width: 520px;
    max-height: 520px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.32;
    pointer-events: none;
}
.story-glow.orange {
    background: rgba(255, 102, 0, 0.28);
    top: -14%;
    left: -8%;
}
.story-glow.blue {
    background: rgba(99, 169, 255, 0.18);
    top: -8%;
    right: -10%;
}
.story-glow.purple {
    background: rgba(141, 99, 255, 0.16);
    bottom: -16%;
    left: 30%;
}

.story-label {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.05),
            transparent
        ),
        rgba(8, 17, 31, 0.94); /* RF-02: Neural Surface gradient */
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #dce6ff;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.story-label .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff8a33, #ff6600);
    box-shadow: 0 0 14px rgba(255, 102, 0, 0.55);
}

/* ── Story Cards ── */
.story-card {
    position: absolute;
    width: min(320px, 34vw);
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.05),
            transparent
        ),
        rgba(8, 17, 31, 0.94); /* RF-02: Neural Surface gradient */
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translate3d(0, 70px, 0) scale(0.92);
    /* Layer hint — avoids the 1–2 frame stall when the first card's phase
       tween fires at scroll-trigger entry. */
    will-change: transform, opacity;
}
.story-card .story-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #dbe5ff;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.story-card .story-chip .mini {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}
.story-card h3 {
    margin: 14px 0 10px;
    font-size: 24px;
    letter-spacing: -0.03em;
}
.story-card p {
    margin: 0;
    color: rgba(232, 239, 255, 0.72);
    line-height: 1.75;
}

.story-card[data-tone="orange"] {
    border-color: rgba(255, 138, 51, 0.16);
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.story-card[data-tone="orange"] .story-chip {
    color: #ffb27a;
}
.story-card[data-tone="blue"] {
    border-color: rgba(99, 169, 255, 0.16);
}
.story-card[data-tone="blue"] .story-chip {
    color: #9cc3ff;
}
.story-card[data-tone="purple"] {
    border-color: rgba(141, 99, 255, 0.18);
}
.story-card[data-tone="purple"] .story-chip {
    color: #d7c8ff;
}

.story-card.story-card--active {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 26px 48px rgba(0, 0, 0, 0.26),
        0 0 34px rgba(255, 102, 0, 0.1);
}

/* Pain card positions */
#pain-story .story-card:nth-of-type(1) {
    left: 4%;
    top: 12%;
}
#pain-story .story-card:nth-of-type(2) {
    right: 4%;
    top: 14%;
}
#pain-story .story-card:nth-of-type(3) {
    left: 4%;
    top: 38%;
}
#pain-story .story-card:nth-of-type(4) {
    right: 4%;
    top: 30%;
}
#pain-story .story-card:nth-of-type(5) {
    left: 4%;
    bottom: 12%;
}
#pain-story .story-card:nth-of-type(6) {
    right: 4%;
    bottom: 10%;
}

.story-node-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.16),
        rgba(255, 255, 255, 0)
    );
    opacity: 0.6;
    transform-origin: left center;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ── Mobile fallback ── */
.story-mobile-grid {
    display: none;
}

/* ── Touch devices: kill the scroll-jacked track entirely ──────────────────
   Without this, the 300vh min-height + position:sticky exist in CSS from the
   first paint. On phones/tablets that inflates the page by hundreds of vh of
   empty scroll-track until story-motion.js loads and inline-overrides them.
   This block makes the section render correctly with no JS dependency, and
   also sidesteps iOS Safari's known sticky+momentum repaint glitches.
   The JS still flips into its time-based carousel using the same media query;
   these declarations become the primary mechanism, the inline styles become
   defensive belt-and-suspenders. */
@media (hover: none) and (pointer: coarse) {
    .story-shell {
        min-height: auto;
    }
    .story-pin {
        position: static;
        top: auto;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 1180px) {
    .story-layout {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .story-copy {
        padding-left: 0;
        padding-right: 0;
    }
    .story-stage {
        min-height: 620px;
    }
}
@media (max-width: 900px) {
    #pains {
        padding-top: 84px; /* Matches standard section padding */
    }
    .story-shell {
        min-height: auto;
    }
    .story-pin {
        position: relative;
        top: auto;
        min-height: auto;
    }
    .story-stage {
        display: none;
    }
    .story-mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 4px;
    }
    .story-mobile-grid .panel {
        opacity: 1 !important;
        transform: none !important;
    }
    .story-meter {
        display: none;
    }
    .pain-skip-btn {
        display: none !important;
    }
}

