/* =========================================================
   ABOUT PAGE — css/about.css
   Mobile-first. Breakpoints: 600px (tablet), 900px (desktop).
   Relies on custom properties from style.css.
   ========================================================= */


/* =========================
   1. SHARED SECTION SHELL
   ========================= */

.ap-section {
    padding-block: clamp(48px, 8vw, 88px);
}

.ap-section-title {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 0 0 32px;
    line-height: 1.2;
    -webkit-text-stroke: 1.5px currentColor;
    paint-order: stroke fill;
}

.ap-title-yellow { color: var(--color-yellow); }
.ap-title-teal   { color: var(--color-teal); }


/* =========================
   2. ABOUT ME — stacked on mobile, side-by-side on desktop
   ========================= */

.ap-about-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.ap-prose p {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--color-black);
    margin-bottom: 1.1em;
}

.ap-prose p:last-child { margin-bottom: 0; }

.ap-about-img {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--color-black);
    box-shadow: 6px 6px var(--color-yellow);
    aspect-ratio: 4 / 3;
}

.ap-about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Tablet+ */
@media (min-width: 600px) {
    .ap-about-grid {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
        gap: 48px;
    }

    .ap-about-img {
        aspect-ratio: 3 / 4;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .ap-about-grid {
        gap: 72px;
    }
}


/* =========================
   3. HOW IT STARTED
   ========================= */

/* First three paragraphs */
.ap-story-text p {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--color-black);
    margin-bottom: 1.1em;
}

.ap-story-text p:last-child { margin-bottom: 0; }

/* ── Last paragraph + grad photo — mobile: stacked ── */
.ap-story-grad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.ap-story-grad-text {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--color-black);
    margin: 0;
}

/* Mobile image: centred, 80% wide, brush stroke behind */
.ap-story-img-wrap {
    width: 80%;
    max-width: 340px;
    flex-shrink: 0;
    align-self: center;

    background-image: url("../assets/blue-background.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 120% auto;
}

/* No card styling — the PNG cut-out sits naturally */
.ap-story-img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    aspect-ratio: auto;
}

/* ── Tablet+: text left, photo right, vertically centred ── */
@media (min-width: 600px) {
    .ap-section#story {
        padding-bottom: 0;
    }

    .ap-story-grad {
        flex-direction: row;
        align-items: center;    /* both sides vertically centred */
        gap: 32px;
        margin-bottom: 0;
    }

    .ap-story-grad-text {
        flex: 1 1 0;
        align-self: auto;
        position: relative;
        z-index: 2;
    }

    .ap-story-img-wrap {
        flex: 0 0 clamp(260px, 50%, 440px); /* bigger image */
        width: clamp(260px, 50%, 440px);
        max-width: none;
        margin-left: 0;         /* no overlap — clean side-by-side */
        align-self: auto;
    }
}

/* ── Desktop: larger text ── */
@media (min-width: 900px) {
    .ap-story-text p,
    .ap-story-grad-text {
        font-size: 1.25rem;
    }
}
/* =========================
   4. SEAMLESS CAROUSELS
   ========================= */

.carousel-wrapper {
    --carousel-gap: 20px;
    position: relative;
}

.carousel-track-clip {
    width: 100%;
    overflow: hidden;
    padding-block: 10px;
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 48px,
        #000 calc(100% - 48px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 48px,
        #000 calc(100% - 48px),
        transparent 100%
    );
}

.carousel-track {
    display: flex;
    gap: var(--carousel-gap);
    width: max-content;
    will-change: transform;
    animation: carousel-marquee 36s linear infinite;
}

.carousel-track-slow {
    animation-duration: 42s;
}

.carousel-wrapper:hover .carousel-track,
.carousel-wrapper:focus-within .carousel-track {
    animation-play-state: paused;
}

.carousel-group {
    display: flex;
    gap: var(--carousel-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

@keyframes carousel-marquee {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(-50% - (var(--carousel-gap) / 2)), 0, 0);
    }
}

/* Tool slides */
.tool-slide {
    flex: 0 0 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 20px 22px;
    border: 2px solid var(--color-black);
    border-radius: 20px;
    background: var(--color-white);
    box-shadow: var(--shadow-card);
    user-select: none;
}

.ap-tool-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
    display: block;
}

.ap-tool-name {
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: var(--color-black);
}


/* =========================
   5. CERTIFICATIONS CAROUSEL
   ========================= */

.cert-slide {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 2px solid var(--color-black);
    border-radius: 20px;
    background: var(--color-white);
    box-shadow: var(--shadow-card);
    user-select: none;
}

