/* =========================================================
   Case study pages (loads after style.css)
   ========================================================= */

.cs-page nav {
    opacity: 1;
}


/* style.css hides the nav until the home intro ends */

.cs-page .logo {
    text-decoration: none;
}

.cs-nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.cs-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 56px;
}


/* reading progress bar */

.cs-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 60;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
}


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

.cs-hero {
    padding-top: clamp(140px, 22vh, 220px);
    padding-bottom: clamp(56px, 9vh, 96px);
}

.cs-back {
    display: inline-block;
    margin-bottom: 36px;
    font-size: .85rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color .3s, transform .3s;
}

.cs-back:hover {
    color: var(--text);
    transform: translateX(-4px);
}

.cs-tag {
    display: block;
    margin-bottom: 24px;
}

.cs-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(3.6rem, 12vw, 10.5rem);
    line-height: .94;
    letter-spacing: -.04em;
    margin-bottom: 36px;
}

.cs-title em {
    font-style: italic;
    color: var(--accent);
}

.cs-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: .16em;
    margin-bottom: -.16em;
}

.cs-title .line>span {
    display: block;
    transform: translateY(110%);
    animation: csRise 1.2s cubic-bezier(.16, 1, .3, 1) forwards;
}

.cs-title .line:nth-child(1)>span {
    animation-delay: .1s;
}

.cs-title .line:nth-child(2)>span {
    animation-delay: .25s;
}

.cs-lead {
    max-width: 560px;
    color: var(--text-dim);
    font-size: 1.15rem;
    opacity: 0;
    animation: csFade 1s ease .6s forwards;
}

.cs-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-top: clamp(48px, 8vh, 80px);
    padding-top: 28px;
    border-top: 1px solid var(--line);
    opacity: 0;
    animation: csFade 1s ease .8s forwards;
}

.cs-meta .label {
    display: block;
    margin-bottom: 8px;
}

.cs-meta dd {
    font-size: 1rem;
}

.cs-visit {
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    text-decoration: none;
    transition: border-color .3s, color .3s;
}

.cs-visit:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@keyframes csRise {
    to {
        transform: none;
    }
}

@keyframes csFade {
    to {
        opacity: 1;
    }
}


/* ---------- cover ---------- */

.cs-cover {
    position: relative;
    margin: 0;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface);
    clip-path: inset(0 0 100% 0);
    animation: csReveal 1.4s cubic-bezier(.65, 0, .35, 1) .5s forwards;
}

.cs-cover img,
.cs-shot img {
    position: absolute;
    left: 0;
    top: -10%;
    width: 100%;
    height: 120%;
    object-fit: cover;
    filter: saturate(.85) contrast(1.05);
    will-change: transform;
}

.cs-cover::after,
.cs-shot::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(242, 241, 237, .12);
    background: linear-gradient(180deg, rgba(11, 12, 16, 0) 55%, rgba(11, 12, 16, .5));
}

@keyframes csReveal {
    to {
        clip-path: inset(0);
    }
}


/* ---------- content sections ---------- */

.cs-sec {
    padding-top: clamp(80px, 13vh, 150px);
    padding-bottom: 0;
}

.cs-sec:last-of-type {
    padding-bottom: clamp(80px, 13vh, 150px);
}

.cs-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    align-items: start;
}

.cs-grid>.label {
    padding-top: .7em;
}

.cs-grid.reveal-el {
    opacity: 0;
}

.cs-big {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.18;
    letter-spacing: -.02em;
    max-width: 760px;
}

.cs-text h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.9rem, 3.4vw, 2.9rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin-bottom: 22px;
}

.cs-text h2 em {
    font-style: italic;
    color: var(--accent);
}

.cs-text>p {
    color: var(--text-dim);
    font-size: 1.05rem;
    max-width: 620px;
}

.cs-steps {
    list-style: none;
    margin-top: 44px;
}

.cs-steps li {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.cs-steps li:last-child {
    border-bottom: 1px solid var(--line);
}

.cs-steps li>span {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--accent);
}

.cs-steps h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.cs-steps p {
    color: var(--text-dim);
    font-size: .98rem;
    max-width: 480px;
}


/* ---------- gallery ---------- */

.cs-gallery {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: start;
}

.cs-shot {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 4/5;
}

.cs-shot-b {
    margin-top: clamp(40px, 12vh, 140px);
    aspect-ratio: 3/4;
}


/* ---------- highlights ---------- */

