/* ========================================
   AI Portfolio — Design System & Styles
   ======================================== */

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

:root {
    /* Core palette */
    --bg-deep:       #060611;
    --bg-surface:    #0c0c24;
    --bg-card:       rgba(15, 15, 40, 0.6);
    --bg-card-hover: rgba(20, 20, 55, 0.8);

    /* Accent colors */
    --accent-blue:   #00d4ff;
    --accent-purple: #8b5cf6;
    --accent-cyan:   #06b6d4;
    --accent-pink:   #ec4899;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, #00d4ff, #8b5cf6);
    --gradient-card: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(139,92,246,0.08));
    --gradient-glow: linear-gradient(135deg, rgba(0,212,255,0.3), rgba(139,92,246,0.3));

    /* Text */
    --text-primary:   #e8e8f0;
    --text-secondary: #9898b8;
    --text-muted:     #5a5a7e;

    /* Borders */
    --border-subtle:  rgba(139, 92, 246, 0.15);
    --border-glow:    rgba(0, 212, 255, 0.3);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 120px 0;
    --container-width: 1100px;

    /* Effects */
    --glass-bg: rgba(15, 15, 40, 0.5);
    --glass-blur: blur(20px);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Neural Network Canvas Background --- */
#neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Gradient Text --- */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

#navbar.scrolled {
    background: rgba(6, 6, 17, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 0;
}

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

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

.logo-bracket {
    color: var(--accent-blue);
}

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

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

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

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

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

/* Hamburger */
.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);
    transition: var(--transition);
    border-radius: 2px;
}

.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 Section
   ======================================== */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
}

.hero-content {
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-blue);
    border: 1px solid var(--border-glow);
    border-radius: 999px;
    padding: 8px 20px;
    margin-bottom: 28px;
    background: rgba(0, 212, 255, 0.05);
    animation: fadeInDown 0.8s ease-out;
}

.hero-title {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -2px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--accent-purple);
    margin-bottom: 20px;
    min-height: 2em;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--accent-blue);
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 36px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
}

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

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.08);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.05rem;
    border-radius: 14px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    animation: fadeInUp 1s ease-out 1.2s both;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.mouse-wheel {
    width: 4px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 2px;
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease-in-out infinite;
}

/* ========================================
   Sections (General)
   ======================================== */
.section {
    position: relative;
    z-index: 1;
    padding: var(--section-padding);
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.section-number {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 0.9em;
    margin-right: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 48px;
}

.subsection-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

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

.about-text strong {
    color: var(--accent-blue);
    font-weight: 600;
}

.education-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}

.edu-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.edu-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.edu-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.edu-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.edu-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-blue);
    margin-top: 4px;
    display: block;
}

/* ========================================
   Projects Section
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 28px;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.1);
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.12);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.3;
}

.project-card > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.project-details {
    list-style: none;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-details li {
    position: relative;
    padding-left: 18px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.project-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 700;
}

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

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(6, 182, 212, 0.15);
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--accent-blue);
}

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

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 28px;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}

.skill-category:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

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

.skill-category h3 {
    font-size: 1rem;
    font-weight: 700;
}

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

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.06);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.12);
    transition: var(--transition);
}

.skill-tag:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

/* ========================================
   Experience / Timeline
   ======================================== */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 48px auto 0;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
    z-index: 2;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 22px 24px;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}

.timeline-content:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.timeline-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-bottom: 6px;
    display: block;
}

.timeline-year.award {
    color: var(--accent-pink);
}

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

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* ========================================
   Contact Section
   ======================================== */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

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

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 36px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}

.contact-item:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    transform: translateX(4px);
}

.contact-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.contact-icon svg {
    fill: currentColor;
}

/* ========================================
   Footer
   ======================================== */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 24px;
    border-top: 1px solid var(--border-subtle);
}

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

.footer-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

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

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

/* ========================================
   Keyframe Animations
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scrollWheel {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

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

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

@media (max-width: 768px) {
    :root {
        --section-padding: 80px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: rgba(6, 6, 17, 0.97);
        backdrop-filter: var(--glass-blur);
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.4s ease;
        border-left: 1px solid var(--border-subtle);
    }

    .nav-links.open {
        right: 0;
    }

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

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

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

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

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