/*
 * NICS-AIM — design system
 * ---------------------------------------------------------------------------
 * Tokens first, then base type, then components, then page-level composition.
 * Every colour, radius, shadow and rhythm value comes from :root so the whole
 * site can be retuned from one place.
 */

:root {
    /* Brand ramp — NICS purple, 700 is the primary brand colour. */
    --brand-50: #faf5fb;
    --brand-100: #f3e7f6;
    --brand-200: #e6cdec;
    --brand-300: #d3a6dd;
    --brand-400: #b877c4;
    --brand-500: #9a45a8;
    --brand-600: #7d1c8c;
    --brand-700: #660874;
    --brand-800: #4c0657;
    --brand-900: #380840;
    --brand-950: #220427;

    /* Ink and surfaces */
    --ink: #1b1520;
    --ink-soft: #3f3a46;
    --muted: #6f6878;
    --faint: #746c80;
    --surface: #ffffff;
    --canvas: #faf8fc;
    --canvas-strong: #f3eef6;
    --line: #e9e3ee;
    --line-strong: #d9d0e2;
    --navbar-bg: #2b0a33;
    --footer-bg: #1c0a21;

    /* Typography */
    --font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Source Serif 4 Variable", "Iowan Old Style", "Source Serif Pro",
        Georgia, "Times New Roman", serif;
    --font-cjk-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;

    /* Shape */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Elevation — purple-tinted rather than neutral grey. */
    --shadow-xs: 0 1px 2px rgba(30, 12, 36, 0.05);
    --shadow-sm: 0 6px 18px -10px rgba(30, 12, 36, 0.25);
    --shadow-md: 0 18px 40px -22px rgba(30, 12, 36, 0.35);
    --shadow-lg: 0 36px 80px -36px rgba(30, 12, 36, 0.45);

    /* Rhythm */
    --section-y: clamp(3.25rem, 5vw, 5rem);
    --navbar-height: 64px;

    /* Legacy aliases — templates and page styles still reference these. */
    --primary-color: var(--brand-700);
    --primary-dark: var(--brand-800);
    --secondary-color: #ffffff;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: var(--canvas);
    --dark-color: var(--ink);

    /* Bootstrap bridges */
    --bs-primary: #660874;
    --bs-primary-rgb: 102, 8, 116;
    --bs-link-color: #660874;
    --bs-link-color-rgb: 102, 8, 116;
    --bs-link-hover-color: #4c0657;
    --bs-link-hover-color-rgb: 76, 6, 87;
    --bs-body-color: #3f3a46;
    --bs-body-font-family: var(--font-sans);
    --bs-border-color: #e9e3ee;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

section[id],
[id="home-directions"],
[id="home-achievements"],
[id="home-publications"] {
    scroll-margin-top: calc(var(--navbar-height) + 1rem);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.main-content {
    flex: 1 0 auto;
}

::selection {
    background: var(--brand-200);
    color: var(--brand-950);
}

a {
    color: var(--brand-700);
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.18em;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-800);
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

img {
    max-width: 100%;
}

/* Display type: the serif carries page and section titles. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

h1, .h1 {
    font-size: clamp(2.15rem, 3.6vw, 2.95rem);
    letter-spacing: -0.022em;
}

h2, .h2 {
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
}

h3, .h3 {
    font-size: 1.4rem;
}

h4, .h4 {
    font-size: 1.15rem;
}

h5, h6, .h5, .h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.005em;
    font-size: 1rem;
}

.lead {
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    line-height: 1.65;
    color: var(--muted);
}

small, .small {
    font-size: 0.85rem;
}

.text-muted,
.text-body-secondary {
    color: var(--muted) !important;
}

.text-primary {
    color: var(--brand-700) !important;
}

hr {
    border-color: var(--line);
    opacity: 1;
}

/* ==========================================================================
   Shared helpers
   ========================================================================== */

.eyebrow {
    margin: 0 0 0.6rem;
    color: var(--brand-600);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
}

.section-title {
    margin: 0;
    font-size: clamp(1.75rem, 2.8vw, 2.35rem);
}

.section-link,
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--brand-700);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.section-link {
    padding-bottom: 0.3rem;
    border-bottom: 1px solid transparent;
}

.section-link:hover,
.link-arrow:hover {
    color: var(--brand-900);
}

.section-link:hover {
    border-bottom-color: var(--brand-300);
}

.section-link i,
.link-arrow i {
    transition: transform 0.2s ease;
}

.section-link:hover i,
.link-arrow:hover i,
.direction-card:hover .direction-more i {
    transform: translateX(3px);
}

/* Category chips */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    line-height: 1.7;
    text-transform: uppercase;
    white-space: nowrap;
}

