/* team styles - the team layout, clean hover, solid layout */

/* ── 1. static, clean background ── */
.team-page-body {
    background: linear-gradient(120deg, #F4F2FC, #E8F0E4, #F2EBE1, #E4EBE6);
    min-height: 100vh;
    /* clip, not hidden - hidden breaks the sticky sidebar */
    overflow-x: clip;
    width: 100%;
}

.team-nav {
    /* #3A4B3A at 0.85: dark enough for AA text on the light pages */
    background-color: rgba(58, 75, 58, 0.85) !important;

    /* the frosted glass effect */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* hairline as an inset shadow so it does not take height from the bar */

    /* 5.72:1 on the bar */
    color: var(--text-on-dark);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* placeholder circle only; the real logo is sized by --nav-logo */
.team-nav .logo-circle:not(img) {
    width: 32px;
    height: 32px;
}

.team-page-wrapper {
    background-color: transparent;
    border-radius: 0;
    margin: 0 auto;
    max-width: none;
    box-shadow: none;
}

.team-hero-clean {
    /* full-bleed; the body clips horizontally */
    margin-top: var(--nav-h);
    margin-left: calc(-1 * (100vw - 100%) / 2);
    width: 100vw;
    border-radius: 0;
    /* a band with the photo's ratio (1522×677), so nothing is cropped */
    aspect-ratio: 2.25;
    position: relative;
    overflow: hidden;
    /* the photo lives on ::before (parallax layer) */
    background-color: #c8c4b8;
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
    /* scroll yes, pinch-zoom no: a pinch that starts on the photo does nothing */
    touch-action: pan-x pan-y;
}

/* parallax layer: moves with transform, taller than the hero by 2% of its height */
.team-hero-clean::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    /* in CSS, not JS: sized from the first paint, so cover does not re-zoom on load; = SAFE_BOTTOM */
    top: -2%;
    /* --hero-img is set inline by the page; gradient until a photo is uploaded */
    background-image: var(--hero-img, linear-gradient(135deg, var(--primary-mid) 0%, var(--tertiary-dark) 55%, var(--secondary-mid) 100%));
    background-size: cover;
    /* --hero-pos: optional framing per page (page_hero_pos) */
    background-position: var(--hero-pos, center bottom);
    transform: translate3d(0, var(--hero-parallax, 0px), 0);
    will-change: transform;
}

/* ── art direction: the hero aspect-ratio must pair with the active file ── */
@media (orientation: portrait) {
    .team-hero-clean { aspect-ratio: 4 / 3; }
    .team-hero-clean::before { background-image: var(--hero-img-portrait, var(--hero-img)); }
}

.team-hero-clean::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.15) 30%, transparent 55%);
    border-radius: inherit;
}

/* the frost layer shares the title's box, size and parallax */
.team-hero-clean h1,
.team-hero-clean .hero-script-frost {
    position: absolute;
    bottom: 2rem;
    left: 2.5rem;
    z-index: 2;
    color: #ffffff !important;
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(4rem, calc(9vw * var(--fs-scale, 1)), 9rem);
    font-weight: 500;
    margin: 0;
    line-height: 0.95;
    letter-spacing: -3px;
    /* no blend mode: clean white + shadow */
    text-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 8px 32px rgba(0,0,0,0.45);
    /* the title moves up faster than the photo - reads as depth */
    transform: translate3d(0, var(--hero-title-shift, 0px), 0);
    opacity: var(--hero-title-fade, 1);
    will-change: transform, opacity;
}

