/* ===== Base & Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --bg-alt: #111119;
    --surface: #1a1a25;
    --text: #e4e4e7;
    --text-muted: #8888a0;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.3);
    --gradient: linear-gradient(135deg, #6c63ff, #3b82f6);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

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

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    padding: 12px 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.nav-logo .cursor {
    color: var(--accent);
    animation: blink 1.06s step-end infinite;
}

.nav-logo .cursor.blink-off {
    opacity: 0;
}

@keyframes blink {
    50% { opacity: 0; }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 36px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: color 0.2s;
    letter-spacing: 0.3px;
}

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

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 40px 80px;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent);
    font-family: var(--mono);
    margin-bottom: 12px;
}

.hero-name {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Code Block */
.hero-visual {
    flex-shrink: 0;
}

.code-block {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.code-header {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-content {
    padding: 20px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
    overflow-x: auto;
}

.code-content .kw { color: #c678dd; }
.code-content .cls { color: #e5c07b; }
.code-content .fn { color: #61afef; }
.code-content .str { color: #98c379; }

/* ===== Sections ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 60px;
    text-align: center;
}

.section-title .accent {
    color: var(--accent);
    font-family: var(--mono);
    margin-right: 8px;
}

/* ===== About ===== */
.about-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.9;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.skill-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.skill-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
}

.skill-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.skill-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Contact ===== */
.contact-content {
    text-align: center;
}

.contact-content > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 20px 36px;
    color: var(--text);
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.contact-card span {
    font-weight: 600;
    font-size: 1rem;
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px 0;
    text-align: center;
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.skill-card.reveal {
    transition-delay: calc(var(--i, 0) * 0.08s);
}

.skill-card:nth-child(1) { --i: 0; }
.skill-card:nth-child(2) { --i: 1; }
.skill-card:nth-child(3) { --i: 2; }
.skill-card:nth-child(4) { --i: 3; }
.skill-card:nth-child(5) { --i: 4; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        gap: 48px;
        text-align: center;
        padding-top: 100px;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
    }

    .code-block {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .nav-container {
        padding: 0 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .container {
        padding: 0 20px;
    }

    .section {
        padding: 72px 0;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }
}
