:root {
    --case-background: #111;
    --case-surface: #151515;
    --case-surface-deep: #0e0e0e;
    --case-border: #303030;
    --case-border-strong: #414141;
    --case-text: #f1f1f1;
    --case-text-muted: #b4b4b4;
    --case-shell: 1400px;
    --case-radius: clamp(50px, 2.2vw, 30px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-synthesis: none !important;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: var(--case-background);
}

body {
    display: flex;
    flex-direction: column;
    color: var(--case-text);
    cursor: none;
}

.scrollbar-track,
.scrollbar-track-y {
    opacity: 0 !important;
    pointer-events: none !important;
}

#content-wrapper {
    height: 100vh;
    height: 100dvh;
    overflow: auto;
}

.container {
    min-height: 100%;
    overflow: hidden;
    background: var(--case-background);
}

.case-study-main {
    width: 100%;
    overflow: hidden;
}

#section1 {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(9rem, 18vh, 12rem) max(6%, calc((100vw - var(--case-shell)) / 2)) clamp(5rem, 10vh, 7rem);
    background-color: #050505;
    background-image: var(--case-hero-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transform: scale(1.08);
    animation: case-hero-reveal 1s ease forwards;
}

#overlay-top {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background: #0707078f;
}

#section1 > h1,
#section1 > h4,
#section1 > .primarybutton-white {
    position: relative;
    z-index: 1;
    width: min(100%, 52rem);
    text-align: left;
}

#section1 > h1 {
    color: var(--case-text);
    font-size: clamp(3.75rem, 8vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.065em;
    overflow-wrap: anywhere;
}

#section1 > h4 {
    margin: 1rem 0 2.25rem;
    color: #d5d5d5;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.55;
    letter-spacing: 0.01em;
}

.primarybutton-white {
    width: auto !important;
    padding: 0.95rem 1.5rem;
    color: var(--case-text);
    border: 2px solid var(--case-text);
    border-radius: 999px;
    background: transparent;
    cursor: none;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.primarybutton-white:hover {
    color: var(--case-background);
    background: var(--case-text);
    transform: scale(1.04);
}

.primarybutton-white:focus-visible,
.picture-wrapper:focus-within {
    outline: 3px solid var(--case-accent, #fff);
    outline-offset: 5px;
}

.text-section,
.text-section-info {
    position: relative;
    width: min(88%, var(--case-shell));
    min-height: 0;
    margin: 0 auto;
    padding: clamp(3.5rem, 5vw, 5rem) 0;
    display: grid;
    grid-template-columns: minmax(13rem, 0.72fr) minmax(0, 1.28fr);
    column-gap: clamp(2.5rem, 7vw, 7rem);
    align-items: start;
}

.text-section + .text-section {
    padding-top: clamp(1.5rem, 2.5vw, 2.5rem);
}

.text-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 50rem);
    height: 1px;
    background: var(--case-border);
    display: none;
}

#section1 + .text-section::before,
.header + .text-section::before {
    display: none;
}

.text-section > h3,
.text-section-info > h3 {
    grid-column: 1;
    margin: 0;
    color: var(--case-text);
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-align: left;
}

.text-section > p,
.text-section-info > p,
.text-section > .info-entry,
.text-section-info > .info-entry {
    grid-column: 2;
}

.text-section > p,
.text-section-info > p,
.info-entry > p {
    width: 100%;
    max-width: 50rem;
    margin: 0;
    color: var(--case-text-muted);
    font-size: clamp(1rem, 1.25vw, 1.16rem);
    line-height: 1.8;
    letter-spacing: 0.01em;
    text-align: left;
}

#section1 + .text-section > p {
    color: #d0d0d0;
    font-size: clamp(1.08rem, 1.5vw, 1.3rem);
    line-height: 1.75;
}

.text-section-info {
    margin-top: clamp(1.25rem, 2.5vw, 2.5rem);
    margin-bottom: clamp(1.25rem, 2.5vw, 2.5rem);
    padding: clamp(2rem, 4vw, 3.75rem);
    overflow: hidden;
    background: var(--case-surface);
    border: 1px solid var(--case-border);
    border-radius: var(--case-radius);
    box-shadow: 0 18px 55px #00000033;
}

