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

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --heading: #0f172a;
    --text: #334155;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-tint: #eff6ff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--heading);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    gap: 26px;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--heading);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 55%);
}

#home .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.profile-photo {
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--border);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.latest-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-tint);
    color: var(--accent-dark);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid #dbeafe;
    margin-bottom: 18px;
}

.latest-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent);
    flex-shrink: 0;
}

h1 {
    font-size: 3.4rem;
    color: var(--heading);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.tagline-divider {
    color: var(--border);
    font-weight: 400;
    margin: 0 4px;
}

.bio {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 30px;
    max-width: 700px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 28px;
    margin-bottom: 34px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
    max-width: 700px;
}

.hero-stat {
    flex: 0 0 auto;
    min-width: 100px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-stat-num {
    color: var(--heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.hero-stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.contact-info {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.contact-info a {
    color: var(--heading);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.95rem;
}

.contact-info a:hover {
    color: var(--accent);
}

.contact-info span {
    color: var(--border);
}

.skills-section {
    margin-top: 50px;
}

.skills-section h3 {
    color: var(--heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 15px;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills-tags span {
    background-color: var(--accent-tint);
    color: var(--accent-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

/* Section Styling */
section {
    padding: 90px 0;
}

.section-title {
    color: var(--heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 60px;
}

/* Featured Work */
#featured-work {
    background-color: var(--bg);
}

.projects-intro {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 640px;
    margin-top: -40px;
    margin-bottom: 50px;
}

/* Featured project cards */
.featured-projects {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 70px;
}

.project-featured {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 46% 1fr;
    align-items: start;
    transition: box-shadow 0.25s;
}

.project-featured:hover {
    box-shadow: var(--shadow-md);
}

.pf-image {
    background-color: var(--bg-alt);
    position: sticky;
    top: 86px;
    height: 340px;
    overflow: hidden;
}

.pf-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pf-image-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.pf-image-dual figure {
    position: relative;
    margin: 0;
    height: 100%;
}

.pf-image-dual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pf-image-dual figcaption {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
}

.notebook-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: all 0.2s;
}

.notebook-link:hover {
    background-color: var(--accent);
    color: #ffffff;
}

.pf-body {
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
}

.pf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pf-header h3 {
    color: var(--heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.pf-tagline {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* Award badge (used inline next to project/award titles) */
.award {
    display: inline-block;
    background-color: var(--accent-tint);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Tech/skill tag row (used across project cards) */
.tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tech span {
    background-color: var(--bg-alt);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pf-body .tech {
    margin-bottom: 22px;
}

/* Case study disclosure */
.case-study-full {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.case-study-full summary {
    cursor: pointer;
    list-style: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-study-full summary::-webkit-details-marker {
    display: none;
}

.case-study-full summary::after {
    content: '↓';
    transition: transform 0.25s;
}

.case-study-full[open] summary::after {
    transform: rotate(180deg);
}

.case-study-full summary:hover {
    color: var(--accent-dark);
}

.case-content {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.case-content h4 {
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    margin-top: 24px;
}

.case-content h4:first-child {
    margin-top: 0;
}

.case-content p {
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.65;
}

.case-content .tech {
    margin-top: 0;
    margin-bottom: 0;
}

.case-diagram {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.case-diagram img {
    max-width: 100%;
    height: auto;
}

.case-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.case-gallery figure {
    margin: 0;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.case-gallery img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.case-gallery figcaption {
    padding: 10px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* More Projects (compact grid) */
.more-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    align-items: start;
}

.project-earlier {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0.92;
    transition: opacity 0.2s;
}

.project-earlier:hover {
    opacity: 1;
}

.pe-image {
    height: 120px;
}

.pe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pe-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pe-body h5 {
    color: var(--heading);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pe-body p {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pe-body .tech {
    margin-bottom: 10px;
}

.pe-body .tech span {
    font-size: 0.7rem;
}

.pe-body .project-link {
    margin-top: auto;
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 5px 10px;
}

.pe-body .case-study-full {
    margin-top: 10px;
    padding-top: 10px;
}

.pe-body .case-study-full summary {
    font-size: 0.75rem;
}

.pe-body .case-content {
    margin-top: 10px;
    padding-top: 10px;
}

.pe-body .case-content h4 {
    font-size: 0.62rem;
    margin-top: 12px;
}

.pe-body .case-content p {
    font-size: 0.76rem;
    line-height: 1.5;
}

/* Experience */
#experience {
    background-color: var(--bg-alt);
}

.subsection-title {
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 25px;
}

.subsection-title:first-of-type {
    margin-top: 0;
}

.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 40px;
}

.exp-item {
    background-color: var(--bg);
    padding: 22px 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s, transform 0.25s;
}

.exp-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.exp-item-compact {
    padding: 16px 20px;
    box-shadow: none;
    border-left-color: var(--border);
    background-color: var(--bg-alt);
}

.exp-item-compact h3 {
    font-size: 1rem;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 20px;
}

.exp-item h3 {
    color: var(--heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.exp-org {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0;
}

.exp-date {
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    font-weight: 500;
}

.exp-details {
    list-style: none;
    padding-left: 0;
}

.exp-details li {
    color: var(--text);
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
    font-size: 0.95rem;
}

.exp-details li::before {
    content: '▹';
    color: var(--accent);
    position: absolute;
    left: 0;
}

.role-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: default;
    font-size: 1.1rem;
    font-weight: normal;
    margin-left: 10px;
    padding: 0;
    line-height: 1;
    transition: transform 0.3s;
    display: inline-flex;
    align-items: center;
    pointer-events: none;
}

.exp-item:hover .role-toggle {
    transform: rotate(180deg);
}

.role-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin 0.3s ease-out;
    margin-top: 0;
    margin-bottom: 0;
}

.exp-item:hover .role-history {
    max-height: 200px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.role-timeline {
    position: relative;
    padding-left: 25px;
}

.role-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
}

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

.role-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: -15px;
    width: 2px;
    background-color: var(--accent);
    opacity: 0.3;
}

.role-item:last-child::before {
    display: none;
}

.role-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 2px var(--border);
}

.role-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 15px;
}

.role-content strong {
    color: var(--heading);
    font-size: 0.95rem;
}

.role-content span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.awards-section {
    margin-top: 60px;
    margin-bottom: 40px;
}

.awards-section h3 {
    color: var(--heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.award-item {
    background-color: var(--bg);
    padding: 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    min-height: 150px;
}

.award-item h4 {
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.award-org {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.award-item p:last-child {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Education */
#education {
    background-color: var(--bg);
}

.education-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.edu-item {
    background-color: var(--bg);
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.edu-item h3 {
    color: var(--heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.edu-program {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0;
}

.edu-date {
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    font-weight: 500;
}

.edu-courses {
    color: var(--text);
    font-size: 0.9rem;
    margin-top: 10px;
    padding-left: 20px;
    position: relative;
}

.edu-courses::before {
    content: '▹';
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* Contact */
#contact {
    text-align: center;
    background-color: var(--bg-alt);
}

#contact h2 {
    color: var(--heading);
    margin-bottom: 15px;
}

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

.contact-info-centered {
    justify-content: center;
    margin-bottom: 0;
}

/* More Projects / Leadership section backgrounds */
#more-projects {
    background-color: var(--bg);
}

#leadership {
    background-color: var(--bg-alt);
}

.awards-subtitle {
    margin-top: 50px;
}

/* Skills */
#skills {
    background-color: var(--bg-alt);
}

.skills-chip-groups {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.skill-group h3 {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px 7px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, transform 0.2s;
}

.skill-chip:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.skill-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
    object-fit: contain;
    flex-shrink: 0;
}

/* More Experience disclosure */
.more-experience {
    margin-top: 20px;
}

.more-experience summary {
    cursor: pointer;
    list-style: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg);
    transition: background-color 0.2s;
}

.more-experience summary::-webkit-details-marker {
    display: none;
}

.more-experience summary:hover {
    background-color: var(--accent-tint);
}

.more-experience summary::after {
    content: '↓ Show';
    float: right;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.more-experience[open] summary::after {
    content: '↑ Hide';
}

.more-experience-list {
    margin-top: 18px;
}

/* Education tiers */
.edu-item-primary {
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-md);
}

.edu-item-primary h3 {
    font-size: 1.3rem;
}

.prior-education-title {
    font-size: 1rem;
    margin-top: 36px;
    margin-bottom: 18px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.education-list-prior {
    gap: 12px;
}

.edu-item-compact {
    padding: 16px 20px;
    box-shadow: none;
    background-color: var(--bg-alt);
}

.edu-item-compact h3 {
    font-size: 1rem;
}

.edu-item-compact .edu-program,
.edu-item-compact .edu-date {
    font-size: 0.85rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        right: -100%;
        background-color: var(--bg);
        flex-direction: column;
        width: 250px;
        padding: 30px;
        box-shadow: -5px 0 15px rgba(15, 23, 42, 0.1);
        transition: right 0.3s;
        border-left: 1px solid var(--border);
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-toggle {
        display: block;
    }

    #home .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-text .bio {
        max-width: 100%;
    }

    .hero-stats {
        max-width: 100%;
        gap: 20px;
        justify-content: center;
        text-align: center;
    }

    .hero-stat {
        align-items: center;
        flex: 0 0 40%;
    }

    .contact-info {
        justify-content: center;
    }

    .profile-photo {
        order: -1;
        width: 160px;
        height: 160px;
        margin-bottom: 10px;
    }

    h1 {
        font-size: 2.4rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .projects-intro {
        margin-top: 0;
    }

    .project-featured {
        grid-template-columns: 1fr;
    }

    .pf-image {
        position: static;
        height: 220px;
    }

    .pf-body {
        padding: 24px;
    }

    .pf-image-dual {
        grid-template-columns: 1fr;
        height: 400px;
    }

    .case-gallery {
        grid-template-columns: 1fr;
    }

    .exp-header {
        flex-direction: column;
        gap: 5px;
    }

    .exp-date {
        white-space: normal;
    }

    .edu-header {
        flex-direction: column;
        gap: 5px;
    }

    .edu-date {
        white-space: normal;
    }

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

    .more-experience summary::after {
        float: none;
        display: block;
        margin-top: 4px;
    }
}
