/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --gradient-1: linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-2: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

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

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 60px;
    text-align: center;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-md);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

.nav-link--cta {
    background: var(--gradient-1);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
}

.nav-link--cta::after {
    display: none;
}

.nav-link--cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

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

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    background: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.hero-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.tag {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-light);
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

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

.hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}

.hero-social a:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-2px);
}

/* Hero Visual - Photo + Code Block */
.hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
    padding-bottom: 60px;
}

.profile-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.profile-frame {
    padding: 4px;
    border-radius: var(--radius-xl);
    background: var(--gradient-2);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.25);
    transform: rotate(2deg);
    transition: transform 0.4s ease;
}

.profile-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.profile-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 20%;
    border-radius: calc(var(--radius-xl) - 4px);
}

.profile-badge {
    position: absolute;
    top: 20px;
    left: -24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-visual .code-block {
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 300px;
    max-width: 80%;
    font-size: 0.85em;
}

.hero-visual .code-block pre {
    padding: 14px 18px;
    font-size: 0.7rem;
    line-height: 1.6;
}

.hero-visual .code-header {
    padding: 8px 14px;
}

@media (prefers-reduced-motion: reduce) {
    .badge-dot { animation: none; }
    .profile-frame { transition: none; }
}

.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
}

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

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

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.code-block pre {
    padding: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-keyword { color: #c084fc; }
.code-variable { color: #67e8f9; }
.code-property { color: #93c5fd; }
.code-string { color: #86efac; }

/* ===== About Section ===== */
.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

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

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

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

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

.skill-category:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.skill-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    margin-bottom: 20px;
}

.skill-category h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tags span {
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-tags span:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ===== Experience Section ===== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -6px;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gradient-1);
    box-shadow: 0 0 0 4px var(--bg-dark);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.timeline-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.company {
    color: var(--primary-light);
    font-weight: 500;
    font-size: 0.95rem;
}

.company a {
    color: var(--primary-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.company a:hover {
    border-bottom-color: var(--primary-light);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.08);
    padding: 4px 12px;
    border-radius: 50px;
}

.timeline-details {
    list-style: none;
}

.timeline-details li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-details li:last-child {
    margin-bottom: 0;
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    position: relative;
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card.featured {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.05));
}

.project-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-1);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tech span {
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-light);
}

.project-link:hover {
    color: var(--text-primary);
}

/* ===== Education Section ===== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.education-card,
.certifications-card,
.awards-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.education-card:hover,
.certifications-card:hover,
.awards-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.education-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    margin-bottom: 20px;
}

.education-card h3,
.certifications-card h3,
.awards-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.education-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.education-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cert-list {
    list-style: none;
    margin-top: 12px;
}

.cert-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

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

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

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-darker);
    text-align: center;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: -40px auto 48px;
    line-height: 1.7;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 32px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text-secondary);
}

.contact-card:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-card svg {
    flex-shrink: 0;
    color: var(--primary-light);
}

.contact-card span {
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

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

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-name {
        font-size: 2.75rem;
    }

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

    .hero-description {
        margin: 0 auto 32px;
    }

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

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

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 32px 24px;
        gap: 24px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-toggle {
        display: flex;
    }

    .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);
    }

    .section {
        padding: 70px 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 40px;
    }

    .hero-name {
        font-size: 2.2rem;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .hero-visual {
        padding-bottom: 0;
        order: -1;
    }

    .hero-visual .code-block {
        display: none;
    }

    .profile-wrap {
        max-width: 260px;
    }

    .profile-badge {
        left: 50%;
        top: auto;
        bottom: -14px;
        transform: translateX(-50%);
        white-space: nowrap;
    }

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

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        padding-left: 30px;
    }

    .timeline-content {
        padding: 24px;
    }

    .timeline-header {
        flex-direction: column;
    }

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

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

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

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

@media (max-width: 480px) {
    .hero-name {
        font-size: 1.8rem;
    }

    .stat-card {
        padding: 16px;
    }

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

    .skill-category {
        padding: 24px;
    }

    .timeline-content {
        padding: 20px;
    }

    .project-card {
        padding: 24px;
    }
}
