:root {
    /* Primary brand color: Peking University red */
    --pku-red: #8B0012;
    --pku-red-dark: #6B000E;
    --pku-red-light: #A81024;
    /* Accent: warm gold for decorative elements */
    --gold: #C9A84C;
    --gold-light: #E8D5A3;
    /* Neutral backgrounds */
    --cream: #FAF7F2;
    --warm-gray: #F5F0EB;
    /* Text hierarchy: dark → body → muted */
    --text-dark: #1A1A1A;
    --text-body: #3D3D3D;
    --text-muted: #6B6B6B;
    --white: #FFFFFF;
    /* Borders & shadows for depth */
    --border-subtle: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    /* Border radius scale */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    /* Max content width for consistent centering */
    --max-width: 1200px;
    /* Standard transition curve — smooth easing */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Layout constants — single source of truth */
    --header-height: 72px;
    --logo-size: 46px;
    --nav-mobile-width: 280px;
    --hero-arrow-size: 44px;
    /* Hero slide gradient backgrounds */
    --hero-slide-1: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --hero-slide-2: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 50%, #0f2027 100%);
    --hero-slide-3: linear-gradient(135deg, #1b0a1a 0%, #2d1b3d 50%, #1a1a2e 100%);
    /* Grid column widths — adjust for responsive behavior */
    --col-chip: 340px;
    --col-goal: 300px;
    --col-join-us: 240px;
    --col-contact-card: 220px;
    --col-gallery: 300px;
    --col-member: 280px;
}

/* ═══════════════════════════════════════════════════════════════════
   [2/7] CSS RESET & BASE STYLES
   Box-sizing: border-box ensures padding is included in width.
   Smooth scrolling enables native CSS scroll-behavior (anchor links).
   ═══════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ── Anti-flash for i18n handled via inline <style> in <head> ── */

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-body);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   [3/7] TYPOGRAPHY — DM Sans for body + headings, CJK system fallback.
   ═══════════════════════════════════════════════════════════════════ */
h1,
h2,
h3,
h4 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

a {
    color: var(--pku-red);
    text-decoration: none;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: var(--pku-red-light);
}

/* Keyboard focus: visible outline for accessibility */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--pku-red);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   [4/7] LAYOUT COMPONENTS
   ── Top Bar ──
   ═══════════════════════════════════════════════════════════════════ */
.top-bar {
    background: var(--pku-red);
    color: var(--white);
    font-size: 0.8rem;
    padding: 6px 0;
    letter-spacing: 0.02em;
}

.top-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.top-bar a:hover {
    color: var(--white);
}

/* ── Sticky Header — stays at top on scroll, glass-morphism blur ── */
.header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    /* Frosted glass effect */
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    border-bottom: 1px solid var(--border-subtle);
    transition: box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo>*:not(:last-child) {
    margin-right: 14px;
}

/* Safari <14.1 gap fallback */

.logo-icon {
    width: var(--logo-size);
    height: var(--logo-size);
    background: var(--pku-red);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-lab {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-dark);
}

.logo-uni {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2px;
}

.nav-links>li:not(:last-child) {
    margin-right: 2px;
}

/* Safari <14.1 gap fallback */

.nav-links a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--pku-red);
    background: rgba(139, 0, 18, 0.05);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    z-index: 101;
    touch-action: manipulation;
}

.hamburger span {
    margin-bottom: 7px;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

/* ── Language toggle ── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pku-red);
    background: rgba(139, 0, 18, 0.06);
    border: 1px solid rgba(139, 0, 18, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    margin-right: 8px;
    line-height: 1;
    min-height: 36px;
    min-width: 44px;
}

.lang-toggle:hover {
    background: var(--pku-red);
    color: var(--white);
    border-color: var(--pku-red);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ── Hero Slider — full-width image carousel with 3 slides ──
   Slides use absolute positioning + opacity transitions.
   JS controls which .hero-slide has .active class.
   To add more slides: copy a .hero-slide div in HTML and JS auto-detects.
   HERO_BG: replace linear-gradient with url('your-image.jpg') for photos.
── */
.hero {
    position: relative;
    width: 100%;
    height: clamp(380px, 50vw, 600px);
    overflow: hidden;
    background: #1A1A1A;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    /* Fade between slides */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.55);
    /* Darken bg so text is readable */
}

.hero-slide-bg-1 {
    background-image: var(--hero-slide-1);
}

.hero-slide-bg-2 {
    background-image: var(--hero-slide-2);
}

.hero-slide-bg-3 {
    background-image: var(--hero-slide-3);
}

.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 2rem;
    max-width: 800px;
}

