/* ===== Design Tokens ===== */
:root {
    --color-primary:     #1e3a5f;
    --color-accent:      #7ba05b;
    --color-accent-dark: #4f7942;
    --color-body:        #0f172a;
    --color-muted:       #374151;
    --color-subtle:      #6b7280;
    --color-border:      #e5e7eb;
    --color-bg:          #ffffff;
    --color-bg-alt:      #f9fafb;
    --color-header-bg:   #f8f9fa;
    --color-footer-bg:   #f3f4f6;
    --font-body:         'Inter', sans-serif;
    --font-heading:      'Merriweather', serif;
    --font-hero:         'Times New Roman', Times, serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-body);
    background-color: var(--color-bg);
}

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

/* ===== Section Bands ===== */
.band { padding: 40px 0; background: #ffffff; }

/* ===== Section Heading Style (shared) ===== */
.page-section > h2,
.page-section > h2.section-title {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.page-section > p {
    line-height: 1.85;
    color: var(--color-muted);
    margin-bottom: 12px;
}

.page-section > p strong {
    color: var(--color-body);
}

/* ===== Header ===== */
header {
    background-color: var(--color-header-bg);
    border-bottom: 2px solid var(--color-primary);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ===== Hamburger Button ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.logo h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: var(--color-subtle);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: color 0.25s ease;
}

nav ul li a:hover  { color: var(--color-primary); }
nav ul li a.active { color: var(--color-accent); font-weight: 700; }

/* ===== Hero ===== */
.hero {
    background:
        linear-gradient(135deg, transparent 48%, rgba(255,255,255,0.04) 48%, rgba(255,255,255,0.04) 52%, transparent 52%),
        linear-gradient(45deg,  transparent 48%, rgba(255,255,255,0.04) 48%, rgba(255,255,255,0.04) 52%, transparent 52%),
        linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 50%, #1a1a1a 100%);
    background-size: 80px 80px, 80px 80px, 100% 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-small { height: 160px; }

.hero-overlay { text-align: center; }

.hero-text {
    font-family: var(--font-hero);
    color: #fff;
    font-size: 46px;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 12px;
}

.hero-small .hero-text {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.5px;
}

.hero-underline {
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    margin: 0 auto;
    border-radius: 2px;
}

/* ===== Profile Section ===== */
.profile-section {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    align-items: flex-start;
}

.left-col {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-pic {
    width: 240px;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.social-icons { margin-top: 18px; display: flex; gap: 12px; }

.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 17px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.icon-circle[aria-label="LinkedIn"]      { background: #0A66C2; }
.icon-circle[aria-label="Google Scholar"]{ background: #4285F4; }
.icon-circle[aria-label="GitHub"]        { background: #24292F; }

.icon-circle:hover { opacity: 0.85; transform: translateY(-3px); }

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 20px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    transition: background 0.25s ease;
}

.cv-btn:hover { background: var(--color-accent-dark); }

.center-col { flex: 1; min-width: 260px; }

.name {
    font-family: var(--font-heading);
    margin: 0 0 8px 0;
    color: var(--color-accent);
    font-size: 30px;
    font-weight: 700;
}

.position {
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 6px 0;
    font-size: 15px;
}

.center-col p { color: var(--color-muted); font-size: 14px; margin-bottom: 4px; }

.section-title {
    font-family: var(--font-heading);
    margin-top: 22px;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-size: 17px;
    font-weight: 700;
}

.right-col { flex: 0 0 260px; text-align: center; }

.university-logo { width: 140px; max-width: 100%; margin-bottom: 16px; }

.right-col p { color: var(--color-muted); font-size: 14px; margin-bottom: 4px; }

.right-col a { color: var(--color-primary); text-decoration: none; }
.right-col a:hover { text-decoration: underline; }

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    text-align: center;
    gap: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 28px 16px;
    border-radius: 10px;
    border: 1px solid;
}

.stat-icon { font-size: 26px; }

.stat-value { display: flex; align-items: flex-start; line-height: 1; }

.stat-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.stat-plus { font-size: 24px; font-weight: 700; margin-top: 8px; }

/* Per-stat colors: Publications | Teaching | Institutions | Industry */
.stats-bar .stat:nth-child(1) { background: #eff6ff; border-color: #bfdbfe; }
.stats-bar .stat:nth-child(1) .stat-icon,
.stats-bar .stat:nth-child(1) .stat-number,
.stats-bar .stat:nth-child(1) .stat-plus { color: #2563eb; }

.stats-bar .stat:nth-child(3) { background: #f0fdf4; border-color: #bbf7d0; }
.stats-bar .stat:nth-child(3) .stat-icon,
.stats-bar .stat:nth-child(3) .stat-number,
.stats-bar .stat:nth-child(3) .stat-plus { color: #16a34a; }

.stats-bar .stat:nth-child(5) { background: #fffbeb; border-color: #fde68a; }
.stats-bar .stat:nth-child(5) .stat-icon,
.stats-bar .stat:nth-child(5) .stat-number,
.stats-bar .stat:nth-child(5) .stat-plus { color: #d97706; }

.stats-bar .stat:nth-child(7) { background: #f5f3ff; border-color: #ddd6fe; }
.stats-bar .stat:nth-child(7) .stat-icon,
.stats-bar .stat:nth-child(7) .stat-number,
.stats-bar .stat:nth-child(7) .stat-plus { color: #7c3aed; }

.stat-label {
    font-size: 11px;
    color: var(--color-subtle);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-divider { display: none; }

/* ===== Education ===== */
.education-section > h2.section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 28px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.education-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 30px;
    align-items: start;
    padding: 28px 0;
    border-bottom: 1px solid var(--color-border);
}

.education-grid:last-child { border-bottom: none; }

.edu-logo img { width: 110px; height: auto; }

.edu-content .degree {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--color-border);
}

.edu-content .degree:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.edu-content h3 { font-family: var(--font-body); margin: 0 0 6px 0; font-size: 15px; font-weight: 600; color: var(--color-body); }

.edu-content h3 span { font-weight: 500; color: var(--color-subtle); font-size: 14px; }

.edu-content p { margin: 4px 0; line-height: 1.65; color: var(--color-muted); font-size: 14px; }

/* ===== About Page ===== */
.about-content { max-width: 900px; }

.academic-section h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.academic-section ul { list-style: none; }

.academic-section > ul > li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.8;
    color: var(--color-muted);
    font-size: 15px;
}

.academic-section > ul > li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

.university-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.university-logos img {
    height: 48px;
    width: auto;
    filter: grayscale(20%);
    transition: filter 0.25s ease;
}

.university-logos img:hover { filter: grayscale(0%); }

/* ===== Publications Page ===== */
.publications-content { max-width: 900px; }

.pub-note { font-size: 13px; color: var(--color-subtle); margin-bottom: 24px; font-style: italic; }

.publications-content h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.publications-list { list-style: decimal; padding-left: 22px; }

.publications-list li { margin-bottom: 22px; line-height: 1.85; color: var(--color-muted); font-size: 15px; }

.publications-list strong { color: var(--color-body); }
.publications-list em     { color: var(--color-primary); font-style: italic; }

.publications-list a { color: var(--color-accent-dark); text-decoration: none; font-weight: 500; }
.publications-list a:hover { text-decoration: underline; }

/* ===== Teaching Page ===== */
.teaching-content { max-width: 800px; }

.teaching-courses { display: flex; flex-direction: column; gap: 28px; }

.course {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 6px;
    padding: 24px 28px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.course-header { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }

.course-logo { width: auto; max-width: 90px; max-height: 55px; object-fit: contain; flex-shrink: 0; }

.course-header-text h3 { font-family: var(--font-heading); color: var(--color-primary); font-size: 17px; font-weight: 700; margin-bottom: 4px; }

.course-header-text h3 span { font-size: 14px; font-weight: 400; color: var(--color-subtle); }

.course-role { color: var(--color-accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; margin: 0; }

.course ul { list-style: none; }

.course ul li { margin-bottom: 6px; padding-left: 18px; position: relative; color: var(--color-muted); font-size: 14px; }

.course ul li::before { content: "▸"; position: absolute; left: 0; color: var(--color-accent); font-size: 12px; }

/* ===== Contact Form ===== */
.contact-form-section h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.contact-form-section > p { color: var(--color-muted); margin-bottom: 20px; line-height: 1.8; }

.contact-form { max-width: 560px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }

.form-group label { font-size: 12px; font-weight: 600; color: var(--color-subtle); text-transform: uppercase; letter-spacing: 0.5px; }

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--color-body);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.submit-btn {
    padding: 11px 30px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.25s ease;
}

.submit-btn:hover    { background: var(--color-accent); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.form-success {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0f7eb;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    max-width: 560px;
}

.form-success i   { font-size: 28px; color: var(--color-accent); flex-shrink: 0; }
.form-success h3  { font-size: 15px; color: var(--color-primary); margin-bottom: 4px; }
.form-success p   { color: var(--color-subtle); font-size: 13px; margin: 0; }

/* ===== Footer ===== */
footer {
    background-color: var(--color-footer-bg);
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

footer p { color: var(--color-subtle); font-size: 13px; }

/* ===== Accessibility ===== */
.skip-nav {
    position: absolute;
    top: -50px;
    left: 16px;
    padding: 8px 16px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 9999;
    transition: top 0.2s;
}

.skip-nav:focus { top: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    nav ul { gap: 15px; }

    .hero-text              { font-size: 34px; padding: 0 20px; }
    .hero-small .hero-text  { font-size: 30px; }
}

@media (max-width: 900px) {
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
    }

    .left-col, .center-col, .right-col { width: 100%; max-width: 520px; flex: none; }
    .center-col { min-width: unset; }

    /* Stats: tighten padding, shrink numbers slightly */
    .stats-bar     { padding: 28px 20px; }
    .stat-number   { font-size: 40px; }
    .stat-icon     { font-size: 22px; }
}

@media (max-width: 768px) {
    .education-grid { grid-template-columns: 1fr; text-align: center; }
    .edu-logo { margin-bottom: 16px; }
    .edu-logo img { width: 90px; }

    /* Publications: prevent long titles / URLs from breaking layout */
    .publications-list li { word-break: break-word; overflow-wrap: break-word; }
}

@media (max-width: 600px) {
    header { padding: 12px 0; }
    .logo h1 { font-size: 17px; }

    .nav-toggle { display: flex; }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-header-bg);
        border-top: 1px solid var(--color-border);
        border-bottom: 2px solid var(--color-primary);
        padding: 8px 0;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    nav ul.open { display: flex; }

    nav ul li { border-bottom: 1px solid var(--color-border); }
    nav ul li:last-child { border-bottom: none; }
    nav ul li a { display: block; padding: 12px 24px; font-size: 15px; }

    .band { padding: 28px 0; }

    .hero { height: 240px; }
    .hero-small { height: 190px; }
    .hero-text { font-size: 26px; padding: 0 15px; }
    .hero-small .hero-text { font-size: 26px; }

    .profile-section { gap: 24px; }
    .profile-pic { width: 180px; }

    .stat-number { font-size: 36px; }
    .stats-bar   { flex-wrap: wrap; gap: 12px; }
    .stat        { flex: 1 1 calc(50% - 12px); min-width: 120px; }

    /* Teaching: stack logo above text on small screens */
    .course-header { flex-direction: column; align-items: flex-start; gap: 12px; }

    .university-logos { gap: 20px; }

    .form-row { grid-template-columns: 1fr; gap: 0; }
}
