/* Inter font loaded via <link> in HTML for better performance */

:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #38bdf8;
    --font-main: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

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

/* Screen-reader only (visually hidden, crawlable by search engines) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation */
.navbar {
    position: relative;
    width: 100%;
    padding: 1rem 0;
    z-index: 100;
    background: transparent;
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    background: var(--text-primary);
    color: var(--bg-color);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

/* View All Button */
.view-all-container {
    text-align: center;
    margin-top: 3rem;
}

.view-all-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 99px;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.view-all-btn:hover {
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
}

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

/* Background Effects */
.background-glow {
    position: fixed;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, rgba(0, 0, 0, 0) 60%);
    top: -400px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -2;
    pointer-events: none;
}

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

/* Layout Grid for Header */
header {
    margin-top: 0;
    margin-bottom: 5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: start;
}

.page-header {
    margin: 0 0 3rem 0;
    display: block;
}

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

.profile-image-container {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--card-border);
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.1);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 100%;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Bio List (Hero Section) */
.bio-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bio-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.bio-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
    display: inline-block;
}

.bio-text {
    font-weight: 400;
}


/* Social Icons */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.social-icon {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all var(--transition-speed);
}

.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Section Titles */
.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

/* Experience Section */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 5rem;
}

.experience-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all var(--transition-speed);
}

.experience-card:hover {
    border-color: var(--card-hover-border);
    background: rgba(255, 255, 255, 0.04);
}

/* Company Logo Container */
.company-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    overflow: hidden;
    padding: 5px;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.exp-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.exp-role {
    color: var(--accent-color);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.exp-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Project Grid (Home Page) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Project List (Projects Page - Horizontal Layout) */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-jump-nav {
    position: sticky;
    top: 0.75rem;
    z-index: 90;
    margin-bottom: 2.5rem;
    padding: 0.65rem;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 26px -18px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    isolation: isolate;
}

.project-jump-nav::after {
    content: '';
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -26px;
    height: 28px;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(5, 5, 5, 0.92) 0%,
            rgba(5, 5, 5, 0.65) 45%,
            rgba(5, 5, 5, 0) 100%);
}

.jump-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.jump-link:hover,
.jump-link.active {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.jump-progress-track {
    flex-basis: 100%;
    width: 100%;
    height: 2px;
    margin-top: 0.2rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.jump-progress-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.6), rgba(56, 189, 248, 1));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.16s ease-out;
}

.project-groups {
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
}

.project-group-header {
    margin-bottom: 1.25rem;
    position: relative;
}

.project-group {
    scroll-margin-top: 200px;
}

.group-chip {
    display: inline-block;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.group-intro {
    margin-top: 0.7rem;
    color: var(--text-secondary);
    max-width: 620px;
}

/* Project Detail Page */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
    min-height: 80vh;
}

.detail-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 4rem;
}

.detail-icon-container {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-icon-container i {
    font-size: 3.5rem;
    color: var(--text-primary);
}

.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.detail-tag {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d4d4d8;
    margin-bottom: 3rem;
    max-width: 800px;
}

.tech-highlights h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.tech-list {
    list-style: none;
    padding: 0;
    margin-bottom: 4rem;
}

.tech-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.tech-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 4rem;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

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

.detail-footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    padding-top: 3rem;
    border-top: 1px solid var(--card-border);
}

.detail-footer-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.detail-footer-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Base Card Style */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Grid Layout specific (Default vertical card) */
.project-grid .project-card {
    height: 100%;
    padding: 2rem;
}

/* Horizontal List Layout specific */
.project-list .project-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    padding: 2rem;
    align-items: start;
}

/* Hover effects */
.project-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.04);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

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

.card-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-grid .card-content {
    margin-bottom: 0;
}

/* Project Links Container (New) */
.project-links-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.github-repo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.github-repo-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Learn More Link */
.learn-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.learn-more-link:hover {
    opacity: 0.8;
}