.hero-overlay h1 {
    color: var(--white);
    font-size: clamp(2rem, 5vw, 3.6rem);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    /* Readability on dark bg */
}

.hero-overlay .subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: 0.04em;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

/* Page hero description paragraph (join-us.html, etc.) */
.hero-desc {
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
    margin: 0 auto 1.5rem;
    font-size: 1.05rem;
}

/* ── Slider navigation dots — auto-generated by JS ── */
.hero-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-dots button::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    transition: all var(--transition);
}

.hero-dots button.active::before {
    background: var(--white);
    border-color: var(--white);
    transform: scale(1.2);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: var(--hero-arrow-size);
    height: var(--hero-arrow-size);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.2);
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.hero-arrow.prev {
    left: 20px;
}

.hero-arrow.next {
    right: 20px;
}

/* ── Generic Section Wrapper — used by every <section> on the page ──
   .section-inner centers content and limits max width.
   .section-label is the small uppercase red label above each title.
   .section-title has a gold underline decoration via ::after pseudoelement.
   .section-desc is the lead paragraph.
── */
section {
    padding: 5rem 2rem;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pku-red);
    margin-bottom: 0.8rem;
}

.section-title {
    margin-bottom: 1.2rem;
    position: relative;
}

.section-title::after {
    /* Gold underline decoration */
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--gold);
    margin-top: 0.8rem;
    border-radius: 2px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 1000px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════════
   [5/7] FEATURE COMPONENTS
   ── Research Posters — poster-style layout with papers below ──
   Each area gets a poster card + a papers list underneath.
   ═══════════════════════════════════════════════════════════════════ */
.research-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Poster Card ── */
.research-poster {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    border: 1px solid rgba(139, 0, 18, 0.12);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.research-poster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--pku-red), #c0392b, var(--pku-red));
}

.research-poster:hover {
    box-shadow: 0 8px 30px rgba(139, 0, 18, 0.12);
    transform: translateY(-2px);
}

.poster-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.poster-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: var(--warm-gray);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-sm);
}

.poster-header-text h3 {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
    color: var(--pku-red);
}

.poster-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.poster-items {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Poster illustration image (single) ── */
.poster-image {
    margin: 1rem 0 1.2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--warm-gray);
}

.poster-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 220px;
}

/* ── Poster illustration gallery (multi-image) ── */
.poster-gallery {
    margin: 1rem 0 1.2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
}

.poster-gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--warm-gray);
    /* aspect-ratio fallback for older browsers */
    position: relative;
    padding-bottom: 50%;
    /* 2:1 ratio */
    height: 0;
}

.poster-gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Modern browsers override padding-bottom with native aspect-ratio */
@supports (aspect-ratio: 2 / 1) {
    .poster-gallery-item {
        position: static;
        padding-bottom: 0;
        height: auto;
    }

    .poster-gallery-item img {
        position: static;
        aspect-ratio: 2 / 1;
    }
}

.poster-items li {
    background: var(--warm-gray);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid rgba(139, 0, 18, 0.08);
    transition: all var(--transition);
}

.poster-items li:hover {
    background: rgba(139, 0, 18, 0.06);
    border-color: rgba(139, 0, 18, 0.2);
    color: var(--pku-red);
}

/* ── Papers list below each poster ── */
.research-papers {
    background: var(--warm-gray);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    border: 1px solid rgba(139, 0, 18, 0.08);
}

