/* Custom Properties */
:root {
    /* Colors */
    --primary-color: #800020;
    --secondary-color: #800020;
    --secondary-color-child: #ffffff;
    --accent-color: #FFD700;
    --dark-color: #000000;
    --light-color: #ffffff;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Text Colors */
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #6c757d;
    --text-light: rgba(255, 255, 255, 0.9);
    
    /* Typography */
    --font-main: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Lora', Georgia, serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    
    /* Font Sizes - Fluid Typography */
    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --fs-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --fs-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --fs-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --fs-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --fs-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
    --fs-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 4rem);
    
    /* Spacing - Consistent Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: clamp(1rem, 5vw, 2rem);
    --navbar-height: 70px;
    --navbar-height-mobile: 60px;
    
    /* Transitions & Animations */
    --transition-fast: 0.15s ease;
    --transition-default: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 15px 35px rgba(0, 0, 0, 0.15);
    --shadow-colored: 0 8px 25px rgba(0, 34, 68, 0.2);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1ರೀಡ್‌ನಲ್ಲಿ: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, #003366 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #aa0030 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #ffed4a 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.5) 80%);
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    /* Typography */
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* Utility Classes */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.visually-hidden {
    /* Positioning */
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Section Titles */
.section-title {
    position: relative;
    color: var(--primary-color);
    text-align: center;
    font-weight: 700;
    font-size: var(--fs-3xl);
    margin-bottom: var(--space-2xl);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    margin: var(--space-md) auto 0;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transition: transform var(--transition-bounce);
}

.section-title.visible::after {
    transform: scaleX(1);
}

/* Buttons */
.btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    overflow: hidden;
    font-family: var(--font-main);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.025em;
    white-space: nowrap;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-default);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 0;
    height: 100%;
    transition: width var(--transition-slow);
}

.btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--light-color);
    box-shadow: var(--shadow-colored);
}

.btn-primary::before {
    background: var(--gradient-secondary);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:hover:not(:disabled)::before {
    width: 100%;
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--light-color);
    box-shadow: 0 4px 15px rgba(128, 0, 32, 0.3);
}

.btn-secondary::before {
    background: var(--gradient-primary);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(128, 0, 32, 0.4);
}

.btn-secondary:hover:not(:disabled)::before {
    width: 100%;
}

.btn-outline-light {
    background: transparent;
    color: var(--light-color);
    border: 2px solid var(--light-color);
}

.btn-outline-light::before {
    background: var(--light-color);
}

.btn-outline-light:hover:not(:disabled) {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline-light:hover:not(:disabled)::before {
    width: 100%;
}

.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--fs-sm);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--fs-lg);
}

.projects-hero {
    min-height: 340px;
    padding-top: 120px;
    padding-bottom: 60px;
    margin-bottom: 2rem;
    background: linear-gradient(rgba(128,0,32,0.7), rgba(0,0,0,0.5)), url('../images/ai-generated-8894200_1280.jpg') center/cover no-repeat;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: 1rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
    box-shadow: 0 8px 32px rgba(128,0,32,0.12), 0 1.5px 6px rgba(0,0,0,0.06);
    transform: translateY(-4px) scale(1.02);
}

.project-img img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-body {
    padding: 1.25rem 1rem 1rem 1rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #800020;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: #444;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    font-size: 0.95rem;
    color: #003366;
}

.cta-section {
    /* Visual */
    background: linear-gradient(90deg, #800020 60%, #003366 100%);
    color: #fff;
}

.cta-section .btn-primary {
    padding: 0.75rem 2.5rem;
    background: #fff;
    color: #800020;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.cta-section .btn-primary:hover {
    /* Visual */
    background: #003366;
    color: #fff;
}

/* Mission, Vision, and Core Values Cards Section */
.info-cards-section {
    background: #fff;
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
}

.info-cards-section .section-title {
    color: #800020;
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-md);
}

.info-cards-section .card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-cards-section .card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: var(--shadow-xl);
}

.info-cards-section .card-title {
    color: #003366;
    font-size: 1.25rem;
    font-weight: 700;
}

.info-cards-section .card-body i {
    margin-bottom: 0.5rem;
}

.info-cards-section ul {
    padding-left: 1.2em;
    margin-bottom: 0;
    text-align: left;
}

.info-cards-section ul li {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.25rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.9; }
}

@keyframes slideUpFade {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadePulse {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-modal);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--light-color);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.modern-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0;
}

.dot1 { animation: fadePulse 1.5s infinite ease-in-out 0s; }
.dot2 { animation: fadePulse 1.5s infinite ease-in-out 0.3s; }
.dot3 { animation: fadePulse 1.5s infinite ease-in-out 0.6s; }

/* Footer */
footer {
    position: relative;
    padding: var(--space-4xl) 0 var(--space-2xl);
    overflow: hidden;
    background: var(--gradient-primary);
    color: var(--light-color);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    animation: scaleX 1.5s var(--transition-bounce) 0.5s forwards;
}

footer a {
    position: relative;
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-default);
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: aliceblue;
    transition: width var(--transition-default);
}

footer a:hover {
    color: var(--accent-color);
}

footer a:hover::after {
    width: 100%;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--accent-color);
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.social-icons a::before {
    content: '';    
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--accent-color);
    border-radius: var(--radius-full);
    transform: scale(0);
    transition: transform var(--transition-bounce);
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.1);
}

.social-icons a:hover::before {
    transform: scale(1);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-fixed);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: all var(--transition-default);
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-lg);
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn.show:hover {
    animation: pulse 1.5s infinite;
}

@media (max-width: 767.98px) {
    :root {
        --navbar-height: var(--navbar-height-mobile);
        --container-padding: var(--space-md);
    }

    .hero-text {
        padding: var(--space-xl) var(--space-lg);
    }

    .hero-text h1 {
        font-size: var(--fs-3xl);
    }

    .hero-text p {
        font-size: var(--fs-lg);
    }

    .btn {
        padding: var(--space-md) var(--space-lg);
    }

    .count-box {
        padding: var(--space-lg);
    }

    .projects-hero {
        padding-top: 80px;
        min-height: 220px;
    }

    .project-img img {
        height: 160px;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .info-cards-section {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-2xl);
    }

    .info-cards-section .section-title {
        font-size: var(--fs-xl);
    }

    .info-cards-section .card-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 100vh;
        min-height: 500px;
    }

    .hero-text {
        padding: var(--space-lg) var(--space-md);
    }

    .card-body {
        padding: var(--space-lg);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .count-box {
        padding: var(--space-md);
    }
}