/* ============================================
   About Page Styles - Code Blue Academy
   StoryBrand Guide story: 7 sections.

   Card & step patterns match homepage exactly
   using color-mix() for dynamic accent glows.
   ============================================ */


/* ===== 1. HERO SECTION: css/pages/hero.css (#424) ===== */


/* ===== 2. ORIGIN STORY ===== */

.about-origin {
    position: relative;
    padding-block: 6rem;
    background-color: var(--color-midnight-950);
}

.about-origin__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

@media (max-width: 64em) {
    .about-origin__layout {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

.about-origin__text h2 {
    color: var(--color-white);
    font-size: var(--text-3xl);
    line-height: var(--leading-tight);
    margin-block-end: var(--space-8);
}

.about-origin__prose {
    color: var(--color-slate-300);
}

.about-origin__prose p {
    max-width: none;
}

.about-origin__quote {
    margin-block-start: var(--space-8);
    padding-inline-start: var(--space-6);
    border-inline-start: 3px solid;
    border-image: var(--gradient-brand-vertical) 1;
    font-family: var(--font-reading);
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--color-slate-200);
    line-height: var(--leading-relaxed);
}

.about-origin__quote p {
    margin: 0;
    max-width: none;
}

/* Origin image */
.about-origin__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-midnight-600);
}


/* ===== SECTION HEADERS (enhanced for about page) ===== */

.about-origin__text .subheading,
.about-section-header .subheading {
    display: block;
    text-align: center;
}

.about-section-header {
    text-align: center;
    margin-block-end: var(--space-16);
    max-width: 48rem;
    margin-inline: auto;
}

.about-section-header h2 {
    color: var(--color-white);
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
    line-height: var(--leading-tight);
    margin-block-start: var(--space-5);
    letter-spacing: var(--tracking-tight);
}


/* ===== 3. MISSION VALUES ===== */
/* Matches homepage .problem__card pattern: color-mix glows, hover lift+scale, icon pulse */

.about-mission {
    position: relative;
    padding-block: 6rem;
    background-color: var(--surface-dark);
}

.about-mission__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
    align-items: stretch;
}

@media (max-width: 64em) {
    .about-mission__grid {
        grid-template-columns: 1fr;
        max-width: 32rem;
        margin-inline: auto;
    }
}

