/* =========================================
   1. GLOBAL RESET & VARIABLES
   ========================================= */
:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ff3b30;         /* Bright Red */
    --gold: #FFD700;           /* Gold */
    --maroon: #800000;         /* Maroon */
    --accent-glow: rgba(255, 59, 48, 0.4);
    --glass: rgba(10, 10, 10, 0.95);
    --transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* =========================================
   2. NAVIGATION (DESKTOP)
   ========================================= */
.navbar {
    position: fixed; top: 0; width: 100%; padding: 15px 0;
    background: var(--glass); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 1000; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-content {
    width: 90%; max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}

.nav-logo { height: 40px; width: auto; mix-blend-mode: screen; }
.logo-container { display: flex; align-items: center; gap: 15px; z-index: 1001; }
.logo-text { font-weight: 700; letter-spacing: 2px; font-size: 1.2rem; color: #fff; }

.nav-links { list-style: none; display: flex; gap: 40px; align-items: center; }
.nav-links a {
    text-decoration: none; color: var(--text-secondary);
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s;
}
.nav-links a:hover, .active-link { color: var(--text-primary); }

.nav-cta {
    padding: 10px 24px; border: 1px solid var(--text-primary);
    color: var(--text-primary) !important; border-radius: 2px;
}
.nav-cta:hover { background: var(--text-primary); color: #000 !important; }

/* Hamburger (Hidden on Desktop) */
.hamburger { display: none; cursor: pointer; z-index: 1001; }
.hamburger div { width: 25px; height: 3px; background-color: white; margin: 5px; transition: all 0.3s ease; }

/* =========================================
   3. GENERAL STYLES
   ========================================= */
h1, h2, h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; }
.reveal { opacity: 1; transform: translateY(0); transition: 1s ease; }

.section { padding: 120px 0; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.section-header { margin-bottom: 80px; }
.section-header h2 { font-size: 3rem; color: #fff; }
.divider { width: 60px; height: 4px; background: var(--accent); margin-top: 20px; }

/* HEADER SUBTITLE (Used in Board & Projects) */
.page-header { 
    height: 40vh; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; 
    background: #111; padding-top: 60px; text-align: center; 
}
.page-header h1 { font-size: 4rem; color: #fff; }
.highlight { color: var(--accent); }

.header-subtitle, .subtitle {
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 20px auto 0;
    line-height: 1.6;
    text-transform: none;
    padding: 0 20px;
}

/* =========================================
   4. HOME PAGE STYLES
   ========================================= */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    padding: 0 10px;
}
.hero-tag { display: block; color: var(--accent); font-size: 0.9rem; letter-spacing: 4px; margin-bottom: 20px; font-weight: 700; }
.hero h1 { font-size: 6rem; line-height: 0.9; letter-spacing: -2px; margin-bottom: 30px; }
.hero h1 .highlight { color: transparent; -webkit-text-stroke: 2px #fff; }

.button-group { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.btn { padding: 15px 40px; text-decoration: none; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; transition: var(--transition); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 20px var(--accent-glow); }
.btn-secondary { border: 1px solid rgba(255,255,255,0.3); color: #fff; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card { background: var(--card-bg); padding: 50px 30px; border: 1px solid rgba(255,255,255,0.05); position: relative; }
.card .icon { font-family: 'Oswald'; font-size: 3rem; color: rgba(255, 255, 255, 0.1); position: absolute; top: 20px; right: 30px; }
.card h3 { font-size: 1.5rem; margin-bottom: 15px; color: #fff; }
.card p { color: var(--text-secondary); line-height: 1.6; }

.quote-section { padding: 150px 0; text-align: center; background: #080808; border-top: 1px solid #222; }
blockquote { font-family: 'Oswald'; font-size: 4rem; text-transform: uppercase; color: #fff; margin-bottom: 20px; }
.sinhala-quote { font-family: 'Noto Serif Sinhala', serif; font-size: 6rem; font-weight: 900; line-height: 1.1; margin-bottom: 25px; color: #d4af6a; text-shadow: 0 0 30px rgba(255, 59, 48, 0.3); text-transform: none !important; }

/* =========================================
   5. PROJECTS PAGE (NEW GRID LAYOUT)
   ========================================= */
/* Main Event (ADDICTA) */
.featured-project {
    width: 100%; margin-bottom: 60px; position: relative;
    border-radius: 8px; overflow: hidden; border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.feat-img { width: 100%; height: 500px; position: relative; overflow: hidden; }
.feat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; filter: brightness(0.6); }
.featured-project:hover .feat-img img { transform: scale(1.05); filter: brightness(0.8); }

.feat-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 40px;
    background: linear-gradient(to top, #000 0%, transparent 100%); z-index: 2;
}
.feat-badge {
    background: var(--accent); color: #fff; padding: 5px 15px; font-size: 0.8rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 15px; display: inline-block; border-radius: 2px;
}
.feat-overlay h2 { font-size: 4rem; color: #fff; margin-bottom: 10px; line-height: 1; }
.feat-overlay p { color: #ccc; font-size: 1.2rem; max-width: 600px; }

/* Standard Project Grid */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.project-card {
    background: #0a0a0a; border: 1px solid #222; border-radius: 6px;
    overflow: hidden; transition: all 0.4s ease;
}
.project-card:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.p-img-box { width: 100%; height: 250px; overflow: hidden; }
.p-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; filter: grayscale(100%); }
.project-card:hover .p-img-box img { transform: scale(1.1); filter: grayscale(0%); }
.p-content { padding: 25px; }
.p-content h3 { font-size: 1.5rem; color: #fff; margin-bottom: 10px; }
.p-content p { color: #888; font-size: 0.9rem; line-height: 1.5; }

/* =========================================
   6. CONTACT PAGE
   ========================================= */
.contact-section { padding-bottom: 100px; }
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: -60px; position: relative; z-index: 5; width: 90%; max-width: 1200px; margin-left: auto; margin-right: auto; }
.contact-card { background: #111; border: 1px solid rgba(255, 255, 255, 0.1); padding: 50px 20px; text-decoration: none; display: flex; flex-direction: column; align-items: center; text-align: center; border-radius: 4px; transition: all 0.4s ease; position: relative; overflow: hidden; }
.card-icon { font-size: 3rem; margin-bottom: 20px; color: #666; transition: 0.4s; }
.contact-card h3 { color: #fff; font-size: 1.2rem; margin-bottom: 5px; font-weight: 700; text-transform: uppercase; }
.contact-card p { color: var(--text-secondary); font-size: 0.8rem; opacity: 0.6; transition: 0.3s; }
.contact-card:hover { transform: translateY(-10px); background: #161616; border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.contact-card:hover .card-icon { color: #fff; transform: scale(1.2); text-shadow: 0 0 20px var(--accent); }
.contact-card:hover p { opacity: 1; color: #fff; }

.location-section { text-align: center; padding: 100px 0 60px 0; border-top: 1px solid #222; margin-top: 50px; }
.location-section h2 { font-size: 3rem; color: #333; }

/* =========================================
   7. FOOTER (MODERN LIQUID FLOW)
   ========================================= */
footer { 
    background: #050505; 
    padding: 40px 20px 20px; /* More space for the glow */
    text-align: center; 
    margin-top: auto; 
    width: 100%; 
    position: relative; 
    border-top: 1px solid #1a1a1a; 
}

/* THE LIQUID LINE */
footer::after { 
    content: ""; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 6px; /* Sleek and thin */
    
    /* THE GRADIENT: Maroon -> Gold -> Maroon (Seamless Loop) */
    background: linear-gradient(
        90deg, 
        #500000, 
        #800000, 
        #FFD700, 
        #800000, 
        #500000
    );
    
    /* Make the background huge so we can scroll it */
    background-size: 300% 100%;
    
    /* THE ANIMATION: Smooth Flow */
    animation: liquidFlow 4s ease-in-out infinite alternate;
    
    /* THE GLOW: Upward Gold Light */
    box-shadow: 0 -2px 15px rgba(255, 215, 0, 0.2);
}

/* THE ANIMATION KEYFRAMES */
@keyframes liquidFlow { 
    0% { background-position: 0% 50%; } 
    100% { background-position: 100% 50%; } 
}

/* Footer Text Styling */
.footer-content { 
    max-width: 600px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
}

.footer-content h3 { 
    font-family: 'Oswald', sans-serif; 
    font-size: 1.5rem; 
    color: #fff; 
    letter-spacing: 3px; 
    margin: 0; 
    background: linear-gradient(to bottom, #fff, #999); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

.footer-content p { 
    font-family: 'Inter', sans-serif; 
    font-size: 0.75rem; 
    color: #555; 
    margin: 0; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

.copyright { 
    margin-top: 15px !important; 
    color: #333 !important; 
    font-size: 0.65rem !important; 
}

/* =========================================
   8. BOARD MEMBERS (FIXED HEADS)
   ========================================= */
.board-section { padding-bottom: 100px; background: #050505; }
.level-label {
    text-align: center; font-family: 'Oswald', sans-serif; font-size: 1.2rem;
    background: linear-gradient(to right, #b08d55, #800000); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-transform: uppercase; letter-spacing: 4px; margin: 60px 0 40px;
    border-bottom: 1px solid #333; display: table; margin-left: auto; margin-right: auto; padding-bottom: 10px;
}
.prof-card {
    background: #0a0a0a; width: 240px; border-radius: 6px; overflow: hidden; position: relative;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #333; border-bottom: 3px solid #800000;
}
.img-container { width: 100%; height: 240px; overflow: hidden; position: relative; border-bottom: 1px solid #222; }

/* FIX: OBJECT POSITION TOP prevents heads from being cut off */
.img-container img { 
    width: 100%; height: 100%; 
    object-fit: cover; 
    object-position: top; /* <--- THE FIX */
    filter: grayscale(100%) contrast(1.1); 
    transition: all 0.5s ease; 
}

.card-details { padding: 20px 10px; text-align: center; background: linear-gradient(to bottom, #111, #080808); position: relative; }
.prof-card h3 { font-size: 1rem; color: #fff; margin-bottom: 5px; font-weight: 600; letter-spacing: 0.5px; }
.prof-card .role { font-size: 0.75rem; color: #888; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; transition: 0.3s; }

.prof-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 10px 30px rgba(128, 0, 0, 0.3), 0 0 15px rgba(212, 175, 55, 0.2);
    border-image: linear-gradient(45deg, #800000, #FFD700) 1; border: 1px solid transparent; border-bottom: 3px solid #FFD700;
}
.prof-card:hover img { filter: grayscale(0%) contrast(1.1); transform: scale(1.05); }
.prof-card:hover .role { background: linear-gradient(to right, #FFD700, #b08d55); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.level-1 { display: flex; justify-content: center; margin-bottom: 20px; }
.president-card { width: 280px; }
.president-card .img-container { height: 280px; }
.president-card h3 { font-size: 1.3rem; }
.level-2 { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-bottom: 60px; }
.level-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; justify-content: center; max-width: 1100px; margin: 0 auto; }


/* =========================================
   9. MOBILE OPTIMIZATION (CRITICAL SECTION)
   ========================================= */
@media (max-width: 768px) {
    
    /* SYSTEM */
    * { -webkit-tap-highlight-color: transparent; }
    html, body { overflow-x: hidden; position: relative; width: 100%; }
    
    /* MENU (FULL SCREEN, SMOOTH) */
    .hamburger { display: block !important; z-index: 99999; }
    .nav-links { 
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        position: fixed; right: 0; top: 0; 
        height: 100vh; width: 75%; background-color: #000; 
        z-index: 99998; box-shadow: -10px 0 30px rgba(0,0,0,0.8);
        transform: translateX(100%); opacity: 0;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    }
    .nav-links.nav-active { transform: translateX(0); opacity: 1; }
    .nav-links li { margin: 20px 0; width: 100%; text-align: center; }
    .nav-links a { font-size: 1.2rem; color: #fff; letter-spacing: 1px; display: block; }
    
    /* JOIN BUTTON FIX */
    .nav-links .nav-cta {
        display: inline-block !important; width: auto !important; margin-top: 15px;
        padding: 8px 25px !important; border: 1px solid #fff; font-size: 1rem !important;
    }

    /* HEADERS */
    .hero h1 { font-size: 4rem; line-height: 1; }
    .page-header { height: 50vh; padding-top: 100px; padding-bottom: 20px; justify-content: center; }
    .page-header h1 { font-size: 2.5rem; }
    .header-subtitle { font-size: 0.95rem; max-width: 90%; }
    
    /* SLOGAN */
    .quote-section { padding: 50px 0 !important; }
    .sinhala-quote { font-size: 2.8rem !important; line-height: 1.3; padding: 0 10px; margin-bottom: 20px !important; word-wrap: break-word; }
    blockquote { font-size: 2rem; }

    /* GENERAL LAYOUT */
    .section { padding: 60px 0; }
    .container { width: 90%; margin: 0 auto; }
    .grid-3 { grid-template-columns: 1fr; gap: 20px; }
    .contact-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 0; }
    .contact-card { padding: 25px 10px; }

    /* PROJECTS PAGE (MOBILE GRID) */
    .feat-img { height: 350px; }
    .feat-overlay h2 { font-size: 2.5rem; }
    .feat-overlay { padding: 20px; }
    .project-grid { grid-template-columns: 1fr; }
    .project-card { margin-bottom: 20px; }
    .p-img-box img { filter: grayscale(0%); }

    /* BOARD PAGE */
    .level-1 { display: flex; justify-content: center; width: 100%; }
    .president-card { width: 100%; max-width: 300px; margin-bottom: 30px; transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
    .level-2, .level-3 { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; width: 100%; margin-bottom: 40px; }
    .level-2 .prof-card, .level-3 .prof-card {
        width: calc(50% - 10px); max-width: 170px; flex-grow: 0;
        background: #0a0a0a; border: 1px solid #333; border-bottom: 3px solid #800000;
        border-radius: 6px; transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .prof-card h3 { font-size: 0.85rem; }
    .prof-card .role { font-size: 0.65rem; }
    .img-container { height: auto; aspect-ratio: 1/1; }

    /* ACTIVE STATES */
    .prof-card.mobile-active, .president-card.mobile-active {
        transform: translateY(-10px) !important;
        box-shadow: 0 10px 30px rgba(128, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.3) !important;
        z-index: 100; border-bottom: 3px solid #FFD700 !important;
    }
    .prof-card img, .president-card img { transition: filter 0.6s ease; }
    .prof-card.mobile-active img, .president-card.mobile-active img {
        filter: grayscale(0%) contrast(1.1) !important;
    }
    .prof-card.mobile-active .role, .president-card.mobile-active .role {
        background: linear-gradient(to right, #FFD700, #b08d55);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }
}
/* =========================================
   HERO SPACING FIX (FINAL BALANCED VERSION)
   ========================================= */

/* 1. DESKTOP (Clean & Open) */
.hero .subtitle {
    margin-bottom: 40px !important; /* The "Breathing Room" for Desktop */
    display: block;
}

.button-group {
    display: flex;
    flex-direction: row; /* Side by side on Desktop */
    gap: 25px; /* Clean space between buttons */
    justify-content: center;
}

.btn {
    padding: 14px 35px !important; /* Normal, Professional Size */
    font-size: 0.95rem !important;
    letter-spacing: 1px;
}

/* 2. MOBILE (Stacked & Tidy) */
@media (max-width: 768px) {
    
    /* Pull the text closer to buttons (but not touching) */
    .hero .subtitle {
        margin-bottom: 30px !important; 
    }

    /* Stack Buttons Vertically */
    .button-group {
        flex-direction: column; 
        align-items: center;
        gap: 15px !important; /* The Sweet Spot Gap (not too big) */
    }

    /* Make buttons symmetric and normal size */
    .btn {
        width: 220px !important; /* Fixed width looks uniform */
        padding: 12px 0 !important;
        text-align: center;
    }
}