.papers-heading {
    font-size: 0.95rem;
    color: var(--pku-red);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(139, 0, 18, 0.12);
}

.paper-item {
    padding: 0.55rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.paper-item+.paper-item {
    border-top: 1px solid rgba(139, 0, 18, 0.06);
}

.paper-title-row {
    flex: 1 1 100%;
    min-width: 0;
}

.paper-link {
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    transition: color var(--transition);
    display: inline;
}

.paper-link:hover {
    color: var(--pku-red);
}

.paper-title {
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.paper-venue {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--white);
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Contributions / Awards — timeline-style list ──
   Each .contrib-item has a gold dot + year + description.
   On hover, a red left border appears. Grid auto-fits 2 columns.
Content driven by data/awards.json.
── */
.contributions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.contrib-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--warm-gray);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.contrib-item:hover {
    border-left-color: var(--pku-red);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.contrib-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    margin-top: 0.55rem;
}

.contrib-item .year {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pku-red);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.contrib-item .text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* ── PI Bio Card — photo + text side-by-side layout ──
On mobile, stacks vertically (flex-wrap: wrap + media query).
Content driven by data/members.json (pi section).
── */
.pi-section {
    background: var(--cream);
}

.pi-card {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.pi-info {
    flex: 1;
    min-width: 280px;
}

.pi-info h2 {
    margin-bottom: 0.3rem;
}

.pi-info .pi-title {
    color: var(--pku-red);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.pi-info .pi-affiliation {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.pi-info .pi-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.pi-info .pi-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border: 1px solid var(--pku-red);
    border-radius: 50px;
    transition: all var(--transition);
}

.pi-info .pi-links a:hover {
    background: var(--pku-red);
    color: var(--white);
}

.pi-awards {
    list-style: none;
    margin-top: 1rem;
}

.pi-awards li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.5;
}

.pi-awards li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 0.6rem;
    top: 0.35rem;
}

/* ── Open Positions — red background section, glass cards ──
   Semi-transparent cards with backdrop blur on the red bg.
   The .message-block inside is a white quote-style panel.
── */
.join-us-section {
    background: var(--pku-red);
    color: var(--white);
}

.join-us-section .section-label {
    color: var(--gold-light);
}

.join-us-section .section-title {
    color: var(--white);
}

.join-us-section .section-title::after {
    background: var(--gold);
}

.join-us-section .section-desc {
    color: rgba(255, 255, 255, 0.85);
}

.join-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--col-join-us, 240px), 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.join-us-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.join-us-card:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.join-us-card .icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.join-us-card h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.join-us-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Student Message ── */
.message-block {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.message-block::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 6rem;
    color: var(--pku-red);
    opacity: 0.15;
    line-height: 1;
}

.message-block p {
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}


/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Member Cards (People page) — details/summary cards
   Content driven by data/members.json.
   ═══════════════════════════════════════════════════════════════════ */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--col-member, 280px), 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.member-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all var(--transition);
}

.member-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.member-card summary {
    list-style: none;
    cursor: pointer;
    padding: 1.8rem 1.5rem 1.2rem;
    text-align: center;
    outline: none;
    position: relative;
}

