/* 
 * IEEE VISAT GLOBAL DESIGN SYSTEM
 * Centralized theme, variables, and common mobile-first foundations.
 */

:root {
    --bg-main: #000000;
    --bg-mid: #0a0000;
    --bg-soft: #000000;
    --purple-main: #8C0020;
    --purple-soft: #DC143C;
    --accent-gold: #DC143C;
    --crimson: #DC143C;
    --crimson-dark: #8C0020;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --white: #ffffff;
    
    /* Spacing System */
    --gap-xs: 8px;
    --gap-sm: 16px;
    --gap-md: 24px;
    --gap-lg: 32px;
    --gap-xl: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scroll globally */
}

body {
    font-family: 'Outfit', "Segoe UI", system-ui, sans-serif;
    background: #000;
    color: var(--text-main);
    line-height: 1.6;
    width: 100%;
    position: relative;
    font-size: 16px; /* Base size */
}

/* Base Ambient Background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 10% 10%, rgba(220, 20, 60, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(220, 20, 60, 0.05) 0%, transparent 40%);
    z-index: -2;
    pointer-events: none;
}

/* Global Typography - Fluid Scaling */
h1 { font-size: clamp(32px, 8vw, 64px); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(28px, 6vw, 42px); font-weight: 800; line-height: 1.2; }
h3 { font-size: clamp(20px, 4vw, 24px); font-weight: 700; }
p { font-size: clamp(14px, 2vw, 16px); color: var(--text-muted); }

/* Global Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000000; }
::-webkit-scrollbar-thumb {
    background: var(--crimson);
    border-radius: 6px;
}

/* Common Card Components */
.card, .preview, .event-card, .gallery-card {
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(220, 20, 60, 0.1);
    overflow: hidden;
}

@media (hover: hover) {
    .card:hover, .preview:hover, .event-card:hover, .gallery-card:hover {
        transform: translateY(-5px);
        border-color: rgba(220, 20, 60, 0.4);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

/* ================= HEADER & NAVIGATION ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 2000;
    transition: all 0.4s ease;
}

.header.scrolled {
    height: 65px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
}

.logo {
    height: 32px; /* Standard mobile logo height */
    display: flex;
    align-items: center;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

@media (min-width: 900px) {
    .logo { height: 42px; }
}

/* Unified Desktop Nav */
.nav {
    display: none;
}

@media (min-width: 900px) {
    .nav {
        display: flex;
        gap: 30px;
    }
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.nav a:hover, .nav a.active {
    opacity: 1;
    color: var(--crimson);
}

/* Fullscreen Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Hamburger Toggle (The ONLY system) */
.menu-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    cursor: pointer;
    z-index: 2100;
}

@media (min-width: 900px) {
    .menu-toggle { display: none; }
}

.menu-toggle span {
    width: 28px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle span:nth-child(2) { width: 20px; }

.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); width: 28px; }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); width: 28px; }

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 5%;
    background: none;
    border: none;
    color: #fff;
    font-size: 44px;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    transition: color 0.3s ease;
    z-index: 1600;
}

.mobile-menu-close:hover {
    color: var(--crimson);
}

/* Global Footer */
.footer {
    padding: var(--gap-xl) var(--gap-md) var(--gap-md);
    background: #000;
    border-top: 1px solid rgba(220, 20, 60, 0.1);
}

.footer-grid {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-md);
    padding-bottom: var(--gap-md);
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-socials {
    justify-content: center;
}

@media (min-width: 768px) {
    .footer-grid { 
        grid-template-columns: 2fr 1fr 1fr 1fr; 
        text-align: left;
    }
    .footer-brand {
        align-items: flex-start;
    }
    .footer-socials {
        justify-content: flex-start;
    }
}

.footer-logo { height: 32px; margin-bottom: var(--gap-sm); }
.footer-brand p { max-width: 300px; }
.footer-brand p, .footer-section p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.footer-section h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: var(--gap-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.footer-section a:hover { color: var(--crimson); }

.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: var(--gap-sm);
}

.footer-socials a {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    background: var(--crimson);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1200px;
    margin: auto;
    padding-top: var(--gap-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p { font-size: 11px; }
.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 4px;
    display: inline-block;
}

.footer-bottom a:hover { color: var(--crimson); }

/* Performance Optimization Utilities */
@media (max-width: 768px) {
    .reveal { opacity: 1 !important; transform: none !important; }
    .parallax-bg { background-attachment: scroll !important; }
    #hero-canvas, #particles-canvas { display: none; } /* Disable heavy canvases on mobile */
}

/* Utility Classes */
.btn-primary {
    background: linear-gradient(135deg, #8C0020, #DC143C);
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:active { transform: scale(0.95); }
/* ================= UNIFIED PAGE TITLES ================= */
.page-title {
    text-align: center;
    padding: clamp(100px, 15vh, 160px) 20px 20px; /* Reduced bottom padding to 20px per request */
    position: relative;
    z-index: 1;
}

.page-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--crimson);
    background: rgba(220, 20, 60, 0.08);
    border: 1px solid rgba(220, 20, 60, 0.3);
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
    animation: fadeSlideDown 0.7s ease both;
}

.page-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--crimson);
    box-shadow: 0 0 8px rgba(220, 20, 60, 0.9);
    animation: blinkDot 1.4s ease-in-out infinite;
}

.page-title h1 {
    font-size: clamp(36px, 7vw, 62px);
    font-weight: 900;
    letter-spacing: -2px;
    display: inline-block;
    position: relative;
    padding-bottom: 16px;
    line-height: 1.1;
    background: linear-gradient(90deg, #DC143C 0%, #ff4060 40%, #ffffff 70%, #DC143C 100%);
    background-size: 300% 300%;
    animation: gradientFlow 6s ease-in-out infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #DC143C, #ff4060);
    box-shadow: 0 0 12px rgba(220, 20, 60, 0.6);
    animation: lineGrow 1s 0.4s cubic-bezier(.22, 1, .36, 1) both;
}

.page-title p {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 16px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    animation: fadeSlideUp 0.8s 0.3s ease both;
}

@keyframes lineGrow { from { width: 0; opacity: 0; } to { width: 60px; opacity: 1; } }
@keyframes gradientFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes blinkDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.6); } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
