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

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

html, body {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: #0e0e0e;
    color: #e8e8e8;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4rem;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.nav-link {
    color: #a0a0a0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #00d4aa;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
}

/* Hero section */
.hero {
    max-width: 800px;
    margin-bottom: 6rem;
    animation: fadeInUp 1s ease-out;
}

.name {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #b0b0b0;
    margin-bottom: 2rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.separator {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4aa, transparent);
    margin: 0 auto 2.5rem;
    opacity: 0.8;
}

.description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #c8c8c8;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.7;
}

/* Sections */
.section {
    max-width: 800px;
    margin-bottom: 6rem;
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
}

.content {
    text-align: left;
}

.text {
    font-size: 1.1rem;
    color: #d0d0d0;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Projects */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.project {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4aa, #0099cc);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project:hover::before {
    transform: scaleX(1);
}

.project:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 170, 0.2);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
}

.project-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.project-description {
    color: #d0d0d0;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1rem;
}

.project-tech {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.5;
}

/* Contact */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.contact-link {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.8rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 200px;
    text-align: center;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.1), transparent);
    transition: left 0.5s ease;
}

.contact-link:hover::before {
    left: 100%;
}

.contact-link:hover {
    color: #ffffff;
    border-color: rgba(0, 212, 170, 0.3);
    background: rgba(0, 212, 170, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.1);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .header {
        padding: 1.5rem 0;
        margin-bottom: 3rem;
    }
    
    .nav {
        gap: 2rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .hero {
        margin-bottom: 4rem;
    }
    
    .section {
        margin-bottom: 4rem;
    }
    
    .projects {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project {
        padding: 1.5rem;
    }
    
    .contact-links {
        gap: 1rem;
    }
    
    .contact-link {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .description {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .text {
        font-size: 1rem;
    }
    
    .project {
        padding: 1.25rem;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .contact-link {
        padding: 0.6rem 1.25rem;
        font-size: 0.95rem;
        min-width: 160px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #00d4aa;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00b894;
}

/* Selection styling */
::selection {
    background: rgba(0, 212, 170, 0.2);
    color: #ffffff;
}

/* Focus styles for accessibility */
.nav-link:focus,
.contact-link:focus {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* Typing Game Styles */
.game-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.difficulty-selector, .word-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-selector label, .word-count label {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
}

.difficulty-selector select, .word-count select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 6px;
    color: #e8e8e8;
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.difficulty-selector select:focus, .word-count select:focus {
    border-color: #00d4aa;
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.2);
}

.game-container:hover {
    border-color: rgba(0, 212, 170, 0.4);
    box-shadow: 0 12px 48px rgba(0, 212, 170, 0.15);
}

.quote-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 212, 170, 0.05);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #c8c8c8;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.typing-area {
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: #e8e8e8;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

.restart-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6464;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.restart-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.5);
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.2);
}

.typing-area:focus {
    border-color: #00d4aa;
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.2);
}

.typing-area::placeholder {
    color: #666;
}

.stats {
    display: none;
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(0, 212, 170, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.stat-item {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
}

.stat-value {
    color: #00d4aa;
    font-weight: 600;
}

.garv-record {
    font-size: 1.1rem;
    color: #888;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
}

.comment {
    font-style: italic;
    color: #a0a0a0;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.button-group {
    display: none;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-btn, .play-again {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid #00d4aa;
    color: #00d4aa;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover, .play-again:hover {
    background: rgba(0, 212, 170, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.3);
}

.retry-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: #e8e8e8;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: all 2s ease;
}

.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s ease;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}