/* Fonts */
@font-face {
    font-family: 'CMGSans';
    src: url('../fonts/CMGSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'CMGSans';
    src: url('../fonts/CMGSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'CMGSans';
    src: url('../fonts/CMGSans-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

:root {
    /* Colors */
    --bg-color: #000000;
    --surface-color: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-blue: #0004FF;
    --accent-red: #FF0004;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
    --border-color: #222222;

    /* Fonts */
    --font-display: 'CMGSans', sans-serif;
    --font-body: 'CMGSans', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 100px;
    --border-radius: 12px;

    /* Transitions */
    --transition-fast: 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 900;
    /* Black weight */
    line-height: 1.1;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 3rem;
}

.accent {
    color: var(--accent-blue);
    background: none;
    -webkit-text-fill-color: initial;
    background-clip: border-box;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    font-family: var(--font-display);
    font-weight: 900;
    /* Black weight */
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: 2px solid var(--accent-blue);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 4, 255, 0.4);
}

.btn-primary::before {
    display: none;
    /* Remove gradient overlay */
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--text-primary);
    color: #000;
    border-color: var(--text-primary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.95);
    /* White background */
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 700;
    /* Heavier weight */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    /* Black text */
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* Specific styles for the Give button in navbar */
.nav-links .btn {
    padding: 8px 24px;
    /* Reduced padding */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    /* Keep button text white */
    line-height: 1;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #000;
    /* Black hamburger menu */
    margin: 5px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    /* Use dynamic viewport height */
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.hero.cursor-active {
    cursor: none;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.6;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.3), var(--bg-color));
    z-index: -1;
}

.hero-content {
    z-index: 1;
    max-width: 900px;
}

.eyebrow {
    display: block;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.hero h1 {
    font-size: clamp(5rem, 15vw, 12rem);
    line-height: 0.85;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -4px;
    font-weight: 900;
}

.outline-text {
    -webkit-text-stroke: 2px var(--text-primary);
    color: transparent;
}

.hero .lead {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 2;
    /* Ensure buttons are clickable */
}

/* Hero Video Background */
.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    z-index: -2;
}

.hero-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Scale to fill viewport height */
    height: 100vh;
    /* Width based on video's aspect ratio (3840/1644 ≈ 2.34:1) */
    width: 234vh;
    /* Ensure it covers full width if needed */
    min-width: 100vw;
    min-height: 42.74vw;
    /* 100vw / 2.34 */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.hero-video-wrapper iframe.loaded {
    opacity: 1;
}

/* Video Poster Image */
.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: opacity 0.8s ease-out;
}

.video-poster.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* Video Loading Indicator */
.video-loading-bar {
    position: fixed;
    top: 80px;
    /* Height of navbar + padding */
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 4, 255, 0.15);
    z-index: 999;
    overflow: hidden;
    transition: opacity 0.5s ease-out;
}

.video-loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(0, 4, 255, 0.6);
    /* Muted blue accent */
    transition: width 0.3s ease-out;
}

.video-loading-bar.loading::before {
    animation: loadingProgress 2s ease-out forwards;
}

.video-loading-bar.complete::before {
    width: 100%;
    transition: width 0.4s ease-out;
}

.video-loading-bar.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 95%;
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
    mix-blend-mode: difference;
}

.custom-cursor.active {
    transform: translate(-50%, -50%) scale(1);
}

.custom-cursor span {
    font-size: 10px;
    font-weight: 700;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Video Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 1200px;
    /* Optimized for horizontal video */
    position: relative;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

/* Sections */
.section {
    padding: var(--section-padding) 0;
}

.section-header {
    margin-bottom: 60px;
    max-width: 700px;
    text-align: left;
}

.section-title {
    font-size: 3rem;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}



.about-section {
    padding-bottom: 150px;
}

.programs-section {
    padding-top: 150px;
}

.location-section {
    padding-top: 0px;
}

/* Grid Systems */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

.align-center {
    align-items: center;
}

/* Cards */
.card {
    background: var(--surface-color);
    padding: 40px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    border-radius: var(--border-radius);
}

.card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 4, 255, 0.2);
}

.card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    height: 80px;
}

.card-icon img {
    max-height: 100%;
    width: auto;
}

.vision-card {
    text-align: center;
    padding: 50px 30px;
}

.vision-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.vision-card p {
    color: var(--text-secondary);
    max-width: 300px;
    margin: 0 auto;
}