/* handwritten title: each stroke draws itself in, like Apple's "hello" */
.team-hero-clean {
    /* when the last stroke ends (.hero-script-eam: 0.98s + 0.9s); the glass settles in then */
    --pen-done: 1.88s;
}
.team-hero-clean .hero-script,
.team-hero-clean .hero-script-frost {
    display: block;
    /* never wider than the screen: at the largest text sizes on a phone the hero would clip it */
    width: min(3.89em, 100vw - 5rem);
    height: auto;
    aspect-ratio: 528 / 110;   /* the viewBox */
}
.team-hero-clean .hero-script {
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    /* SVG ignores text-shadow; one shadow, as it is repainted every frame of the drawing */
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.3));
}
/* while drawing: plain white 0.72 (cheap); the #hero-glass filter switches on once the pen is done */
.hero-script-glass {
    opacity: 0.72;
    animation: hero-glass-on 0s var(--pen-done) forwards;
}
@keyframes hero-glass-on { to { opacity: 1; filter: url(#hero-glass); } }

/* frosted glass inside the letters: with #hero-glass (team.html), the same material as .glass-name-pill */
.team-hero-clean .hero-script-frost {
    z-index: 1;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    /* backwards, so afterwards opacity follows the parallax fade */
    animation: hero-frost-in 0.4s var(--pen-done) ease-out backwards;
}
@keyframes hero-frost-in { from { opacity: 0; } }
/* until the script sets the mask, or it would blur the whole box */
.team-hero-clean .hero-script-frost[hidden] { display: none; }

.hero-script path {
    /* pathLength="1": offset 1 = hidden, 0 = drawn; 1.01 hides the round cap at the start */
    stroke-dasharray: 1 2;
    stroke-dashoffset: 1.01;
    animation: hero-script-draw var(--draw-dur) var(--draw-delay) cubic-bezier(0.3, 0.15, 0.4, 1) forwards;
}
/* strokes: O · "ur" · T bar · T stem + "eam"; durations follow stroke lengths (276 : 394 : 168 : 989) */
.hero-script-o   { --draw-dur: 0.25s; --draw-delay: 0.1s; }
.hero-script-ur  { --draw-dur: 0.34s; --draw-delay: 0.4s; }
.hero-script-t   { --draw-dur: 0.15s; --draw-delay: 0.79s; }
.hero-script-eam { --draw-dur: 0.9s;  --draw-delay: 0.98s; }
/* pen speed sampled from the path (linear()); cubic-bezier fallback */
.hero-script .hero-script-o {
    animation-timing-function: linear(0, 0.023, 0.036, 0.049, 0.063, 0.077, 0.091, 0.106, 0.121, 0.136, 0.152, 0.168, 0.185, 0.201, 0.218,
        0.235, 0.252, 0.27, 0.287, 0.305, 0.322, 0.34, 0.357, 0.375, 0.392, 0.409, 0.426, 0.443, 0.46, 0.477,
        0.495, 0.513, 0.531, 0.549, 0.568, 0.586, 0.604, 0.623, 0.641, 0.659, 0.677, 0.695, 0.713, 0.731, 0.748,
        0.765, 0.782, 0.799, 0.815, 0.831, 0.844, 0.858, 0.889, 0.912, 0.925, 0.937, 0.949, 0.961, 0.973, 0.986,
        1);
}
.hero-script .hero-script-ur {
    animation-timing-function: linear(0, 0.021, 0.033, 0.044, 0.057, 0.07, 0.087, 0.108, 0.129, 0.147, 0.161, 0.174, 0.187, 0.198, 0.21,
        0.222, 0.234, 0.246, 0.259, 0.273, 0.288, 0.304, 0.319, 0.335, 0.351, 0.367, 0.385, 0.419, 0.459, 0.478,
        0.492, 0.505, 0.518, 0.531, 0.543, 0.557, 0.571, 0.586, 0.601, 0.616, 0.631, 0.647, 0.662, 0.681, 0.712,
        0.746, 0.767, 0.783, 0.8, 0.824, 0.86, 0.891, 0.91, 0.924, 0.936, 0.947, 0.958, 0.968, 0.978, 0.989,
        1);
}
.hero-script .hero-script-eam {
    animation-timing-function: linear(0, 0.033, 0.056, 0.078, 0.098, 0.116, 0.137, 0.158, 0.177, 0.195, 0.213, 0.23, 0.248, 0.268, 0.29,
        0.306, 0.324, 0.341, 0.358, 0.374, 0.39, 0.405, 0.482, 0.497, 0.511, 0.526, 0.542, 0.57, 0.591, 0.604,
        0.616, 0.63, 0.644, 0.659, 0.674, 0.703, 0.718, 0.744, 0.77, 0.782, 0.793, 0.803, 0.815, 0.826, 0.838,
        0.854, 0.88, 0.894, 0.903, 0.912, 0.92, 0.929, 0.938, 0.948, 0.956, 0.964, 0.971, 0.979, 0.985, 0.993,
        1);
}

@keyframes hero-script-draw { to { stroke-dashoffset: 0; } }

/* reduce motion: the word is simply there, glass and all */
@media (prefers-reduced-motion: reduce) {
    .hero-script path { animation: none; stroke-dashoffset: 0; }
    .hero-script-frost { animation: none; }
    .hero-script-glass { animation: none; opacity: 1; filter: url(#hero-glass); }
}
html[data-reduce-motion] .hero-script path { animation: none; stroke-dashoffset: 0; }
html[data-reduce-motion] .hero-script-frost { animation: none; }
html[data-reduce-motion] .hero-script-glass { animation: none; opacity: 1; filter: url(#hero-glass); }

/* reduce transparency / high contrast / forced colors: solid white strokes */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
    .hero-script-frost { display: none; }
    .hero-script-glass { animation: none; opacity: 1; filter: none; }
}
html[data-reduce-transparency] .hero-script-frost,
html[data-high-contrast] .hero-script-frost { display: none; }
html[data-reduce-transparency] .hero-script-glass,
html[data-high-contrast] .hero-script-glass { animation: none; opacity: 1; filter: none; }

/* high contrast: dark halo too (≥ 5.3:1) */
@media (prefers-contrast: more) {
    .team-hero-clean .hero-script { filter: drop-shadow(0 0 2px rgba(0,0,0,0.9)) drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }
}
html[data-high-contrast] .team-hero-clean .hero-script {
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.9)) drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

/* dyslexia font: plain one-line text instead of the script */
html[data-dyslexia-font] .team-hero-clean .hero-title-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    font-size: min(1em, (100vw - 5rem) / 4.5);
}
html[data-dyslexia-font] .team-hero-clean .hero-script,
html[data-dyslexia-font] .team-hero-clean .hero-script-frost { display: none; }

/* print: finished word in ink with a light halo */
@media print {
    .hero-script path { animation: none; stroke-dashoffset: 0; }
    .hero-script-glass { animation: none; opacity: 1; filter: none; }
    .team-hero-clean .hero-script { stroke: var(--text-strong); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)); }
    .hero-script-frost { display: none; }
}

/* ── Layout: sidebar + main ─────────────────── */
.team-layout {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

/* Sidebar */
.team-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
    padding: 1.2rem 0 1.2rem 2rem;
}

.sidebar-toggle {
    display: none;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.6rem 0;
    align-items: center;
    justify-content: space-between;
}
.sidebar-toggle svg { width: 10px; height: 6px; transition: transform 0.3s ease; }
.sidebar-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-link {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-body);
    text-decoration: none;
    padding: 0.55rem 0;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    transition: color 0.2s ease, border-color 0.2s ease;
    line-height: 1.3;
}

.sidebar-link:hover { color: #314031; }
.sidebar-link.active {
    color: #314031;
    font-weight: 500;
    border-left-color: #314031;
}

/* Main */
.team-main {
    flex: 1;
    min-width: 0;
    padding: 1.2rem 2rem 0rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Intro */
.team-intro {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.team-intro-title {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1.2rem, calc(2vw * var(--fs-scale, 1)), 1.6rem);
    font-weight: 400;
    color: #1A1A1A;
    letter-spacing: -0.4px;
    margin: 0;
}

.team-intro-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.92rem;
    color: var(--text-body);
    line-height: 1.7;
    margin: 0;
    max-width: 560px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.section-tag {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1.1rem, calc(2vw * var(--fs-scale, 1)), 1.5rem);
    font-weight: 400;
    color: #314031;
    letter-spacing: -1px;
    white-space: nowrap;
}

.section-count {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding-top: 4px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(49,64,49,0.15), transparent);
}

.team-grid-clean {
    display: grid;
    /* min(280px, 100%) keeps the grid centred on narrow screens */
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 2.5rem;
    background-color: transparent;
}

.team-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    max-width: 1100px;
}

