/* Modern Minimal LEAP Design */
:root {
    --primary-purple: #4E2A84;
    --secondary-purple: #2D1B4E;
    --white: #ffffff;
    --near-white: #fafafa;
    --light-gray: #f5f5f5;
    --medium-gray: #666666;
    --dark-gray: #1a1a1a;
    --black: #000000;
    
    --font-primary: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-purple: 0 0 30px rgba(78, 42, 132, 0.3);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: var(--glow-purple);
    }
    50% {
        box-shadow: 0 0 40px rgba(78, 42, 132, 0.5);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-purple);
    }
}

/* Mobile viewport fix */
:root {
    --vh: 1vh;
}

@media screen and (max-width: 768px) {
    :root {
        --vh: 1dvh; /* Use dynamic viewport height on mobile */
    }
}

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

/* Prevent horizontal overflow on all elements */
*, *:before, *:after {
    max-width: 100%;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.4;
    color: var(--dark-gray);
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: calc(100 * var(--vh));
    display: flex;
    flex-direction: column;
}

/* Main Layout */
.main-content {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Homepage layout - extend hero background behind footer */
.main-content:not(.scrollable) {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('assets/hero.jpg');
    background-size: cover;
    background-position: center center;
    min-height: calc(100 * var(--vh));
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: calc(100 * var(--vh));
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('assets/hero.jpg');
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 2;
}

.hero-content {
    text-align: center;
    color: var(--white);
    max-width: 800px;
    z-index: 3;
}

/* Brand Section */
.brand {
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.logo {
    font-family: var(--font-primary);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-shadow: 0 0 20px rgba(78, 42, 132, 0.2);
}

.logo:hover {
    /* animation: breathe 2s ease-in-out infinite; */
    text-shadow: 0 0 30px rgba(78, 42, 132, 0.4);
}

.subtitle {
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: var(--space-xs);
}

.university {
    font-family: var(--font-secondary);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

/* Tagline */
.tagline {
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.tagline p {
    font-family: var(--font-secondary);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 300;
    line-height: 1.5;
    opacity: 0.95;
    font-style: italic;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.cta-btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--white);
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: color var(--transition);
    z-index: 1;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--white);
    transition: left var(--transition);
    z-index: -1;
}

.cta-btn:hover::before {
    left: 0;
}

.cta-btn:hover {
    color: var(--black);
}

.cta-btn:focus {
    outline: 2px solid var(--white);
    outline-offset: 4px;
}

/* Logo */
.site-logo {
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1000;
    height: 48px;
    cursor: pointer;
    transition: all var(--transition);
}

.site-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0) invert(1);
    transition: all var(--transition);
}

.site-logo:hover img {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Navigation Toggle */
.nav-toggle {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition);
}

/* Header Background for Content Pages */
.main-content.scrollable .header-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.main-content.scrollable .header-background.visible {
    opacity: 1;
    visibility: visible;
}

/* Center header elements within header background on content pages */
.main-content.scrollable .site-logo {
    top: calc((80px - 48px) / 2);
}

