/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --bg-primary: #13131a;
    --bg-secondary: #1a1a24;
    --bg-card: #24243a;
    --text-primary: #f0f0f5;
    --text-secondary: #b0b0ba;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-dim: rgba(59, 130, 246, 0.15);
    --border: #34344a;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Syne', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
}

h1, h2, h3, .job-title {
    font-family: var(--font-display);
}

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

html {
    scroll-behavior: smooth;
}

/* ============================================
   Scroll Animations
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
.animate-on-scroll.visible .skill-category:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll.visible .skill-category:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll.visible .skill-category:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll.visible .skill-category:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll.visible .skill-category:nth-child(5) { transition-delay: 0.5s; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(96, 165, 250, 0.02) 0%, transparent 40%);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

/* ============================================
   Navigation
   ============================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 0 2rem;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    z-index: 101;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

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

.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(ellipse at 50% 30%, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    position: relative;
    overflow: hidden;
}

#heroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

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

.scroll-indicator {
    z-index: 1;
}

.hero-content .tagline {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 400;
    animation: blink 0.7s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Scroll indicator */
.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-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
    animation: bounce 2s infinite;
    cursor: pointer;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

.hero-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.hero-links a {
    color: var(--text-secondary);
}

.hero-links a:hover {
    color: var(--accent-hover);
}

.separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ============================================
   Sections (Shared)
   ============================================ */
section {
    padding: 5rem 2rem;
}

.section-content {
    max-width: 900px;
    margin: 0 auto;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

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

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 1rem;
}

.about-text:last-child {
    margin-bottom: 0;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
}

/* Project Card Overlay */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(19, 19, 26, 0.95) 60%, rgba(19, 19, 26, 0.98) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-overlay-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-overlay-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.project-overlay-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.project-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

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

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.project-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

.skill-category:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.skill-category h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
}

.skill-list li {
    padding: 0.6rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-list li::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-dim);
    border-radius: 50%;
    border: 1px solid var(--accent);
}

/* Skill proficiency indicators */
.skill-list li[data-level="expert"]::after {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.skill-list li[data-level="advanced"]::after {
    background: var(--accent);
}

.skill-list li[data-level="intermediate"]::after {
    background: var(--accent-dim);
}

/* ============================================
   Experience Section
   ============================================ */
#experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent 0%, var(--accent) 10%, var(--accent-hover) 90%, transparent 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.2);
}

.timeline-item {
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(2px - 1.5rem);
    top: 1.75rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 0 10px rgba(59, 130, 246, 0.7);
    z-index: 1;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.company {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.location {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.dates {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.responsibilities {
    padding-left: 1.25rem;
}

.responsibilities li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    position: relative;
}

.responsibilities li::before {
    content: '▸';
    position: absolute;
    left: -1.25rem;
    color: var(--accent);
}

/* ============================================
   Scroll to Top Button
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
    transition: stroke 0.2s ease;
}

.scroll-to-top:hover svg {
    stroke: white;
}

/* ============================================
   Currently Learning Section
   ============================================ */
#learning {
    background: var(--bg-secondary);
}

.learning-grid {
    display: grid;
    gap: 1.5rem;
}

.learning-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.learning-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(8px);
}

.learning-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.learning-content {
    flex: 1;
}

.learning-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.learning-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.learning-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 2px;
    transition: width 1s ease;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Animate progress bars when section becomes visible */
.animate-on-scroll.visible .progress-bar {
    animation: progressGrow 1s ease forwards;
}

@keyframes progressGrow {
    from { width: 0; }
}

/* ============================================
   Contact Section
   ============================================ */
#contact {
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.contact-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    padding: 0.875rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.contact-link:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    section {
        padding: 3rem 1.5rem;
    }

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