/* ── 2. clean card with a classic, light hover ── */
.team-member-clean {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-card);
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 12px 35px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
    /* scroll yes, pinch-zoom no: rapid zoom on the photos crashed Safari on iOS */
    touch-action: pan-x pan-y;
}

.team-member-clean:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 50px rgba(0,0,0,0.08);
}

/* no hover while scrolling (html.is-scrolling, team.html): ~300 MB less in Safari */
html.is-scrolling .team-member-clean:not(.is-expanded) {
    pointer-events: none;
}

.member-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1;
}

.team-member-clean:hover .member-image-bg {
    transform: scale(1.06);
}

.glass-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.glass-buttons {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

/* ── stretched "open profile" button - the card's only action, under the icon links ── */
.member-open-btn {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: inherit;
}
.member-open-btn:focus-visible {
    outline: 3px solid var(--olive-pale, #b4bfa9);
    outline-offset: -3px;
}
.glass-overlay { z-index: 3; }   /* above the opener so the icon links stay pressable */

.glass-name-pill {
    position: absolute;
    bottom: 14px;
    left: 12px;
    right: 12px;
    /* clicks on the name pass to the opener */
    pointer-events: none;
    height: auto;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    /* concentric with the card: 30px − 12px inset = 18px */
    border-radius: 18px;
    /* 12px rhythm; 18px sides so text clears the corner */
    padding: 11px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* grows upward; max-height keeps it inside the card */
    max-height: calc(100% - 28px);
    /* no overflow: hidden - it would clip the pseudo shadows */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 0 rgba(0, 0, 0, 0.04),
                0 6px 20px rgba(0, 0, 0, 0.14);
    /* blur radius stays constant in every state */
    transition: background 0.28s var(--ease-settle),
                box-shadow 0.3s var(--ease-settle),
                border-color 0.28s var(--ease-settle);
}

/* pills appear statically, no animation */

.team-member-clean:hover .glass-name-pill,
.team-member-clean:focus-within .glass-name-pill {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 0 rgba(0, 0, 0, 0.04),
                0 8px 28px rgba(0, 0, 0, 0.16),
                0 0 28px rgba(255, 255, 255, 0.22);
}

.team-member-clean.is-expanded .glass-overlay h3 {
    font-size: clamp(0.95rem, calc(1.8vw * var(--fs-scale, 1)), 1.1rem);
    letter-spacing: -0.4px;
    /* long names wrap when there is room */
    white-space: normal;
    padding-right: 52px;   /* clears the two icon links at the top right (.pill-actions) */
}

/* open: the role folds away (it shows on the closed card) so the bio gets the room */
.team-member-clean.is-expanded .glass-overlay .member-role {
    max-height: 0;
    opacity: 0;
    transition: max-height var(--t-open) var(--ease-snap),
                opacity var(--t-close-x) var(--ease-snap);
}

.glass-overlay h3 {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.78rem, calc(1.4vw * var(--fs-scale, 1)), 0.92rem);
    /* font-size does not transition (too expensive) */
    color: #1A1A1A;
    margin: 0 0 2px 0;
    font-weight: 500;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;   /* a long bio scrolls, the name never gets squeezed */
}

.glass-overlay .member-role {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    max-height: 1.6em;
    transition: max-height var(--t-close) var(--ease-snap),
                opacity var(--t-close) var(--ease-snap);
}

.member-pronouns {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    font-family: 'Quicksand', sans-serif;
    flex-shrink: 0;
    white-space: nowrap;
}
.member-pronouns::before {
    content: '·';
    margin-right: 2px;
    opacity: 0.5;
}

.glass-icon-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.75) translateY(-6px);
    pointer-events: none;
    transition: opacity 0.35s var(--apple-ease), transform 0.4s var(--apple-ease), box-shadow 0.4s ease, background 0.3s ease;
}