.main-content.scrollable .nav-toggle {
    top: calc((80px - 48px) / 2);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-toggle span {
    width: 20px;
    height: 1px;
    background: var(--white);
    transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--white);
    z-index: 1001;
    transition: right var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-content {
    padding: var(--space-lg) var(--space-md);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.close-btn {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--medium-gray);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.close-btn:hover {
    color: var(--black);
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: var(--space-sm);
}

.nav-links a {
    display: block;
    padding: var(--space-sm) 0;
    color: var(--dark-gray);
    text-decoration: none;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
    transition: all var(--transition);
    border-bottom: 1px solid transparent;
}

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

.nav-links a.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
    font-weight: 600;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    
    .hero-content {
        padding: var(--space-sm);
    }
    
    .brand {
        margin-bottom: var(--space-lg);
    }
    
    .tagline {
        margin-bottom: var(--space-lg);
    }
    
    .tagline p {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
    
    .sidebar {
        width: 280px;
        right: -280px;
    }
    
    .site-logo {
        top: var(--space-sm);
        left: var(--space-sm);
        height: 44px;
    }

    .nav-toggle {
        top: var(--space-sm);
        right: var(--space-sm);
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        height: 40px;
    }

    /* Ensure touch targets meet 44px minimum accessibility requirement */
    .nav-toggle {
        width: 44px;
        height: 44px;
    }

    .nav-toggle span {
        width: 18px;
    }

    .sidebar {
        width: 100%;
        right: -100%;
    }

    /* Improve close button touch target */
    .close-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }

}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hero {
        background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('assets/hero.jpg');
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Content Pages */
.main-content.scrollable {
    /* min-height: 100vh; */
}

/* Shorter hero for content pages */
.main-content.scrollable .hero {
    height: calc(40 * var(--vh));
    min-height: 300px;
    max-height: 400px;
}

.main-content.scrollable .hero .brand {
    margin-bottom: 0;
}

.main-content.scrollable .hero .logo {
    font-size: clamp(3.5rem, 10vw, 6rem);
    margin-bottom: var(--space-sm);
}

.main-content.scrollable .hero .subtitle {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    margin-bottom: calc(var(--space-xs) * 0.5);
}

.main-content.scrollable .hero .university {
    font-size: clamp(0.7rem, 1.3vw, 0.9rem);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    width: 100%;
    /* Prevent container from causing horizontal overflow */
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Mission Section */
.mission-section {
    background: var(--white);
    padding: var(--space-xl) 0;
    min-height: calc(50 * var(--vh));
    display: flex;
    align-items: center;
    flex: 1;
}

.mission-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--primary-purple);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.01em;
}

.mission-text {
    max-width: 800px;
    margin: 0 auto;
}

.mission-text p {
    font-family: var(--font-secondary);
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    line-height: 1.7;
    color: var(--dark-gray);
    margin-bottom: var(--space-md);
    font-weight: 300;
}

.mission-text p:last-child {
    margin-bottom: 0;
}

/* Projects Section */
.projects-section {
    background: var(--white);
    padding: var(--space-xl) 0;
    min-height: calc(70 * var(--vh));
}

.projects-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.project-card {
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    padding: var(--space-lg);
    text-align: left;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--secondary-purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-purple);
    box-shadow: 0 8px 30px rgba(78, 42, 132, 0.15);
}

.project-title {
    font-family: var(--font-primary);
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 600;
    color: var(--primary-purple);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.project-description {
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.6;
    color: var(--medium-gray);
    margin: 0;
}

/* Content pages responsive design */
@media (max-width: 768px) {
    .mission-section {
        padding: var(--space-lg) 0;
    }

    .container {
        padding: 0 var(--space-sm);
    }

    .mission-content {
        text-align: left;
    }

    .section-title {
        text-align: center;
        margin-bottom: var(--space-md);
    }

    .projects-section {
        padding: var(--space-lg) 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .projects-content {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .mission-section {
        padding: var(--space-md) 0;
    }

    .projects-section {
        padding: var(--space-md) 0;
    }

    .project-card {
        padding: var(--space-md);
    }
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

/* Footer */
.footer {
    position: relative;
    padding: var(--space-sm) var(--space-sm);
    text-align: center;
    border-top: 1px solid rgba(102, 102, 102, 0.08);
    background: linear-gradient(to bottom, transparent, rgba(250, 250, 250, 0.6));
    margin-top: auto;
}

/* Homepage footer styling - transparent background with white text */
.main-content:not(.scrollable) .footer {
    background: transparent;
    border-top: none;
}

.main-content:not(.scrollable) .footer-disclaimer {
    color: white;
    opacity: 0.9;
}

.footer-disclaimer {
    font-size: 0.7rem;
    color: var(--medium-gray);
    font-weight: 400;
    opacity: 0.7;
    line-height: 1.4;
    max-width: 500px;
    margin: 0 auto;
}

/* Simplified body layout */
html, body {
    margin: 0;
    padding: 0;
}



@media (max-width: 480px) {
    .footer {
        padding: var(--space-xs) var(--space-sm);
    }

    .footer-disclaimer {
        font-size: 0.65rem;
    }
}