:root {
    --primary-blue: #0060B0;
    --accent-orange: #D07020;
    --bg-white: #F9F9F9;
    --bg-off-white: #FFFFFF;
    --text-dark: #101010;
    --text-muted: #555555;
    --card-shadow: 0 10px 40px rgba(0, 96, 176, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
}

/* --- STICKY STACKING LOGIC --- */
main { position: relative; }

/* Invisible spacer — gives mission extra pin time for the text animation.
   Mission stays stuck at top:0 over this entire range before programs appears. */
.scroll-space {
    height: 200vh;
}

section {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 100px 8% 60px;
    background: var(--bg-white);
    overflow: hidden;
}

/* Hero not sticky — sections stack over it as you scroll */
#hero {
    position: relative;
    z-index: 1;
    background: #000;
    color: #fff;
    padding: 0;
    justify-content: center;
}

/* Each section gets an ascending z-index so the next card always
   slides on top of the previous one as you scroll down */
#mission  { z-index: 2; }
#programs { z-index: 3; }
#join     { z-index: 4; }

/* Shadow on the top edge makes the card lift visible */
section:not(#hero) {
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}

/* --- UI ELEMENTS --- */
.btn {
    padding: 20px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-decoration: none;
    display: inline-block;
    transition: 0.4s;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-orange); letter-spacing: 5px; }

.btn-outline {
    border: 1px solid white;
    color: white;
    background: transparent;
}
.btn-outline:hover { background: white; color: var(--text-dark); }

/* ============================================================
   HERO — VIDEO BACKGROUND
   ============================================================ */
.hero-video-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #0a0a1a;
}

#hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

/* Shown when no video source is loaded */
.video-placeholder-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    border: 2px dashed rgba(255,255,255,0.1);
    margin: 40px;
    pointer-events: none;
}

/* Dark gradient so text stays readable */
.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.75) 0%,
        rgba(0,0,0,0.3) 60%,
        rgba(0,0,0,0.1) 100%
    );
}

#hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
}

.hero-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    max-width: 1000px;
    z-index: 5;
    padding: 0 8%;
}

.hero-content h1 {
    font-size: clamp(40px, 6vw, 80px);
    line-height: 0.9;
    margin-bottom: 40px;
    text-transform: uppercase;
}

/* --- INTRO OVERLAY --- */
.intro-words {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: #000;
    transition: opacity 0.8s ease;
}

.word {
    position: absolute;
    font-size: clamp(40px, 10vw, 120px);
    font-weight: 700;
    opacity: 0;
    letter-spacing: -2px;
}

/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 30px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    color: white;
    opacity: 0;
    transition: opacity 1s ease, transform 0.4s ease, background 0.3s ease;
}

/* Logo image in the nav */
.nav-logo {
    height: 38px;
    width: auto;
    display: block;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
}