.member-card summary::after {
    content: '▾';
    position: absolute;
    bottom: 0.4rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.member-card[open] summary::after {
    transform: translateX(-50%) rotate(180deg);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.member-photo.pi {
    background: linear-gradient(135deg, var(--pku-red-dark), var(--pku-red));
    width: 250px;
    height: 250px;
    font-size: 2.5rem;
}

.member-photo.phd {
    background: linear-gradient(135deg, #6B000E, #8B0012);
}

.member-photo.master {
    background: linear-gradient(135deg, #0B3D5C, #1A6B8A);
}

.member-photo.ugrad {
    background: linear-gradient(135deg, #8B7500, #C9A84C);
}

.member-card summary h3 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    color: var(--text-dark);
}

.member-card summary .role {
    font-size: 0.82rem;
    color: var(--pku-red);
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.member-card summary .brief {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.member-details {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: left;
    font-size: 0.88rem;
    color: var(--text-body);
    line-height: 1.7;
}

.member-details .label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pku-red);
    display: block;
    margin: 1rem 0 0.3rem;
}

.member-details .label:first-child {
    margin-top: 0.8rem;
}

.member-details .award {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.25rem;
}

.member-details .award::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 0.5rem;
    top: 0.4rem;
}

.member-details a {
    font-size: 0.85rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-card {
    padding: 2rem;
    background: var(--warm-gray);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.contact-card:hover {
    box-shadow: var(--shadow-md);
}

.contact-card h3 {
    margin-bottom: 1rem;
}

.contact-card p,
.contact-card a {
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ── Footer — dark background with gold divider ── */
.footer {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.6);
    padding: 3rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
}

.footer a:hover {
    color: var(--white);
}

.footer .divider {
    width: 40px;
    height: 2px;
    background: var(--gold);
    margin: 1.5rem auto;
    border-radius: 1px;
    opacity: 0.5;
}

.footer-lab-name {
    color: rgba(255, 255, 255, 0.9);
}

.footer-copy {
    margin-top: 0.8rem;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   [6/7] ANIMATIONS
   - fadeInUp keyframe: slides element 30px up while fading in
   - .reveal system: elements start invisible, become visible when
     they scroll into view (Intersection Observer in JS triggers this)
   ═══════════════════════════════════════════════════════════════════ */
/* .reveal: content always visible by default. Animation is decorative slide-up only.
   If IntersectionObserver fires, .visible removes the transform for the effect. */
.reveal {
    opacity: 1;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect user motion preferences — disable animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        transform: none;
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   [7/7] RESPONSIVE DESIGN — Mobile & Tablet overrides
   Breakpoint 768px: tablet/mobile (nav becomes hamburger menu,
   hero arrows hidden, PI card stacks vertically)
   Breakpoint 480px: small phone (single-column grids)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    section {
        padding: 3rem 1.2rem;
    }

    .header-inner {
        padding: 0 1.2rem;
        height: 64px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: var(--nav-mobile-width);
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        background: var(--white);
        padding: 5rem 2rem 2rem;
        gap: 4px;
        box-shadow: var(--shadow-lg);
        transition: transform var(--transition), visibility var(--transition);
        z-index: 100;
        transform: translateX(100%);
        visibility: hidden;
    }

    .nav-links.open {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
    }

    .nav-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .pi-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .member-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .pi-info .pi-links {
        justify-content: center;
    }

    .hero-arrow {
        display: none;
    }

    .hero {
        height: 350px;
    }

    .research-grid {
        gap: 1.5rem;
    }

    .research-poster {
        padding: 1.5rem 1.2rem;
    }

    .poster-header {
        gap: 0.8rem;
    }

    .poster-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.5rem;
        border-radius: 12px;
    }

    .poster-header-text h3 {
        font-size: 1.1rem;
    }

    .research-papers {
        padding: 1.2rem 1.2rem;
    }

    .chip-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] News Section — timeline-style news list on Home page
   Content driven by data/news.json.
   ═══════════════════════════════════════════════════════════════════ */
.news-list {
    max-width: 800px;
}

.news-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.8rem 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.news-item:first-child {
    padding-top: 0;
}

.news-item:hover {
    padding-left: 0.5rem;
}

.news-date {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pku-red);
    white-space: nowrap;
    min-width: 60px;
    padding-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.news-content h3 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.news-content p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Chip Gallery — card grid for die shots and chip info
   Each .chip-entry = image (top) + meta (bottom).
   Content driven by data/chips.json.
   ═══════════════════════════════════════════════════════════════════ */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--col-chip, 340px), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chip-entry {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border-subtle);
}

.chip-entry:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.chip-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    overflow: hidden;
    position: relative;
}

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

.chip-placeholder {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
}

.chip-info {
    padding: 1.5rem;
}

.chip-info h3 {
    margin-bottom: 0.6rem;
}

.chip-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.chip-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    background: rgba(139, 0, 18, 0.08);
    color: var(--pku-red);
}

.chip-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Override for designer info — more specific selector beats .chip-info p */
.chip-info p.chip-designers {
    font-size: 0.82rem;
    color: var(--text-dark);
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Publications List — year-grouped paper entries
   Content driven by data/publications.json.
   ═══════════════════════════════════════════════════════════════════ */
.pub-section {
    margin-top: 2rem;
}

.pub-year {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pku-red);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
    font-variant-numeric: tabular-nums;
}

.pub-year span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

.pub-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.pub-item:hover {
    padding-left: 0.5rem;
    background: rgba(139, 0, 18, 0.02);
}

.pub-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.pub-tag.journal {
    background: rgba(139, 0, 18, 0.1);
    color: var(--pku-red);
}

.pub-tag.conf {
    background: rgba(201, 168, 76, 0.2);
    color: #8B7500;
}

.pub-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0.3rem 0;
    line-height: 1.5;
}

