/* ==========================================================================
   CSS Reset & Variables
   ========================================================================== */
   :root {
    --primary: #ffffff;    /* Pure White */
    --secondary: #888888;  /* Silver / Grey */
    --bg-dark: #000000;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Premium Preloader
   ========================================================================== */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Overlay only */
}

.preloader-door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: #000000;
    transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1;
}
.left-door { left: 0; }
.right-door { right: 0; }

.loader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: opacity 0.5s ease;
}

/* Glitch / scanning effect on text */
.loader-text {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}
.loader-text::before {
    content: "E-CELL RGIPT";
    position: absolute;
    top: 0; left: 0;
    width: 0%;
    height: 100%;
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
    border-right: 2px solid #ffffff;
    animation: scanText 3s ease-in-out infinite alternate;
}
@keyframes scanText {
    0% { width: 0%; }
    100% { width: 100%; }
}
.loader-bar-container {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}
.loader-bar {
    width: 0%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 0 10px #ffffff;
    transition: width 0.1s ease;
}
.loader-percentage {
    color: #888888;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove blue flash on mobile tap */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==========================================================================
   Fixed Background Canvas
   ========================================================================== */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: var(--bg-dark);
}

/* ==========================================================================
   Premium Static Background (For Non-Video Pages)
   ========================================================================== */
.premium-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6; /* Dim the image slightly so text remains readable */
    transform: scale(1.15); /* Zoom in to crop out the generated black borders */
}

