/* Base Styles */
:root {
    --color-background: #f5f5f5;
    --color-text: #111111;
    --color-accent: #333333;
    --color-muted: #777777;
    --color-border: #dddddd;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --grid-gap: 2rem;
    --header-height: 6rem;
    --transition-ease: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-speed: 0.8s;
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-muted);
}

h5 {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--color-muted);
}

p {
    margin-bottom: 1.5rem;
    max-width: 40rem;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
}

/* Noise Effect */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Cursor */
.cursor {
    position: fixed;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.15);
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    pointer-events: none !important;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.2s, opacity 0.3s;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-words {
    position: relative;
    height: 4rem;
    overflow: hidden;
}

.loader-words div {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 4rem;
    font-weight: 600;
    opacity: 0;
    animation: loader-words 6s infinite;
}

.loader-words div:nth-child(2) { animation-delay: 0.5s; }
.loader-words div:nth-child(3) { animation-delay: 1s; }
.loader-words div:nth-child(4) { animation-delay: 1.5s; }
.loader-words div:nth-child(5) { animation-delay: 2s; }
.loader-words div:nth-child(6) { animation-delay: 2.5s; }
.loader-words div:nth-child(7) { animation-delay: 3s; }
.loader-words div:nth-child(8) { animation-delay: 3.5s; }
.loader-words div:nth-child(9) { animation-delay: 4s; }

@keyframes loader-words {
    0%, 20%, 100% { opacity: 0; transform: translateY(20px); }
    5%, 15% { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5vw;
    z-index: 100;
    mix-blend-mode: difference;
    color: white;
}

.header-logo a {
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link a {
    display: inline-block;
    transform-origin: bottom left;
    transition: transform 0.3s var(--transition-ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--transition-ease);
}

/* .nav-link:hover a {
    transform: translateY(-100%);
} */

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.menu-toggle {
    cursor: pointer;
    padding: 0.5rem;
    font-weight: 500;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--transition-ease), visibility 0.5s;
}

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

.menu-content {
    height: 100%;
    padding: 5vw;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
    
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.menu-logo {
    font-weight: 700;
    font-size: 1.25rem;
}

.menu-close {
    cursor: pointer;
    font-weight: 500;
}

.menu-nav, .menu-socials {
    margin-bottom: 2rem;
}

.menu-nav ul, .menu-socials ul {
    display: grid;
    gap: 1rem;
}

.menu-nav a, .menu-socials a {
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.5;
    display: inline-block;
    position: relative;
    transition: color 0.3s ease;
}

.menu-nav a::after, .menu-socials a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--transition-ease);
}

.menu-nav a:hover, .menu-socials a:hover {
    color: var(--color-muted);
}

.menu-nav a:hover::after, .menu-socials a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.menu-location {
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Main Content */
.main {
    padding-top: var(--header-height);
}

section {
    padding: 8rem 5vw;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: calc(var(--header-height) + 8rem);
}

.hero-title {
    max-width: 800px;
}

.hero-cta {
    margin-top: 3rem;
}

.hero-cta a {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--color-text);
    color: var(--color-background);
    border-radius: 0.25rem;
    font-weight: 500;
    transition: transform 0.3s var(--transition-ease);
}

.hero-cta a:hover {
    transform: translateY(-5px);
}

#webgl {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Projects Section */
.projects {
    background-color: var(--color-text);
    color: var(--color-background);
}

.section-header {
    margin-bottom: 3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--grid-gap);
}

.project {
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    transition: transform 0.3s var(--transition-ease), box-shadow 0.3s var(--transition-ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-category {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.project-description {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-description p {
    margin-bottom: 0.75rem;
}

.project-description strong {
    color: rgba(255, 255, 255, 0.9);
}

.project-link, .award-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    margin-top: 0.5rem;
}

.project-link:hover, .award-link:hover {
    color: #fff;
    transform: translateX(5px);
}

.project-link::after, .award-link::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
    margin-left: 5px;
}

.project-link:hover::after, .award-link:hover::after {
    width: 20px;
}

.award-link {
    color: var(--color-accent);
}

.award-link:hover {
    color: var(--color-text);
}

.hidden {
    display: none;
}

.project.expanded .project-description {
    display: block;
}

.projects-more {
    margin-top: 3rem;
    text-align: right;
}

.projects-more a {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.projects-more span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.about-text {
    grid-column: 1 / -1;
}

.about-skills, .about-experience, .about-education, .about-awards {
    display: flex;
    flex-direction: column;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skills-list div {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.experience-item, .education-item, .award-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.experience-item:last-child, .education-item:last-child, .award-item:last-child {
    border-bottom: none;
}

.experience-title, .education-title, .award-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.experience-company, .education-institution {
    margin-bottom: 0.25rem;
}

.experience-date, .education-date, .experience-location, .education-location, .award-date {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
}

.experience-description, .education-description, .award-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Contact Section */
.contact {
    background-color: var(--color-text);
    color: var(--color-background);
    padding: 8rem 5vw;
    margin-bottom: 0;
}

.contact-header h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
}

.contact-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 2rem;
    max-width: 1400px;
    width: 100%;
    gap: 4rem;
}

.contact-left {
    flex: 1;
    max-width: 600px;
}

.contact-cta a {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--color-background);
    color: var(--color-text);
    border-radius: 0.25rem;
    font-weight: 500;
    transition: transform 0.3s var(--transition-ease);
}

.contact-cta a:hover {
    transform: translateY(-5px);
}

/* Contact Form Styles */
.contact-form-container {
    width: 100%;
    transition: all 0.5s ease;
    opacity: 1;
    transform: translateY(0);
}

.contact-form-container.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--color-background);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-background);
    background-color: rgba(255, 255, 255, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.submit-btn, .cancel-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn {
    background-color: var(--color-background);
    color: var(--color-text);
}

.submit-btn:hover {
    background-color: #fff;
    transform: translateY(-2px);
}

.cancel-btn {
    background-color: transparent;
    color: var(--color-background);
    border: 1px solid var(--color-background);
}

.cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    height: 1.5rem;
}

.form-status.success {
    color: #4CAF50;
}

.form-status.error {
    color: #FF5252;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1rem;
    opacity: 0.7;
    min-width: 250px;
}

/* Responsive Design for Contact Form */
@media (max-width: 992px) {
    .contact-content {
        flex-direction: column;
        gap: 4rem;
    }
    
    .contact-left {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .contact-content {
        gap: 2rem;
    }
    
    .contact-header h2 {
        font-size: 2.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Footer */
.footer {
    padding: 4rem 5vw;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    gap: 4rem;
}

.footer-socials ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-socials a {
    color: var(--color-text);
    transition: color 0.3s ease;
}

.footer-socials a:hover {
    color: var(--color-muted);
}

/* Media Queries */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-content {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 4rem;
    }
    
    .nav-link {
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-left {
        flex-direction: column;
        gap: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s var(--transition-ease) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1s; }