.chip--news { background: var(--brand-100); color: var(--brand-800); }
.chip--award { background: #fdf1e3; color: #95500a; }
.chip--grant { background: #e6f4f1; color: #0c655c; }
.chip--project { background: #e9eefc; color: #24439c; }
.chip--default { background: var(--canvas-strong); color: var(--muted); }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */

.btn {
    --bs-btn-font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.004em;
    transition: background-color 0.2s ease, border-color 0.2s ease,
        color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-sm {
    padding: 0.38rem 0.8rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand-700);
    --bs-btn-border-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-800);
    --bs-btn-hover-border-color: var(--brand-800);
    --bs-btn-active-bg: var(--brand-900);
    --bs-btn-active-border-color: var(--brand-900);
    --bs-btn-disabled-bg: var(--brand-700);
    --bs-btn-disabled-border-color: var(--brand-700);
    --bs-btn-focus-shadow-rgb: 102, 8, 116;
    box-shadow: 0 8px 18px -12px rgba(102, 8, 116, 0.85);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-700);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-800);
    --bs-btn-focus-shadow-rgb: 102, 8, 116;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

.btn-link {
    color: var(--brand-700);
    font-weight: 600;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--brand-900);
}

.btn-light {
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #ffffff;
    --bs-btn-color: var(--brand-800);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-border-color: var(--brand-50);
    --bs-btn-hover-color: var(--brand-900);
}