.premium-bg::after {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    /* Add a subtle dark overlay so the image isn't too bright */
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

#scroll-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Removing the dark gradient overlay completely so the video is in its original colors */
.overlay-gradient {
    display: none;
}

/* ==========================================================================
   Scrollable Content & Layout
   ========================================================================== */
.hero-content {
    max-width: 45vw; /* Keep strictly to the side to avoid covering the center */
}

/* ==========================================================================
   Home Page: Cinematic Scroll UI (Pop-ups)
   ========================================================================== */
.fixed-scroll-ui {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    pointer-events: none; /* Let scroll pass through to body */
    z-index: 10;
}

.fixed-scroll-ui .navbar {
    pointer-events: auto; /* Keep navbar clickable */
}

.scroll-popup {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 5%;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transform: translateY(30px);
}

.scroll-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.left-flank, .right-flank {
    width: 35%; /* Leave 30% empty in the center for the ladder */
}

/* ==========================================================================
   Home Page: Cinematic Typography (Raw Text)
   ========================================================================== */
.cinematic-content {
    max-width: 400px;
    padding: 20px 0;
}


.highlight-title {
    font-size: 3.5rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.4);
    letter-spacing: 4px;
    margin-bottom: 25px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-logo {
    height: 40px;
    width: 40px;
    object-fit: contain; /* changed from cover to contain so square logos fit nicely */
    border-radius: 4px; /* Slight rounding so it looks premium, instead of 50% circle */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
.nav-brand-text {
    display: flex;
    align-items: center;
    gap: 5px;
}
.nav-brand-text span {
    color: #00e5ff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

/* Override Glow Buttons for Home Page (Monochrome) */
.fixed-scroll-ui .glow-button {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.fixed-scroll-ui .glow-button:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.cinematic-title {
    font-size: 2.8rem;
    font-weight: 300; /* Thin, elegant weight */
    color: var(--text-light);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.8); /* Readability over background */
}

.cinematic-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8); /* Softer white */
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.cinematic-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.cinematic-list li {
    font-size: 1.3rem;
    line-height: 2.2;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    transition: color 0.3s ease, transform 0.3s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.cinematic-list li:hover {
    color: #ffffff; /* Monochrome hover */
    transform: translateX(-5px); /* Slide slightly left on hover since it is on the right flank */
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5); /* Subtle white glow */
}

/* ==========================================================================
   Home Page: Events Grid (Centered Cards)
   ========================================================================== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1000px;
}

.event-card {
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
    text-align: left;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    background: rgba(30, 30, 30, 0.6);
}

.event-card h4 {
    font-size: 1.4rem;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.event-card p {
    font-size: 1rem;
    color: #aaaaaa;
    line-height: 1.5;
    font-weight: 300;
}

/* ==========================================================================
   Home Page: Contact Card
   ========================================================================== */
.contact-card {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 90%;
}

/* ==========================================================================
   Home Page: Social Links (Creative Contact)
   ========================================================================== */
.social-links-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sibling Dimming Effect */
.social-links-container:hover .social-link:not(:hover) {
    opacity: 0.3;
    transform: scale(0.95);
}

.social-link {
    font-size: 1.5rem; /* Reduced from 2.5rem */
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    letter-spacing: 5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    position: relative;
}

/* Extend hover hit-box to prevent flickering when translated up */
.social-link::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    height: 25px;
}

.social-arrow {
    display: inline-block;
    font-size: 1.2rem;
    margin-right: 15px;
    opacity: 0;
    transform: translateX(30px) rotate(45deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #ffffff;
    pointer-events: none;
}

.social-link:hover {
    color: #ffffff;
    transform: translateY(-15px);
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.social-link:hover .social-arrow {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}

.gradient-text {
    background: linear-gradient(45deg, #ffffff, #888888, #cccccc, #ffffff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
    font-size: 4rem; /* Ensure massive size */
    line-height: 1.1;
    margin-bottom: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.premium-glow {
    position: relative;
    overflow: hidden;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px; /* Pill shape */
}

.premium-glow::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.premium-glow:hover::before {
    left: 150%;
}

.section-spacing {
    min-height: 100vh;
    padding: 100px 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tight-spacing {
    min-height: auto;
    padding: 80px 5%;
}

.align-left {
    align-items: flex-start;
}

.align-right {
    align-items: flex-end;
}

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

/* ==========================================================================
   Navigation Bar (Glassmorphism)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.nav-brand span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s;
}

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

.social-arrow {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, color 0.3s ease;
}
.social-link:hover .social-arrow {
    transform: translateX(10px);
    color: #ffffff;
}

.mobile-break {
    display: none;
}

/* ==========================================================================
   Responsive Design (Mobile & Tablets)
   ========================================================================== */

/* ==========================================================================
   Typography & Shared Components
   ========================================================================== */
h1, h2, h3, p {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Ensure readability against bright backgrounds */
}

h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
}

h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.highlight {
    background: linear-gradient(270deg, #ffffff, #555555, #ffffff, #888888);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 6s ease infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glass Card Style */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-width: 40vw; /* Keep strictly to one side, leaving center free */
    width: 100%;
    text-align: left; /* Keep text readable regardless of side */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s, box-shadow 0.4s;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 0;
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.15);
}

.glass-card:hover::before {
    opacity: 1;
}

/* ==========================================================================
   Interactive Flip Cards for Startups
   ========================================================================== */
.flip-card {
    background-color: transparent;
    width: 100%;
    height: 250px;
    perspective: 1000px; /* 3D effect */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    border-radius: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.flip-card-front .startup-logo {
    max-width: 100px;
    max-height: 100px;
    margin-bottom: 1rem;
    border-radius: 10px;
    object-fit: contain;
}

.flip-card-back {
    transform: rotateY(180deg);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.15);
}

.flip-card-back p {
    font-size: 1.15rem; /* Increased for better readability on tall cards */
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 0 10px;
}

.flip-card-back a.glow-button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin-top: auto;
}

/* ==========================================================================
   Specific Sections
   ========================================================================== */
.hero {
    text-align: center;
}

.scroll-indicator {
    margin-top: 50px;
    font-size: 0.9rem;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

.arrow {
    font-size: 1.5rem;
    margin-top: 5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin-top: 40px;
}

.startup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Back to 3-4 columns */
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin-top: 40px;
}

.startup-grid .flip-card {
    height: 400px; /* Tall height makes them vertical rectangles! */
}

.startup-grid .startup-logo {
    max-width: 150px;
    max-height: 150px;
    margin-bottom: 2rem;
}

.small-card {
    padding: 30px;
}

.event-list {
    margin-top: 30px;
    text-align: left;
}

.event-item {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: transform 0.4s ease, background 0.4s ease, padding-left 0.4s ease;
    cursor: default;
}
.event-item:hover {
    transform: translateX(15px);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 30px;
    border-color: transparent;
}

/* ==========================================================================
   Home Page: Bento Box Grid
   ========================================================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin-top: 40px;
}

.bento-card {
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.5);
}

.bento-large {
    grid-column: span 3;
    align-items: flex-start;
    text-align: left;
}

.bento-large h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.bento-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.bento-small {
    grid-column: span 1;
    align-items: center;
    text-align: center;
}

.bento-stat {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(204, 164, 102, 0.3);
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-large, .bento-small {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Home Page: Split Contact Layout
   ========================================================================== */
.split-layout {
    display: flex;
    gap: 50px;
    width: 100%;
    max-width: 1000px;
    align-items: center;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 50px;
}

.split-left {
    flex: 1;
    text-align: left;
}

.split-left h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.contact-info {
    margin-top: 30px;
}

.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.split-right {
    flex: 1;
}

.premium-form .input-group {
    position: relative;
    margin-bottom: 25px;
}

.premium-form input, .premium-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.premium-form input:focus, .premium-form textarea:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.premium-form label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: 0.3s ease all;
}

/* Floating Label Magic */
.premium-form input:focus ~ label,
.premium-form input:valid ~ label,
.premium-form textarea:focus ~ label,
.premium-form textarea:valid ~ label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background: var(--bg-color);
    padding: 0 5px;
    color: #ffffff;
}

.w-full {
    width: 100%;
}

@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
        padding: 30px;
    }
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
}

