/* The Crawler — case study */

.crawler-story {
    --accent: #c70039;
    --ink: #0a0a0a;
    --mist: rgba(245, 245, 245, .08);
    --bone: #e8e2d6;
    background:
        radial-gradient(800px 480px at 12% 12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
        radial-gradient(700px 420px at 90% 30%, rgba(180, 200, 220, .04), transparent 55%),
        #101010;
}

.crawler-main {
    max-width: none;
    margin: 0;
    padding: 0 0 80px;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.crawler-story .case-pager {
    --pager-accent: var(--accent);
    max-width: 1280px;
    width: 100%;
    margin: 48px auto 0;
    padding: 0 8vw;
    box-sizing: border-box;
}

.crawler-story #case-chrome-top { position: relative; z-index: 70; }

/* ---- fixed side dock (rail + color changer) ---- */

.crawler-dock {
    position: fixed;
    right: 0;
    top: 50%;
    margin-top: 0;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
    pointer-events: none;
}

.crawler-dock > * {
    pointer-events: auto;
}

.crawler-story .color-changer {
    position: relative;
    right: -150px;
    top: auto;
    z-index: 2;
    transition: right .4s ease;
}

.crawler-story .color-changer-active {
    right: 0;
}

/* ---- rail ---- */

.crawler-rail {
    position: relative;
    right: 16px;
    top: auto;
    transform: none;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crawler-rail a {
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: rgba(245, 245, 245, .4);
    font-family: poppins;
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: color .3s ease;
}

.crawler-rail a i {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(245, 245, 245, .18);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-style: normal;
    font-size: 9px;
}

.crawler-rail a span {
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
}

.crawler-rail:hover a span,
.crawler-rail a.is-active span {
    opacity: 1;
    transform: translateX(0);
}

.crawler-rail a.is-active,
.crawler-rail a:hover { color: whitesmoke; }

.crawler-rail a.is-active i {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ---- chapter chrome ---- */

.chapter {
    position: relative;
    padding: 96px 8vw 48px;
    max-width: 1280px;
    margin: 0 auto;
}

.chapter-index {
    position: absolute;
    left: 8vw;
    top: 36px;
    font-family: raleway;
    font-size: clamp(56px, 8vw, 96px);
    font-weight: 900;
    line-height: .85;
    color: rgba(245, 245, 245, .05);
    pointer-events: none;
}

.chapter-head { margin: 28px 0 36px; max-width: 720px; }

.chapter-head h2,
.chapter-prose h2 {
    font-family: raleway;
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.05;
    margin: 8px 0 0;
}

.season-kicker,
.case-kicker {
    font-family: poppins;
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}

.chapter-prose { max-width: 68ch; }

.chapter-prose .lead {
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.7;
}

.chapter-prose p {
    font-family: poppins;
    font-size: 15px;
    line-height: 1.75;
    opacity: .88;
    margin: 0 0 14px;
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
}

/* ---- hero ---- */

.crawler-hero { padding: 0; max-width: none; }

.hero-stage {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #050505;
}

.hero-media {
    position: absolute;
    inset: 0;
}

.hero-frame {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .9s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
}

.hero-frame.is-active {
    opacity: 1;
    z-index: 1;
}

.hero-frame img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.hero-veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 5, 5, .4) 0%, transparent 30%),
        linear-gradient(180deg, transparent 45%, rgba(5, 5, 5, .9) 100%);
}

.hero-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0 8vw 8vh;
}

.hero-copy h1 {
    font-family: raleway;
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: -2px;
    margin: 10px 0 14px;
    display: flex;
    flex-direction: column;
    text-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}

.hero-title-line { display: block; }

.hero-line {
    font-family: raleway;
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 500;
    font-style: italic;
    color: rgba(232, 226, 214, .92);
    max-width: 32ch;
    margin: 0 0 12px;
}

.hero-role {
    font-family: poppins;
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: rgba(245, 245, 245, .55);
    margin: 0 0 28px;
}

.chapter-prose .beat,
.split-copy .beat,
.design-copy .beat {
    opacity: .95 !important;
}

.chapter-prose strong,
.split-copy strong,
.design-copy strong {
    color: whitesmoke;
    font-weight: 600;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 28px;
    height: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 1px;
    background: rgba(245, 245, 245, .28);
    cursor: pointer;
}

.hero-dots button.is-on { background: var(--accent); }

/* ---- layouts ---- */

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
}

.concept-split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 40px;
}

.split-copy p {
    font-family: poppins;
    font-size: 15px;
    line-height: 1.75;
    opacity: .88;
    margin: 0 0 14px;
}

.split-copy .lead {
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.7;
}

.split-media {
    display: grid;
    gap: 12px;
}

.concept-media {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-self: start;
    position: sticky;
    top: 96px;
}

.concept-media figure {
    margin: 0;
    border: 1px solid var(--mist);
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.concept-media-hero {
    grid-column: 1 / -1;
}

.concept-media img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(320px, 38vh);
    display: block;
    object-fit: contain;
    object-position: center;
}

.concept-media-hero img {
    max-height: min(460px, 52vh);
}

