/* ═══════════════════════════════════════════════════════════════
   statement-stack.css — the module pages' "The Problem" / "How It
   Works" sections: a stack of large statements, one lit at a time,
   each with a mono label and a detail paragraph that opens under
   the lit row. Shared by every module page (behaviour in
   js/statement-stack.js), so a fix lands once.

   Markup:
     section.s-stack > .ss-head (eyebrow, h2, .ss-count)
                     > ol.ss-list > li.ss-row (.ss-thumb, .ss-body, .ss-label)
   ═══════════════════════════════════════════════════════════════ */

.s-stack {
    --ss-accent: #c8ff00;
    --ss-rule: rgba(255, 255, 255, 0.12);
    --ss-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    min-height: calc(100vh - 60px);
    scroll-snap-align: start;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(240px, 28%) 1fr;
    gap: clamp(32px, 4vw, 72px);
    align-items: center;
    padding: clamp(36px, 6vh, 72px) 48px;
    background: #030405;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* ── head: eyebrow, title, row counter ── */
.ss-head {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.ss-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 18px;
}

.ss-head h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(64px, 8vw, 128px);
    line-height: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    position: relative;
}

.ss-count {
    margin-top: 28px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.45);
}

.ss-count b {
    font-weight: 500;
    color: var(--ss-accent);
}

/* ── the stack ── */
.ss-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--ss-rule);
}

.ss-row {
    display: grid;
    grid-template-columns: 44px 1fr minmax(150px, 210px);
    gap: 24px;
    align-items: start;
    padding: 22px 0;
    border-bottom: 1px solid var(--ss-rule);
}

/* thumbnail rail: dim until its row is lit, then a small accent dot beside it */
.ss-thumb {
    position: relative;
    width: 44px;
    height: 44px;
    margin-top: 2px;
    background: #111 center / cover no-repeat;
    filter: grayscale(1) brightness(0.55);
    transition: filter 0.35s ease;
}

.ss-thumb::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    background: var(--ss-accent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ss-row.is-active .ss-thumb {
    filter: none;
}

.ss-row.is-active .ss-thumb::after {
    opacity: 1;
}

/* statement: the whole line is the button that lights the row */
.ss-statement {
    margin: 0;
    font: inherit;
}

.ss-statement button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 1.9vw, 30px);
    line-height: 1.24;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.ss-statement button:hover {
    color: rgba(255, 255, 255, 0.8);
}

.ss-statement button:focus-visible {
    outline: 1px solid var(--ss-accent);
    outline-offset: 6px;
}

/* the highlight wipes in left to right behind each wrapped line */
.ss-statement span {
    padding: 0 0.12em;
    background: linear-gradient(var(--ss-accent), var(--ss-accent)) no-repeat 0 0 / 0% 100%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-size 0.5s var(--ss-ease), color 0.3s ease;
}

.ss-row.is-active .ss-statement button {
    color: #000;
}

.ss-row.is-active .ss-statement span {
    background-size: 100% 100%;
}

/* detail: closed rows keep only their statement */
.ss-detail {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.45s var(--ss-ease), opacity 0.3s ease;
}

.ss-detail > p {
    overflow: hidden;
    margin: 0;
    max-width: 62ch;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.66);
}

.ss-row.is-active .ss-detail {
    grid-template-rows: 1fr;
    opacity: 1;
}

.ss-row.is-active .ss-detail > p {
    padding-top: 14px;
}

/* mono label column */
.ss-label {
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.ss-label span {
    display: block;
    color: rgba(255, 255, 255, 0.32);
}

.ss-row.is-active .ss-label {
    color: #fff;
}

.ss-row.is-active .ss-label span {
    color: var(--ss-accent);
}

/* ── short laptop screens: tighter rows so the stack fits one screen ── */
@media (min-width: 769px) and (max-height: 820px) {
    .ss-row {
        padding: 14px 0;
    }

    .ss-statement button {
        font-size: clamp(18px, 1.6vw, 24px);
    }

    .ss-detail > p {
        font-size: 14px;
    }

    .ss-head h2 {
        font-size: clamp(56px, 6.5vw, 104px);
    }
}

/* ── tablet ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .s-stack {
        grid-template-columns: 1fr;
        padding: 48px 32px;
        align-content: center;
    }


    .ss-row {
        grid-template-columns: 40px 1fr 150px;
        gap: 18px;
    }
}

/* ── phone: one column, label above each statement, no thumbnail rail ── */
@media (max-width: 768px) {
    .s-stack {
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: calc(100svh - 60px);
        padding: 32px 20px 40px;
        align-content: start;
    }


    .ss-eyebrow {
        margin-bottom: 10px;
    }

    .ss-head h2 {
        font-size: clamp(48px, 14vw, 72px);
    }

    .ss-count {
        margin-top: 14px;
    }

    .ss-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 18px 0;
    }

    .ss-thumb {
        display: none;
    }

    .ss-label {
        order: -1;
        margin-top: 0;
    }

    .ss-label span {
        display: inline;
        margin-left: 10px;
    }

    .ss-statement button {
        font-size: 19px;
        min-height: 44px;
    }

    .ss-detail > p {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ss-statement span,
    .ss-detail,
    .ss-thumb,
    .ss-label,
    .ss-statement button {
        transition: none;
    }
}
