/* ============================================
   Zhanhan Cao — Personal Homepage
   Clean, Configurable, Elegant
   ============================================ */

:root {
    --bg: #ffffff;
    --bg-paper: #f8fafc;

    /* Typography scale — darker, clearer hierarchy */
    --text: #0f172a;           /* headings, names */
    --text-bio: #1e293b;       /* bio paragraph — prominent */
    --text-body: #334155;      /* body text, bullets */
    --text-secondary: #475569; /* dates, descriptions, authors */
    --text-muted: #64748b;     /* tags, venue, footer */

    --accent: #1d4ed8;
    --accent-hover: #2563eb;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 6px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --transition: 0.15s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.65;
}

::selection {
    background-color: rgba(29, 78, 216, 0.1);
}

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

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

/* ============================================
   Layout
   ============================================ */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 28px;
}

@media (max-width: 480px) {
    .page {
        padding: 0 20px;
    }
}

/* ============================================
   Header
   ============================================ */
.header {
    padding: 64px 0 8px;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.header-avatar {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--bg-paper);
    border: 1.5px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-avatar svg {
    width: 40px;
    height: 40px;
    opacity: 0.35;
}

.header-content {
    flex: 1;
    min-width: 0;
}

.header h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--text);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.header-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 2px 0;
}

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

.nav-sep {
    color: var(--text-muted);
    user-select: none;
}

/* ============================================
   Sections
   ============================================ */
.section {
    margin-bottom: 44px;
}

.section h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Bio — most prominent text on the page */
#about p {
    font-size: 1rem;
    color: var(--text-bio);
    line-height: 1.75;
}

#about strong {
    color: var(--text);
    font-weight: 600;
}

/* ============================================
   Entry (Education, Experience, Projects)
   ============================================ */
.entry {
    margin-bottom: 22px;
}

.entry:last-child {
    margin-bottom: 0;
}

.entry-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.entry-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.entry-name a {
    color: var(--text);
}

.entry-name a:hover {
    color: var(--accent);
}

.entry-when {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.entry-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.entry-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.entry-bullets li {
    position: relative;
    padding-left: 14px;
    font-size: 0.88rem;
    color: var(--text-body);
    line-height: 1.6;
    margin-bottom: 3px;
}

.entry-bullets li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.entry-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Tags */
.tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-paper);
    padding: 2px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

/* ============================================
   Papers
   ============================================ */
.paper {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
}

.paper:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.paper-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.paper-title a {
    color: var(--text);
}

.paper-title a:hover {
    color: var(--accent);
}

.paper-authors {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.paper-authors strong {
    color: var(--text);
    font-weight: 600;
}

.paper-venue {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

.paper-links {
    display: flex;
    gap: 14px;
}

.paper-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    position: relative;
}

.paper-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent);
    transition: width var(--transition);
}

.paper-links a:hover::after {
    width: 100%;
}

/* ============================================
   Awards
   ============================================ */
.award {
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light);
}

.award:last-child {
    border-bottom: none;
}

.award-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.award-name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.award-year {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.award-source {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: 56px;
    padding: 24px 0 48px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Under Construction
   ============================================ */
.construction-container {
    padding: 24px 0 48px;
}

.construction-card {
    background-color: var(--bg-paper);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 48px 36px;
    text-align: center;
    max-width: 460px;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.02);
}

.construction-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background-color: rgba(29, 78, 216, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.construction-card h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-transform: none;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

.construction-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    .header-nav {
        justify-content: center;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .header {
        padding-top: 0;
    }

    body {
        font-size: 10pt;
        line-height: 1.4;
    }

    a {
        color: var(--text) !important;
    }

    .paper {
        border-bottom: 1px solid #ddd;
        padding-bottom: 12px;
    }

    .footer {
        margin-top: 24px;
    }
}
