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

:root {
    --transition-speed: 0.3s;
    --spacing-unit: 1rem;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.7;
}

.content-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.content-wrapper.loaded {
    opacity: 1;
}

/* Add backdrop blur to text content for better readability */
.page-content,
.bio-corner,
.nav,
.theme-toggle,
.font-toggle {
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* Stronger blur for text elements */
.hero-name,
.hero-role,
.page-title,
.info-text,
.project-title,
.social-link {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

body.light .hero-name,
body.light .hero-role,
body.light .page-title,
body.light .info-text,
body.light .project-title,
body.light .social-link {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Page Container */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity, filter;
    transform: translateX(0) scale(1);
    filter: blur(0px);
}

.page.active {
    opacity: 1;
    pointer-events: all;
}

.page-content {
    width: 100%;
    max-width: 1200px;
    padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    text-align: center;
}

/* Navigation */
.nav {
    position: fixed;
    left: calc(var(--spacing-unit) * 2);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1);
}

.nav-btn {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed);
    text-align: left;
    min-width: 120px;
}

.nav-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: translateX(5px);
}

.nav-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    z-index: 1000;
    display: flex;
    gap: calc(var(--spacing-unit) * 0.5);
}

.theme-btn {
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    text-transform: capitalize;
}

.theme-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.theme-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Font Toggle */
.font-toggle {
    position: fixed;
    top: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 3);
    z-index: 1000;
}

.font-btn {
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    text-transform: capitalize;
    width: 100%;
}

.font-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.font-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Hero Section */
.hero-name {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.1;
}

.hero-role {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 300;
    opacity: 0.8;
    letter-spacing: 0.05em;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Bio Corner */
.bio-corner {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    max-width: 400px;
    z-index: 100;
}

.bio-content {
    text-align: left;
    background: var(--bg-color);
    opacity: 0.95;
    backdrop-filter: blur(10px);
    padding: calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 4);
    letter-spacing: -0.02em;
}

/* Info Section */
.info-page .info-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

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

.info-text {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    opacity: 0.9;
}

.info-text strong {
    font-weight: 600;
    opacity: 1;
}

.info-text.funky {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 2;
    opacity: 0.85;
    font-style: italic;
}

/* Projects Section */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    width: 100%;
}

.project-item {
    padding: calc(var(--spacing-unit) * 2);
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.project-item:hover {
    transform: translateY(-5px);
    border-color: var(--text-color);
}

.project-date {
    font-size: 0.875rem;
    opacity: 0.6;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.project-credits {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Contact Section */

.social-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.125rem;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-speed);
    padding-bottom: calc(var(--spacing-unit) * 0.25);
}

.social-link:hover {
    border-bottom-color: var(--text-color);
    opacity: 1;
}

/* Footer */
.footer {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 2);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.6;
    font-size: 0.875rem;
    z-index: 100;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        left: var(--spacing-unit);
    }
    
    .nav-btn {
        min-width: 100px;
        font-size: 0.875rem;
        padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    }
    
    .theme-toggle {
        top: var(--spacing-unit);
        right: var(--spacing-unit);
        flex-direction: column;
    }
    
    .font-toggle {
        top: calc(var(--spacing-unit) * 4);
        right: var(--spacing-unit);
    }
    
    .page-content {
        padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    }
    
    .bio-corner {
        bottom: var(--spacing-unit);
        right: var(--spacing-unit);
        left: var(--spacing-unit);
        max-width: 100%;
    }
    
    .bio-content {
        text-align: center;
        font-size: 0.875rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer {
        font-size: 0.75rem;
        bottom: var(--spacing-unit);
    }
}

