:root {
    --c-void: #080808;
    --c-frame: #111111;
    --c-silver: #c8c8c8;
    --c-white: #f5f4f0;
    --c-accent: #e8d5b0;
}

.team-page {
    --text: var(--c-white);
    --accent: var(--c-accent);
    background: var(--bg);
    color: var(--c-white);
}

.team-page.grain::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.035;
    animation: grain-shift 0.5s steps(2) infinite;
    pointer-events: none;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: screen;
}

.team-main {
    position: relative;
    padding-top: 15vh;
    overflow: clip;
}

.team-main > * {
    position: relative;
    z-index: 1;
}

.team-main::before,
.team-main::after {
    content: none;
}

.team-hero,
.team-cta {
    min-height: 100vh;
    padding: 0 5vw;
    position: relative;
}

.team-hero {
    display: grid;
    place-items: center;
}

.team-hero-stage {
    width: min(1280px, 100%);
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 1rem;
    transform: translateY(clamp(-7rem, -9vh, -4rem));
}

.team-kicker {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.52em;
    text-transform: uppercase;
    color: rgba(200, 200, 200, 0.7);
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    will-change: transform, opacity;
}

.team-hero.is-ready .team-kicker {
    animation: team-label-fade 0.75s cubic-bezier(0.19, 1, 0.22, 1) 0.3s forwards;
}

.team-title {
    margin: 0;
    font-family: var(--font-raleway);
    font-size: clamp(3.15rem, 10.5vw, 9.8rem);
    letter-spacing: 0.16em;
    line-height: 0.92;
    color: var(--c-white);
}

.team-title-letter {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding: 0 0.01em 0.08em;
}

.team-title-letter-char {
    display: inline-block;
    transform: translate3d(0, 108%, 0);
    opacity: 0;
    transition:
        transform 0.9s cubic-bezier(0.215, 0.61, 0.355, 1),
        opacity 0.6s ease;
    transition-delay: calc(120ms + var(--letter-index, 0) * 60ms);
    will-change: transform, opacity;
}

.team-title-letter::after {
    content: none;
}

.team-hero.is-ready .team-title-letter-char {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.team-scroll-indicator {
    margin-top: clamp(2rem, 4vh, 3rem);
    width: 1px;
    height: 82px;
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    will-change: transform, opacity;
}

.team-hero.show-scroll-cue .team-scroll-indicator {
    animation: team-indicator-enter 0.7s ease forwards;
}

.team-scroll-indicator-line {
    display: block;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(232, 213, 176, 0.08), rgba(232, 213, 176, 0.85));
    transform-origin: top center;
    animation: team-scroll-pulse 1.8s ease-in-out infinite;
    will-change: transform, opacity;
}

.team-profile {
    --profile-progress: 0;
    --portrait-progress: 1;
    position: relative;
    min-height: 100vh;
}

.team-profile-sticky {
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: max(10vh, 96px) 5vw;
}

.team-profile-shell {
    width: min(1400px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
}

.team-profile.is-reverse .team-profile-shell {
    grid-template-columns: minmax(300px, 1fr) minmax(0, 1.2fr);
}

.team-portrait-column,
.team-copy-column,
.team-copy-inner,
.team-name,
.team-role,
.team-word,
.team-rule span,
.team-reel-line,
.team-cta-inner,
.team-cta-button,
.team-cta-button-fill,
.team-cta-button-text {
    will-change: transform, opacity;
}

.team-portrait-column {
    position: relative;
    display: flex;
    opacity: 0;
    transform: translate3d(0, 8vh, 0);
    transition:
        transform 0.85s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.6s ease;
}

.team-profile.is-reverse .team-portrait-column {
    justify-content: flex-end;
}

.team-portrait-shell {
    position: relative;
    width: min(100%, min(56vw, 760px));
    height: var(--portrait-frame-height, min(78vh, 760px));
    max-width: 100%;
    overflow: hidden;
    border-radius: 0;
    background: var(--c-frame);
    transform: translate3d(0, var(--portrait-frame-y, 0px), 0);
    box-shadow:
        0 45px 140px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(245, 244, 240, 0.06);
}

.team-portrait-media,
.team-portrait-media img {
    width: 100%;
    height: 100%;
}

.team-portrait-media {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.78), rgba(8, 8, 8, 0.94));
}

.team-portrait-media img {
    display: block;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1) brightness(0.92);
    transform: scale(1.03);
}

.team-portrait-media::before,
.team-portrait-media::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.team-portrait-media::before {
    background:
        radial-gradient(circle at center, transparent 46%, rgba(0, 0, 0, 0.36) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.22));
    z-index: 1;
}