.pub-authors {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.pub-authors strong {
    color: var(--pku-red);
}

.pub-venue {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-style: italic;
}

.pub-link {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.pub-link a {
    color: var(--pku-red);
}

.pub-link a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Goal Section — numbered research area cards
   Designed for prospective students to understand what the lab does.
   ═══════════════════════════════════════════════════════════════════ */
.goal-section {
    background: var(--cream);
}

.goal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--col-goal, 300px), 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}

.goal-item {
    display: flex;
    gap: 1.2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.goal-item:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(139, 0, 18, 0.2);
    transform: translateY(-2px);
}

.goal-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--pku-red);
    opacity: 0.25;
    line-height: 1;
    flex-shrink: 0;
    min-width: 40px;
    transition: opacity var(--transition);
}

.goal-item:hover .goal-num {
    opacity: 0.5;
}

.goal-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.goal-item p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.goal-cta {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-body);
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 0, 18, 0.15);
}

.goal-cta a {
    font-weight: 600;
    white-space: nowrap;
}

.pub-corresponding {
    color: var(--pku-red);
}

#contributions {
    background: var(--warm-gray);
}

#publications {
    background: var(--white);
}

.message-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

#gallery {
    background: var(--cream);
}

/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Quick Contact Section — compact cards for fast access
   Designed for prospective students to easily find contact info.
   The last card (.qc-highlight) uses a red accent to draw attention.
   ═══════════════════════════════════════════════════════════════════ */
.quick-contact-section {
    background: var(--warm-gray);
}

.quick-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--col-contact-card, 220px), 1fr));
    gap: 1rem;
    margin: 2rem 0 1.5rem;
}

.quick-contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-body);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

a.quick-contact-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-body);
}

.qc-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-gray);
    border-radius: 50%;
}

.quick-contact-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    color: var(--text-dark);
}

.quick-contact-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Highlighted card for the most important CTA (Join Us) */
.qc-highlight {
    border-color: var(--pku-red);
    background: rgba(139, 0, 18, 0.03);
}

.qc-highlight .qc-icon {
    background: var(--pku-red);
    color: var(--white);
}

.qc-highlight h4 {
    color: var(--pku-red);
}

.quick-contact-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.quick-contact-note a {
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   [FEATURE] Group Life Gallery — inviting photo grid
   Designed to showcase lab culture and attract prospective students.
   ═══════════════════════════════════════════════════════════════════ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--col-gallery, 300px), 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.gallery-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.gallery-img {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img img {
    transform: scale(1.05);
}

.gallery-info {
    padding: 1rem 1.2rem;
}

.gallery-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.gallery-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.gallery-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-gray);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.5;
}


@media (max-width: 480px) {
    .research-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .research-poster {
        padding: 1.2rem 1rem;
    }

    .poster-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .poster-image img {
        max-height: 160px;
    }

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

    .poster-items li {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    .paper-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .news-item {
        flex-direction: column;
        gap: 0.3rem;
    }

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

    .quick-contact-grid {
        grid-template-columns: 1fr;
    }

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

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

    .pub-item:hover {
        padding-left: 0;
    }
}