/* icon buttons show on hover and keyboard focus */
.team-member-clean:hover .glass-icon-btn,
.team-member-clean:focus-within .glass-icon-btn {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.team-member-clean:hover .btn-linkedin,
.team-member-clean:focus-within .btn-linkedin {
    transition-delay: 0.06s;
}

/* touch: icon buttons always visible */
@media (hover: none) and (pointer: coarse) {
    .glass-icon-btn {
        opacity: 1;
        transform: scale(1) translateY(0);
        pointer-events: auto;
    }
}

.glass-icon-btn:hover,
.glass-icon-btn:focus-visible {
    transform: scale(1.1) !important;
}
.glass-icon-btn svg {
    width: 15px;
    height: 15px;
}

.glass-icon-btn.btn-mail {
    background: rgba(58, 75, 58, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(90, 115, 90, 0.25);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.glass-icon-btn.btn-mail:hover {
    background: rgba(58, 75, 58, 0.88);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 22px rgba(80, 120, 80, 0.45);
}

.glass-icon-btn.btn-linkedin {
    background: rgba(10, 102, 194, 0.68);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(10, 102, 194, 0.25);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.glass-icon-btn.btn-linkedin:hover {
    background: rgba(10, 102, 194, 0.88);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 22px rgba(10, 102, 194, 0.45);
}

.expand-hint {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s var(--apple-ease), background 0.2s ease;
    pointer-events: none;
}

.team-member-clean:hover .expand-hint {
    opacity: 1;
    transform: scale(1);
    background: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.9);
}

.expand-hint svg {
    width: 10px;
    height: 10px;
}

/* ── expand in place: the pill grows upward to show bio + actions ── */

/* ── tuning table: every curve and duration of the expand ── */
:root {
    --ease-expo:    cubic-bezier(0.19, 1, 0.22, 1);          /* out - the motion */
    --ease-expo-in: cubic-bezier(0.95, 0.05, 0.795, 0.035);  /* in  - the exit */
    --ease-settle:  cubic-bezier(0.22, 1, 0.36, 1);          /* out, gentle - the light */
    --ease-quick:   cubic-bezier(0.4, 0, 0.6, 1);            /* in-out - small resets */

    /* --ease-snap: for the height and the card lift */
    --ease-snap:    cubic-bezier(0.19, 1, 0.22, 1);

    --t-open:    0.32s;   /* pill height */
    /* closing uses the same out curve as opening */
    --t-close:   0.16s;   /* height, card, photo, light */
    --t-close-x: 0.1s;    /* text & rule - they leave first */
    --t-lift:    0.36s;   /* card lift */
    --t-photo:   0.44s;   /* photo zoom - long tail, it is composited */
    --t-content: 0.28s;   /* bio & actions */
    --t-light:   0.85s;   /* the light, deliberately NOT snappy */
}

/* steeper curve where linear() is supported */
@supports (transition-timing-function: linear(0, 1)) {
    :root {
        --ease-snap: linear(0.0000, 0.3960, 0.6351, 0.7796, 0.8669, 0.9196, 0.9514, 0.9707, 0.9823, 0.9893, 0.9935, 0.9961, 0.9976, 0.9986, 0.9991, 0.9995, 0.9997, 0.9998, 0.9999, 0.9999, 1.0000, 1.0000, 1);
    }
}

.team-member-clean.is-expanded {
    z-index: 5;                       /* the open pill above the neighbouring cards */
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.14);
    /* only transform transitions; the shadow changes instantly */
    transition: transform var(--t-lift) var(--ease-snap);
}

/* .is-closing: fast return while collapsing */
.team-member-clean.is-closing,
.team-member-clean.is-closing .member-image-bg,
.team-member-clean.is-closing .expand-hint {
    transition: transform var(--t-close) var(--ease-snap),
                box-shadow var(--t-close) var(--ease-snap),
                opacity var(--t-close) var(--ease-snap),
                background var(--t-close) var(--ease-snap) !important;
}

/* press-in */
.team-member-clean:has(.member-open-btn:active) {
    transform: scale(0.99);
    transition: transform 0.12s var(--ease-quick);
}
.team-member-clean.is-expanded:has(.member-open-btn:active) {
    transform: translateY(-6px) scale(0.995);
}

.team-member-clean.is-expanded .member-image-bg {
    transform: scale(1.05);
    /* darker photo so the open glass stands out */
    /* no filter animation; darkening via scrim opacity */
    transition: transform var(--t-photo) var(--ease-expo);
}

/* ── the light builds after the motion ── */

/* static pseudo-element shadows, revealed with opacity */
.glass-name-pill::before,
.glass-name-pill::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

/* depth - arrives with the motion */
.glass-name-pill::before {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
    transition: opacity var(--t-close) var(--ease-snap);
}
.team-member-clean.is-expanded .glass-name-pill::before {
    opacity: 1;
    transition: opacity 0.3s var(--ease-settle);
}

/* halo - the light, gradually, once the motion has landed */
.glass-name-pill::after {
    box-shadow: 0 0 46px rgba(255, 255, 255, 0.55);
    transition: opacity var(--t-close) var(--ease-snap);
}
.team-member-clean.is-expanded .glass-name-pill::after {
    opacity: 1;
    transition: opacity var(--t-light) var(--ease-settle) 0.1s;
}

/* ── pre-warm the layers before the click ── */
.team-member-clean.is-warm .member-image-bg,
.team-member-clean.is-warm .glass-overlay::after,
.team-member-clean.is-warm .glass-name-pill::before,
.team-member-clean.is-warm .glass-name-pill::after,
.team-member-clean.is-warm .pill-bio,
.team-member-clean.is-warm .pill-actions > * {
    will-change: opacity, transform;
}

/* photo light & depth in one layer: darkening, vignette, ambient */
.glass-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(105% 78% at 50% 100%,
            rgba(255, 255, 255, 0.50) 0%,
            rgba(255, 255, 255, 0.22) 30%,
            rgba(255, 255, 255, 0) 55%),
        radial-gradient(115% 85% at 50% 32%,
            transparent 38%,
            rgba(0, 0, 0, 0.40) 100%),
        linear-gradient(rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.20));
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-close) var(--ease-snap);
}

