/* Root Variables - Dark Mode Default */
:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #0a0a0a;
    /* Same as primary for seamless look, or slightly lighter */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-color: #64ffda;
    /* Teal accent */
    --border-color: #333;

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(2rem, 1.7rem + 1.5vw, 3rem);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --accent-color: #0070f3;
    /* Blue accent */
    --border-color: #e0e0e0;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
    overflow-x: hidden;
    /* Reverting from previous module: allow scrolling now that we have content */
    overflow-y: auto;
}

/* Typography Utility */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

/* Canvas - Background */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    /* Let clicks pass through */
    opacity: 0.6;
    /* Slight transparency to blend with theme */
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm) 0;
    background: rgba(var(--bg-primary), 0.8);
    /* Glassmorphism attempt without complex filters */
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Mobile menu placeholder */
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

/* Sections */
section {
    padding: var(--spacing-xl) 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    /* Separator for visual debugging */
}

/* Hero Section */
#hero {
    text-align: left;
    padding-top: var(--spacing-xl);
    /* Account for fixed header */
}

.hero-subtitle {
    color: var(--accent-color);
    font-family: var(--font-mono);
    margin-bottom: var(--spacing-sm);
}

/* Grid Layouts for Sections */
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform var(--transition-fast);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

/* Contact Section */
#contact {
    text-align: center;
}

/* Footer */
footer {
    padding: var(--spacing-md) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-color);
}