.text-section-info + .text-section-info {
    margin-top: 1rem;
}

.text-section-info::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 #ffffff0d;
}

.info-entry {
    max-width: 50rem;
    display: grid;
    grid-template-columns: minmax(2.5rem, max-content) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
    padding: 1rem 0;
    border-top: 1px solid var(--case-border);
    text-align: left;
}

.info-entry + .info-entry {
    margin-top: 0;
}

.text-section > h3 + .info-entry,
.text-section-info > h3 + .info-entry {
    padding-top: 0;
    border-top: 0;
}

.text-section > p + .info-entry,
.text-section-info > p + .info-entry {
    margin-top: 1.5rem;
}

.info-entry > h5 {
    margin: 0;
    color: var(--case-accent, #cea0ff);
    font-family: "Just Sans Bold";
    font-size: 1.2rem;
    line-height: 1.5;
    letter-spacing: 0em;
}

.research-synthesis {
    width: min(88%, var(--case-shell));
    margin: clamp(6rem, 10vw, 10rem) auto;
    color: var(--case-text);
}

.research-synthesis-header {
    margin-bottom: clamp(4rem, 6vw, 7.25rem);
}

.research-synthesis-header > h2 {
    max-width: 64rem;
    margin: 0 auto;
    color: var(--case-text);
    font-family: "Just Sans ExtraBold";
    font-size: clamp(2.75rem, 6vw, 5.25rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    text-align: center;
    text-wrap: balance;
}

.research-insight-list {
    background: transparent;
}

.research-insight {
    min-width: 0;
    padding: clamp(2.25rem, 4vw, 3.5rem) clamp(1rem, 2vw, 2rem);
    display: grid;
    grid-template-columns: minmax(17rem, 0.85fr) minmax(20rem, 1.15fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.research-insight:first-child {
    padding-top: 0;
}

.research-insight + .research-insight {
    border-top: 1px solid var(--case-border);
}

.research-insight > h3 {
    max-width: 52rem;
    margin: 0;
    color: var(--case-text);
    font-family: "Just Sans Bold";
    font-size: clamp(1.5rem, 2.4vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-align: left;
    text-wrap: balance;
}

.research-insight > p {
    max-width: 44rem;
    margin: 0;
    color: var(--case-text-muted);
    font-family: "Roboto Regular";
    font-size: clamp(1rem, 1.25vw, 1.16rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    text-align: left;
    text-indent: 0;
}

.header {
    position: relative;
    width: 100%;
    min-height: clamp(17rem, 24vw, 22rem);
    height: auto;
    margin: clamp(1rem, 2vw, 2rem) 0;
    padding: clamp(4rem, 7vw, 6rem) max(6%, calc((100vw - var(--case-shell)) / 2));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: var(--case-surface);
    border-top: 1px solid #242424;
    border-bottom: 1px solid #242424;
}

.header > h4,
.header > h2 {
    width: min(100%, var(--case-shell));
    margin: 0;
    text-align: left;
}

.header > h4 {
    margin-bottom: 1.5rem;
    color: #fff;
    font-family: "Just Sans Regular";
    font-size: 1.7rem;
    line-height: 1.3;
    letter-spacing: 0em;
    text-transform: uppercase;
}

.header > h2 {
    max-width: 80rem;
    color: var(--case-text);
    font-size: clamp(2.75rem, 6vw, 5.75rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.picture-section {
    position: relative;
    width: min(88%, var(--case-shell));
    max-width: var(--case-shell);
    margin: clamp(1.5rem, 3vw, 2.75rem) auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.picture-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--case-surface-deep);
    border: 1px solid var(--case-border);
    border-radius: var(--case-radius);
    box-shadow: 0 18px 55px #00000040;
}

.picture-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 #ffffff12;
}

.picture-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--case-surface-deep);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.picture-wrapper:not(.slideshow):hover img {
    transform: scale(1.01);
    filter: brightness(0.96);
}

.picture-wrapper.slideshow {
    position: relative;
}

.picture-wrapper.slideshow img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(5%);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.picture-wrapper.slideshow:not(.is-initialized) img:first-child,
.picture-wrapper.slideshow img.is-active {
    z-index: 2;
    opacity: 1;
    transform: translateX(0);
}

.picture-wrapper.slideshow img.is-exiting {
    z-index: 1;
    opacity: 0;
    transform: translateX(-5%);
}

.case-gallery {
    width: min(88%, var(--case-shell));
    margin: clamp(1.5rem, 3vw, 2.75rem) auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.75rem);
}

.case-gallery > .picture-section {
    width: 100%;
    margin: 0;
}

.case-gallery > .picture-section:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - clamp(0.5rem, 1vw, 0.875rem));
    justify-self: center;
}

footer {
    width: 100%;
    height: auto;
    min-height: 6rem;
    margin-top: clamp(6rem, 10vw, 10rem);
    border-top: 1px solid #242424;
    background: var(--case-background);
}

#footer-contents {
    width: min(88%, var(--case-shell));
}

@keyframes case-hero-reveal {
    from {
        opacity: 0;
        transform: scale(1.12);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 1100px) {
    .text-section,
    .text-section-info {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1.5rem;
    }

    .text-section > h3,
    .text-section-info > h3,
    .text-section > p,
    .text-section-info > p,
    .text-section > .info-entry,
    .text-section-info > .info-entry {
        grid-column: 1;
    }

    .text-section::before {
        width: 100%;
    }

    .research-insight {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .case-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .case-gallery > .picture-section:last-child:nth-child(odd) {
        grid-column: auto;
        width: 100%;
    }
}

@media (max-width: 768px), (pointer: coarse) {
    html,
    body {
        height: auto;
        overflow: visible;
    }

    #content-wrapper {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        overflow-x: clip;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    #section1 {
        min-height: 92vh;
        min-height: 92svh;
        align-items: center;
        padding: 7rem 1.25rem 4rem;
        background-position: center;
    }

    #overlay-top {
        background: #0707078f;
    }

    #section1 > h1,
    #section1 > h4,
    #section1 > .primarybutton-white {
        text-align: center;
    }

    #section1 > h1 {
        font-size: clamp(2.75rem, 13vw, 4rem);
        line-height: 0.94;
    }

    #section1 > h4 {
        width: min(100%, 20rem);
        margin-bottom: 1.75rem;
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .text-section,
    .text-section-info,
    .picture-section,
    .case-gallery,
    .research-synthesis {
        width: min(calc(100% - 2rem), var(--case-shell));
    }

    .research-synthesis {
        margin-top: 5rem;
        margin-bottom: 5rem;
    }

    .research-synthesis-header {
        margin-bottom: 2.75rem;
    }

    .research-synthesis-header > h2 {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .research-insight {
        padding: 1.5rem 1rem;
    }

    .research-insight > h3 {
        font-size: clamp(1.4rem, 6.5vw, 1.85rem);
    }

    .text-section {
        padding: 3.5rem 0;
    }

    .text-section + .text-section {
        padding-top: 1rem;
    }

    .text-section-info {
        padding: 1.5rem;
    }

    .header {
        min-height: 16rem;
        margin: 1rem 0;
        padding: 3.75rem 1rem;
    }

    .header > h4,
    .header > h2 {
        width: 100%;
    }

    .header > h2 {
        font-size: clamp(2.6rem, 12vw, 4rem);
    }

    .header::after {
        right: 1rem;
        bottom: 2.5rem;
    }

    .info-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }

    .picture-wrapper {
        border-radius: clamp(14px, 5vw, 22px);
    }

    footer {
        margin-top: 5rem;
    }
}

@media (pointer: coarse) {
    body,
    .primarybutton-white,
    .picture-wrapper img {
        cursor: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    #section1 {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .primarybutton-white,
    .picture-wrapper img,
    .picture-wrapper.slideshow img {
        transition: none;
    }
}
