/* Homepage: a viewport-height desktop opening with an edge-to-edge film rail.
   Measured tile sizing in homepage-opening.js leaves the client strip at the
   fold. Keep the original heading spacing and the entire mobile layout. */
html body.light-theme .portfolio-intro [data-reel-showcase="portfolio"] {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    transform: none;
}
html body.light-theme .portfolio-intro .reel-viewport {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding-inline: 0;
    overflow: hidden;
    contain: inline-size;
    overscroll-behavior-x: contain;
}
html body.light-theme .portfolio-intro .rp-reel-toolbar { display:none!important; }

@media (min-width: 981px) {
    html body.light-theme .portfolio-intro {
        --rp-opening-card-width: clamp(144px, 18vw, 480px);
        /* Progressive fallback; JS measures the real header offset and captions.
           This is a floor, never a fixed clipping height. */
        box-sizing: border-box;
        min-height: calc(100vh - var(--rp-opening-top, 81px));
        min-height: calc(100svh - var(--rp-opening-top, 81px));
        --rp-opening-gap: clamp(14px, 1.05vw, 24px);
        display: block;
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: clamp(45px, 5.2vw, 82px) 0 clamp(28px, 3.6vh, 56px);
    }
    /* Heading size, kicker and intro spacing deliberately use editorial-light.css.
       In particular, do not bring back the short-window side-by-side rail. */
    html body.light-theme .portfolio-intro .intro-layout,
    html body.light-theme .portfolio-intro .intro-layout > div { min-width: 0; }
    html body.light-theme .portfolio-intro .hero-rotating-line { min-height:1.06em; }
    html body.light-theme .portfolio-intro .reel-group {
        gap: var(--rp-opening-gap);
        padding-right: var(--rp-opening-gap);
        align-items: flex-start;
    }
    html body.light-theme .portfolio-intro [data-reel-showcase="portfolio"] .reel-card {
        width: max(var(--rp-opening-card-width),var(--rp-reel-min-width,0px)) !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    html body.light-theme .portfolio-intro .reel-picture { width:100%; aspect-ratio:9/16; }
    html body.light-theme .portfolio-intro .reel-caption {
        padding: clamp(8px, 1.1vh, 14px) 2px 0;
        width: 100%;
        min-width: 0;
    }
    html body.light-theme .portfolio-intro .reel-caption small {
        font-size: clamp(9px,.65vw,12px);
        line-height: 1.4;
        margin-bottom: 4px;
        letter-spacing: .075em;
        overflow-wrap: anywhere;
    }
    html body.light-theme .portfolio-intro .reel-caption strong {
        font-size: clamp(12px,.84vw,16px);
        line-height: 1.4;
        overflow-wrap: anywhere;
    }
    html body.light-theme .portfolio-intro .clients--featured {
        padding: clamp(10px,1.3vh,26px) 0 clamp(12px,1.6vh,32px)!important;
    }
    html body.light-theme .portfolio-intro .clients--featured::before {
        width: min(calc(100% - 96px),var(--desktop-content,1320px));
        height: 1px;
        margin: 0 auto clamp(12px,1.4vh,24px);
        background: linear-gradient(90deg,transparent 0%,rgba(25,28,32,.08) 5%,rgba(25,28,32,.18) 18%,rgba(25,28,32,.18) 82%,rgba(25,28,32,.08) 95%,transparent 100%);
    }
    html[data-theme="dark"] body.light-theme .portfolio-intro .clients--featured::before {
        background: linear-gradient(90deg,transparent 0%,rgba(244,247,251,.06) 5%,rgba(244,247,251,.18) 18%,rgba(244,247,251,.18) 82%,rgba(244,247,251,.06) 95%,transparent 100%);
    }
    html body.light-theme .portfolio-intro .clients--featured .client-logo {
        min-height: clamp(76px,10vh,140px)!important;
        padding: clamp(6px,.8vh,14px) 14px!important;
        gap:6px!important;
    }
    html body.light-theme .portfolio-intro .clients--featured .client-logo img { height:clamp(32px,4.2vh,64px)!important; }
    html body.light-theme .portfolio-intro .clients--featured .client-logo-name {
        font-size:clamp(10px,.7vw,14px)!important;
        line-height:1.2!important;
        min-height:2.4em!important;
    }
    html body.light-theme .portfolio-intro .clients--featured .client-collaborations-header { margin-bottom:10px!important; }
}
@media (min-width:1700px) {
    /* Exact original desktop spacing rule, before the first-screen-fit revisions. */
    html body.light-theme .portfolio-intro { padding-top:clamp(72px,4.4vw,150px); }
}

/* Longer brand-focused phrases keep the same single-line rhythm without
   colliding with the intro copy in the right column. */
html body.light-theme .portfolio-intro .hero-rotating-text {
    transition: font-size 180ms ease, letter-spacing 180ms ease;
}
html body.light-theme .portfolio-intro .hero-rotating-text.is-long {
    font-size: .66em;
    letter-spacing: -.045em;
}
html body.light-theme .portfolio-intro .hero-rotating-text.is-xlong {
    font-size: .56em;
}

@media (max-width:680px) {
    html body.light-theme .portfolio-intro .hero-rotating-text.is-long { font-size:.62em; }
    html body.light-theme .portfolio-intro .hero-rotating-text.is-xlong { font-size:.52em; }
}

@media (prefers-reduced-motion:reduce) {
    html body.light-theme .portfolio-intro .hero-rotating-text { transition:none; }
}

/* The first-screen cue belongs to the content flow directly below the client
   logos. It stays unboxed and the opening-height calculation makes room for it. */
.rp-scroll-cue {
    position: relative;
    z-index: 2;
    display: flex;
    width: max-content;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    max-width: calc(100vw - 2rem);
    min-height: 2rem;
    margin: clamp(.85rem, 1.7vh, 1.25rem) auto clamp(.15rem, .7vh, .55rem);
    padding: .25rem 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #191c20;
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .055em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    transition: color 220ms ease, opacity 300ms ease;
}

.rp-scroll-cue-marks {
    display: inline-flex;
    align-items: center;
    gap: .08rem;
    min-width: 2.8rem;
}

.rp-scroll-cue-marks-right {
    justify-content: flex-end;
}

.rp-scroll-cue-mark {
    display: grid;
    width: 1.2rem;
    height: 1.35rem;
    place-items: center;
    border: 0;
    background: transparent;
    color: #285cc4;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    animation: rp-scroll-cue-pulse 4.8s ease-in-out infinite;
}

@keyframes rp-scroll-cue-pulse {
    0%, 68%, 100% { opacity: .22; transform: translateY(-1px) scale(.92); }
    76%, 90% { opacity: 1; transform: translateY(3px) scale(1); }
}

.rp-scroll-cue:hover,
.rp-scroll-cue:focus-visible {
    color: #285cc4;
    background: transparent;
}

.rp-scroll-cue:hover .rp-scroll-cue-mark,
.rp-scroll-cue:focus-visible .rp-scroll-cue-mark {
    transform: translateY(2px);
}

.rp-scroll-cue.is-hidden {
    pointer-events: none;
    opacity: 0;
}

html[data-theme="dark"] .rp-scroll-cue {
    color: #b0b9c7;
    background: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .rp-scroll-cue:hover,
html[data-theme="dark"] .rp-scroll-cue:focus-visible {
    color: #82b3ff;
    background: transparent;
}

html[data-theme="dark"] .rp-scroll-cue > .rp-scroll-cue-mark {
    background: transparent;
    color: #82b3ff;
}

@media (max-width: 680px) {
    .rp-scroll-cue {
        min-height: 2rem;
        margin-top: .75rem;
        font-size: .62rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rp-scroll-cue,
    .rp-scroll-cue > .rp-scroll-cue-mark { transition: none; animation: none; }
}
