/* Case detail + Thinking */

.case-hero,
.thinking-hero,
.article-hero {
    position: relative;
    padding: 140px var(--pad) 70px;
    color: var(--white);
    background: var(--black);
    overflow: hidden;
}

.case-hero-grid,
.thinking-hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 8.333vw 8.333vw;
    pointer-events: none;
}

.case-hero > *,
.thinking-hero > *,
.article-hero > * {
    position: relative;
    z-index: 1;
}

.case-kicker,
.thinking-kicker,
.article-kicker {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 42px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.case-hero h1,
.thinking-hero h1,
.article-hero h1 {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(52px, 8vw, 120px);
    font-weight: 400;
    letter-spacing: -0.07em;
    line-height: 0.92;
}

.case-hero .case-sub,
.article-lead {
    max-width: 36ch;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: clamp(16px, 1.6vw, 22px);
}

.case-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
}

.case-meta-row span {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.case-cover {
    margin: 0;
    background: #111;
    overflow: hidden;
}

.case-media {
    margin: 0;
    display: grid;
    gap: 0;
    background: var(--paper);
    overflow: hidden;
}

.case-cover img,
.case-shot img,
.case-cover picture,
.case-shot picture {
    display: block;
    width: 100%;
    height: auto;
}

.case-body,
.article-body,
.thinking-list-wrap {
    padding: clamp(70px, 10vw, 120px) var(--pad);
    background: var(--paper);
    color: var(--black);
}

.case-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.7fr);
    gap: clamp(40px, 8vw, 120px);
    align-items: start;
}

.case-prose h2,
.article-body h2 {
    margin: 0 0 18px;
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 400;
    letter-spacing: -0.05em;
}

.case-block + .case-block {
    margin-top: 56px;
}

.case-prose p,
.article-body p,
.case-aside p {
    margin: 0;
    color: rgba(9, 9, 9, 0.68);
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.55;
}

.case-prose p + p,
.case-prose p + ul,
.case-prose ul + p {
    margin-top: 14px;
}

.case-prose ul,
.article-body ul {
    margin: 0;
    padding-left: 1.15em;
    color: rgba(9, 9, 9, 0.68);
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.55;
}

.case-prose li + li,
.article-body li + li {
    margin-top: 8px;
}

.case-aside {
    position: sticky;
    top: 110px;
    display: grid;
    gap: 28px;
    padding: 28px;
    background: var(--white);
    border: 1px solid rgba(9, 9, 9, 0.1);
}

.case-aside h3 {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(9, 9, 9, 0.45);
    font-weight: 500;
}

.case-aside a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--black);
    border-bottom: 1px solid rgba(9, 9, 9, 0.35);
}

.case-aside a i {
    display: inline-block;
    font-style: normal;
    border-bottom: none;
    transition: transform 0.35s ease;
}

.case-aside a:hover i {
    transform: rotate(-45deg);
}

.case-gallery {
    padding: 0 var(--pad) clamp(80px, 10vw, 140px);
    background: var(--paper);
}

.case-gallery h2 {
    margin: 0 0 36px;
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 400;
    letter-spacing: -0.05em;
}

.case-gallery-collage {
    display: grid;
    gap: 0;
}

.case-shot {
    margin: 0;
}

.case-shot-hero {
    position: relative;
    overflow: hidden;
    background: #111;
    aspect-ratio: 16 / 9;
}

.case-shot-hero .case-shot-stage {
    position: absolute;
    inset: 0;
}

.case-shot-hero .case-shot-stage > picture,
.case-shot-hero .case-shot-stage > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.case-shot-hero .case-shot-stage img {
    object-fit: cover;
    object-position: center top;
}

.case-shot-hero .case-shot-stage > picture,
.case-shot-hero .case-shot-stage > img {
    opacity: 1;
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.case-shot-hero .case-shot-stage > .is-outgoing {
    opacity: 0;
    pointer-events: none;
}

.case-shot-hero .case-shot-stage > .is-incoming {
    opacity: 0;
}

.case-shot-hero .case-shot-stage > .is-incoming.is-shown {
    opacity: 1;
}

.case-shot-hero figcaption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.case-gallery-thumbs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    background: #0a0a0a;
}

.case-gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.case-gallery-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
}

.case-shot-thumb {
    /* ~4.25 visible on desktop → peek of next = scroll cue */
    --thumb-visible: 4.25;
    flex: 0 0 calc(100% / var(--thumb-visible));
    width: calc(100% / var(--thumb-visible));
    max-width: none;
    display: block;
    padding: 0;
    border: 0;
    margin: 0;
    background: #111;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    scroll-snap-align: start;
    position: relative;
    isolation: isolate;
}

