/* ============================================================
   CSS Custom Properties — Dark (default) & Light themes
   ============================================================ */
:root {
    --bg:        #1a1b2e;
    --bg-2:      #20213a;
    --bg-card:   #252640;
    --text:      #e2e8f0;
    --text-2:    #94a3b8;
    --text-muted:#64748b;
    --accent:    #60a5fa;
    --accent-hov:#93c5fd;
    --green:     #4ade80;
    --orange:    #fb923c;
    --border:    #2d3058;
    --tag-bg:    #2a2d52;
    --tag-text:  #a5b4fc;
    --nav-bg:    rgba(26, 27, 46, 0.95);
    --shadow:    0 4px 24px rgba(0, 0, 0, 0.35);
    --radius:    12px;
    --transition:0.2s ease;
}

[data-theme="light"] {
    --bg:        #f8fafc;
    --bg-2:      #f1f5f9;
    --bg-card:   #ffffff;
    --text:      #1e293b;
    --text-2:    #475569;
    --text-muted:#94a3b8;
    --accent:    #2563eb;
    --accent-hov:#1d4ed8;
    --green:     #16a34a;
    --orange:    #ea580c;
    --border:    #e2e8f0;
    --tag-bg:    #eff6ff;
    --tag-text:  #2563eb;
    --nav-bg:    rgba(248, 250, 252, 0.95);
    --shadow:    0 4px 24px rgba(0, 0, 0, 0.08);
}

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

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-hov);
    text-decoration: underline;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-container {
    padding-top: 3rem;
    padding-bottom: 6rem;
}

/* ============================================================
   Theme Toggle
   ============================================================ */
.theme-toggle-wrapper {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
}

.theme-toggle {
    display: flex;
    gap: 0.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.3rem;
    box-shadow: var(--shadow);
    transition: background var(--transition), border-color var(--transition);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    transition: all var(--transition);
    line-height: 1;
}
.theme-btn:hover {
    color: var(--text);
    background: var(--bg-2);
}
.theme-btn.active {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   Header
   ============================================================ */
.header {
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
}

.header-photo-wrap {
    flex-shrink: 0;
    width: 210px;
    height: 210px;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.header-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* shown by JS on successful load */
    border-radius: var(--radius);
}

.header-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    border-radius: var(--radius);
}

.header-text {
    flex: 1;
    padding-top: 0.25rem;
}

.header-name {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.header-contact {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.header-contact a {
    color: var(--text-2);
}
.header-contact a:hover {
    color: var(--accent);
    text-decoration: none;
}
.dot {
    opacity: 0.5;
}

.header-bio {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.header-labels {
    margin-bottom: 1.1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.label-orange { color: var(--orange); }
.label-green  { color: var(--green);  }
.label-white  { color: var(--text);   }

.header-socials {
    display: flex;
    gap: 0.6rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 0.9rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}
.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
    margin-bottom: 4rem;
}

.section-heading {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.section-sub {
    color: var(--accent);
    margin-bottom: 1.75rem;
    font-size: 0.975rem;
}

/* ============================================================
   TL;DR
   ============================================================ */
.tldr {
    margin-bottom: 2rem;
}
.tldr p {
    margin-bottom: 0.9rem;
    color: var(--text);
}
.tldr strong {
    font-weight: 600;
}

/* ============================================================
   Documents
   ============================================================ */
.docs-section {
    margin-bottom: 2rem;
}
.docs-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.6rem;
}
.docs-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.doc-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
    background: var(--bg-2);
}

/* ============================================================
   About Paragraphs
   ============================================================ */
.about-paragraphs {
    margin-bottom: 2rem;
}
.about-paragraphs p {
    margin-bottom: 1rem;
    font-size: 1.025rem;
    line-height: 1.75;
    color: var(--text);
}

/* ============================================================
   Info Cards
   ============================================================ */
.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--transition);
}
.info-card:hover {
    border-color: var(--accent);
}
.info-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.info-card p {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.6;
}