.team-member-clean.is-expanded .glass-overlay::after {
    opacity: 1;
    transition: opacity var(--t-light) var(--ease-settle) 0.1s;
}

.team-member-clean.is-expanded .glass-name-pill {
    justify-content: flex-start;      /* name on top, bio below */
    /* light vertical gradient instead of flat white */
    background: linear-gradient(165deg,
                rgba(255, 255, 255, 0.97) 0%,
                rgba(255, 255, 255, 0.90) 100%);
    /* backdrop-filter radius stays fixed */
    border-color: rgba(255, 255, 255, 0.5);
    /* transition declared on the base pill */
}

/* the chevron in the top right flips = "put it away" */
.team-member-clean.is-expanded .expand-hint {
    opacity: 1;
    transform: rotate(180deg) scale(1);
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.98);
    transition: transform var(--t-lift) var(--ease-expo),
                opacity 0.2s ease,
                background 0.3s var(--ease-settle);
}

/* corner icon links hide while open (JS sets inert too) */
.team-member-clean.is-expanded .glass-icon-btn {
    opacity: 0 !important;
    transform: scale(0.9) !important;
    pointer-events: none !important;
}

/* ── the part that opens ── */
.pill-details {
    display: grid;
    grid-template-rows: 0fr;
    min-height: 0;
    /* visibility: hidden keeps closed content out of the tab order */
    visibility: hidden;
    pointer-events: none;
    transition: grid-template-rows var(--t-close) var(--ease-snap),
                visibility 0s linear var(--t-close);
}