.split-media figure,
.split-single {
    margin: 0;
    border: 1px solid var(--mist);
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.split-media img,
.split-single img {
    width: auto;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

/* ---- 02 design ---- */

.design-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 36px;
    align-items: start;
}

.design-copy p {
    font-family: poppins;
    font-size: 15px;
    line-height: 1.75;
    opacity: .88;
    margin: 0 0 14px;
}

.design-copy .beat {
    margin: 18px 0;
}

.design-carousel {
    position: sticky;
    top: 88px;
    min-width: 0;
}

.design-carousel-stage {
    position: relative;
    border: 1px solid var(--mist);
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.04), transparent 55%),
        #0a0a0a;
    height: min(62vh, 560px);
    min-height: 300px;
    overflow: hidden;
}

.design-carousel-track {
    position: absolute;
    inset: 0;
}

.design-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(28px);
    transition:
        opacity .55s ease,
        transform .7s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.design-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 2;
}

.design-slide.is-exit {
    opacity: 0;
    transform: translateX(-22px);
    z-index: 1;
}

.design-slide img,
.design-slide video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: transparent;
}

.design-carousel-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(245, 245, 245, .08);
    z-index: 3;
    overflow: hidden;
}

.design-carousel-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transform-origin: left center;
}

.design-carousel.is-ticking .design-carousel-progress span {
    animation: design-progress var(--carousel-dwell, 4200ms) linear forwards;
}

@keyframes design-progress {
    from { width: 0%; }
    to { width: 100%; }
}

.design-carousel-ui {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "prev thumbs next"
        "count count count";
    gap: 10px 8px;
    align-items: center;
    margin-top: 12px;
}

.design-carousel-nav {
    grid-row: 1;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(245, 245, 245, .18);
    background: rgba(255, 255, 255, .03);
    color: whitesmoke;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.design-carousel-nav:hover {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    color: var(--accent);
}

.design-carousel-nav[data-carousel-prev] { grid-area: prev; }
.design-carousel-nav[data-carousel-next] { grid-area: next; }

.design-carousel-thumbs {
    grid-area: thumbs;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
}

.design-carousel-thumbs::-webkit-scrollbar { display: none; }

.design-carousel-thumbs button {
    flex: 0 0 auto;
    width: 44px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(245, 245, 245, .14);
    background: #111;
    cursor: pointer;
    opacity: .55;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.design-carousel-thumbs button.is-on {
    opacity: 1;
    border-color: var(--accent);
    transform: translateY(-1px);
}

.design-carousel-thumbs img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: #0a0a0a;
    pointer-events: none;
}

.design-carousel-count {
    grid-area: count;
    margin: 0;
    font-family: poppins;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    opacity: .45;
    text-align: center;
}

/* ---- 03 behavior ---- */

.behavior-split {
    grid-template-columns: 1.05fr .95fr;
    align-items: start;
}

.behavior-video {
    margin: 0;
    border: 1px solid var(--mist);
    background: #0a0a0a;
    overflow: hidden;
    position: sticky;
    top: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    height: min(56vh, 480px);
    padding: 12px;
    box-sizing: border-box;
}

.behavior-video video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: #0a0a0a;
}

.behavior-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 18px;
    display: grid;
    gap: 12px;
}

.behavior-list li {
    font-family: poppins;
    font-size: 15px;
    line-height: 1.65;
    opacity: .9;
    padding: 14px 16px;
    border-left: 2px solid var(--accent);
    background: rgba(255, 255, 255, .02);
}

.behavior-list strong {
    display: block;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0 20px;
}

.flow-node {
    font-family: poppins;
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 10px 14px;
    border: 1px solid rgba(245, 245, 245, .22);
}

.flow-arrow {
    opacity: .45;
    font-size: 14px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.photo-grid figure {
    margin: 0;
    border: 1px solid var(--mist);
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.photo-grid img {
    width: auto;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.photo-grid figcaption {
    font-family: poppins;
    font-size: 12px;
    line-height: 1.45;
    opacity: .55;
    padding: 10px 12px 12px;
}

.media-slot {
    margin-top: 18px;
    min-height: 180px;
    border: 1px dashed rgba(245, 245, 245, .2);
    display: grid;
    place-items: center;
    font-family: poppins;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(245, 245, 245, .4);
}

.ref-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 52ch;
    display: grid;
    gap: 12px;
}

.ref-list a {
    font-family: poppins;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(245, 245, 245, .78);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
    text-underline-offset: 4px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.ref-list a:hover {
    color: whitesmoke;
    text-decoration-color: var(--accent);
}

@media (max-width: 980px) {
    .crawler-rail { display: none; }
    .crawler-dock { top: 120px; transform: none; }
    .chapter { padding-left: 22px; padding-right: 22px; }
    .chapter-index { left: 22px; }
    .hero-copy { padding: 0 22px 7vh; }
    .hero-copy h1 { font-size: clamp(40px, 12vw, 64px); }
    .split,
    .behavior-split,
    .photo-grid { grid-template-columns: 1fr; }
    .concept-split {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .concept-media {
        position: static;
        max-width: 520px;
    }
    .design-layout {
        grid-template-columns: 1fr;
    }
    .design-carousel {
        position: static;
    }
    .design-carousel-stage {
        min-height: 260px;
    }
    .behavior-video {
        position: static;
        max-height: none;
    }
    .behavior-video video { max-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
    .design-slide {
        transition: opacity .2s ease;
        transform: none;
    }
    .design-carousel.is-ticking .design-carousel-progress span {
        animation: none;
        width: 100%;
    }
}
