/* --- Root Variables --- */
:root {
    /* Colors */
    --bg-dark: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.6);
    --primary: #ffffff;
    --secondary: #a0a0a0;
    --accent: #3a86ff; /* A clean modern blue */
    --accent-glow: rgba(58, 134, 255, 0.3);
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --container-padding: 2rem;
    --section-gap: 8rem;
}

/* --- Light Theme Variables --- */
body.light-theme {
    --bg-dark: #f5f5f7;
    --bg-card: rgba(255, 255, 255, 0.8);
    --primary: #0a0a0a;
    --secondary: #4a4a4a;
    --accent: #0071e3;
    --accent-glow: rgba(0, 113, 227, 0.15);
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --glass-border: rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* --- Utility Classes --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-padding {
    padding: var(--section-gap) 0;
}

/* --- Loading Screen --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content {
    text-align: center;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    transition: var(--transition-smooth);
}

nav.scrolled {
    background: var(--bg-dark);
    height: 70px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-theme nav.scrolled {
    background: rgba(245, 245, 247, 0.8);
    backdrop-filter: blur(10px);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    display: inline-block;
    will-change: transform;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: inline-block;
    will-change: transform;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary);
}

/* --- Theme Toggle --- */
.theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
    will-change: transform;
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.theme-toggle svg {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .sun-icon {
    display: none;
}

body.light-theme .theme-toggle .moon-icon {
    display: none;
}

body.light-theme .theme-toggle .sun-icon {
    display: block;
}

/* --- Custom Cursor --- */
#cursor {
    width: 20px;
    height: 20px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cursor-glow {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* --- Background Canvas --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent);
    z-index: 1001;
}

/* --- Buttons --- */
.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: inline-block;
    will-change: transform;
}

.btn.primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn.primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn.secondary {
    border: 1px solid var(--glass-border);
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

body.light-theme .btn.secondary {
    background: rgba(0, 0, 0, 0.05);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

body.light-theme .btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* --- Back to Top --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--accent);
    color: #fff;
}

#pdf-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --section-gap: 5rem;
    }
    
    .nav-links {
        display: none; /* Simplified for now, mobile menu logic later */
    }
    
    * {
        cursor: auto !important;
    }
    
    #cursor, #cursor-glow {
        display: none;
    }
}