.cs-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.cs-stats>div {
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.cs-stats strong {
    display: block;
    margin-bottom: 10px;
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    letter-spacing: -.02em;
    line-height: 1.05;
}

.cs-stats p {
    color: var(--text-dim);
    font-size: .95rem;
}


/* ---------- next project ---------- */

.cs-next {
    display: block;
    text-decoration: none;
    color: inherit;
    border-top: 1px solid var(--line);
    padding: clamp(80px, 14vh, 160px) 0;
}

.cs-next-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.cs-next .label {
    display: block;
    margin-bottom: 14px;
}

.cs-next-title {
    display: block;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(3rem, 9vw, 8rem);
    line-height: .95;
    letter-spacing: -.04em;
    transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.cs-next-title em {
    font-style: italic;
    color: var(--accent);
}

.cs-next:hover .cs-next-title {
    transform: translateX(16px);
}

.cs-next-orb {
    flex: none;
    display: grid;
    place-items: center;
    width: clamp(72px, 9vw, 120px);
    aspect-ratio: 1;
    border: 1px solid rgba(242, 241, 237, .28);
    border-radius: 50%;
    font-size: 1.6rem;
    transition: background .5s, color .5s, border-color .5s, transform .5s cubic-bezier(.22, .61, .36, 1);
}

.cs-next:hover .cs-next-orb {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    transform: rotate(-45deg);
}


/* ---------- footer ---------- */

.cs-foot {
    border-top: 1px solid var(--line);
    padding: 32px 0;
    color: var(--text-dim);
    font-size: .8rem;
}

.cs-foot-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cs-foot a {
    text-decoration: none;
    transition: color .3s;
}

.cs-foot a:hover {
    color: var(--accent);
}


/* ---------- responsive ---------- */

@media (max-width:900px) {
    .cs-wrap {
        padding: 0 24px;
    }
    .cs-nav-links {
        gap: 20px;
    }
    .cs-nav-links a:first-child {
        display: none;
    }
    .cs-meta {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .cs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .cs-grid>.label {
        padding-top: 0;
    }
    .cs-gallery {
        grid-template-columns: 1fr;
    }
    .cs-shot-b {
        margin-top: 0;
    }
    .cs-stats {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (prefers-reduced-motion:reduce) {
    .cs-title .line>span {
        transform: none;
        animation: none;
    }
    .cs-lead,
    .cs-meta {
        opacity: 1;
        animation: none;
    }
    .cs-cover {
        clip-path: none;
        animation: none;
    }
    .cs-cover img,
    .cs-shot img {
        transform: none !important;
    }
    .cs-progress {
        display: none;
    }
}

.reveal-el {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}


/* ---------- device mockup ---------- */

.dev {
    position: relative;
    width: 100%;
}

.dev-win {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #0d0f13;
    border: 1px solid rgba(242, 241, 237, .14);
    box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
}

.dev-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    background: #14161b;
    border-bottom: 1px solid rgba(242, 241, 237, .08);
}

.dev-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(242, 241, 237, .18);
}

.dev-url {
    margin-left: 12px;
    padding: 0 12px;
    height: 18px;
    display: flex;
    align-items: center;
    border-radius: 100px;
    background: rgba(242, 241, 237, .06);
    font-size: .62rem;
    letter-spacing: .04em;
    color: rgba(242, 241, 237, .45);
}

.dev-screen {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0b0c10;
}

.dev-screen img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    display: block;
    transition: transform 1.1s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}


/* JS sets --travel (how far the page can scroll) and --dur (how long that takes) */

.dev:hover .dev-screen img {
    transform: translate3d(0, var(--travel, 0px), 0);
    transition-duration: var(--dur, 6s);
    transition-timing-function: cubic-bezier(.45, .05, .25, 1);
}

.dev-phone {
    position: absolute;
    right: -13%;
    bottom: -9%;
    width: 27%;
    padding: 5px;
    border-radius: 22px;
    background: #14161b;
    border: 1px solid rgba(242, 241, 237, .16);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}

.dev-phone .dev-screen {
    aspect-ratio: 9/19;
    border-radius: 17px;
}

.dev-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 3;
    padding: 6px 12px;
    border-radius: 100px;
    white-space: nowrap;
    font-size: .6rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: rgba(11, 12, 16, .72);
    backdrop-filter: blur(6px);
    color: rgba(242, 241, 237, .7);
    transition: opacity .4s ease;
    pointer-events: none;
}

.dev:hover .dev-hint {
    opacity: 0;
}


/* touch screens: no hover, so the page scrolls itself, slowly, back and forth */

@media (hover:none) {
    .dev-hint {
        display: none;
    }
    .dev-screen img {
        animation: devScroll calc(var(--dur, 6s) * 1.5) ease-in-out infinite alternate;
    }
}

@keyframes devScroll {
    to {
        transform: translate3d(0, var(--travel, 0px), 0);
    }
}

@media (prefers-reduced-motion:reduce) {
    .dev-screen img {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .dev-hint {
        display: none;
    }
}


/* inside the pinned work section */

.wk-media.has-dev {
    background: radial-gradient(60% 55% at 50% 50%, rgba(159, 180, 232, .1), transparent 70%);
}

.wk-media.has-dev::after {
    display: none;
}


/* the old image border and gradient */

.wk-dev {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    padding: 0 clamp(50px, 6vw, 84px) 0 clamp(14px, 2vw, 28px);
    will-change: transform;
    /* the work JS drifts this, like it did the image */
}

@media (max-width:900px) {
    .wk-dev {
        padding: 0 14px;
    }
    .wk-dev .dev-phone {
        display: none;
    }
}

.cs-device {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 12% 0 0;
    /* leaves room for the phone to overhang */
    overflow: visible;
}

.cs-device .dev-phone {
    right: -9%;
}