/* ===========================
   Modern Portfolio — Styles
   =========================== */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #f1f5f9;
    --bg-card-hover: #e8eef4;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --accent-glow: rgba(37, 99, 235, 0.08);
    --border: #e2e8f0;
    --gradient-start: #2563eb;
    --gradient-end: #7c3aed;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Background gradient */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.04), transparent),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(124, 58, 237, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

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

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 60px;
}

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

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

.hero-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

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

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

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

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

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

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

.hero-social a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
}

.hero-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-3px);
}

.hero-image {
    display: flex;
    justify-content: center;
}

.profile-pic-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
}

.profile-pic-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    opacity: 0.6;
    z-index: 0;
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    border: 4px solid var(--bg-primary);
}

/* ===========================
   Sections General
   =========================== */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 48px;
    letter-spacing: -0.5px;
}

.title-number {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
    margin-right: 10px;
}

/* ===========================
   About Section
   =========================== */
.about-content {
    max-width: 700px;
}

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

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

.about-details {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.detail-item i {
    color: var(--accent);
    font-size: 1rem;
}

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

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

.skill-category:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.skill-category h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category h3 i {
    color: var(--accent);
    font-size: 1.1rem;
}

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

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.15);
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background: rgba(37, 99, 235, 0.15);
}

/* ===========================
   Timeline / Experience
   =========================== */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--gradient-end), transparent);
    border-radius: 2px;
}

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

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

.timeline-marker {
    position: absolute;
    left: -38px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent);
    z-index: 2;
}

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

.timeline-content:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-card-hover);
}

.timeline-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    display: block;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.timeline-date {
    display: block;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.timeline-list {
    list-style: none;
    padding: 0;
}

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

.timeline-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.9rem;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

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

.project-icon {
    color: var(--accent);
    font-size: 2rem;
}

.project-link {
    color: var(--text-muted);
    font-size: 1.3rem;
    text-decoration: none;
    transition: var(--transition);
}

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

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 20px;
}

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

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-tech span:not(:last-child)::after {
    content: ' · ';
    color: var(--border);
    margin-left: 8px;
}

/* ===========================
   Testimonial Section
   =========================== */
.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    position: relative;
    transition: var(--transition);
}

.testimonial-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-card-hover);
}

.testimonial-quote-icon {
    color: var(--accent);
    font-size: 2rem;
    opacity: 0.4;
    margin-bottom: 20px;
    display: block;
}

.testimonial-text {
    margin: 0;
    padding: 0;
    border: none;
    font-style: normal;
}

.testimonial-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

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

.testimonial-author {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.testimonial-role {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

/* ===========================
   Interests Section
   =========================== */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.interest-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.interest-item:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

.interest-item i {
    color: var(--accent);
    font-size: 1.3rem;
}

.interest-item span {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* ===========================
   Footer
   =========================== */
.footer {
    text-align: center;
    padding: 100px 0 40px;
    position: relative;
    z-index: 1;
}

.footer .section-title {
    margin-bottom: 20px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 48px;
}

.footer-social a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--border);
}

.footer-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-3px);
}

.footer-credit {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

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

/* Stagger children */
.timeline-item.reveal { transition-delay: 0.1s; }
.timeline-item.reveal:nth-child(2) { transition-delay: 0.2s; }
.timeline-item.reveal:nth-child(3) { transition-delay: 0.3s; }
.timeline-item.reveal:nth-child(4) { transition-delay: 0.4s; }

.skill-category.reveal:nth-child(2) { transition-delay: 0.1s; }
.skill-category.reveal:nth-child(3) { transition-delay: 0.2s; }
.skill-category.reveal:nth-child(4) { transition-delay: 0.3s; }

.interest-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.interest-item.reveal:nth-child(3) { transition-delay: 0.2s; }
.interest-item.reveal:nth-child(4) { transition-delay: 0.3s; }

.publication-card.reveal:nth-child(2) { transition-delay: 0.15s; }

.metric-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.metric-item.reveal:nth-child(3) { transition-delay: 0.2s; }
.metric-item.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ===========================
   Typing Animation
   =========================== */
.typing-wrapper {
    display: inline-flex;
    align-items: center;
}

.typing-text {
    color: var(--accent);
    font-weight: 600;
}

.typing-cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 300;
    margin-left: 2px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===========================
   Impact Metrics
   =========================== */
.metrics {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.02), transparent);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
}

.metric-item {
    padding: 24px 16px;
}

.metric-number {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.metric-suffix {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===========================
   Company Logos
   =========================== */
.company-logo {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 3px;
    filter: brightness(0.9);
}

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

.publication-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.publication-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    opacity: 0;
    transition: var(--transition);
}

.publication-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08);
}

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

.publication-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.publication-platform {
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.publication-platform i {
    font-size: 1rem;
}

.publication-date {
    color: var(--text-muted);
}

.publication-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.publication-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.publication-stats {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.publication-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.publication-stats i {
    color: var(--accent);
    font-size: 0.75rem;
}

.publications-cta {
    text-align: center;
    margin-top: 32px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 1px solid var(--border);
    }

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

    .nav-toggle {
        display: block;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

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

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

    .profile-pic-wrapper {
        width: 200px;
        height: 200px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .about-details {
        flex-direction: column;
        gap: 16px;
    }

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

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

    .interests-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .metric-number {
        font-size: 2.2rem;
    }

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

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

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

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

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

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

/* ===========================
   Selection Color
   =========================== */
::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}