.team-member-clean.is-expanded .pill-details {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows var(--t-open) var(--ease-snap),
                visibility 0s linear 0s;
}

.pill-details-inner {
    min-height: 0;
    overflow: hidden;
    /* contain keeps the layout work inside the card */
    contain: layout;
}

/* .pill-scrolls: content scrolls at large font sizes */
.team-member-clean.pill-scrolls .pill-details-inner {
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
}

/* reveal: opacity + small offset, slight stagger */
.pill-bio,
.pill-actions > * {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--t-close-x) var(--ease-snap),
                transform var(--t-close-x) var(--ease-snap);
}

.team-member-clean.is-expanded .pill-bio,
.team-member-clean.is-expanded .pill-actions > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--t-content) var(--ease-expo),
                transform var(--t-content) var(--ease-expo);
}
.team-member-clean.is-expanded .pill-bio                     { transition-delay: 0.05s; }
.team-member-clean.is-expanded .pill-actions > *:nth-child(1) { transition-delay: 0.09s; }
.team-member-clean.is-expanded .pill-actions > *:nth-child(2) { transition-delay: 0.13s; }

.pill-bio {
    /* one 12px rhythm for the whole pill */
    margin: 12px 0 0 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(0, 0, 0, 0.62);
    /* the h3/role above are cut with an ellipsis; the bio has to wrap */
    white-space: normal;
}

/* icon links on the name's row (a direct child of the pill, not of the clipped details) */
.pill-actions {
    position: absolute;
    top: 8px;
    right: 9px;
    display: flex;
    gap: 2px;
    /* only the actions take clicks */
    pointer-events: auto;
    visibility: hidden;
    transition: visibility 0s linear var(--t-close);
}
.team-member-clean.is-expanded .pill-actions {
    visibility: visible;
    transition: visibility 0s linear 0s;
}