.learn-more-link i {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.learn-more-link:hover i {
    transform: translateX(4px);
}

/* Project Thumbnail (Left side in list view) */
.project-thumbnail {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.project-grid .project-thumbnail {
    display: none;
    /* Hide in grid view */
}

/* Link Wrapper behavior */
.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    z-index: 2;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer */
footer {
    margin-top: 6rem;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
    /* Center the social links */
}

/* Reusing .social-links inside footer if present */
/* We will likely just redefine or reuse the block */

/* ========================================
   Responsive — Tablets & Mobile
   ======================================== */
@media (max-width: 768px) {

    /* --- Container & Spacing --- */
    .container {
        padding: 1.25rem;
    }

    /* --- Navigation --- */
    .nav-container {
        padding: 0 1rem;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.45rem 1rem;
    }

    /* --- Header / Hero --- */
    header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        margin-bottom: 2.5rem;
    }

    .header-content {
        margin: 0 auto;
        max-width: 100%;
    }

    h1 {
        font-size: 2.2rem;
        margin-bottom: 0.75rem;
    }

    .subtitle {
        white-space: normal;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .profile-image-container {
        margin: 0 auto 1rem;
        width: 110px;
        height: 110px;
        order: -1;
    }

    /* --- Bio Items: left-aligned even when header is centered --- */
    .bio-list {
        align-items: flex-start;
        padding: 0 0.25rem;
    }

    .bio-item {
        text-align: left;
        font-size: 0.88rem;
        gap: 0.65rem;
    }

    .bio-icon {
        font-size: 1.2rem;
        width: 26px;
        flex-shrink: 0;
    }

    .social-links {
        justify-content: center;
        gap: 1.25rem;
    }

    .social-icon {
        font-size: 1.35rem;
    }

    .project-jump-nav {
        position: sticky;
        top: 0.5rem;
        gap: 0.45rem;
    }

    .project-jump-nav::after {
        bottom: -20px;
        height: 22px;
    }

    .project-groups {
        gap: 2.5rem;
    }

    .project-group {
        scroll-margin-top: 170px;
    }

    .project-group-header {
        position: relative;
    }

    .detail-container {
        padding: 2rem 1.25rem 4rem;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .detail-icon-container {
        padding: 1.25rem;
    }

    .detail-icon-container i {
        font-size: 2.5rem;
    }

    .detail-title {
        font-size: 1.8rem;
    }

    .detail-subtitle {
        font-size: 0.95rem;
    }

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

    .detail-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .tech-highlights h3 {
        font-size: 1.2rem;
    }

    .tech-list li {
        font-size: 0.92rem;
    }

    .back-link {
        font-size: 0.9rem;
        margin-bottom: 2.5rem;
        padding: 0.5rem 0;
    }

    .detail-footer-links {
        justify-content: center;
    }

    /* --- Section Titles --- */
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    /* --- Experience Cards --- */
    .experience-list {
        gap: 1.25rem;
        margin-bottom: 3rem;
    }

    .experience-card {
        grid-template-columns: 56px 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }

    .company-logo {
        width: 56px;
        height: 56px;
        border-radius: 10px;
    }

    .exp-content h3 {
        font-size: 1.15rem;
    }

    .exp-role {
        font-size: 0.95rem;
    }

    .exp-desc {
        font-size: 0.85rem;
    }

    /* --- Project Grid (Home Page) --- */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-grid .project-card {
        padding: 1.5rem;
    }

    /* --- Project List (Projects Page) --- */
    .project-list .project-card {
        grid-template-columns: 56px 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }

    .project-thumbnail {
        width: 56px;
        height: 56px;
        border-radius: 10px;
        font-size: 1.4rem;
    }

    /* --- Card Content --- */
    .project-title {
        font-size: 1.15rem;
    }

    .project-desc {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .project-links-container {
        gap: 1rem;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
    }

    .github-repo-link {
        font-size: 0.78rem;
        padding: 0.3rem 0.6rem;
    }

    .learn-more-link {
        font-size: 0.85rem;
    }

    /* --- Page Header (Projects Page) --- */
    .page-header {
        margin-bottom: 2rem;
        text-align: center;
    }

    /* --- View All Button --- */
    .view-all-btn {
        font-size: 0.9rem;
        padding: 0.7rem 1.5rem;
    }

    .view-all-container {
        margin-top: 2rem;
    }

    /* --- Footer --- */
    footer {
        margin-top: 3rem;
        padding: 2rem 0;
    }

    /* --- Card hover: reduce lift on mobile --- */
    .project-card:hover {
        transform: translateY(-2px);
    }
}

/* ========================================
   Responsive — Small Phones (≤ 380px)
   ======================================== */
@media (max-width: 380px) {

    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.88rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .profile-image-container {
        width: 90px;
        height: 90px;
    }

    .bio-item {
        font-size: 0.82rem;
    }

    .jump-link {
        font-size: 0.74rem;
    }

    .group-intro {
        font-size: 0.86rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-jump-nav,
    .project-jump-nav::after,
    .jump-progress-fill,
    .project-card,
    .social-icon,
    .view-all-btn,
    .detail-footer-icon,
    .learn-more-link i {
        transition: none;
    }
}