.team-portrait-media::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 160px 160px;
    mix-blend-mode: screen;
    opacity: 0.18;
    transform: translate3d(0, 0, 0) scale(1.04);
    animation: portrait-grain-drift 1.8s steps(3) infinite;
    z-index: 2;
}

.team-portrait-shell:hover .team-portrait-media::after {
    opacity: 0.08;
    transform: translate3d(0, -6px, 0) scale(1.01);
}

.team-portrait-shell:hover .team-portrait-media img {
    filter: grayscale(1) contrast(1.02) brightness(0.97);
    transform: scale(1.03);
}

.team-copy-column {
    display: flex;
    align-items: center;
}

.team-copy-inner {
    width: min(100%, 520px);
}

.team-profile.is-reverse .team-copy-inner {
    margin-right: auto;
}

.team-name,
.team-role,
.team-bio,
.team-rule {
    opacity: 0;
}

.team-name {
    margin: 0;
    color: var(--c-white);
    transform: translate3d(68px, 0, 0) rotate(-2deg);
    transition:
        transform 0.8s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.6s ease;
}

.team-profile.is-reverse .team-name {
    transform: translate3d(-68px, 0, 0) rotate(2deg);
}

.team-role {
    margin: 1rem 0 1.5rem;
    color: var(--c-accent);
    font-size: 0.92rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    transform: translate3d(0, 18px, 0);
    transition:
        transform 0.7s cubic-bezier(0.19, 1, 0.22, 1) 0.3s,
        opacity 0.5s ease 0.3s;
}

.team-bio {
    margin: 0;
    max-width: 34rem;
    color: rgba(245, 244, 240, 0.82);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.85;
    transform: translate3d(0, 22px, 0);
    transition:
        transform 0.8s cubic-bezier(0.19, 1, 0.22, 1) 0.42s,
        opacity 0.6s ease 0.42s;
}

.team-rule {
    margin-top: 2rem;
    width: min(100%, 22rem);
}

.team-rule span,
.team-cta-rule span {
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 213, 176, 0.08), rgba(232, 213, 176, 1));
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition:
        transform 0.72s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
}

.team-profile.is-active .team-name,
.team-profile.is-active .team-role,
.team-profile.is-active .team-bio,
.team-profile.is-active .team-portrait-column,
.team-profile.is-mobile-visible .team-name,
.team-profile.is-mobile-visible .team-role,
.team-profile.is-mobile-visible .team-bio {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
}

.team-profile.is-active .team-rule,
.team-profile.is-mobile-visible .team-rule {
    opacity: 1;
}

.team-word {
    display: inline-block;
    opacity: 0.12;
    transform: translate3d(0, 16px, 0);
    transition:
        transform 0.55s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.4s ease;
    transition-delay: calc(var(--word-index, 0) * 22ms);
}