.about-mission__card {
    background-color: var(--color-midnight-800);
    border: 2px solid var(--card-color, var(--color-cb-blue));
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow:
        0 0 50px color-mix(in srgb, var(--card-color, #4478CC) 30%, transparent),
        0 0 100px color-mix(in srgb, var(--card-color, #4478CC) 10%, transparent);
    transition:
        transform var(--duration-normal) var(--ease-default),
        box-shadow var(--duration-normal) var(--ease-default),
        background-color var(--duration-normal) var(--ease-default);
}

.about-mission__card:hover {
    transform: translateY(-8px) scale(1.03);
    background-color: var(--color-midnight-700);
    box-shadow:
        0 0 80px color-mix(in srgb, var(--card-color, #4478CC) 50%, transparent),
        0 0 140px color-mix(in srgb, var(--card-color, #4478CC) 20%, transparent);
}

.about-mission__icon-wrap {
    width: 72px;
    height: 72px;
    margin-block-end: var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-midnight-900);
    border: 2px solid var(--card-color, var(--color-cb-blue));
    border-radius: var(--radius-full);
    box-shadow:
        0 0 30px color-mix(in srgb, var(--card-color, #4478CC) 35%, transparent),
        0 0 60px color-mix(in srgb, var(--card-color, #4478CC) 12%, transparent);
    animation: about-icon-pulse 3s ease-in-out infinite;
}

@keyframes about-icon-pulse {
    0%, 100% {
        box-shadow:
            0 0 30px color-mix(in srgb, var(--card-color, #4478CC) 35%, transparent),
            0 0 60px color-mix(in srgb, var(--card-color, #4478CC) 12%, transparent);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 45px color-mix(in srgb, var(--card-color, #4478CC) 50%, transparent),
            0 0 80px color-mix(in srgb, var(--card-color, #4478CC) 20%, transparent);
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-mission__icon-wrap {
        animation: none;
    }
}

.about-mission__icon-wrap svg {
    width: 32px;
    height: 32px;
    color: var(--card-color, var(--color-cb-blue));
}

.about-mission__card-title {
    font-size: var(--text-xl);
    color: var(--color-white);
    margin-block-end: var(--space-3);
}

.about-mission__card-desc {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    line-height: var(--leading-relaxed);
    max-width: 30ch;
    margin-inline: auto;
}


/* ===== 4. OUR APPROACH (step process) ===== */
/* Matches homepage .plan__ pattern exactly: color-mix glows, track, step cards, hover */

.about-approach {
    position: relative;
    padding-block: 6rem;
    background-color: var(--color-midnight-950);
}

/* ── Step grid ── */
.about-approach__steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Five across only from 80em: at 64em five columns left 114 px of text a
   card (titles on three and four lines, and the longest word pushed its
   column wider than the rest). From 64em to 80em the steps sit three
   across (see the step rule below). */
@media (min-width: 80em) {
    .about-approach__steps {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: var(--space-8);
        max-width: 100%;
        position: relative;
        align-items: stretch;
    }
}

/* ── Desktop connecting track ── */
.about-approach__track {
    display: none;
}

@media (min-width: 80em) {
    .about-approach__track {
        display: block;
        position: absolute;
        top: 40px;
        left: calc(100% / 10);
        width: calc(100% * 4 / 5);
        height: 2px;
        z-index: 0;
        transform: translateY(-50%);
    }

    .about-approach__track-line {
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, var(--color-cb-red), var(--neon-blue), var(--neon-gold), var(--neon-emerald), var(--neon-purple));
        border-radius: 2px;
        opacity: 0.6;
    }

    .about-approach__track-glow {
        position: absolute;
        inset: -4px 0;
        background: linear-gradient(90deg, var(--color-cb-red), var(--neon-blue), var(--neon-gold), var(--neon-emerald), var(--neon-purple));
        border-radius: 8px;
        filter: blur(8px);
        opacity: 0.5;
        animation: about-track-pulse 2.5s ease-in-out infinite;
    }
}

@keyframes about-track-pulse {
    0%, 100% { opacity: 0.25; filter: blur(8px); }
    50%      { opacity: 0.6;  filter: blur(12px); }
}

/* ── Individual step ── */
.about-approach__step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 24rem;
}

/* 64em to 80em: three across, the last two centred under them. */
@media (min-width: 64em) {
    .about-approach__steps {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: var(--space-8);
    }

    .about-approach__step {
        width: calc((100% - 2 * var(--space-8)) / 3);
    }
}

@media (min-width: 80em) {
    .about-approach__step {
        width: 100%;
    }
}

/* ── Icon wrap (ring + number badge) ── */
.about-approach__step-icon-wrap {
    position: relative;
    margin-block-end: var(--space-5);
    z-index: 1;
}

.about-approach__step-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: var(--color-midnight-800);
    border: 2px solid var(--step-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px color-mix(in srgb, var(--step-color) 30%, transparent),
        0 0 60px color-mix(in srgb, var(--step-color) 10%, transparent);
    transition: transform var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}

.about-approach__step-icon svg {
    width: 36px;
    height: 36px;
    color: var(--step-color);
}

.about-approach__step-number {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    background: var(--step-color, var(--color-cb-red));
    color: var(--color-white);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* A light step colour (blue, yellow, green) takes dark ink: white on it is
   under 4.5:1. The view marks those steps (number_dark). */
.about-approach__step-number--dark {
    color: var(--color-midnight-950);
}

/* ── Mobile connector ── */
.about-approach__connector-mobile {
    width: 2px;
    height: 40px;
    margin-block: var(--space-2);
    position: relative;
}

.about-approach__connector-mobile svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--step-color) 50%, transparent));
}

.about-approach__connector-line {
    stroke: var(--step-color);
    stroke-dasharray: 6 4;
    opacity: 0.5;
}

@media (min-width: 64em) {
    .about-approach__connector-mobile {
        display: none;
    }
}

/* ── Step card ── */
.about-approach__step-card {
    background-color: var(--color-midnight-800);
    border: 2px solid var(--step-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 100%;
    flex-grow: 1;
    box-shadow:
        0 0 40px color-mix(in srgb, var(--step-color) 25%, transparent),
        0 0 80px color-mix(in srgb, var(--step-color) 8%, transparent);
    transition:
        transform var(--duration-normal) var(--ease-default),
        border-color var(--duration-normal) var(--ease-default),
        box-shadow var(--duration-normal) var(--ease-default),
        background-color var(--duration-normal) var(--ease-default);
}

.about-approach__step-card:hover {
    transform: translateY(-6px) scale(1.03);
    background-color: var(--color-midnight-700);
    box-shadow:
        0 0 60px color-mix(in srgb, var(--step-color) 45%, transparent),
        0 0 120px color-mix(in srgb, var(--step-color) 15%, transparent);
}

.about-approach__step:hover .about-approach__step-icon {
    transform: scale(1.1);
    box-shadow:
        0 0 50px color-mix(in srgb, var(--step-color) 45%, transparent),
        0 0 90px color-mix(in srgb, var(--step-color) 18%, transparent);
}

.about-approach__step-title {
    font-size: var(--text-lg);
    color: var(--color-white);
    margin-block-end: var(--space-2);
    font-weight: var(--weight-semibold);
}

.about-approach__step-desc {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    line-height: var(--leading-relaxed);
}

/* ── Desktop: equal-height cards ── */
@media (min-width: 64em) {
    .about-approach__step-card {
        flex-grow: 1;
    }
}


/* ===== 5. AUTHORITY STATS ===== */
/* Matches homepage .guide__stat pattern: colored borders, color-mix glows, hover lift */

.about-stats {
    position: relative;
    padding-block: 6rem;
    background-color: var(--surface-dark);
}

/* One equal column per tile, so a row of three (a tile with no real value
   is left out) still fills the width and stays centred. */
.about-stats__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--space-6);
    max-width: 56rem;
    margin-inline: auto;
}

@media (max-width: 64em) {
    .about-stats__grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 36em) {
    .about-stats__grid {
        grid-template-columns: 1fr;
        max-width: 16rem;
    }
}

.about-stats__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--color-midnight-800);
    border: 2px solid var(--color-cb-red);
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 40px rgba(193, 0, 0, 0.25),
        0 0 80px rgba(193, 0, 0, 0.08);
    transition:
        transform var(--duration-normal) var(--ease-default),
        background-color var(--duration-normal) var(--ease-default),
        border-color var(--duration-normal) var(--ease-default),
        box-shadow var(--duration-normal) var(--ease-default);
}

/* Per-stat accent colors (mirrors homepage .guide__stat) */
.about-stats__stat:nth-child(2) {
    border-color: var(--neon-blue);
    box-shadow: 0 0 40px rgba(var(--accent-blue-rgb), 0.25), 0 0 80px rgba(var(--accent-blue-rgb), 0.08);
}
.about-stats__stat:nth-child(3) {
    border-color: var(--neon-gold);
    box-shadow: 0 0 40px rgba(var(--accent-gold-rgb), 0.25), 0 0 80px rgba(var(--accent-gold-rgb), 0.08);
}
.about-stats__stat:nth-child(4) {
    border-color: var(--neon-emerald);
    box-shadow: 0 0 40px rgba(var(--accent-green-rgb), 0.25), 0 0 80px rgba(var(--accent-green-rgb), 0.08);
}

/* Hover: lift + scale + intensified glow */
.about-stats__stat:hover {
    transform: translateY(-6px) scale(1.03);
    background-color: var(--color-midnight-700);
    box-shadow: 0 0 60px rgba(193, 0, 0, 0.45), 0 0 120px rgba(193, 0, 0, 0.15);
}
.about-stats__stat:nth-child(2):hover {
    box-shadow: 0 0 60px rgba(var(--accent-blue-rgb), 0.45), 0 0 120px rgba(var(--accent-blue-rgb), 0.15);
}
.about-stats__stat:nth-child(3):hover {
    box-shadow: 0 0 60px rgba(var(--accent-gold-rgb), 0.45), 0 0 120px rgba(var(--accent-gold-rgb), 0.15);
}
.about-stats__stat:nth-child(4):hover {
    box-shadow: 0 0 60px rgba(var(--accent-green-rgb), 0.45), 0 0 120px rgba(var(--accent-green-rgb), 0.15);
}

/* Per-stat icon colors */
.about-stats__stat-icon {
    width: 28px;
    height: 28px;
    color: var(--color-cb-red-400);
    margin-block-end: var(--space-1);
}
.about-stats__stat:nth-child(2) .about-stats__stat-icon { color: var(--neon-blue); }
.about-stats__stat:nth-child(3) .about-stats__stat-icon { color: var(--neon-gold); }
.about-stats__stat:nth-child(4) .about-stats__stat-icon { color: var(--neon-emerald); }

.about-stats__stat-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    line-height: 1;
    /* Prevent layout shift during CountUp animation */
    font-variant-numeric: tabular-nums;
    min-width: 5ch;
}

.about-stats__stat-label {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
}

/* Authority logos */
.about-stats__logos {
    margin-block-start: var(--space-12);
    text-align: center;
}

.about-stats__logos-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-block-end: var(--space-5);
}

.about-stats__logos-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-10);
    flex-wrap: wrap;
}


/* ===== 6. TEAM ===== */

.about-team {
    position: relative;
    padding-block: 6rem;
    background-color: var(--color-midnight-950);
}

.about-team__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    max-width: 72rem;
    margin-inline: auto;
}

@media (max-width: 64em) {
    .about-team__grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 48rem;
    }
}

@media (max-width: 36em) {
    .about-team__grid {
        grid-template-columns: 1fr;
        max-width: 20rem;
        margin-inline: auto;
    }
}

.about-team__card {
    background: var(--color-midnight-800);
    border: 2px solid var(--color-midnight-700);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    box-shadow:
        0 0 30px rgba(68, 120, 204, 0.08),
        0 0 60px rgba(68, 120, 204, 0.03);
    transition:
        transform var(--duration-normal) var(--ease-default),
        border-color var(--duration-normal) var(--ease-default),
        box-shadow var(--duration-normal) var(--ease-default),
        background-color var(--duration-normal) var(--ease-default);
}

.about-team__card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: var(--color-cb-blue);
    background-color: var(--color-midnight-700);
    box-shadow:
        0 0 60px rgba(68, 120, 204, 0.30),
        0 0 120px rgba(68, 120, 204, 0.10);
}

.about-team__avatar {
    width: 72px;
    height: 72px;
    margin-inline: auto;
    margin-block-end: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(193, 0, 0, 0.2), rgba(68, 120, 204, 0.2));
    border: 2px solid var(--color-midnight-600);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.about-team__name {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-1);
}

.about-team__title {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-cb-blue-400);   /* 4.87:1 on the card (the brand blue was 3.35:1) */
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-block-end: var(--space-3);
}

.about-team__bio {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    line-height: var(--leading-relaxed);
}


/* ===== SECTION BLENDING =====
   Matches the index page pattern: hero+origin(950) stay dark,
   then alternate 900/950/900/950 fading into each next section.
   The hero is css/pages/hero.css. */

/* The stats section is left out when it has nothing real to show: the
   approach section then meets the team section, both 950, with no fade. */
.about-approach--before-team::after {
    display: none;
}

/* 950 → 900: bottom fades into lighter (origin, approach, team) */
.about-origin::after,
.about-approach::after,
.about-team::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--surface-dark));
    pointer-events: none;
    z-index: 0;
}

/* 900 → 950: bottom fades into darker (mission, stats) */
.about-mission::after,
.about-stats::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--color-midnight-950));
    pointer-events: none;
    z-index: 0;
}


/* ===== GSAP ANIMATION INITIAL STATE =====
   A block that animates in starts hidden, but only while <html> carries
   .reveal-pending: an inline script in the page head (about.html) sets it
   before the body is drawn and lifts it after 3 s. Once the page scripts
   run, GSAP's inline styles take over. So the page is readable without
   JavaScript, and a slow or failed script cannot leave it blank under the
   navbar. (hero.css hides .gs-hidden too, for the other hero pages; the
   second rule outranks it.) */

.gs-hidden {
    opacity: 0;
}

html:not(.reveal-pending) .gs-hidden {
    opacity: 1;
}