.ap-cert-img {
    width: 100%;
    height: 176px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .tool-slide {
        flex-basis: 188px;
        padding: 32px 22px 24px;
    }

    .ap-tool-img {
        width: 84px;
        height: 84px;
    }

    .cert-slide {
        flex-basis: 320px;
        padding: 22px;
    }

    .ap-cert-img {
        height: 196px;
    }
}

@media (min-width: 900px) {
    .carousel-track-clip {
        mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 72px,
            #000 calc(100% - 72px),
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 72px,
            #000 calc(100% - 72px),
            transparent 100%
        );
    }

    .cert-slide {
        flex-basis: 340px;
    }

    .ap-cert-img {
        height: 210px;
    }
}


/* =========================
   7. FUN FACT
   ========================= */

.ap-funfact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 28px 20px;
    border-top: 1.5px solid var(--color-border);
    border-bottom: 1.5px solid var(--color-border);
    text-align: center;
}

.ap-funfact-img {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.ap-funfact-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ap-funfact-text p {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.6;
    color: var(--color-black);
}

.ap-funfact-text p:last-child {
    margin: 0;
    color: var(--color-text-muted);
}

.ap-funfact-text strong { color: var(--color-teal-dark); }

/* Tablet+: side by side */
@media (min-width: 600px) {
    .ap-funfact {
        flex-direction: row;
        text-align: left;
        gap: 32px;
        padding: 28px 32px;
    }

    .ap-funfact-img {
        width: 140px;
        height: 140px;
    }
}


/* =========================
   8. EDUCATION LOGOS
   ========================= */

.ap-edu-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.ap-edu-item {
    width: 150%;
    max-width: 280px;
}

.ap-edu-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Tablet+: side by side */
@media (min-width: 600px) {
    .ap-edu-logos {
        flex-direction: row;
        justify-content: center;
        gap: clamp(40px, 8vw, 100px);
    }

    .ap-edu-item {
        max-width: 220px;
    }
}


/* =========================
   9. CTA
   ========================= */

.ap-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    text-align: center;
    padding: clamp(36px, 5vw, 60px) clamp(24px, 4vw, 52px);
    margin-bottom: clamp(36px, 5vw, 60px);

    border: 2px solid var(--color-black);
    border-radius: 20px;
    background: var(--color-black);
    color: #ffffff;
    box-shadow: 6px 6px var(--color-yellow);
}

.ap-cta::before {
   
    position: absolute;
    inset: -40px;
    z-index: -1;
    background: radial-gradient(
        ellipse 65% 50% at 50% 110%,
        rgba(243, 184, 47, 0.3) 0%,
        rgba(0, 158, 174, 0.12) 50%,
        transparent 70%
    );
    animation: cta-glow 6s ease-in-out infinite alternate;
}

.ap-cta .eyebrow {
    justify-content: center;
    color: var(--color-teal);
    letter-spacing: 0.18em;
    margin-bottom: 16px;
}

.ap-cta-text {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: rgba(9, 9, 9, 0.9);
    line-height: 1.65;
    margin-bottom: 28px;
}


/* =========================
   10. REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        animation: none;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .carousel-group[aria-hidden="true"] {
        display: none;
    }

    .carousel-track-clip {
        mask-image: none;
        -webkit-mask-image: none;
        overflow: visible;
    }
}

/* About Me photo: cut-out on a yellow brush stroke */
.ap-about-photo {
    width: 90%;
    max-width: 420px;
    justify-self: center;
    align-self: center;

    background-image: url("../assets/yellow-background.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 135% auto;
}

@media (min-width: 600px) {
    .ap-about-grid {
        grid-template-columns: 1fr 1fr;   /* gives the photo half the row */
        align-items: center;
    }

    .ap-about-photo {
        width: 100%;
        max-width: 480px;
    }
}

@media (min-width: 900px) {
    .ap-about-photo {
        max-width: 560px;
    }
}

/* Fade the bottom of the photo into the black background */
.ap-about-photo {
    position: relative;
    isolation: isolate;
}

/* Layer 1: the yellow brush, with its own fade */
.ap-about-photo::before {
    content: "";
    position: absolute;
    inset: -4% -14% -14% -14%;      /* sticks out past the photo, extra at the bottom */
    z-index: -1;
    background: url("../assets/yellow-background.png") center bottom / contain no-repeat;

    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}

/* Layer 2: you, fading to nothing exactly at the bottom edge of the photo */
.ap-about-photo img {
    display: block;
    width: 100%;
    height: auto;

    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 97%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 97%);
}