/* ==========================================================================
   Design System & Modern CSS Variables
   ========================================================================== */
:root {
    /* Color Palette - Dark Theme (Default) */
    --bg-primary: #0b0f17;
    --bg-secondary: #111827;
    --surface-card: #161f30;
    --surface-hover: #1e293b;
    --surface-border: #243047;
    --surface-border-subtle: #1c2638;

    /* Typography Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0b0f17;

    /* Accent & Brand Colors */
    --accent-cyan: #38bdf8;
    --accent-cyan-glow: rgba(56, 189, 248, 0.15);
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-amber: #f59e0b;

    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.45);
    --glow-cyan: 0 0 25px rgba(56, 189, 248, 0.25);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', SFMono-Regular, Consolas, monospace;

    /* Sizing & Layout */
    --max-width: 1040px;
    --nav-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --surface-card: #ffffff;
    --surface-hover: #f8fafc;
    --surface-border: #e2e8f0;
    --surface-border-subtle: #edf2f7;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --accent-cyan: #0284c7;
    --accent-cyan-glow: rgba(2, 132, 199, 0.12);
    --accent-indigo: #4f46e5;
    --accent-teal: #0d9488;
    --accent-amber: #d97706;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08);
    --glow-cyan: 0 0 20px rgba(2, 132, 199, 0.15);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 1.5rem);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography Helpers */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--surface-border-subtle);
}

.section:last-of-type {
    border-bottom: none;
}

.section-header {
    margin-bottom: 3rem;
}

.section-subtitle {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(11, 15, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-border-subtle);
    z-index: 1000;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] .header {
    background: rgba(248, 250, 252, 0.9);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.logo-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.nav-profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-logo:hover .nav-profile-img {
    transform: scale(1.06);
    box-shadow: var(--glow-cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-cyan);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Card & Surface Smooth Transitions on Theme Switch */
.about-card, .skill-card, .project-card, .cert-card, .social-card, .detail-card, .hero-tag, .header, .footer {
    transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

/* Mobile Hamburger Toggle */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-cyan);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: var(--glow-cyan);
}

.btn-outline {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding-top: calc(var(--nav-height) + 4rem);
    padding-bottom: 5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3.5rem;
    align-items: center;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-headline {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hero-institution {
    font-size: 1.1rem;
    color: var(--accent-indigo);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.hero-bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.75rem;
    max-width: 620px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-avatar-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-avatar {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.hero-avatar:hover {
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-4px);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.about-text {
    font-size: 1.08rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 1.5rem;
}

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

.highlight-accent {
    color: var(--accent-cyan);
    font-weight: 600;
}

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

.skill-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    transition: all var(--transition-normal);
}

.skill-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.skill-category-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface-border-subtle);
}

.skill-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.skill-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.skill-level {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    background: var(--accent-cyan-glow);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Academic Timeline Section
   ========================================================================== */
.timeline {
    position: relative;
    border-left: 2px solid var(--surface-border);
    margin-left: 1rem;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

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

.timeline-dot {
    position: absolute;
    top: 4px;
    left: calc(-2rem - 7px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
}

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

.timeline-institution {
    font-size: 1rem;
    color: var(--accent-indigo);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.timeline-desc {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==========================================================================
   Projects Section & Cards
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
}

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

.project-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    background: var(--accent-cyan-glow);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

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

.project-title {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
}

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

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--surface-border);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
}

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

.cert-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition-normal);
}

.cert-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cert-badge-img-wrapper {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-bottom: 1.5rem;
}

.cert-badge-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cert-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.cert-issuer {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 1rem;
}

.cert-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.social-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.social-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--accent-cyan);
}

.social-icon {
    width: 44px;
    height: 44px;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.social-meta {
    display: flex;
    flex-direction: column;
}

.social-name {
    font-size: 1.05rem;
    font-weight: 600;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--surface-border-subtle);
    background: var(--bg-primary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.back-to-top:hover {
    color: var(--accent-cyan);
}

/* ==========================================================================
   Project Detail / Projects Catalog Page Styles
   ========================================================================== */
.projects-header {
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 2.5rem;
}

.back-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.back-breadcrumb:hover {
    color: var(--accent-cyan);
}

.project-search-bar {
    width: 100%;
    max-width: 450px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    margin-bottom: 2.5rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.project-search-bar:focus {
    border-color: var(--accent-cyan);
}

/* Project Detail View */
.detail-container {
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 5rem;
}

.detail-header {
    margin-bottom: 2.5rem;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.detail-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.detail-card-title {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--surface-border-subtle);
    padding-bottom: 0.75rem;
}

.detail-content {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.85;
}

.detail-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.detail-highlights li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.detail-highlights li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-avatar-wrapper {
        order: -1;
    }

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

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

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--surface-border);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        display: none;
    }

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

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.25rem;
    }

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

    .hero-avatar {
        width: 180px;
        height: 180px;
    }

    .about-card, .project-card, .detail-card {
        padding: 1.5rem;
    }
}
