/* ==========================================================================
   Reset & Base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #000000;
    --white: #FFFFFF;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
    
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s var(--transition-smooth);
}

.nav-logo {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.3s var(--transition-smooth);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--white);
    transition: width 0.3s var(--transition-smooth);
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
    padding: 0 2rem;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s var(--transition-smooth) 0.3s forwards;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title .line:nth-child(1) {
    animation: fadeInUp 1s var(--transition-smooth) 0.5s forwards;
}

.hero-title .line:nth-child(2) {
    animation: fadeInUp 1s var(--transition-smooth) 0.7s forwards;
}

.hero-title .line:nth-child(3) {
    animation: fadeInUp 1s var(--transition-smooth) 0.9s forwards;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInUp 1s var(--transition-smooth) 1.1s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s var(--transition-smooth) 1.5s forwards;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--white), transparent);
    animation: scrollLineMove 2s ease-in-out infinite;
}

.scroll-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-400);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */

.projects {
    padding: 10rem 4rem;
    position: relative;
}

.section-header {
    max-width: 1400px;
    margin: 0 auto 6rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
}

.projects-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 4rem;
}

/* ==========================================================================
   Project Cards
   ========================================================================== */

.project-card {
    position: relative;
    background: var(--gray-900);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: all 0.5s var(--transition-smooth);
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s var(--transition-smooth);
    pointer-events: none;
    z-index: 1;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-8px);
}

.project-card:hover::before {
    opacity: 1;
}

.project-visual {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: var(--black);
}

.project-3d {
    width: 100%;
    height: 100%;
    position: relative;
}

.project-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.project-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s var(--transition-smooth);
}

.project-card:hover .project-grid {
    opacity: 1;
}

.project-content {
    padding: 3rem;
    position: relative;
    z-index: 2;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.project-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    color: var(--white);
}

.project-title {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.project-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--gray-300);
    transition: all 0.3s var(--transition-smooth);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.project-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.spec {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spec-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.spec-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
    font-family: var(--font-mono);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact {
    padding: 10rem 4rem;
    position: relative;
    background: var(--gray-900);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.contact-text {
    font-size: 1.125rem;
    color: var(--gray-400);
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 3rem;
    background: var(--black);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s var(--transition-smooth);
}

.contact-link:hover {
    border-color: var(--white);
    transform: translateY(-4px);
}

.link-label {
    letter-spacing: 0.02em;
}

.link-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s var(--transition-smooth);
}

.contact-link:hover .link-arrow {
    transform: translateX(8px);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    padding: 4rem;
    background: var(--black);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
}

.footer-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-style: italic;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scrollLineMove {
    0%, 100% {
        transform: scaleY(1);
        opacity: 1;
    }
    50% {
        transform: scaleY(1.5);
        opacity: 0.5;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 1.5rem 2rem;
    }
    
    .nav-links {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .projects {
        padding: 6rem 2rem;
    }
    
    .project-content {
        padding: 2rem;
    }
    
    .project-specs {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact {
        padding: 6rem 2rem;
    }
    
    .footer {
        padding: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