.team-bio.is-visible .team-word {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.team-rule.is-visible span,
.team-cta.is-visible .team-cta-rule span {
    opacity: 1;
    transform: scaleX(1);
}

.team-reel-transition {
    position: relative;
    min-height: 58vh;
    display: grid;
    align-items: center;
    padding: 0 5vw;
}

.team-reel-line {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--c-accent);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

.team-reel-transition.is-visible .team-reel-line {
    animation: team-reel-sweep 0.4s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.profile-mario .team-copy-column {
    transform: translate3d(0, 8vh, 0);
    opacity: 0;
    transition:
        transform 0.9s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.6s ease;
}

.profile-mario.is-active .team-portrait-column,
.profile-mario.is-mobile-visible .team-portrait-column,
.profile-mario.is-active .team-copy-column,
.profile-mario.is-mobile-visible .team-copy-column {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.team-cta {
    display: grid;
    place-items: center;
    padding-bottom: 14vh;
}

.team-cta-inner {
    width: min(920px, 100%);
    display: grid;
    justify-items: center;
    gap: 2rem;
    text-align: center;
    opacity: 0;
    transform: translate3d(0, 42px, 0);
    transition:
        transform 0.85s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.65s ease;
}

.team-cta.is-visible .team-cta-inner {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.team-cta-title {
    margin: 0;
    font-size: clamp(3.8rem, 11vw, 8.4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.team-cta-rule {
    width: min(100%, 18rem);
}

.team-cta-button {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20rem;
    padding: 1.25rem 2rem;
    border: 1px solid rgba(232, 213, 176, 0.72);
    color: var(--c-accent);
    text-transform: uppercase;
    letter-spacing: 0.34em;
    font-size: 0.88rem;
    font-family: var(--font-josefin);
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.team-cta-button:hover,
.team-cta-button:focus-visible {
    opacity: 1;
    transform: translate3d(0, -4px, 0);
    color: var(--c-void);
}

.team-cta-button-fill {
    position: absolute;
    inset: 0;
    background: var(--c-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.team-cta-button:hover .team-cta-button-fill,
.team-cta-button:focus-visible .team-cta-button-fill {
    transform: scaleX(1);
}

.team-cta-button-text {
    position: relative;
    z-index: 1;
}

html:not(.js-pending):not(.js-ready) .team-kicker,
html:not(.js-pending):not(.js-ready) .team-name,
html:not(.js-pending):not(.js-ready) .team-role,
html:not(.js-pending):not(.js-ready) .team-bio,
html:not(.js-pending):not(.js-ready) .team-portrait-column,
html:not(.js-pending):not(.js-ready) .team-rule,
html:not(.js-pending):not(.js-ready) .team-rule span,
html:not(.js-pending):not(.js-ready) .team-cta-inner,
html:not(.js-pending):not(.js-ready) .team-cta-rule span,
html:not(.js-pending):not(.js-ready) .profile-mario .team-copy-column {
    opacity: 1;
    transform: none;
}

@keyframes team-label-fade {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes team-indicator-enter {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes team-scroll-pulse {
    0%,
    100% {
        transform: scaleY(0.5) translateY(0);
        opacity: 0.28;
    }

    50% {
        transform: scaleY(1) translateY(10px);
        opacity: 1;
    }
}

@keyframes team-reel-sweep {
    0% {
        opacity: 1;
        transform: scaleX(0);
    }

    100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes portrait-grain-drift {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: -8% 6%;
    }

    100% {
        background-position: 6% -10%;
    }
}

@keyframes grain-shift {
    0% {
        background-position: 0 0;
    }

    25% {
        background-position: -5% -10%;
    }

    50% {
        background-position: -15% 5%;
    }

    75% {
        background-position: 7% -15%;
    }

    100% {
        background-position: 0 0;
    }
}

@media (min-width: 1920px) {
    .team-hero-stage {
        width: min(1400px, 100%);
    }

    .team-profile-shell,
    .team-profile.is-reverse .team-profile-shell {
        grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
        gap: clamp(2rem, 6vw, 7rem);
    }
}

@media (max-width: 768px) {
    .team-page.grain::after {
        opacity: 0.02;
    }

    .team-main {
        padding-top: 12vh;
    }

    .team-hero {
        min-height: 92vh;
    }

    .team-kicker {
        font-size: 0.72rem;
        letter-spacing: 0.42em;
    }

    .team-title {
        font-size: clamp(2.38rem, 12.6vw, 4.2rem);
        letter-spacing: 0.12em;
    }

    .team-scroll-indicator {
        height: 64px;
    }

    .team-profile {
        min-height: auto;
        padding: 0 0 5.5rem;
    }

    .team-profile-sticky {
        position: relative;
        min-height: auto;
        padding: 0 5vw;
    }

    .team-profile-shell,
    .team-profile.is-reverse .team-profile-shell {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .team-profile.is-reverse .team-copy-column {
        order: 1;
    }

    .team-profile.is-reverse .team-portrait-column {
        order: 0;
    }

    .team-portrait-column,
    .team-copy-column,
    .profile-mario .team-copy-column {
        transform: translate3d(0, 34px, 0);
        opacity: 0;
        transition:
            transform 0.75s cubic-bezier(0.19, 1, 0.22, 1),
            opacity 0.55s ease;
    }

    .team-profile.is-mobile-visible .team-portrait-column,
    .team-profile.is-mobile-visible .team-copy-column {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    .team-portrait-shell {
        width: 100%;
        height: min(64vh, 480px);
        transform: none;
        border-radius: 26px;
    }

    .team-name {
        font-size: clamp(2.2rem, 11vw, 3.8rem);
    }

    .team-role {
        font-size: 0.75rem;
    }

    .team-bio {
        font-size: 1rem;
        line-height: 1.75;
    }

    .team-reel-transition {
        min-height: 24vh;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .team-cta {
        min-height: 78vh;
        padding: 8rem 5vw 6rem;
    }

    .team-cta-title {
        font-size: clamp(2.8rem, 16vw, 4.9rem);
        letter-spacing: 0.1em;
    }

    .team-cta-button {
        min-width: 100%;
        letter-spacing: 0.22em;
        font-size: 0.78rem;
    }
}