/* About Section */
.about-image {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 600px;
    /* Fixed height for consistency */
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 0;
    /* Handled by container */
}

.carousel-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--accent-blue);
    transform: scale(1.2);
}

.about-content h2 {
    /* Inherit standard h2 size (3rem) */
    margin-bottom: 30px;
    text-transform: uppercase;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.quote-box {
    border-left: 4px solid var(--accent-red);
    padding-left: 20px;
    margin-top: 30px;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: rgba(255, 0, 4, 0.1);
    /* Solid red tint */
    padding: 20px;
    border-radius: 0 8px 8px 0;
}

/* Programs Section */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.program-item {
    position: relative;
    group: hover;
}

.program-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    filter: brightness(0.8);
    transition: var(--transition-fast);
}

.program-item:hover img {
    filter: brightness(1);
}

.program-info h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.program-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px 12px;
    background: rgba(0, 4, 255, 0.343);
    border: 1px solid rgba(0, 4, 255, 0.463);
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.time-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.program-info p {
    color: var(--text-secondary);
}

/* Video Divider */
.video-divider {
    width: 100%;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.video-divider-wrapper {
    position: relative;
    width: 1250px;
    max-width: 100%;
    /* Ensure it doesn't overflow on smaller screens */
    height: 300px;
    /* Fixed height to maintain 5120x1080 aspect ratio (1500 × 1080/5120) */
    left: 50%;
    transform: translateX(-50%);
}

.video-divider-wrapper::before,
.video-divider-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.video-divider-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color) 0%, var(--bg-color) 25%, transparent 100%);
}

.video-divider-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color) 0%, var(--bg-color) 25%, transparent 100%);
}

.video-divider-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.video-divider-wrapper iframe.loaded {
    opacity: 1;
}

/* Video Divider Poster Image */
.video-divider-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: opacity 0.8s ease-out;
}

.video-divider-poster.hidden {
    opacity: 0;
    pointer-events: none;
}


/* CTA Section */
.cta-section {
    background: linear-gradient(to top, var(--surface-color), var(--bg-color));
    position: relative;
}

.cta-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 50px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.cta-card h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Footer */
.footer {
    background: var(--surface-color);
    padding: 80px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand p {
    margin-top: 20px;
    color: var(--text-secondary);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.social-icons a:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    animation-delay: 0.2s;
    transition-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
    transition-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
    transition-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.grain-overlay::after {
    content: "";
    position: absolute;
    top: -125%;
    left: -125%;
    width: 350%;
    height: 350%;
    animation: grain 1s steps(2) infinite;
    background-image: url('../Img/grain.png');
    background-position: 50%;
    background-size: 256px;
    opacity: 0.45;
    will-change: transform;
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}

/* Scrolling Text Animation */
.scroll-text-container {
    position: absolute;
    width: 100%;
    height: 20rem;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    transform: translateY(-50%);
}

.scrolling-text {
    font-family: var(--font-display);
    font-size: 15rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 2px var(--accent-blue);
    opacity: 0.3;
    line-height: 1;
    will-change: transform;
}

/* Mobile Watch Video Button */
.mobile-watch-video {
    display: none;
    margin-top: 10px;
    color: var(--text-primary);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.mobile-watch-video:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* 1. Hero text larger and matching width */
    .hero h1 {
        font-size: clamp(3.5rem, 15vw, 6rem);
        line-height: 0.9;
        width: 100%;
        padding: 0 20px;
    }
    
    .hero .lead {
        font-size: 1.2rem;
        padding: 0 20px;
        width: 100%;
    }

    /* 2. Hero CTA buttons width adjustment */
    .hero-ctas {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Show watch video button on mobile */
    .mobile-watch-video {
        display: block;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* 3. Reduced section padding */
    .section {
        padding: 60px 0;
    }
    
    .about-section {
        padding-bottom: 60px;
    }

    .programs-section {
        padding-top: 60px;
    }

    /* 4. Stacked buttons in Who We Are section */
    .about-ctas {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    /* 5. Remove scrolling text on mobile */
    .scroll-text-container {
        display: none;
    }

    /* 6. Reduced space around video divider */
    .location-section {
        padding-bottom: 30px;
    }
    
    .video-divider {
        display: none;
    }
    
    .cta-section {
        padding-top: 30px;
    }

    /* 7. Center text in CTA cards */
    .cta-card {
        text-align: center;
    }

    /* General Mobile Layout Fixes */
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-content h2 {
        font-size: 2.5rem;
    }
}