.case-shot-thumb picture,
.case-shot-thumb img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
    opacity: 0.72;
    transition: opacity 0.25s var(--ease);
}

.case-shot-thumb:hover picture,
.case-shot-thumb:hover img,
.case-shot-thumb:focus-visible picture,
.case-shot-thumb:focus-visible img,
.case-shot-thumb.is-active picture,
.case-shot-thumb.is-active img {
    opacity: 1;
}

.case-shot-thumb.is-active::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--lime, #c8f54a);
    content: "";
    pointer-events: none;
}

.case-shot-thumb:focus-visible {
    outline: none;
}

.case-shot-thumb:focus-visible::after {
    border-color: #fff;
}

.case-shot-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 1101px) {
    .case-media {
        --gallery-gap: clamp(8px, 0.9vw, 14px);
        --gallery-pad: clamp(18px, 2.4vw, 40px);
        --gallery-rail: clamp(168px, 15vw, 230px);
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--gallery-rail);
        gap: var(--gallery-gap);
        align-items: stretch;
        padding: var(--gallery-pad);
        background: var(--paper);
    }

    .case-media .case-shot-hero {
        min-width: 0;
        background: #111;
    }

    /* height:0 + min-height:100% → рельса = высота героя, без чёрной дыры */
    .case-media .case-gallery-thumbs {
        position: static;
        width: auto;
        height: 0;
        min-height: 100%;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scroll-snap-type: y proximity;
        background: transparent;
    }

    .case-media .case-gallery-thumbs::-webkit-scrollbar {
        width: 4px;
        height: 0;
    }

    .case-media .case-shot-thumb {
        flex: 0 0 auto;
        width: 100%;
        scroll-snap-align: start;
    }

    .case-media .case-shot-thumb + .case-shot-thumb {
        margin-top: 0;
    }
}

@media (max-width: 1100px) {
    .case-shot-thumb {
        --thumb-visible: 3.25;
    }
}

@media (max-width: 720px) {
    .case-shot-thumb {
        --thumb-visible: 2.2;
    }
}

.case-text-only {
    padding: 48px;
    border: 1px dashed rgba(9, 9, 9, 0.25);
    color: rgba(9, 9, 9, 0.55);
    font-size: 14px;
}

.thinking-list {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(9, 9, 9, 0.18);
}

.thinking-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 28px;
    align-items: center;
    padding: 42px 0;
    border-bottom: 1px solid rgba(9, 9, 9, 0.18);
    color: inherit;
    cursor: pointer;
    transition: background 0.3s, padding 0.3s var(--ease);
}

.thinking-item:hover {
    background: var(--lime);
}

.thinking-item span {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(9, 9, 9, 0.45);
}

.thinking-item h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 400;
    letter-spacing: -0.05em;
}

.thinking-item i {
    display: inline-block;
    font-style: normal;
    font-size: 22px;
    transition: transform 0.35s ease;
}

.thinking-item:hover i {
    transform: rotate(-45deg);
}

.article-body {
    max-width: 760px;
}

.privacy-doc {
    max-width: 760px;
    margin: 0 auto;
}

.privacy-doc h2 {
    margin-top: 48px;
}

.privacy-doc h3 {
    margin: 28px 0 12px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(9, 9, 9, 0.45);
}

.privacy-updated {
    margin-bottom: 36px !important;
    color: rgba(9, 9, 9, 0.45) !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.privacy-doc ul {
    margin: 0 0 18px;
}

.privacy-doc a {
    color: var(--black);
    border-bottom: 1px solid rgba(9, 9, 9, 0.3);
}

.privacy-doc code {
    font-size: 0.92em;
}

.article-body .article-meta {
    margin-bottom: 48px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(9, 9, 9, 0.45);
}

.article-body h2 {
    margin-top: 48px;
}

.article-body p + p,
.article-body ul {
    margin-top: 18px;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 72px;
    padding-top: 28px;
    border-top: 1px solid rgba(9, 9, 9, 0.15);
    font-size: 13px;
}

.article-related {
    margin-top: 36px;
}

.article-related a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.article-related a:hover,
.article-related a:focus-visible {
    opacity: 0.7;
}

@media (max-width: 980px) {
    .case-layout {
        grid-template-columns: 1fr;
    }

    .case-aside {
        position: static;
    }

    .thinking-item {
        grid-template-columns: 1fr auto;
        gap: 14px;
    }

    .thinking-item span:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .case-hero h1,
    .thinking-hero h1,
    .article-hero h1 {
        font-size: 48px;
    }

    .case-kicker,
    .thinking-kicker,
    .article-kicker {
        flex-direction: column;
        gap: 8px;
    }

    .thinking-item:hover {
        padding-right: 0;
        padding-left: 0;
    }
}
