/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --border: rgba(255, 255, 255, 0.06);
    --gradient-1: #6366f1;
    --gradient-2: #8b5cf6;
    --gradient-3: #a855f7;
    --font-sans: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.75rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    position: relative;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--accent);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 0.75rem 1.25rem;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

.nav-menu a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 5.5rem max(1rem, env(safe-area-inset-left)) 4rem max(1rem, env(safe-area-inset-right));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-1);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-2);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--gradient-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-greeting {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-name {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.25rem;
}

.hero-availability {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-availability strong {
    color: var(--accent);
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 600px) {
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2rem 3rem;
    }
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.5; transform: scaleY(0.5); }
}

/* ===== Sections ===== */
.section {
    padding: 5rem 2rem;
    position: relative;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    opacity: 0.8;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-visual {
    min-width: 0;
    max-width: 100%;
}

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

.about-text strong {
    color: var(--text-primary);
}

.about-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.badge {
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent);
}

.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(0.875rem, 3vw, 1.5rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.code-keyword {
    color: #c792ea;
}

.code-string {
    color: #c3e88d;
}

/* ===== Services Section ===== */
.services {
    background: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.service-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.service-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.service-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Experience Section ===== */
.experience-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: var(--transition);
}

.experience-block:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.experience-block-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.experience-block-years {
    display: block;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-intro {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 560px;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.experience-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.experience-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.experience-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.experience-list li:last-child {
    margin-bottom: 0;
}

.experience-tags {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* ===== Projects Section ===== */
.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.project-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.project-icon {
    font-size: 1.5rem;
}

.project-tags {
    font-size: 0.75rem;
    color: var(--accent);
    font-family: var(--font-mono);
    line-height: 1.4;
    word-break: break-word;
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.projects-more {
    text-align: center;
    margin-top: 2rem;
}

.projects-link {
    color: var(--accent);
    font-weight: 500;
}

.projects-link:hover {
    text-decoration: underline;
}

/* ===== Skills Section ===== */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.skill-category:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.skill-category h3 {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.skill-tag {
    padding: 0.4rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* ===== Education Section ===== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.5rem;
}

.education-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
}

.education-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.education-card.certification {
    border-color: rgba(99, 102, 241, 0.2);
}

.edu-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.education-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.education-card h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.education-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 1rem;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-ctas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.contact-cta-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.contact-cta-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.contact-cta-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    max-width: 100%;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    transition: var(--transition);
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contact-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.contact-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .nav-menu {
        display: none;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        align-content: stretch;
        gap: 0;
        background: var(--bg-secondary);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        padding: 0.75rem 1rem 1.25rem;
        border-top: 1px solid var(--border);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
        order: 3;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 0.65rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-logo {
        order: 1;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
        order: 2;
    }

    .section {
        padding: 3.5rem 1rem;
    }

    .section-title {
        margin-bottom: 2rem;
        flex-wrap: wrap;
    }

    .section-intro {
        margin-bottom: 1.75rem;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

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

    .about-visual {
        order: -1;
    }

    .code-block pre {
        font-size: 0.75rem;
    }

    .contact-ctas {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: min(280px, 100%);
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }

    .hero {
        padding-top: 5rem;
        padding-left: max(0.875rem, env(safe-area-inset-left));
        padding-right: max(0.875rem, env(safe-area-inset-right));
    }

    .hero-name {
        letter-spacing: -1px;
    }

    .hero-availability {
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .scroll-indicator {
        bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .experience-block {
        padding: 1.25rem;
    }

    .experience-list li {
        font-size: 0.85rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-link {
        width: 100%;
    }

    .contact-content {
        padding: 0.5rem 0;
    }
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