nav.nav--dark {
    background: rgba(10, 10, 20, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 8%;
}

.nav-links a {
    margin-left: 40px;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* --- SECTION LABELS --- */
.section-tag {
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
    font-size: 0.75rem;
}

.section-header {
    font-size: clamp(30px, 5vw, 60px);
    max-width: 800px;
    line-height: 1.1;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

/* ============================================================
   MISSION — MOVING IMAGE GRID
   ============================================================ */
#mission {
    overflow: hidden;
    justify-content: flex-start;
    align-items: flex-start;
}

.mission-layout {
    display: flex;
    align-items: center;
    gap: 60px;
    width: 100%;
    min-height: 0;
}

.mission-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    width: 380px;
}

.mission-left .section-header {
    margin-bottom: 24px;
}

.mission-text {
    font-size: 1.1rem;
    line-height: 1.7;
}

.word-hl {
    color: rgba(16, 16, 16, 0.18);
    transition: color 0.25s ease;
}

.word-hl.lit {
    color: var(--text-dark);
}

/* Three scrolling columns */
.moving-grid {
    display: flex;
    gap: 12px;
    height: 65vh;
    max-height: 600px;
    overflow: hidden;
    flex: 1;
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: gridScrollUp 18s linear infinite;
    flex: 1;
}

.grid-col--reverse {
    animation-direction: reverse;
    animation-duration: 22s;
}

.grid-col:nth-child(3) {
    animation-duration: 15s;
}

@keyframes gridScrollUp {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.grid-img-ph {
    flex-shrink: 0;
    height: 200px;
    background: #e8eef5;
    border: 1px dashed rgba(0, 96, 176, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: rgba(0, 96, 176, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    padding: 8px;
}

/* ============================================================
   PROGRAMS — BACKGROUND MOVING GRID + CARDS
   ============================================================ */
.programs-bg-grid {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.04;
    pointer-events: none;
}

.bg-grid-track {
    display: flex;
    gap: 8px;
    height: 100%;
    animation: bgGridScroll 60s linear infinite;
    width: max-content;
}

@keyframes bgGridScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.bg-grid-img {
    width: 200px;
    height: 100%;
    background: var(--primary-blue);
    flex-shrink: 0;
}

.programs-content {
    position: relative;
    z-index: 2;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
}

.program-card {
    background: white;
    padding: 0 0 30px 0;
    transition: 0.5s;
    overflow: hidden;
}

.program-card:hover {
    background: var(--primary-blue);
    color: white;
}

.program-card:hover .card-img-ph {
    opacity: 0.3;
}

.card-img-ph {
    width: 100%;
    height: 140px;
    background: #e8eef5;
    border-bottom: 1px dashed rgba(0, 96, 176, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: rgba(0, 96, 176, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    transition: 0.5s;
}

.program-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    padding: 0 20px;
}

.program-card p {
    font-size: 0.85rem;
    padding: 0 20px;
}

/* ============================================================
   STORIES — PORTRAIT + SCROLLING STRIP
   ============================================================ */
.stories-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

.story-slider {
    height: 200px;
    position: relative;
}

.story {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease;
    display: flex;
    align-items: center;
    gap: 30px;
}

.story.active { opacity: 1; }

.story-portrait-ph {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8eef5;
    border: 2px dashed rgba(0, 96, 176, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(0, 96, 176, 0.4);
    letter-spacing: 1px;
    text-align: center;
    padding: 6px;
    flex-shrink: 0;
}

.story blockquote {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 300;
    line-height: 1.3;
}

.story small {
    display: block;
    margin-top: 12px;
    color: var(--accent-orange);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Horizontal portrait strip */
.portrait-strip-wrap {
    overflow: hidden;
    background: var(--bg-white);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.portrait-strip {
    display: flex;
    gap: 16px;
    animation: stripScroll 25s linear infinite;
    width: max-content;
}

@keyframes stripScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.portrait-ph {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #e8eef5;
    border: 2px dashed rgba(0, 96, 176, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(0, 96, 176, 0.35);
    letter-spacing: 1px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================================
   IMPACT — BACKGROUND MOVING GRID
   ============================================================ */
.impact-bg-grid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    overflow: hidden;
    opacity: 0.06;
    pointer-events: none;
}

.impact-grid-row {
    display: flex;
    gap: 6px;
    height: 100%;
    animation: bgGridScroll 40s linear infinite reverse;
    width: max-content;
}

.impact-grid-img {
    width: 180px;
    height: 100%;
    background: var(--primary-blue);
    flex-shrink: 0;
}

.impact-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* --- METRICS --- */
.metrics-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--text-dark);
    padding-top: 40px;
}

.metric-box h2 { font-size: 5rem; color: var(--primary-blue); }

/* --- MARQUEE --- */
.marquee {
    white-space: nowrap;
    overflow: hidden;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 30px 0;
}

.marquee-inner {
    display: inline-block;
    animation: scroll 40s linear infinite;
}

.marquee span {
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 60px;
    text-transform: uppercase;
    color: #ccc;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================
   IMAGE FILLS — makes real photos display in all containers
   ============================================================ */

/* Hero background image/video */
.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

#hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

/* Mission moving grid */
.grid-img-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* Programs cards */
.card-img-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Stories circular portraits */
.story-portrait-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Portrait strip */
.portrait-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Programs & Impact background scrolling images */
.bg-grid-img,
.impact-grid-img {
    object-fit: cover;
}

/* ============================================================
   JOIN — FULL-BLEED BACKGROUND IMAGE
   ============================================================ */
.join-bg-img {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.join-bg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.join-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10,10,20,0.95) 0%,
        rgba(10,10,20,0.7) 100%
    );
}

.join-content {
    position: relative;
    z-index: 2;
}

/* ============================================================
   BRAND PATTERN BACKGROUNDS
   ============================================================ */
.pattern-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-repeat: repeat;
    background-size: 280px;
    z-index: 0;
}

.pattern-bg--orange {
    background-image: url('assets/pattern_background.png');
    opacity: 0.045;
}

.pattern-bg--blue {
    background-image: url('assets/pattern_background_blue.png');
    opacity: 0.09;
    z-index: 1;
}

/* Ensure mission content sits above its pattern layer */
#mission .mission-layout {
    position: relative;
    z-index: 1;
}

/* Ensure join content sits above the blue pattern layer */
.join-content {
    z-index: 3;
}

/* ============================================================
   JOIN ACTIONS ROW
   ============================================================ */
.join-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* ============================================================
   HAMBURGER — hidden on desktop
   ============================================================ */
.nav-hamburger {
    display: none;
}

/* ============================================================
   MOBILE MENU OVERLAY — body-level so it covers everything
   ============================================================ */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    z-index: 999;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: var(--accent-orange);
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .mission-left       { width: 280px; }
    .program-grid       { grid-template-columns: 1fr 1fr; }
    .metric-box h2      { font-size: 3.5rem; }
    .moving-grid        { gap: 8px; }
    .grid-img-ph        { height: 160px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Keep sticky stacking — just tighten padding */
    section {
        padding: 80px 6% 40px;
        justify-content: flex-start;
    }

    #hero {
        padding: 0;
        justify-content: center;
    }

    /* --- Nav --- */
    nav {
        background: transparent;
        padding: 20px 6%;
        z-index: 1000;
    }

    .nav-logo { height: 28px; }

    nav.nav--dark {
        background: rgba(10, 10, 20, 0.92);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 16px 6%;
    }

    .nav-links { display: none; }

    .nav-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px;
    }

    .nav-hamburger span {
        display: block;
        width: 26px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
        transition: transform 0.3s ease, opacity 0.2s ease;
    }

    .nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* --- Hero --- */
    .hero-content {
        padding: 0 6%;
    }

    .hero-content h1 {
        font-size: clamp(28px, 8vw, 48px);
        margin-bottom: 16px;
    }

    #typewriter {
        font-size: 0.95rem !important;
        margin-bottom: 24px !important;
    }

    .btn {
        padding: 14px 22px;
        font-size: 0.72rem;
        letter-spacing: 2px;
    }

    /* --- Mission --- */
    #mission {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .mission-layout {
        flex-direction: column;
        gap: 24px;
        width: 100%;
        align-items: flex-start;
        flex: 1;
        min-height: 0;
    }

    .mission-left {
        width: 100%;
        flex-shrink: 0;
    }

    .moving-grid {
        flex: 1;
        height: auto;
        max-height: none;
        width: 100%;
        min-height: 0;
    }

    .grid-img-ph { height: 140px; }

    /* --- Programs --- */
    .program-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card-img-ph { height: 100px; }

    .program-card h3 { font-size: 0.85rem; }
    .program-card p  { font-size: 0.75rem; }

    /* --- Impact --- */
    .metrics-row {
        flex-direction: column;
        gap: 20px;
        padding-top: 24px;
    }

    .metric-box h2 { font-size: 3rem; }

    .marquee {
        margin-top: 30px !important;
    }

    .marquee span {
        font-size: 0.9rem;
        margin-right: 32px;
    }

    /* --- Join --- */
    .join-actions {
        flex-direction: column;
        gap: 14px;
    }

    .join-actions .btn { text-align: center; }

    /* --- Typography --- */
    .section-header {
        font-size: clamp(24px, 6.5vw, 40px);
        margin-bottom: 16px;
    }

    .section-tag { margin-bottom: 10px; }
}