/* ============================================================
   Experience
   ============================================================ */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
}

.exp-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.exp-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.exp-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.logo-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.logo-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.logo-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); }

.exp-logo-img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 4px;
}
.exp-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.edu-logo-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    padding: 6px;
}

.exp-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.exp-company {
    font-size: 1.075rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.exp-role {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.exp-location {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.exp-desc {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-bottom: 0.75rem;
    line-height: 1.65;
}

/* ============================================================
   Education
   ============================================================ */
.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.edu-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}


.gpa-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.2rem 0.55rem;
    color: var(--text-2);
    white-space: nowrap;
}

.edu-school {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.edu-degree {
    font-size: 0.925rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.edu-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.edu-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
}
.edu-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.edu-detail-item i {
    color: var(--accent);
    margin-top: 0.15rem;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.edu-detail-item strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}
.edu-detail-item p {
    font-size: 0.825rem;
    color: var(--text-2);
}
.edu-transfer {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    transition: border-color var(--transition), transform var(--transition);
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.project-card-muted {
    opacity: 0.7;
}
.project-card-muted:hover {
    transform: none;
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    gap: 0.75rem;
}
.project-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}
.project-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.status-active {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.status-soon {
    background: rgba(251, 146, 60, 0.12);
    color: var(--orange);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.project-context {
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 0.65rem;
}
.project-desc {
    font-size: 0.865rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

/* ============================================================
   Tags
   ============================================================ */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.tag {
    font-size: 0.73rem;
    padding: 0.2rem 0.6rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 2rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

/* ============================================================
   Skills
   ============================================================ */
.skills-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 2rem;
}

.skill-group {
    margin-bottom: 2rem;
}
.skill-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.skill-group-header h3 {
    font-size: 0.975rem;
    font-weight: 700;
}
.skill-level {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
}

/* ============================================================
   Bookshelf
   ============================================================ */
.books-group {
    margin-bottom: 2.5rem;
}

.books-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.books-group-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.books-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-reading { background: var(--green); }
.dot-read    { background: var(--accent); }
.dot-want    { background: var(--text-muted); }

.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.book-card:hover {
    border-color: var(--green);
}

.book-cover-card {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}

.book-cover-placeholder {
    width: 56px;
    height: 84px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.book-cover-thumb {
    width: 32px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

.book-cover-thumb-placeholder {
    width: 32px;
    height: 48px;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
}

.books-list-rows {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.book-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    gap: 1rem;
}
.book-row:last-child {
    border-bottom: none;
}
.book-row:hover {
    background: var(--bg-2);
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.book-author {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.book-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}
.footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.footer a {
    color: var(--text-muted);
    transition: color var(--transition);
}
.footer a:hover {
    color: var(--accent);
    text-decoration: none;
}
.footer-sub {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    opacity: 0.5;
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-photo-wrap {
        width: 170px;
        height: 170px;
    }
    .header-name {
        font-size: 2.2rem;
    }
    .header-contact,
    .header-labels,
    .header-socials {
        justify-content: center;
    }

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

    .info-cards {
        grid-template-columns: 1fr;
    }

    .exp-item {
        grid-template-columns: 1fr;
    }
    .exp-left {
        flex-direction: row;
        justify-content: flex-start;
    }
    .exp-date {
        text-align: left;
    }

    .edu-card {
        grid-template-columns: 1fr;
    }
    .edu-left {
        flex-direction: row;
        align-items: center;
    }

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

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

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

    .theme-toggle-wrapper {
        top: 0.6rem;
        right: 0.75rem;
    }
}

/* Responsive — Mobile */
@media (max-width: 480px) {
    .header-name {
        font-size: 1.85rem;
    }
    .section-heading {
        font-size: 1.4rem;
    }
    .container {
        padding: 0 1rem;
    }
}