.pill-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-decoration: none;
    /* olive, darker than the role */
    color: var(--tertiary-dark, #525E49);
    transition: color 0.2s var(--ease-settle), background 0.2s var(--ease-settle);
}

.pill-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.78;
    transition: opacity 0.2s var(--ease-settle);
}

/* optical balance between the LinkedIn and mail marks */
.pill-btn.btn-linkedin svg {
    width: 13px;
    height: 13px;
    opacity: 0.62;
}

.pill-btn:hover {
    color: var(--primary-mid, #2C3A2C);
    background: rgba(49, 64, 49, 0.08);
}
.pill-btn:hover svg,
.pill-btn:focus-visible svg { opacity: 1; }
.pill-btn:focus-visible {
    outline: 3px solid var(--olive-pale, #b4bfa9);
    outline-offset: 1px;
}

/* ── Responsive ──────────────────────── */
@media (max-width: 900px) {
    .team-sidebar { width: 100%; position: relative; top: 0; padding: 1.5rem 1.5rem 0 1.5rem; }
    .sidebar-toggle { display: flex; }
    .sidebar-nav { display: none; padding-top: 0.5rem; }
    .sidebar-nav.open { display: flex; }
    .team-main { padding: 2rem 1.5rem 1.5rem 1.5rem; } /* was 6rem bottom → a huge gap before Explore More */
    /* stretch so main takes the full width */
    .team-layout { flex-direction: column; align-items: stretch; }

    .team-grid-clean { gap: 2rem; }
}

@media (max-width: 600px) {
    /* minmax(0, 1fr) stops tracks overflowing at large font sizes */
    .team-grid-clean { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .team-grid-small { grid-template-columns: minmax(0, 1fr); }
    .team-member-clean { border-radius: var(--radius-card); }
    .glass-overlay { padding: 12px 16px; border-radius: 16px; }
    /* let long section tags wrap on phones */
    .section-label { margin-bottom: 1.5rem; flex-wrap: wrap; }
    .section-tag { white-space: normal; min-width: 0; }

    .team-member-clean.is-expanded .glass-overlay h3 { font-size: clamp(0.9rem, calc(4.2vw * var(--fs-scale, 1)), 1.02rem); }
    .pill-bio { font-size: 0.8rem; }
}
/* ══ OLIVE BRANCH BACKGROUND DECORATION ══ */

.leaves-container {
    /* leaf size: 200px on phones, 400px max on large screens */
    --leaf-w: clamp(200px, 24vw, 400px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    /* 0, not -1: a negative-z fixed layer cost Safari ~400 MB on scroll */
    z-index: 0;
    /* opacity and --leaf-blur are written by hero-blur.js - no transition */
    opacity: 1;
    /* own compositor layer */
    will-change: opacity;
    transform: translateZ(0);
}

/* positioned, so the page paints over the leaves; :where() lets page rules win */
:where(.leaves-container ~ *) {
    position: relative;
}

.leaf-bg {
    position: absolute;
    width: var(--leaf-w);
    aspect-ratio: 1 / 2;
    /* still, not animated: the WebP cost ~100–200 MB in Safari */
    background-image: var(--leaf);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    /* 40% opacity: visible, but still a background element */
    opacity: 0.4;
    /* --leaf-blur: driven by hero-blur.js on .leaves-container */
    filter: blur(var(--leaf-blur, 0px)) drop-shadow(0 10px 15px rgba(0,0,0,0.03));
    will-change: filter;
}

/* leaves hug the viewport edges, stems off-screen, so only the outer half shows beside the content */
.leaf-1 {
    bottom: calc(var(--leaf-w) * -0.55);
    left: calc(var(--leaf-w) * -0.3);
    transform: rotate(6deg);
}

/* right, hanging down from under the navbar */
.leaf-2 {
    top: calc(var(--leaf-w) * -0.45);
    right: calc(var(--leaf-w) * -0.3);
    transform: rotate(186deg);
}

/* phones: content is full-width, so push the leaves further out */
@media (max-width: 900px) {
    .leaf-1 { left: calc(var(--leaf-w) * -0.5); }
    .leaf-2 { right: calc(var(--leaf-w) * -0.5); }
}

/* ── desktop: leaves baked into the fixed body background (cheaper in Safari); iOS ignores fixed ── */
html                                 { --leaf-l: var(--leaf-left);           --leaf-r: var(--leaf-right); }
html.leaves-soft                     { --leaf-l: var(--leaf-left-soft);      --leaf-r: var(--leaf-right-soft); }
html[data-dark]                      { --leaf-l: var(--leaf-left-dark);      --leaf-r: var(--leaf-right-dark); }
html[data-dark].leaves-soft          { --leaf-l: var(--leaf-left-dark-soft); --leaf-r: var(--leaf-right-dark-soft); }
html[data-reduce-transparency]       { --leaf-l: none !important;            --leaf-r: none !important; }
/* html.leaves-off (hero-blur.js): pinch-zoomed once, leaves gone until reload */
html.leaves-off                      { --leaf-l: none !important;            --leaf-r: none !important; }
html.leaves-off .leaves-container    { display: none !important; }
/* forced colors keeps url() backgrounds */
@media (forced-colors: active)       { html { --leaf-l: none !important;     --leaf-r: none !important; } }

@media (hover: hover) and (pointer: fine) {
    @supports not (-webkit-touch-callout: none) {
        .leaves-container { display: none; }

        body:is(.team-page-body, .project-page-body, .attr-page-body) {
            --leaf-w: clamp(200px, 24vw, 400px);
            /* images are 0.95 × 2.1 leaf widths, centred on .leaf-1 / .leaf-2 */
            --leaf-size: calc(var(--leaf-w) * 0.95) calc(var(--leaf-w) * 2.1);
            --leaf-pos-l: left calc(var(--leaf-w) * -0.275) bottom calc(var(--leaf-w) * -0.6);
            --leaf-pos-r: right calc(var(--leaf-w) * -0.275) top calc(var(--leaf-w) * -0.5);
            background-image: var(--leaf-l), var(--leaf-r), linear-gradient(120deg, #F4F2FC, #E8F0E4, #F2EBE1, #E4EBE6);
            background-attachment: fixed, fixed, scroll;
            background-repeat: no-repeat, no-repeat, repeat;
            background-size: var(--leaf-size), var(--leaf-size), auto;
            background-position: var(--leaf-pos-l), var(--leaf-pos-r), 0 0;
            /* html.leaves-soft (hero-blur.js) crossfades sharp → soft */
            transition: background-image 0.8s ease;
        }

        /* dark.css's background shorthand resets these */
        html[data-dark] body:is(.team-page-body, .project-page-body, .attr-page-body) {
            background-image: var(--leaf-l), var(--leaf-r), var(--d-page);
            background-attachment: fixed;
            background-repeat: no-repeat, no-repeat, repeat;
            background-size: var(--leaf-size), var(--leaf-size), auto;
            background-position: var(--leaf-pos-l), var(--leaf-pos-r), 0 0;
        }

        @media (max-width: 900px) {
            body:is(.team-page-body, .project-page-body, .attr-page-body) {
                --leaf-pos-l: left calc(var(--leaf-w) * -0.475) bottom calc(var(--leaf-w) * -0.6);
                --leaf-pos-r: right calc(var(--leaf-w) * -0.475) top calc(var(--leaf-w) * -0.5);
            }
        }
    }
}

/* ── pinch-zoom (html.is-zoomed, team.html): no blurs, filters or extra layers, or iOS kills the tab ── */
html.is-zoomed .glass-name-pill,
html.is-zoomed .glass-icon-btn,
html.is-zoomed .team-nav,
html.is-zoomed .hero-script-frost {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
/* without the blur the pill needs more body to stay readable */
html.is-zoomed:not([data-reduce-transparency]) .glass-name-pill { background: rgba(255, 255, 255, 0.94) !important; }
html[data-dark].is-zoomed:not([data-reduce-transparency]) .glass-name-pill { background: rgba(22, 28, 22, 0.94) !important; }
/* !important beats the animation's fill, so nothing restarts when the zoom ends */
html.is-zoomed .hero-script-frost { visibility: hidden; }
html.is-zoomed .hero-script-glass { filter: none !important; opacity: 0.9 !important; }
html.is-zoomed .team-hero-clean .hero-script { filter: none !important; }
html.is-zoomed .team-member-clean * { will-change: auto !important; }

/* the footer is defined once in global.css / style.css */

/* Explore More (the carousel at the bottom of the pages) lives in explore-more.css */
