/* ===== ABOUT: full-screen scrolling story =====
   Big photo stays on screen. While you scroll, the photo cross-fades and the
   card (label, title, text, small photo) changes. Works with <body class="is-about">. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap
}

/* header stays on top on this page (also on laptop), so the story fits exactly below it */
.is-about .genesis {
    position: sticky;
    top: 0;
    z-index: 50
}

.story {
    --hh: 70px;
    --step: 30svh;
    position: relative;
    flex: none;
    width: 100%;
    height: calc(var(--n) * var(--step) + 100dvh - var(--hh))
}

.story-stage {
    position: sticky;
    top: var(--hh);
    height: calc(100dvh - var(--hh));
    overflow: hidden;
    background: #0b1a33;
    color: #fff
}

/* ---- photos ---- */
.story-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.12);
    transition: opacity 1.1s ease, transform 7s ease-out
}

.story-bg.is-on {
    opacity: 1;
    transform: scale(1)
}

.story-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(6, 14, 32, .88) 0%, rgba(6, 14, 32, .45) 38%, rgba(6, 14, 32, .08) 70%, rgba(6, 14, 32, .22) 100%)
}

/* ---- content ---- */
.story-ui {
    position: absolute;
    inset: 0;
    width: min(1100px, 100% - 32px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px))
}

.story-cards {
    display: grid;
    width: 100%;
    max-width: 680px
}

.story-card {
    grid-area: 1/1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    row-gap: 6px;
    align-items: start;
    padding: 16px 18px 18px;
    border-radius: 20px;
    background: rgba(10, 24, 50, .58);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    transition: opacity .5s ease, transform .5s ease, visibility 0s .5s
}

.story-card.is-on {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .7s .25s ease, transform .7s .25s ease, visibility 0s
}

.story-label {
    font-family: Georgia, "Times New Roman", "Noto Serif Tamil", serif;
    font-size: clamp(30px, 8vw, 50px);
    font-weight: 400;
    line-height: 1.1;
    color: var(--accent)
}

.story-title {
    margin-top: 4px;
    font-size: clamp(1.05em, 3.6vw, 1.35em);
    font-weight: 700;
    line-height: 1.3
}

.story-photo {
    grid-column: 2;
    grid-row: 1;
    width: clamp(72px, 20vw, 96px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, .75);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35)
}

.story-text {
    grid-column: 1/-1;
    margin-top: 4px;
    font-size: .95em;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92)
}

/* ---- progress ---- */
.story-progress {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.story-now {
    display: grid;
    font-size: .78em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent)
}

.story-now span {
    grid-area: 1/1;
    opacity: 0;
    transition: opacity .4s
}

.story-now span.is-on {
    opacity: 1
}

.story-bar {
    display: flex;
    gap: 6px
}

.story-seg {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: 0;
    cursor: pointer
}

.story-seg b {
    display: block;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden
}

.story-seg i {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left
}

/* ---- laptop / desktop ---- */
@media(min-width:900px) {
    .story-ui {
        gap: 22px;
        padding-bottom: 28px
    }

    .story-cards {
        max-width: 720px
    }

    .story-card {
        padding: 26px 30px 30px;
        column-gap: 24px;
        row-gap: 10px
    }

    .story-label {
        font-size: clamp(44px, 4.4vw, 64px)
    }

    .story-title {
        font-size: 1.5em
    }

    .story-photo {
        width: 150px;
        grid-row: 1/3;
        border-radius: 16px
    }

    .story-text {
        grid-column: 1;
        grid-row: 2;
        font-size: 1.05em;
        align-self: start
    }

    .story-head {
        grid-row: 1
    }
}

/* ---- short screens (phone on its side) ---- */
@media(max-height:520px) {
    .story-photo {
        display: none
    }

    .story-card {
        padding: 10px 14px 12px
    }

    .story-label {
        font-size: 26px
    }

    .story-text {
        font-size: .85em;
        line-height: 1.45
    }
}

@media(prefers-reduced-motion:reduce) {
    .story-bg {
        transform: none
    }
}
