/* Registered so the mask's gradient stop can be transitioned rather than
   snapping. Where @property is unsupported the variable still resolves and the
   mask simply cuts over, which is the pre-existing behaviour. */
@property --desc-fade-start {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 70%;
}

body {
    background-color: var(--primary-color);
}

.leadership h3, h2 {
    color: #ffde59;
}

.leadership h3 {
    font-weight: 800;
}

.leadership h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

.leadership p {
    color: white;
    margin-bottom: 0.5rem;
    font-size: medium;
}

.leadership {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.leadership:last-child {
    border-bottom: none;
}

.leadership .background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    height: calc(100vh - (90px + 1rem));
}
.bio-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.description-area {
    flex-grow: 1;
}

.description-container {
    position: relative;
    /* 96px - logo footer
        114px- header
        3rem - padding
    */
    height: calc(100vh - 96px - 114px - 3rem);
    overflow: hidden;
    /* Animated between two measured pixel heights by the page script; the
       resting states are `auto` and a calc(), neither of which the browser can
       interpolate on its own. */
    transition: height var(--dur-slow) var(--ease-standard);
    margin-bottom: 15px;
    min-height: 100px;
}

.description-container.is-expanded {
    height: auto;
    overflow: visible;
}

/* Set by the script for the duration of the height transition, so growing
   content stays clipped instead of spilling out on the first frame. Must come
   after .is-expanded — same specificity, source order decides. */
.description-container.is-animating {
    overflow: hidden;
}

/* Held for the synchronous measuring pass only, so reading the target height
   can't itself kick off a transition. */
.description-container.is-measuring {
    transition: none;
}

.description-inner {
    position: relative;
    height: 100%;
    overflow: hidden;
    --desc-fade-start: 70%;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 var(--desc-fade-start), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 var(--desc-fade-start), transparent 100%);
    transition: --desc-fade-start var(--dur-slow) var(--ease-standard);
}

/* Both stops at 100% leaves the mask fully opaque — equivalent to the old
   `mask-image: none`, but reachable by interpolation. */
.description-container.is-expanded .description-inner,
.description-container.no-overflow .description-inner {
    --desc-fade-start: 100%;
    overflow: visible;
}

.description-container.is-expanded .description-inner {
    height: auto;
}

/* While the container animates, keep the inner box pinned to it rather than
   letting it jump to its full `auto` height — otherwise the mask's fade sits
   below the clipped area and vanishes instead of dissolving in view. Later in
   source order than the .is-expanded rule above, which it must beat. */
.description-container.is-animating .description-inner {
    height: 100%;
    overflow: hidden;
}

.description {
    margin-bottom: 40px;
    width: 100%;
}

.read-more-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    color: #ffde59;
    font-weight: bold;
    text-decoration: none;
    width: 100%;
    text-align: center;
    z-index: 10;
    padding: 8px 0;
    cursor: pointer;
}

.read-less-btn {
    display: none;
    color: #ffde59;
    font-weight: bold;
    text-decoration: none;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    cursor: pointer;
}

.description-container.is-expanded .read-more-btn {
    display: none;
}

/* Both buttons flip `display`, so they can't transition — use the shared
   entrance keyframe from motion.css instead. */
.description-container.is-expanded .read-less-btn {
    display: block;
    animation: fade-up var(--dur-base) var(--ease-out) both;
}

.read-more-btn, .read-less-btn {
    transition: color var(--dur-fast) var(--ease-standard);
}
.read-more-btn:hover, .read-less-btn:hover {
    text-decoration: underline;
    color: #ffd025;
}

.description-container.no-overflow .read-more-btn {
     display: none;
}

.educations {
    margin-top: auto;
    padding-top: 15px;
}

@media (max-width: 991px) {
     .description-container {
         height: auto;
         max-height: 250px;
    }
     .description-inner {
         height: auto;
         max-height: 250px;
    }
     .description-container.is-expanded .description-inner {
        max-height: 5000px;
    }
    .description-container.is-expanded {
        max-height: 5000px;
     }
    /* The script animates an inline `height`, which the 250px max-height above
       would clamp — the expansion would animate to nowhere. Lift it for the
       duration of the transition (.is-expanded already covers the resting
       state). */
    .description-container.is-animating,
    .description-container.is-animating .description-inner {
        max-height: none;
    }
    /* Shorter column, so the fade starts earlier. */
    .description-inner {
        --desc-fade-start: 55%;
    }
    .description-container.is-expanded .description-inner,
    .description-container.no-overflow .description-inner {
        --desc-fade-start: 100%;
    }
}




.side-profile {
    height: 100vh;
    max-height: 100vh;
    object-position: top;
    object-fit: cover;
    width: 100%;
}

.educations {
    background-color: white;
    border-radius: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.educations img {
    height: 4rem;
    width: 9rem;
    object-fit: contain;
    padding: 0.2rem;
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 0.5rem;
}

.side-profile.background{
    display: none;
}
.image-person{
    position: relative;
}
@media(min-width: 991px){
    .image-person-container{
        display: flex;
        flex-direction: column;
    }
    .image-person{
        margin-top: auto;
    }
}
@media (max-width: 768px) {
    .leadership {
        min-height: auto;
    }
    .image-person {
         padding: 0 1rem;
         margin: 0 1rem;
    }
}
@media (min-width: 700px) and (max-width: 991px){
    .side-profile {
        height: 50vh;
        width: 100%;
        object-fit: contain;
    }
    .description-container{
        margin: 1rem 3rem;
    }
    .leadership h3, .leadership h2{
        margin: 1rem 3rem;
    }
}
@media (max-width: 700px){
    .side-profile.background{
        display: block;
        position: absolute;
        top: 0;
        height: 50vh;
        left: 0;
        right: 0;
        z-index: 2;
        object-fit: cover;
        padding: 0 1rem;
        object-position: bottom right;
    }
    .side-profile {
        position: relative;
        height: 50vh;
        z-index: 3;
        object-fit: contain;
        object-position: left;
    }
    .description-container{
        margin: 1rem;
    }
    .description-container p{
        font-size: small;
    }
    .leadership h3, .leadership h2{
        margin: 1rem;
        font-size: medium;
    }
}

/* ------------------------------------------------- portrait scroll drift */

/* The portrait settles upward slightly as its row scrolls into view. It only
   ever sits at or below its resting position, so the lower edge is clipped by
   `.leadership { overflow: hidden }` and no gap can open above the head.
   Scroll-driven animations are Chrome/Safari only for now; elsewhere @supports
   leaves the portrait static, which is the current appearance. */
@supports (animation-timeline: view()) {
    @media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
        /* `overflow: hidden` makes .leadership a scroll container, and view()
           resolves against the nearest ancestor scroll container — which would
           pin the timeline to this row instead of the page, so it never
           progresses. `clip` clips identically without being scrollable. */
        .leadership {
            overflow: clip;
        }

        .image-person {
            animation: portrait-drift linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 35%;
        }

        @keyframes portrait-drift {
            from { transform: translateY(28px); }
            to   { transform: translateY(0); }
        }
    }
}