.glow-button {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

footer {
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Premium Word-by-Word Text Reveal */
.word-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.word-inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active .word-inner {
    transform: translateY(0);
}

/* ==========================================================================
   Image-Based Interactive Book (Resources Page)
   ========================================================================== */
body.resources-page {
    /* Custom deep wood texture for the background */
    background-color: #1a100a;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(0,0,0,0.1) 15px, rgba(0,0,0,0.1) 30px),
        radial-gradient(circle at center, #2e1a0f 0%, #0d0603 100%) !important;
}

body.resources-page .premium-bg {
    display: none !important; /* Hide the generic animated grid */
}

.image-book-container {
    width: 100%;
    max-width: 800px; /* Scale with the viewport */
    aspect-ratio: 1 / 1;
    margin: -40px auto 20px auto; /* Negative top margin to reduce gap caused by the square image bounding box */
    position: relative;
    overflow: hidden;
    /* Feather the edges so the square image fades seamlessly into the wooden background */
    -webkit-mask-image: radial-gradient(circle at center, black 65%, transparent 95%);
    mask-image: radial-gradient(circle at center, black 65%, transparent 95%);
}

.book-state {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.book-state.book-closed {
    transform: scale(0.85); /* Smaller when closed */
}
.book-state.book-closed.active {
    transform: scale(0.85); /* Stays smaller */
}

.book-state.book-open {
    transform: scale(0.85); /* Start small when fading in */
}
.book-state.book-open.active {
    transform: scale(1); /* Zooms to full size when open */
}

.book-state.active {
    opacity: 1;
    pointer-events: auto;
}

.book-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hitboxes mapped to the bookmarks on the right edge */
.hitbox {
    position: absolute;
    left: 72%; /* Shifted right to perfectly cover the tabs */
    width: 20%; 
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    /* Uncomment the line below if you want to visually see the hitboxes to fine-tune them! */
    /* border: 2px solid rgba(255,0,0,0.5); background: rgba(255,0,0,0.1); */
}

.hitbox:hover {
    background: rgba(255, 255, 255, 0.05); /* Subtle hover highlight */
}

/* Open book has a wider aspect, tabs are further right */
.open-hitbox {
    left: 82%; /* Shifted even further right for the open book tabs */
    width: 15%;
}

/* Content overlays for the Open Book */
.book-open-content {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.close-image-book {
    position: absolute;
    top: 0%;
    left: 0%; /* Start at the absolute left edge */
    width: 40%; /* Reduced from 48% to ensure it never touches the right page */
    height: 100%; /* Cover the entire height */
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
}

.page-text-container {
    position: absolute;
    top: 15%; 
    left: 44%; /* Shifted even slightly more left */
    width: 24%; /* Keep width */
    height: 70%;
    padding: 0 10px; /* Add some padding so it doesn't touch the spine */
    overflow: visible; /* Prevent chopping the button */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the left */
    text-align: left; /* Align text to the left */
}

/* Individual Page Content */
.page-content {
    display: none;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.page-content.active {
    display: flex;
    animation: smoothFade 0.4s ease-in-out forwards;
}

@keyframes smoothFade {
    0% { 
        opacity: 0; 
        transform: translateY(5px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.page-content h3 {
    color: #4a2e15; /* Dark brown ink */
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #d4bda5;
    padding-bottom: 10px;
    text-shadow: none;
    font-family: 'Courier New', Courier, monospace; /* Vintage typewriter font */
}

.page-content p {
    color: #333;
    font-size: 1.05rem;
    line-height: 1.5;
    text-shadow: none;
    font-weight: 600;
}

.page-content .glow-button {
    margin-top: 20px;
    align-self: flex-start; /* Align button to the left */
    background: #4a2e15;
    color: #fff;
    border: none;
    font-family: 'Outfit', sans-serif;
    padding: 10px 20px;
    font-size: 1.1rem;
    white-space: nowrap; /* Prevent text wrapping */
    text-decoration: none !important; /* Force removal of underline */
    transition: background 0.3s, transform 0.3s;
}

.page-content .glow-button:hover {
    background: #2a180e;
}

/* ==========================================================================
   Alumni Page: Timeline Layout
   ========================================================================== */
.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.timeline-row {
    display: flex;
    flex-direction: row;
    margin-bottom: 150px;
    position: relative;
}

.timeline-year {
    flex: 0 0 300px;
    position: relative;
}

.sticky-year {
    position: sticky;
    top: 150px;
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4); /* Much higher opacity for visibility */
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2); /* Stronger glow */
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: right;
    letter-spacing: -5px;
}

.timeline-content {
    flex: 1;
    padding-left: 50px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-heading {
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: #ffffff;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.team-card {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    transition: all 0.4s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.leadership-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.team-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
}

.team-card p {
    font-size: 1rem;
    color: #aaaaaa;
    font-weight: 300;
    margin: 0;
}

.team-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-card ul li {
    font-size: 1rem;
    color: #aaaaaa;
    font-weight: 300;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .timeline-row {
        flex-direction: column;
    }
    .timeline-year {
        flex: none;
        margin-bottom: 40px;
    }
    .sticky-year {
        position: relative;
        top: 0;
        writing-mode: horizontal-tb;
        transform: none;
        text-align: left;
        font-size: 5rem;
    }
    .timeline-content {
        padding-left: 0;
        border-left: none;
    }
}

/* ==========================================================================
   Comprehensive Mobile Responsive Overrides (Phones)
   ========================================================================== */
@media (max-width: 768px) {
    /* Navbar - Hamburger Layout */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px 5%;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 100;
    }
    .hamburger span {
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 30px 0;
        gap: 30px;
        display: none; /* Hidden by default */
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-links.nav-active {
        display: flex;
        animation: navSlide 0.4s forwards;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
    }

    @keyframes navSlide {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Preloader */
    .loader-text {
        font-size: 1.8rem !important;
        text-align: center;
    }
    .loader-content p {
        font-size: 0.8rem !important;
        letter-spacing: 2px !important;
        text-align: center;
    }
    
    /* Set overlay darker on mobile so text is super readable over bright video */
    .overlay-gradient {
        display: block !important;
        background: rgba(0, 0, 0, 0.7) !important; 
    }

    /* Change fixed scroll container to normal relative flow so long content like the Events Grid fits on screen */
    .fixed-scroll-ui {
        position: relative !important;
        height: auto !important;
        padding-top: 120px; /* Space for navbar */
    }

    /* Make popups flow naturally and stay visible instead of vanishing on scroll */
    .scroll-popup {
        position: relative !important;
        height: auto !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 20px;
        width: 100%;
        margin-top: 50px;
        margin-bottom: 50px;
        
        /* Force visibility regardless of JS scroll calculation */
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
        background: none !important;
    }
    
    /* Ensure headers don't hit the edges of the phone screen */
    .section-header p {
        padding: 0 20px !important;
    }
    
    /* Remove the massive desktop scroll spacer on mobile */
    .scroll-spacer {
        display: none !important;
    }
    
    .left-flank, .right-flank {
        width: 100%;
        text-align: center !important;
    }

    /* Glassmorphism translucent box for Vision and Mission (Phone View Only) */
    .left-flank .cinematic-content, .right-flank .cinematic-content {
        background: rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 20px !important;
        padding: 30px 20px !important;
        margin: 15px 0 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
        text-align: center !important; /* Force center alignment inside the box */
    }
    
    .left-flank h1, .right-flank h1 {
        text-align: center !important;
        font-size: 3.5rem !important;
        line-height: 1.2;
        background: none !important;
        -webkit-text-fill-color: #ffffff !important;
        color: #ffffff !important;
        text-shadow: 0 5px 30px rgba(0, 0, 0, 1), 0 0 50px rgba(0, 0, 0, 1) !important;
    }
    
    .hero-subtitle {
        text-align: center !important;
        float: none !important;
        font-size: 1.2rem;
        margin-top: 15px;
        color: #ffffff !important;
        font-weight: 500;
        text-shadow: 0 5px 20px rgba(0, 0, 0, 1) !important;
    }

    /* Typography */
    h1 {
        font-size: 2.5rem !important;
    }
    .highlight-title {
        font-size: 2rem !important;
        text-align: center;
    }

    /* Split Layout */
    .split-layout {
        flex-direction: column;
        padding: 30px;
        gap: 30px;
        text-align: center;
    }
    .split-left, .split-right {
        text-align: center;
    }
    
    /* Events Grid Fix */
    .events-grid, .card-grid, .startup-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* Fix initiatives page glass cards being too narrow */
    .glass-card {
        max-width: 100% !important;
    }
    
    /* Contact Card */
    .contact-card {
        padding: 40px 20px;
        margin: 0 auto !important;
    }
    .social-links-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    .social-link {
        font-size: 1rem;
    }
    
    /* Hide hover arrows on mobile to prevent them from taking up invisible width and uncentering text */
    .social-arrow {
        display: none !important;
    }
    
    /* Fix Book UI for mobile screens */
    .mobile-break {
        display: block !important;
    }
    .image-book-container {
        aspect-ratio: 1 / 1 !important; /* Square for closed book */
        margin-top: 20px !important; 
        transition: aspect-ratio 0.5s ease;
    }
    .image-book-container.is-open {
        aspect-ratio: 1.4 / 1 !important; /* Wider for open book so it's not cropped! */
    }
    
    .page-text-container {
        /* Strictly bound to right page */
        width: 20% !important; 
        left: 46% !important; 
        top: 13% !important; /* Moved up slightly */
        height: 75% !important; 
        padding: 0 !important; 
        text-align: center; /* Center the text! */
    }
    .page-content h3 {
        font-size: 0.75rem !important; /* Tiny title */
        margin-bottom: 4px !important;
    }
    .page-content p {
        font-size: 0.55rem !important; /* Tiny paragraph */
        line-height: 1.1 !important;
        margin-bottom: 6px !important;
    }
    .read-button, .page-content .glow-button {
        padding: 4px 6px !important;
        font-size: 0.5rem !important;
        width: 100% !important; /* Force button to strictly obey 20% width */
        text-align: center;
        box-sizing: border-box !important;
        display: inline-block;
        white-space: normal;
        line-height: 1.2;
        margin-top: 6px !important; /* Space above button */
    }
    
    /* Realign hitboxes since object-fit: cover crops the image on mobile */
    .hitbox {
        left: 68% !important; /* Shifted slightly right */
        width: 25% !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    .open-hitbox {
        left: 80% !important; /* Shifted right to cover the physical tabs */
        width: 18% !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    .open-hitbox[data-target="content-online-learning"] { top: 8% !important; height: 18% !important; }
    .open-hitbox[data-target="content-guide-book"]      { top: 29% !important; height: 18% !important; }
    .open-hitbox[data-target="content-idea-bank"]       { top: 50% !important; height: 18% !important; }
    .open-hitbox[data-target="content-schemes"]         { top: 71% !important; height: 18% !important; }
}