.form-label {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.form-select,
.form-control {
    padding: 0.62rem 0.9rem;
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 0.2rem rgba(102, 8, 116, 0.12);
}

.badge {
    padding: 0.35em 0.7em;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.badge.bg-secondary {
    background: var(--canvas-strong) !important;
    border: 1px solid var(--line);
    color: var(--muted) !important;
}

.badge.bg-primary {
    background: var(--brand-700) !important;
}

.badge.bg-light {
    background: var(--canvas) !important;
    border-color: var(--line) !important;
    color: var(--ink-soft) !important;
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
    min-height: var(--navbar-height);
    padding: 0;
    background-color: var(--navbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    /* The NICS family dropdown must escape the bar. */
    overflow: visible;
}

.navbar > .container {
    min-height: var(--navbar-height);
    position: relative;
    z-index: 2;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: linear-gradient(145deg, var(--brand-600), var(--brand-800));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 1rem;
    line-height: 1;
}

.navbar-brand-text {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-sans);
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.brand-parent {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-decoration: none;
}

.brand-current {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

/* On the homepage the hero states the group name, so the wordmark only fades
   in once the hero scrolls away — the mark stays visible throughout. */
.navbar.can-hide-brand .navbar-brand-text {
    opacity: 0;
    transform: translateY(-4px);
}

.navbar.can-hide-brand.brand-visible .navbar-brand-text {
    opacity: 1;
    transform: none;
}

.nav-prominent {
    align-items: center;
    gap: clamp(1.1rem, 2.2vw, 2.05rem);
}

.nav-prominent .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    transition: color 0.2s ease;
}

/* Underline lives on ::before so Bootstrap keeps ::after for the caret. */
.nav-prominent .nav-link::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--brand-300);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-prominent .nav-link:hover,
.nav-prominent .nav-link:focus-visible,
.nav-prominent .nav-link.active,
.nav-prominent .nav-link[aria-current="page"] {
    color: #ffffff;
}

.nav-prominent .nav-link:hover::before,
.nav-prominent .nav-link.active::before,
.nav-prominent .nav-link[aria-current="page"]::before {
    transform: scaleX(1);
}

.nav-prominent .dropdown-toggle::after {
    margin-left: 0.4rem;
    vertical-align: 0.12em;
    border-top-color: currentColor;
    opacity: 0.7;
}

.dropdown-menu {
    min-width: 16rem;
    margin-top: 0.75rem;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.dropdown-header {
    padding: 0.45rem 0.7rem 0.35rem;
    color: var(--faint);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dropdown-item {
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: normal;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--brand-50);
    color: var(--brand-800);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--brand-100);
    color: var(--brand-900);
}

.dropdown-item .small {
    margin-top: 0.1rem;
    color: var(--muted) !important;
    font-size: 0.75rem;
    font-weight: 400;
}

.dropdown-divider {
    margin: 0.35rem 0.4rem;
    border-color: var(--line);
}

.navbar-toggler {
    padding: 0.3rem 0.55rem;
    border-color: rgba(255, 255, 255, 0.2);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Breadcrumb — a quiet label above the content, not a floating card
   ========================================================================== */

.breadcrumb-bar {
    position: static;
    z-index: auto;
    padding: 1.15rem 0 0;
    background: transparent;
}

.breadcrumb-glass {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.breadcrumb-item {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.breadcrumb-item a {
    padding: 0;
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb-item a::after {
    display: none;
}

.breadcrumb-item a:hover {
    color: var(--brand-700);
}

.breadcrumb-item.active {
    flex: 0 1 auto;
    max-width: min(34rem, 70vw);
    min-width: 0;
    overflow: hidden;
    color: var(--faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-item + .breadcrumb-item::before {
    padding: 0 0.55rem;
    color: var(--line-strong);
    content: "/";
    font-weight: 400;
}

/* ==========================================================================
   Cards & generic surfaces
   ========================================================================== */

.card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.25s ease, box-shadow 0.25s ease,
        transform 0.25s ease;
}

.card-body {
    padding: 1.4rem 1.45rem;
}

.card-title {
    color: var(--ink);
    font-family: var(--font-serif);
    font-weight: 600;
}

.card-text {
    color: var(--ink-soft);
}

.card-footer {
    padding: 0.95rem 1.45rem;
    border-top: 1px solid var(--line);
    background: transparent;
}

.card-img-top {
    object-fit: cover;
}

/* Only interactive cards lift; static content cards stay put. */
.achievement-card:hover,
.member-card:hover,
.pi-interest-card:hover,
.direction-card:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.achievement-card {
    display: flex;
    flex-direction: column;
}

.achievement-card .card-footer {
    margin-top: auto;
}

.list-group-item {
    padding: 0.9rem 1.15rem;
    border-color: var(--line);
    background: transparent;
    color: var(--ink-soft);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: var(--brand-50);
    color: var(--ink);
}

.list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.list-group-item:last-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Member tiles */
.member-tile {
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.member-tile:hover {
    background: var(--brand-50);
}

.member-tile .fw-semibold {
    letter-spacing: -0.005em;
}

.avatar {
    display: inline-flex;
    flex-shrink: 0;
    width: var(--avatar-size, 84px);
    height: var(--avatar-size, 84px);
    border-radius: 50%;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--canvas);
    object-fit: cover;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px solid var(--brand-200);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--brand-50), var(--brand-100));
    color: var(--brand-800);
    font-family: var(--font-serif);
    font-size: calc(var(--avatar-size, 84px) * 0.34);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Member cards */
.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 1.35rem 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    text-align: center;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.member-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-sm);
}

.member-name {
    margin-top: 0.8rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
}

.member-role {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

/* ==========================================================================
   Interior page shells
   ========================================================================== */

.page-wrap {
    padding-top: 2rem;
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0.5rem 0 clamp(2rem, 4vw, 2.85rem);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.page-head h1 {
    margin: 0 0 0.55rem;
}

.page-lead {
    max-width: 52ch;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.page-count {
    flex-shrink: 0;
    padding-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Team page */
.team-group {
    margin-bottom: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.team-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.team-group-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
    user-select: none;
}

.team-group-title {
    margin: 0;
    font-size: 1.45rem;
}

.team-group-count {
    padding: 0.08rem 0.5rem;
    border-radius: 999px;
    background: var(--canvas-strong);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.team-group-head .toggle-icon {
    margin-left: auto;
    color: var(--faint);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.team-group-head[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

.team-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.team-sidebar {
    position: sticky;
    top: 84px;
    padding-top: 0.3rem;
}

.team-nav {
    display: grid;
    gap: 0.12rem;
    margin-top: 0.55rem;
}

.team-nav-link {
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.86rem;
}

.team-nav-count {
    color: var(--faint);
    font-size: 0.72rem;
}

/* Filter chips */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.filter-chip:hover {
    border-color: var(--brand-300);
    color: var(--brand-700);
}

.filter-chip.active {
    border-color: var(--brand-700);
    background: var(--brand-700);
    color: #ffffff;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: clamp(2rem, 3.5vw, 2.85rem);
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--canvas);
}

.filter-field {
    flex: 1 1 190px;
    max-width: 280px;
}

/* Achievement grid */
.achievement-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.35rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.achievement-card:hover {
    color: inherit;
}

.achievement-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.achievement-date {
    color: var(--faint);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.achievement-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.4;
}

.achievement-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.achievement-card .link-arrow {
    margin-top: auto;
}

.achievement-meta {
    margin: -0.15rem 0 0.6rem;
    color: var(--faint);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.achievement-arrow {
    margin-top: auto;
    align-self: flex-end;
    color: var(--brand-400);
    font-size: 0.85rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.achievement-card:hover .achievement-arrow {
    color: var(--brand-700);
    transform: translateX(3px);
}

.project-funder {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.project-meta {
    margin: -0.1rem 0 0.85rem;
    color: var(--faint);
    font-size: 0.8rem;
}

/* Static project cards */
.project-card {
    height: 100%;
    padding: 1.35rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.project-card .achievement-title {
    font-size: 1.02rem;
    line-height: 1.5;
}

.project-card .achievement-top {
    margin-bottom: 0.65rem;
}

/* Publication detail list */
.pub-year-group {
    margin-bottom: 2.5rem;
}

.pub-year-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding-bottom: 0.6rem;
}

.pub-year-head h2 {
    margin: 0;
    font-size: 1.6rem;
}

.pub-year-head span {
    color: var(--faint);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pub-list .pub-item--detail {
    grid-template-columns: minmax(0, 1fr) auto;
}

.pub-item--detail .pub-actions {
    align-self: center;
}

.pub-authors {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.pub-actions {
    display: flex;
    gap: 0.4rem;
}

.pub-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pub-actions a:hover {
    border-color: var(--brand-300);
    background: var(--brand-50);
    color: var(--brand-700);
}

/* Empty states */
.empty-state {
    padding: 4rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
}

.empty-state i {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--brand-300);
    font-size: 2rem;
}

.empty-state p {
    margin-bottom: 1.1rem;
}

/* Prose and side cards */
.prose {
    max-width: 46rem;
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.2rem;
}

.prose p:last-child {
    margin-bottom: 0;
}

.side-card {
    padding: 1.4rem 1.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--canvas);
}

.side-card h2 {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
}

.side-card p {
    color: var(--muted);
    font-size: 0.88rem;
}

.side-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.side-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ink-soft);
    text-decoration: none;
}

.side-list a:hover {
    color: var(--brand-700);
}

/* Article detail */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.article-meta time {
    color: var(--faint);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-title {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    letter-spacing: -0.025em;
}

.article-image {
    display: block;
    width: 100%;
    max-height: 420px;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
}

.article-note {
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--canvas);
}

.article-note p {
    margin: 0 0 0.9rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.article-note-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-card h2 {
    margin-bottom: 1rem;
}

.related-list {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list .chip {
    justify-self: start;
}

.related-list a {
    display: grid;
    gap: 0.3rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.related-list a:hover {
    background: var(--surface);
}

.related-title {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.related-date {
    color: var(--faint);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* About page */
.about-block {
    margin-bottom: 2.75rem;
}

.about-block:last-child {
    margin-bottom: 0;
}

.about-block > h2 {
    margin-bottom: 1rem;
    font-size: 1.55rem;
}

.about-areas {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.about-areas a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.about-areas a:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.area-body {
    display: grid;
    gap: 0.25rem;
}

.area-title {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 600;
}

.area-desc {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.about-areas i {
    flex-shrink: 0;
    color: var(--brand-500);
}

.contact-list li {
    display: grid;
    gap: 0.05rem;
}

.contact-list span {
    color: var(--muted);
    font-size: 0.78rem;
}

.contact-list a {
    color: var(--ink-soft);
    font-size: 0.86rem;
    text-decoration: none;
}

.contact-list a:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

/* Error pages */
.error-page {
    padding: clamp(4rem, 10vw, 7.5rem) 0;
    text-align: center;
}

.error-code {
    color: var(--brand-200);
    font-family: var(--font-serif);
    font-size: clamp(5rem, 13vw, 9rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.85;
}

.error-page h1 {
    margin: 1.25rem 0 0.75rem;
}

.error-page p {
    margin: 0 auto 1.75rem;
    max-width: 30rem;
    color: var(--muted);
}

/* ==========================================================================
   Homepage — hero
   ========================================================================== */

.home-hero {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3.75rem, 6vw, 5.25rem);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(1100px 520px at 88% -12%, #f2e3f6 0%, rgba(242, 227, 246, 0) 62%),
        linear-gradient(180deg, #fdfafd 0%, #ffffff 100%);
}

.home-hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.13em;
}

.home-hero-parent {
    color: var(--brand-700);
    font-weight: 600;
    text-decoration: none;
}

.home-hero-parent:hover {
    text-decoration: underline;
}

.home-hero-sep {
    color: var(--line-strong);
}

.home-hero-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--line-strong);
}

.home-hero-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(3rem, 5.4vw, 4.7rem);
    font-weight: 600;
    letter-spacing: -0.032em;
    line-height: 0.95;
    white-space: nowrap;
}

.home-hero-title .brand-parent-text {
    color: #4b4553;
    font-weight: 400;
}

.home-hero-title .brand-branch-text {
    color: var(--ink);
    font-weight: 700;
}

.home-hero-tagline {
    margin: 0 0 0.3rem auto;
    color: var(--brand-700);
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.home-hero-ledby {
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.home-hero-ledby a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.home-hero-ledby a:hover {
    color: var(--brand-700);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem 1.4rem;
    margin-bottom: 2rem;
}

.home-hero-textlink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.home-hero-textlink i {
    transition: transform 0.2s ease;
}

.home-hero-textlink:hover {
    color: var(--brand-700);
}

.home-hero-textlink:hover i {
    transform: translateX(3px);
}

.home-hero-stats {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 1.4rem 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.home-hero-stats li {
    padding-right: clamp(1.25rem, 3vw, 2.25rem);
}

.home-hero-stats li + li {
    padding-left: clamp(1.25rem, 3vw, 2.25rem);
    border-left: 1px solid var(--line);
}

.home-hero-stats strong {
    display: block;
    color: var(--brand-800);
    font-family: var(--font-serif);
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.home-hero-stats span {
    display: block;
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-hero-figure {
    margin: 0;
}

/* The cover ratio is locked here: whatever photo is dropped in gets cropped
   to 15:8 and never changes the hero height. Change this one value to
   re-frame the cover. */
.home-hero-figure picture {
    display: block;
    overflow: hidden;
    aspect-ratio: 15 / 8;
    background: var(--brand-950);
    box-shadow: var(--shadow-lg);
}

.home-hero-figure img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: center 60%;
}

.home-hero-figure figcaption {
    margin-top: 0.7rem;
    color: var(--faint);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-align: right;
    text-transform: uppercase;
}

/* ==========================================================================
   Homepage — hiring callout
   ========================================================================== */

.home-callout {
    position: relative;
    z-index: 1;
    margin-top: -2.25rem;
}

.callout {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    overflow: hidden;
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(115deg, #300738 0%, #5a0a67 100%);
    box-shadow: var(--shadow-md);
    color: #ffffff;
}

.callout::after {
    content: "";
    position: absolute;
    top: -110px;
    right: -70px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
    pointer-events: none;
}

.callout-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.2rem;
}

.callout-body {
    flex: 1;
    min-width: 0;
}

.callout .eyebrow {
    margin-bottom: 0.25rem;
    color: #dfc1e6;
}

.callout-title {
    margin: 0 0 0.2rem;
    color: #ffffff;
    font-size: clamp(1.3rem, 2vw, 1.55rem);
}

.callout-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.55;
}

.callout-btn {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    border-color: #ffffff;
    background: #ffffff;
    color: var(--brand-800);
    box-shadow: none;
}

.callout-btn:hover {
    border-color: var(--brand-50);
    background: var(--brand-50);
    color: var(--brand-900);
}

/* ==========================================================================
   Homepage — sections
   ========================================================================== */

.home-section {
    padding: var(--section-y) 0;
}

.home-section--tint {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
}

/* Direction cards */
.direction-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.direction-card:hover {
    color: inherit;
    transform: translateY(-4px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
}

.direction-media {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--canvas-strong);
}

.direction-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.direction-card:hover .direction-media img {
    transform: scale(1.04);
}

.direction-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: linear-gradient(135deg, var(--brand-100), var(--canvas-strong));
    color: var(--brand-300);
    font-size: 1.6rem;
}

.direction-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.45rem 1.5rem 1.55rem;
}

.direction-body h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 1.8vw, 1.42rem);
    letter-spacing: -0.012em;
}

.direction-body p {
    margin: 0 0 1.15rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.direction-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    color: var(--brand-700);
    font-size: 0.8rem;
    font-weight: 600;
}

.direction-more i {
    transition: transform 0.2s ease;
}

/* News cards */
.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    height: 100%;
    padding: 1.4rem 1.45rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.news-card:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
}

.news-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.news-date {
    color: var(--faint);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.news-card h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 1.5vw, 1.16rem);
    line-height: 1.38;
    letter-spacing: -0.008em;
}

.news-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card .link-arrow {
    margin-top: auto;
    padding-top: 0.4rem;
}

/* Publication list */
.pub-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.pub-item {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr);
    gap: 1.35rem;
    align-items: baseline;
    padding: 1.05rem 0.4rem;
    border-bottom: 1px solid var(--line);
    transition: background 0.2s ease;
}

.pub-item:hover {
    background: var(--brand-50);
}

.pub-year {
    color: var(--brand-700);
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pub-title {
    margin: 0 0 0.15rem;
    font-family: var(--font-serif);
    font-size: 1.03rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.45;
}

.pub-title a {
    color: inherit;
    text-decoration: none;
}

.pub-title a:hover {
    color: var(--brand-800);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.pub-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.pub-type {
    margin-left: 0.55rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--line-strong);
    color: var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ==========================================================================
   Research direction detail
   ========================================================================== */

.direction-detail-content {
    max-width: 46rem;
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.8;
    white-space: pre-line;
}

/* ==========================================================================
   PI / member profile
   ========================================================================== */

.profile-header {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    flex-shrink: 0;
}

.pi-avatar-img {
    display: block;
    width: 180px;
    height: 180px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile--prof .profile-name {
    font-size: clamp(2.4rem, 4vw, 3.3rem);
}

.profile--prof .profile-title {
    font-size: 1.08rem;
}

@media (min-width: 992px) {
    .profile--prof .pi-avatar-img {
        width: 210px;
        height: 210px;
    }

    .profile--prof .profile-header .avatar {
        --avatar-size: 210px !important;
    }
}

.profile-name {
    margin: 0 0 0.2rem;
    font-size: clamp(2.1rem, 3.4vw, 2.9rem);
    letter-spacing: -0.025em;
}

/* Chinese identity overrides: a quieter second line, never a second headline. */
.profile-name-zh {
    display: block;
    margin-top: 0.1rem;
    color: var(--muted);
    font-family: var(--font-cjk-sans);
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.55;
}

.profile-title {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 1rem;
}

.profile-title-zh {
    margin-left: 0.55rem;
    color: var(--muted);
    font-family: var(--font-cjk-sans);
    font-size: 0.9rem;
    letter-spacing: 0;
}

.profile-title-zh::before {
    content: "·";
    margin-right: 0.55rem;
    color: var(--line-strong);
}

.profile-office-zh {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-family: var(--font-cjk-sans);
    font-size: 0.84rem;
    letter-spacing: 0;
    line-height: 1.7;
}

.profile-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.4rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.profile-meta li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
    color: var(--ink-soft);
}

.profile-meta i {
    flex-shrink: 0;
    margin-top: 0.18rem;
    color: var(--brand-500);
}

.profile-meta a {
    color: var(--ink-soft);
    text-decoration: none;
}

.profile-meta a:hover {
    color: var(--brand-700);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.profile-actions {
    flex-shrink: 0;
    align-self: flex-start;
}

.pi-header-btn {
    padding: 0.38rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
}

.pi-section-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
}

.pi-section-title .toggle-icon {
    margin-left: auto;
    color: var(--faint);
    font-size: 0.7rem;
}

.pi-section-title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 56px;
    height: 2px;
    background: var(--brand-700);
}

.pi-item-list {
    font-size: 0.92rem;
    line-height: 1.7;
}

.pi-item-list .text-warning {
    color: #b7791f !important;
}

.pi-interest-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pi-news-item {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.25rem 0 0.25rem 0.5rem;
    font-size: 0.92rem;
    line-height: 1.7;
}

.pi-news-date {
    flex-shrink: 0;
    min-width: 4.8em;
    color: var(--brand-500);
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.pi-news-list {
    display: grid;
    gap: 0.2rem;
}

.pi-news-text {
    flex: 1;
}

.pi-news-highlight {
    border-left: 3px solid var(--brand-700);
    border-radius: 0 4px 4px 0;
    background: var(--brand-50);
    padding-left: calc(0.5rem - 3px);
}

.pi-news-highlight .pi-news-date {
    color: var(--brand-700);
    font-weight: 600;
}

.pi-collapse-content {
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.pi-collapse-content.pi-collapsed {
    max-height: 0 !important;
    opacity: 0;
}

section.pi-section-collapsed {
    margin-bottom: 0.5rem !important;
}

.pi-extra-items {
    display: none;
}

.pi-view-toggle {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--brand-700);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pi-view-toggle:hover {
    color: var(--brand-900);
}

.pi-view-toggle i {
    transition: transform 0.3s ease;
}

.pi-toc-sidebar {
    position: sticky;
    top: 84px;
    width: auto;
}

.toc-heading {
    margin: 0 0 0.9rem;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Sidebar navigation */
.sidebar-link,
.pi-toc-link {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.sidebar-link:hover,
.pi-toc-link:hover {
    padding-left: 1rem;
    background: var(--brand-50);
    color: var(--brand-700);
}

.section-toggle {
    cursor: pointer;
    user-select: none;
}

.section-toggle:hover {
    color: var(--brand-800);
}

.section-toggle .toggle-icon {
    color: var(--faint);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.section-toggle[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

/* ==========================================================================
   SPA transitions (homepage ↔ profile)
   ========================================================================== */

.spa-exit {
    opacity: 0 !important;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.spa-enter {
    opacity: 0;
    transform: translateY(20px);
}

.spa-enter.spa-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#pi-anchor {
    transition: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 3.5rem 0 1.6rem;
    background: var(--footer-bg);
    color: #c3b2c9;
    font-size: 0.88rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1.25fr 1.25fr;
    gap: 2.5rem;
}

.footer-wordmark {
    display: inline-flex;
    align-items: baseline;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.footer-wordmark .brand-parent {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.footer-wordmark:hover {
    color: #ffffff;
}

.footer-desc {
    max-width: 32ch;
    margin: 0.9rem 0 0;
    color: #b3a0bb;
    font-size: 0.84rem;
    line-height: 1.65;
}

.footer-network {
    margin: 1.1rem 0 0;
    font-size: 0.78rem;
}

.footer-network-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #a894b0;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-network-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
}

.footer a {
    color: #d7c7dc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.footer-heading {
    margin: 0 0 0.95rem;
    color: #c9a8d2;
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.footer-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.footer-label {
    display: block;
    color: #ab97b3;
    font-size: 0.78rem;
}

.footer-address {
    margin: 0;
    color: #b3a0bb;
    font-size: 0.84rem;
    font-style: normal;
    line-height: 1.7;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.5rem;
    margin-top: 2.75rem;
    padding-top: 1.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ab97b3;
    font-size: 0.78rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-maintainer a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.footer-top {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #c3b2c9;
}

.footer .text-muted,
.footer .text-muted a {
    color: #b3a0bb !important;
}

/* ==========================================================================
   Misc
   ========================================================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.custom-page-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background-color: #ffffff;
}

.custom-page-bar {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
}

.custom-page-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.custom-page-bar a {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.custom-page-bar a:hover {
    color: var(--brand-700);
}

.custom-page-bar h1 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
}

.custom-page-wrapper {
    height: calc(100vh - var(--navbar-height) - 64px);
    min-height: 600px;
}

.accordion-button:not(.collapsed) {
    background-color: var(--canvas);
    color: var(--ink);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 8, 116, 0.18);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
    .footer-main {
        grid-template-columns: 1.5fr 1fr 1.2fr;
    }

    .footer-col:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .navbar > .container {
        min-height: 60px;
    }

    .navbar-collapse {
        margin-top: 0.35rem;
        padding: 0.25rem 0 0.85rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-prominent {
        align-items: stretch;
        gap: 0;
    }

    .nav-prominent .nav-link {
        padding: 0.75rem 0 0.75rem 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        font-size: 0.98rem;
    }

    .nav-prominent .nav-item:last-child .nav-link {
        border-bottom: 0;
    }

    .nav-prominent .nav-link::before {
        top: 0.8rem;
        bottom: 0.8rem;
        left: 0;
        width: 2px;
        height: auto;
        border-radius: 2px;
        transform: scaleY(0);
        transform-origin: top;
    }

    .nav-prominent .nav-link.active::before,
    .nav-prominent .nav-link[aria-current="page"]::before {
        transform: scaleY(1);
    }

    .nav-prominent .nav-link.active,
    .nav-prominent .nav-link[aria-current="page"] {
        color: #ffffff;
    }

    .dropdown-menu {
        margin-top: 0.35rem;
        border-color: rgba(255, 255, 255, 0.1);
        background: #3a0c44;
        box-shadow: none;
    }

    .dropdown-item {
        color: #e4d7e8;
    }

    .dropdown-item:hover,
    .dropdown-item:focus,
    .dropdown-item.active,
    .dropdown-item:active {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .dropdown-item .small {
        color: #b3a0bb !important;
    }

    .dropdown-header {
        color: #9c86a4;
    }

    .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .home-hero {
        padding-top: 2.25rem;
    }

    .home-hero-headline {
        gap: 0.6rem;
    }

    .home-hero-tagline {
        margin-left: 0;
    }

    .home-hero-figure {
        margin-top: 0.5rem;
    }

    .home-callout {
        margin-top: -1.6rem;
    }

    .callout {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.4rem;
    }

    .callout-body {
        flex: 1 1 15rem;
    }

    .callout-btn {
        margin-left: 3.4rem;
    }

    .profile-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .pi-avatar-img {
        width: 132px;
        height: 132px;
    }

    .profile-header .avatar {
        --avatar-size: 132px !important;
    }

    .profile-actions {
        width: 100%;
    }

    .pi-toc-sidebar {
        position: static;
        width: auto;
    }
}

@media (max-width: 767.98px) {
    .footer {
        padding-top: 2.75rem;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .profile-actions,
    .profile-actions .btn {
        width: 100%;
    }

    .profile-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-name-zh {
        font-size: 0.95rem;
    }

    .profile-title-zh {
        font-size: 0.85rem;
    }

    .profile-office-zh {
        font-size: 0.8rem;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-col:last-child {
        grid-column: auto;
    }

    .footer-top {
        margin-left: 0;
    }

    .home-hero-stats {
        gap: 1.25rem 0;
    }

    .home-hero-stats li {
        padding-right: 1.25rem;
    }

    .home-hero-stats li + li {
        padding-left: 1.25rem;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .pub-item {
        grid-template-columns: 3.2rem minmax(0, 1fr);
        gap: 1rem;
    }

    .callout-btn {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .page-count {
        padding-bottom: 0;
    }

    .home-hero-title {
        font-size: clamp(2.5rem, 11vw, 3.2rem);
    }

    .home-hero-eyebrow {
        font-size: 0.64rem;
        gap: 0.35rem;
    }

    .home-hero-sep {
        display: none;
    }

    .home-hero-headline {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-hero-tagline {
        margin-left: 0;
        font-size: 1rem;
    }

    .home-hero-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    .home-hero-stats li {
        padding-right: 0.6rem;
    }

    .home-hero-stats li + li {
        border-left: 1px solid var(--line);
        padding-left: 0.6rem;
    }

    .home-hero-stats strong {
        font-size: 1.5rem;
    }

    .home-hero-stats span {
        letter-spacing: 0.06em;
        line-height: 1.5;
        white-space: normal;
    }

    .callout {
        padding: 1.25rem;
    }

    .callout-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .achievement-card:hover,
    .member-card:hover,
    .direction-card:hover,
    .news-card:hover,
    .pi-interest-card:hover,
    .btn-primary:hover,
    .btn-outline-primary:hover {
        transform: none !important;
    }

    .direction-card:hover .direction-media img {
        transform: none !important;
    }
}

/* Blog projection */
.blog-hero { padding: 3.5rem 0 2rem; }
.blog-hero .eyebrow { margin: 0 0 .7rem; color: var(--brand); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.blog-hero h1 { margin: 0 0 .7rem; font-family: var(--font-serif); font-size: clamp(2.4rem, 4vw, 3.5rem); letter-spacing: -.03em; }
.blog-hero-copy { max-width: 42rem; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.blog-hero-tag { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 1.5rem 0 3rem; }
.blog-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.blog-card-cover { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-soft); }
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.blog-card:hover .blog-card-cover img { transform: scale(1.03); }
.blog-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.15rem 1.2rem 1.25rem; }
.blog-card-meta { margin: 0 0 .55rem; color: var(--muted); font-size: .75rem; letter-spacing: .02em; }
.blog-card-title { margin: 0 0 .55rem; font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.25; }
.blog-card-title a { color: var(--ink); text-decoration: none; }
.blog-card-title a:hover { color: var(--brand); }
.blog-card-summary { display: -webkit-box; overflow: hidden; margin: 0 0 1rem; color: var(--muted); font-size: .9rem; line-height: 1.6; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.blog-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; }
.blog-tags a { padding: .18rem .5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; text-decoration: none; }
.blog-tags a:hover { border-color: var(--brand); color: var(--brand); }
.blog-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem 0 3rem; color: var(--muted); font-size: .9rem; }
.blog-pagination a { color: var(--brand); text-decoration: none; }
.blog-empty { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.blog-empty h2 { font-family: var(--font-serif); color: var(--ink); }
.blog-article { max-width: 820px; padding-top: 3.5rem; padding-bottom: 4rem; }
.blog-article-header { margin-bottom: 2rem; text-align: left; }
.blog-article-header .eyebrow { margin: 0 0 .8rem; color: var(--brand); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.blog-article-header h1 { margin: 0 0 .8rem; font-family: var(--font-serif); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.12; letter-spacing: -.03em; }
.blog-article-summary { margin: 0 0 1rem; color: var(--muted); font-size: 1.1rem; line-height: 1.7; }
.blog-article-byline { color: var(--muted); font-size: .9rem; }
.blog-article-byline a { color: var(--brand); }
.blog-article-cover { width: 100%; margin-top: 1.5rem; border-radius: 12px; }
.article-body { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.8; }
.article-body h2, .article-body h3 { margin-top: 2rem; font-family: var(--font-serif); color: var(--ink); }
.article-body p { margin: 0 0 1.15rem; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.article-body pre { overflow-x: auto; padding: 1rem; border-radius: 8px; background: var(--surface-soft); }
.article-body blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--brand); color: var(--muted); }
.blog-article-tags { margin-top: 2rem; }
.blog-article-footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.blog-article-footer a { color: var(--brand); text-decoration: none; }
@media (max-width: 991.98px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .blog-grid { grid-template-columns: 1fr; } .blog-hero { padding-top: 2.5rem; } }
