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

:root {
    --bg: #0a0e14;
    --bg-alt: #0f1419;
    --fg: #d4d9e0;
    --fg-muted: #6b7280;
    --primary: #22d3ee;
    --border: #1e2530;
    --card: #0d1117;
    --radius: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: transparent;
    transition: background 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.125rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--fg-muted);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--fg);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    background:
            linear-gradient(var(--border) 1px, transparent 1px),
            linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 70%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--fg-muted);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    max-width: 540px;
    color: var(--fg-muted);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.3);
}

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

.btn-outline:hover {
    background: var(--bg-alt);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Sections */
.section {
    padding: 8rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.section-alt {
    max-width: 100%;
    background: var(--bg-alt);
}

.section-alt > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.section-intro {
    font-size: 1.25rem;
    color: var(--fg);
    margin-bottom: 3rem;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.about-text p {
    color: var(--fg-muted);
    margin-bottom: 1rem;
}

.skills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.skill-card {
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.skill-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
}

.skill-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.skill-card span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Projects */
.projects {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card {
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.project-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
}

.project-card h3 {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.project-card:hover h3 {
    color: var(--primary);
}

.project-card p {
    color: var(--fg-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-alt);
    border-radius: 4px;
    color: var(--fg-muted);
}

/* Contact */
#contact {
    text-align: center;
}

.contact-title {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-desc {
    color: var(--fg-muted);
    max-width: 400px;
    margin: 0 auto 2rem;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-muted);
    transition: all 0.2s ease;
}

.social-link:hover {
    color: var(--fg);
    border-color: rgba(34, 211, 238, 0.4);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    padding: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.footer p:first-child {
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .skills {
        grid-template-columns: 1fr 1fr;
    }

    .section {
        padding: 5rem 1.5rem;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .skills {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

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

.animate {
    animation: fade-up 0.6s ease forwards;
}

/* Selection */
::selection {
    background: rgba(34, 211, 238, 0.3);
}

/* 404 Page */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg);
}

.error-page .hero-tag {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.error-code {
    font-family: var(--font-mono);
    font-size: clamp(6rem, 20vw, 12rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
    color: var(--fg);
}

.error-code span {
    color: var(--primary);
}

.error-message {
    max-width: 400px;
    margin: 0 auto 2rem;
    color: var(--fg-muted);
    font-size: 1.125rem;
}