:root {
    /* Warm paper palette */
    --bg-deep: #0d0c0a;
    --bg-paper: #f7f5f0;
    --bg-cream: #ece8df;
    --bg-warm: #e5dfd3;

    /* Ink colors */
    --ink-black: #1a1815;
    --ink-dark: #2d2924;
    --ink-medium: #5c564d;
    --ink-light: #8a847a;
    --ink-faint: #b8b2a6;

    /* Accent: Deep vermillion */
    --accent: #c1453b;
    --accent-soft: rgba(193, 69, 59, 0.12);
    --accent-hover: #a63a31;

    /* Chart palette */
    --chart-1: #c1453b;
    --chart-2: #2d5a4a;
    --chart-3: #8b6914;
    --chart-4: #4a5568;
    --chart-5: #744210;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

    /* Spacing */
    --section-gap: clamp(4rem, 10vw, 8rem);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-paper);
    color: var(--ink-dark);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ===== NOISE TEXTURE OVERLAY ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* ===== NAVIGATION ===== */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
}

.nav-fixed.scrolled {
    background: rgba(247, 245, 240, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ink-faint);
    padding: 0.75rem 2rem;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink-black);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-medium);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

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

/* ===== MOBILE NAV HAMBURGER ===== */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 110;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink-dark);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 245, 240, 0.98);
    backdrop-filter: blur(20px);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-mobile-overlay.active {
    display: flex;
    opacity: 1;
}

.nav-mobile-overlay .nav-link {
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    padding: 0.75rem 0;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--ink-light);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--ink-black);
    margin-bottom: 2rem;
    max-width: 14ch;
}

.hero-title span {
    display: block;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

.hero-title span:nth-child(1) { animation-delay: 0.3s; }
.hero-title span:nth-child(2) { animation-delay: 0.45s; }
.hero-title span:nth-child(3) { animation-delay: 0.6s; }

.hero-title .accent {
    color: var(--accent);
    font-style: italic;
}

.hero-desc {
    max-width: 520px;
    font-size: 1.15rem;
    color: var(--ink-medium);
    line-height: 1.7;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.75s;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.9s;
}

.hero-stat {
    position: relative;
}

.hero-stat::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--ink-faint);
}

.hero-stat:first-child::before {
    display: none;
}

.hero-stat-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 500;
    color: var(--ink-black);
    line-height: 1;
    letter-spacing: -0.02em;
}

.hero-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
    margin-top: 0.5rem;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards, float 3s ease-in-out infinite;
    animation-delay: 1.2s, 2s;
}

.hero-scroll-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-light);
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--ink-light), transparent);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== SECTION LAYOUTS ===== */
.section {
    padding: var(--section-gap) 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
    opacity: 1;
    transform: translateY(0);
}

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--ink-black);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.section-subtitle {
    margin-top: 1rem;
    font-size: 1.05rem;
    color: var(--ink-medium);
    max-width: 600px;
}

/* ===== STATS ROW ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--ink-faint);
    border: 1px solid var(--ink-faint);
    margin-bottom: var(--section-gap);
}

.stats-row .stat-cell {
    background: var(--bg-paper);
    padding: 2.5rem 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-row .stat-cell.revealed {
    opacity: 1;
    transform: translateY(0);
}

.stats-row .stat-cell:nth-child(1) { transition-delay: 0.1s; }
.stats-row .stat-cell:nth-child(2) { transition-delay: 0.2s; }
.stats-row .stat-cell:nth-child(3) { transition-delay: 0.3s; }
.stats-row .stat-cell:nth-child(4) { transition-delay: 0.4s; }

.stat-cell-value {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 500;
    color: var(--ink-black);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-cell-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-light);
    margin-top: 0.75rem;
}

/* ===== FIELD DISTRIBUTION CHART ===== */
.field-chart-section {
    padding: var(--section-gap) 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.chart-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.control-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
}

.control-select {
    padding: 0.9rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-paper);
    border: 2px solid var(--ink-faint);
    color: var(--ink-dark);
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235c564d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

.control-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.control-select:hover {
    border-color: var(--ink-medium);
    background-color: var(--bg-cream);
}

#availability-chart-container {
    min-height: 600px;
    background: transparent;
    padding: 0;
}

/* ===== DEPARTMENTS GRID ===== */
.departments-section {
    background: var(--bg-deep);
    color: var(--bg-paper);
    padding: var(--section-gap) 2rem;
    margin: var(--section-gap) 0;
}

.departments-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.departments-section .section-eyebrow {
    color: var(--chart-1);
}

.departments-section .section-title {
    color: var(--bg-paper);
}

.departments-section .section-subtitle {
    color: var(--ink-faint);
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    margin-top: 3rem;
}

.dept-card {
    background: var(--bg-deep);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.dept-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.dept-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dept-card:hover {
    background: rgba(255,255,255,0.03);
}

.dept-card:hover::before {
    transform: scaleY(1);
}

.dept-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--bg-paper);
    margin-bottom: 0.25rem;
}

.dept-country {
    font-size: 0.75rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
}

.dept-metrics {
    display: flex;
    gap: 2rem;
}

.dept-metric {
    display: flex;
    flex-direction: column;
}

.dept-metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent);
}

.dept-metric-label {
    font-size: 0.65rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* ===== DATA EXPLORER ===== */
.explorer-section {
    padding-bottom: 6rem;
}

.explorer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--bg-cream);
    border: 1px solid transparent;
    color: var(--ink-dark);
    transition: all 0.2s;
}

.search-input::placeholder {
    color: var(--ink-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-paper);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-light);
}

.record-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.explorer-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.download-btn:hover {
    color: #f7f5f0;
    border-color: rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.4);
}

.download-btn svg {
    flex-shrink: 0;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--ink-faint);
    background: var(--bg-paper);
    opacity: 1;
    transform: translateY(0);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
    background: var(--bg-cream);
    border-bottom: 1px solid var(--ink-faint);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.data-table th:hover {
    color: var(--ink-dark);
}

.data-table th.sorted {
    color: var(--accent);
}

.data-table th.sorted::after {
    content: ' ↓';
}

.data-table th.sorted.desc::after {
    content: ' ↑';
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.9rem;
    color: var(--ink-dark);
}

.data-table tr:hover td {
    background: var(--bg-cream);
}

.data-table .name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink-black);
}

.data-table .year {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
}

.data-table .dept-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-cream);
    border: 1px solid var(--ink-faint);
    color: var(--ink-medium);
}

.data-table .placement {
    color: var(--ink-medium);
    max-width: 300px;
}

.data-table .field {
    color: var(--ink-medium);
    font-size: 0.85rem;
    max-width: 200px;
}

.data-table .category-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 2px;
    white-space: nowrap;
}

.data-table .category-badge.cat-tenure-track {
    background: rgba(45, 90, 74, 0.12);
    color: #2d5a4a;
}

.data-table .category-badge.cat-private-sector {
    background: rgba(139, 105, 20, 0.12);
    color: #8b6914;
}

.data-table .category-badge.cat-other-academic {
    background: rgba(74, 85, 104, 0.12);
    color: #4a5568;
}

.data-table .category-badge.cat-central-banks {
    background: rgba(116, 66, 16, 0.12);
    color: #744210;
}

.data-table .category-badge.cat-international-orgs {
    background: rgba(49, 130, 206, 0.12);
    color: #2b6cb0;
}

.data-table .category-badge.cat-think-tanks {
    background: rgba(128, 90, 213, 0.12);
    color: #6b46c1;
}

.data-table .category-badge.cat-government {
    background: rgba(193, 69, 59, 0.12);
    color: #c1453b;
}

.data-table .category-badge.cat-unknown {
    background: var(--bg-cream);
    color: var(--ink-light);
}

/* Column filters */
.column-filter {
    margin-top: 0.5rem;
}

.filter-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    background: var(--bg-paper);
    border: 1px solid var(--ink-faint);
    color: var(--ink-dark);
    transition: all 0.2s;
}

.filter-input::placeholder {
    color: var(--ink-light);
    font-size: 0.7rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: transparent;
    border: 1px solid var(--ink-faint);
    color: var(--ink-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination .page-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-light);
}

/* ===== VISUALIZER DASHBOARD ===== */
.visualizer-section {
    background: var(--bg-deep);
    padding: var(--section-gap) 2rem;
    margin: 0;
}

.visualizer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.visualizer-section .section-eyebrow {
    color: var(--accent);
}

.visualizer-section .section-title {
    color: var(--bg-paper);
}

.visualizer-section .section-subtitle {
    color: var(--ink-faint);
}

.viz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.viz-panel {
    background: rgba(247, 245, 240, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    position: relative;
}

.viz-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

.viz-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.viz-chart-tabs {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.viz-tab-btn {
    padding: 0.85rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--ink-light);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.viz-tab-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.viz-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bg-paper);
}

.viz-tab-btn.active {
    background: var(--accent);
    color: var(--bg-paper);
}

.viz-chart-controls {
    margin-bottom: 1.5rem;
}

.viz-controls-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.viz-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.viz-control-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
}

.viz-select {
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    color: var(--bg-paper);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23f7f5f0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    min-width: 180px;
}

.viz-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.viz-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(193, 69, 59, 0.3);
}

.viz-select option {
    background: #1a1815;
    color: #f7f5f0;
    padding: 0.5rem;
}

.viz-toggle-group {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.viz-toggle-btn {
    padding: 0.65rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: transparent;
    border: none;
    color: var(--ink-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.viz-toggle-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.viz-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bg-paper);
}

.viz-toggle-btn.active {
    background: var(--accent);
    color: var(--bg-paper);
}

.viz-chart-container {
    min-height: 450px;
    margin-top: 1rem;
}

.viz-chart-container .highcharts-background {
    fill: transparent;
}

/* Category legend for charts */
.viz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.viz-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ink-faint);
    cursor: pointer;
    transition: opacity 0.2s ease;
    user-select: none;
}

.viz-legend-item:hover {
    opacity: 0.8;
}

.viz-legend-item.inactive {
    opacity: 0.35;
}

.viz-legend-item.inactive .viz-legend-color {
    background-color: #666 !important;
}

.viz-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .viz-chart-tabs {
        width: 100%;
    }

    .viz-tab-btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .viz-controls-row {
        flex-direction: column;
        gap: 1rem;
    }

    .viz-control-group {
        width: 100%;
    }

    .viz-select {
        width: 100%;
        min-width: 0;
    }

    .viz-toggle-group {
        width: 100%;
    }

    .viz-toggle-btn {
        flex: 1;
    }
}

/* ===== DEPARTMENT PROFILES SECTION ===== */
.profile-section {
    background: var(--bg-deep);
    padding: var(--section-gap) 2rem;
    margin: 0;
    max-width: none;
}

.profile-section::before {
    display: none;
}

.profile-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.profile-section .section-eyebrow {
    color: var(--accent);
}

.profile-section .section-title {
    color: var(--bg-paper);
}

.profile-section .section-subtitle {
    color: var(--ink-faint);
}

.profile-section .section-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Mode Tabs */
.profile-mode-tabs {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    width: fit-content;
}

.profile-mode-btn {
    padding: 0.85rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--ink-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-mode-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.profile-mode-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bg-paper);
}

.profile-mode-btn.active {
    background: var(--accent);
    color: var(--bg-paper);
}

/* Controls */
.profile-controls,
.compare-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 2rem;
    position: relative;
    z-index: 100;
}

/* Profile Card */
.profile-card,
.compare-card {
    background: rgba(247, 245, 240, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    position: relative;
}

.profile-card::before,
.compare-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

/* Stats Row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 2.5rem;
}

.profile-stat {
    background: var(--bg-deep);
    padding: 1.5rem;
    text-align: center;
}

.profile-stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--bg-paper);
    line-height: 1;
    letter-spacing: -0.02em;
}

.profile-stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
    margin-top: 0.5rem;
}

/* Two-column Grid */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.profile-grid-item {
    min-height: 280px;
}

.profile-grid-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
    margin-bottom: 1rem;
}

.profile-chart-container {
    min-height: 280px;
}

.profile-chart-wide {
    min-height: 350px;
}

/* Destinations List */
.dest-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dest-row:last-child {
    border-bottom: none;
}

.dest-rank {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    width: 1.5rem;
    flex-shrink: 0;
    text-align: center;
}

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

.dest-name {
    font-size: 0.85rem;
    color: var(--bg-paper);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.dest-bar-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.dest-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.dest-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-faint);
    flex-shrink: 0;
}

.dest-pct {
    color: var(--ink-light);
    font-size: 0.65rem;
}

.profile-no-data {
    color: var(--ink-light);
    font-size: 0.85rem;
    padding: 2rem 0;
    text-align: center;
}

/* Trend Section */
.profile-trend-section {
    margin-top: 0;
}

/* ===== COMPARISON VIEW ===== */

/* Multi-select component */
.multi-select-wrapper {
    position: relative;
    width: 100%;
    min-width: 280px;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.4rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.multi-select-trigger:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.multi-select-wrapper.open .multi-select-trigger {
    border-color: var(--accent);
}

.multi-select-placeholder {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--ink-light);
}

.multi-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.multi-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bg-paper);
    background: rgba(193, 69, 59, 0.25);
    border: 1px solid rgba(193, 69, 59, 0.4);
}

.multi-select-chip-remove {
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.multi-select-chip-remove:hover {
    opacity: 1;
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #1a1815;
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 0;
    overflow: hidden;
    z-index: 500;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    display: flex;
    flex-direction: column;
}

.multi-select-wrapper.open .multi-select-dropdown {
    max-height: 310px;
    opacity: 1;
}

.multi-select-search-wrap {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.multi-select-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--bg-paper);
    outline: none;
    box-sizing: border-box;
}

.multi-select-search::placeholder {
    color: rgba(184, 178, 166, 0.5);
}

.multi-select-search:focus {
    border-color: var(--accent);
}

.multi-select-options {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.multi-select-option {
    padding: 0.55rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--ink-faint);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.multi-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bg-paper);
}

.multi-select-option.selected {
    color: var(--accent);
    background: rgba(193, 69, 59, 0.08);
}

.multi-select-option.disabled {
    opacity: 0.35;
    cursor: default;
}

.multi-select-check {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
    transition: all 0.15s ease;
}

.multi-select-option.selected .multi-select-check {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Stats Grid (Comparison) */
.compare-stats-grid {
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-stats-header,
.compare-stats-row {
    display: grid;
    grid-template-columns: 1fr repeat(var(--dept-count, 2), 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.compare-stats-dept {
    background: rgba(193, 69, 59, 0.1);
    padding: 1rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--bg-paper);
    text-align: center;
}

.compare-stats-label {
    background: var(--bg-deep);
    padding: 0.85rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    display: flex;
    align-items: center;
}

.compare-stats-value {
    background: var(--bg-deep);
    padding: 0.85rem 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--bg-paper);
    text-align: center;
}

/* Chart section */
.compare-chart-section {
    margin-bottom: 2.5rem;
}

/* Destinations Grid (Comparison) */
.compare-dest-header {
    margin-bottom: 1rem;
}

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

.compare-dest-column {
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem;
}

.compare-dest-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--bg-paper);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-dest-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

.compare-dest-row:last-child {
    border-bottom: none;
}

.compare-dest-rank {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    width: 1.5rem;
    flex-shrink: 0;
}

.compare-dest-name {
    color: var(--bg-paper);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-dest-count {
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ===== METHODOLOGY SECTION ===== */
.methodology-section {
    background: var(--bg-cream);
    max-width: none;
    padding-left: 2rem;
    padding-right: 2rem;
}

.methodology-section .section-header {
    max-width: 1400px;
    margin: 0 auto 4rem auto;
}

.methodology-grid {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.methodology-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
    position: relative;
}

.methodology-step:last-child {
    padding-bottom: 0;
}

.step-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.25;
    line-height: 1;
    width: 80px;
    text-align: right;
    padding-right: 1.5rem;
    position: relative;
}

.step-number::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0.5rem;
    width: 1px;
    height: calc(100% + 2rem);
    background: linear-gradient(to bottom, var(--accent) 0%, transparent 100%);
    opacity: 0.2;
}

.methodology-step:last-child .step-number::after {
    display: none;
}

.step-content {
    padding-top: 0.25rem;
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--ink-black);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.step-description {
    font-size: 0.95rem;
    color: var(--ink-medium);
    line-height: 1.7;
    max-width: 560px;
}

/* ===== METHODOLOGY DETAILS SECTION ===== */
.methodology-details {
    max-width: 1000px;
    margin: 5rem auto 0 auto;
    padding: 0 2rem;
}

.methodology-details-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detail-card {
    background: linear-gradient(145deg, var(--bg-cream) 0%, var(--bg-paper) 100%);
    border: 1px solid rgba(45, 41, 36, 0.08);
    border-radius: 3px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    opacity: 0.5;
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.detail-card-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.detail-card-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--ink-black);
    letter-spacing: -0.02em;
}

.detail-card-intro {
    font-size: 0.95rem;
    color: var(--ink-medium);
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

/* Classification Cards */
.classification-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.classification-item {
    background: var(--bg-paper);
    border: 1px solid rgba(45, 41, 36, 0.06);
    border-radius: 3px;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: start;
    transition: all 0.2s ease;
}

.classification-item:hover {
    border-color: rgba(193, 69, 59, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.classification-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    width: 110px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.4;
}

.classification-badge.academic {
    background: rgba(45, 90, 74, 0.12);
    color: #2d5a4a;
}

.classification-badge.postdoc {
    background: rgba(139, 105, 20, 0.12);
    color: #8b6914;
}

.classification-badge.centralbank {
    background: rgba(59, 130, 156, 0.12);
    color: #2a6a7a;
}

.classification-badge.intlorg {
    background: rgba(106, 90, 140, 0.12);
    color: #5a4a8c;
}

.classification-badge.government {
    background: rgba(74, 85, 104, 0.12);
    color: #4a5568;
}

.classification-badge.thinktank {
    background: rgba(156, 100, 59, 0.12);
    color: #8a5a2a;
}

.classification-badge.private {
    background: rgba(193, 69, 59, 0.10);
    color: #a63a31;
}

.classification-text {
    font-size: 0.9rem;
    color: var(--ink-medium);
    line-height: 1.7;
}

.classification-challenge {
    margin-top: 1.75rem;
    background: rgba(193, 69, 59, 0.04);
    border-left: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 3px 3px 0;
}

.classification-challenge-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.classification-challenge-text {
    font-size: 0.88rem;
    color: var(--ink-medium);
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

.classification-challenge-text:last-child {
    margin-bottom: 0;
}

.classification-challenge-text strong {
    color: var(--ink-dark);
    font-weight: 500;
}

/* Data Availability Section */
.availability-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.availability-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.availability-marker {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 0.55rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.availability-text {
    font-size: 0.9rem;
    color: var(--ink-medium);
    line-height: 1.75;
}

.availability-text strong {
    color: var(--ink-dark);
    font-weight: 500;
}

/* Limitations Section */
.limitation-item {
    background: rgba(193, 69, 59, 0.04);
    border-left: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin-top: 0.75rem;
    border-radius: 0 3px 3px 0;
}

.limitation-dept {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.limitation-reason {
    font-size: 0.9rem;
    color: var(--ink-medium);
    line-height: 1.7;
}

.limitation-list {
    margin-top: 1rem;
    padding-left: 0;
    list-style: none;
}

.limitation-list li {
    font-size: 0.88rem;
    color: var(--ink-medium);
    line-height: 1.7;
    padding: 0.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid rgba(193, 69, 59, 0.3);
    margin-bottom: 0.5rem;
}

.limitation-list li:last-child {
    margin-bottom: 0;
}

.limitation-list li strong {
    color: var(--ink-dark);
    font-weight: 500;
}

.excluded-intro {
    font-size: 0.85rem;
    color: var(--ink-medium);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.excluded-dept-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.excluded-dept-badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(193, 69, 59, 0.08);
    color: var(--accent);
    border: 1px solid rgba(193, 69, 59, 0.2);
    border-radius: 4px;
    letter-spacing: 0.01em;
}

@media (max-width: 900px) {
    .methodology-details-grid {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .methodology-step {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .step-number {
        font-size: 2rem;
        text-align: left;
        padding-right: 0;
        width: auto;
    }

    .step-number::after {
        display: none;
    }

    .detail-card {
        padding: 1.5rem 1.25rem;
    }

    .classification-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .classification-badge {
        width: fit-content;
    }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-deep);
    color: var(--ink-faint);
    padding: 4rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--bg-paper);
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-link {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent);
}

/* ===== ABOUT MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-paper);
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--ink-dark);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--ink-dark);
    margin: 0;
}

.modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

.modal-bio {
    color: var(--ink-body);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-social {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-warm);
    border-radius: 6px;
    color: var(--ink-body);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.social-link:hover {
    background: var(--ink-dark);
    color: var(--bg-paper);
}

.social-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== PRIVACY NOTICE MODAL ===== */
.modal-content--wide {
    max-width: 640px;
}

.privacy-notice h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink-dark);
    margin: 1.5rem 0 0.5rem 0;
}

.privacy-notice h4:first-child {
    margin-top: 0;
}

.privacy-notice p {
    color: var(--ink-body);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
}

.privacy-notice ul {
    color: var(--ink-body);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
    padding-left: 1.5rem;
}

.privacy-notice li {
    margin-bottom: 0.35rem;
}

.privacy-notice a {
    color: var(--ink-dark);
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.2);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}

.privacy-notice a:hover {
    text-decoration-color: var(--ink-dark);
}

.privacy-updated {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero-stats {
        gap: 2.5rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: block;
    }

    .hero-title {
        font-size: clamp(3rem, 14vw, 5rem);
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .hero-stat::before {
        display: none;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

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

    .explorer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: none;
    }

    /* Methodology cards: full width on mobile */
    .methodology-details {
        padding: 0 0.5rem;
    }

    .detail-card {
        padding: 1.5rem 1rem;
    }

    /* Profile section responsive */
    .profile-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .profile-mode-tabs {
        width: 100%;
    }

    .profile-mode-btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .profile-controls,
    .compare-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .compare-selectors {
        flex-direction: column;
        align-items: stretch;
    }

    .compare-vs {
        text-align: center;
        padding: 0;
    }

    .compare-actions {
        margin-left: 0;
        flex-direction: column;
    }

    .compare-stats-header,
    .compare-stats-row {
        grid-template-columns: auto repeat(var(--dept-count, 2), 1fr);
    }

    .compare-stats-label {
        min-width: 80px;
        width: 80px;
        font-size: 0.55rem;
        padding: 0.5rem 0.4rem;
    }

    .compare-stats-value {
        font-size: 1rem;
        padding: 0.5rem 0.3rem;
    }

    .compare-stats-dept {
        font-size: 0.8rem;
        padding: 0.6rem 0.3rem;
    }

    .compare-destinations-grid {
        grid-template-columns: 1fr;
    }

    .profile-stat-value {
        font-size: 1.8rem;
    }

    /* Compact data table on mobile */
    .data-table th {
        padding: 0.6rem 0.5rem;
        font-size: 0.55rem;
        letter-spacing: 0.08em;
    }

    .data-table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .data-table .name {
        font-size: 0.8rem;
    }

    .data-table .year {
        font-size: 0.7rem;
    }

    .data-table .dept-badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.55rem;
    }

    .data-table .field {
        font-size: 0.7rem;
    }

    .data-table .placement {
        font-size: 0.75rem;
    }

    .data-table .category-badge {
        padding: 0.15rem 0.35rem;
        font-size: 0.55rem;
    }

    .column-filter .filter-input {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
    }

    /* Let page scroll through the availability chart on mobile */
    #availability-chart-container {
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    #availability-chart-container .highcharts-container {
        touch-action: pan-y !important;
    }
}

/* Highcharts removed */

/* ===== SCROLL REVEAL SYSTEM ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children delays */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.35s; }

/* ===== MICROINTERACTIONS ===== */

/* Button press effect */
.pagination button:active:not(:disabled),
.viz-tab-btn:active,
.viz-toggle-btn:active {
    transform: scale(0.96);
}

/* Search input focus glow */
.search-input:focus {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Table row hover slide-in accent */
.data-table tr {
    transition: background 0.2s ease;
}

.data-table tbody tr {
    position: relative;
}

.data-table tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.data-table tbody tr:hover::after {
    transform: scaleY(1);
}

/* Smooth category badge hover */
.category-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Dept badge subtle hover */
.data-table .dept-badge {
    transition: background 0.2s ease, border-color 0.2s ease;
}

.data-table .dept-badge:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Nav link underline animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* Footer link hover */
.footer-link {
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-link:hover::after {
    width: 100%;
}

/* Social link hover lift */
.social-link {
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Methodology step hover glow */
.methodology-step {
    transition: transform 0.3s ease;
}

.methodology-step:hover .step-number {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Detail card hover lift */
.detail-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* Viz panel hover glow */
.viz-panel {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.viz-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

/* ===== AMBIENT SCROLL PROGRESS BAR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #8b6914);
    z-index: 200;
    width: 0%;
    transition: width 0.1s linear;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-top: 1rem;
}

/* Dark section divider */
.departments-section .section-divider,
.visualizer-section .section-divider {
    background: linear-gradient(90deg, var(--accent), transparent);
}

/* ===== FLOATING PARTICLES (subtle ambient) ===== */
.ambient-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 20s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 22s; }
.particle:nth-child(2) { left: 20%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(3) { left: 50%; animation-delay: 7s; animation-duration: 25s; }
.particle:nth-child(4) { left: 70%; animation-delay: 2s; animation-duration: 20s; }
.particle:nth-child(5) { left: 85%; animation-delay: 10s; animation-duration: 23s; }
.particle:nth-child(6) { left: 35%; animation-delay: 5s; animation-duration: 19s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--ink-dark);
    border: 1px solid var(--ink-medium);
    color: var(--bg-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.back-to-top:active {
    transform: scale(0.92);
}

/* ===== SMOOTH SECTION TRANSITIONS ===== */
.section::before {
    content: '';
    display: block;
    height: 1px;
    width: 100%;
    max-width: 200px;
    margin: 0 auto 3rem auto;
    background: linear-gradient(90deg, transparent, var(--ink-faint), transparent);
    opacity: 0.5;
}

.hero::before,
.departments-section::before,
.visualizer-section::before,
.methodology-section::before {
    display: none;
}

/* ===== IMPROVED MODAL ANIMATION ===== */
.modal-content {
    transform: translateY(30px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* ===== LOADING SKELETON PULSE ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== ACTIVE NAV INDICATOR ===== */
.nav-link.active {
    color: var(--accent);
}

/* ===== CUSTOM SELECT DROPDOWN (replaces native iOS pickers) ===== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--bg-paper);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger::after {
    content: '';
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23f7f5f0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.custom-select-wrapper.open .custom-select-trigger::after {
    transform: rotate(180deg);
}

.custom-select-trigger:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    background: #1a1815;
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 0;
    overflow-y: auto;
    z-index: 500;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    -webkit-overflow-scrolling: touch;
}

.custom-select-wrapper.open .custom-select-dropdown {
    max-height: 260px;
    opacity: 1;
}

.custom-select-option {
    padding: 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #f7f5f0;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-option:hover,
.custom-select-option.highlighted {
    background: rgba(255, 255, 255, 0.08);
}

.custom-select-option.selected {
    color: var(--accent);
    background: rgba(193, 69, 59, 0.1);
}

.custom-select-option.disabled {
    color: rgba(255, 255, 255, 0.25);
    cursor: default;
    font-size: 0.7rem;
    padding: 0.4rem 1rem;
}

/* Light theme custom selects (for data availability section) */
.custom-select-wrapper.light .custom-select-trigger {
    background-color: var(--bg-paper);
    border: 2px solid var(--ink-faint);
    color: var(--ink-dark);
}

.custom-select-wrapper.light .custom-select-trigger::after {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235c564d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.custom-select-wrapper.light .custom-select-trigger:hover {
    border-color: var(--ink-medium);
    background-color: var(--bg-cream);
}

.custom-select-wrapper.light .custom-select-dropdown {
    background: var(--bg-paper);
    border: 2px solid var(--ink-faint);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.custom-select-wrapper.light .custom-select-option {
    color: var(--ink-dark);
}

.custom-select-wrapper.light .custom-select-option:hover,
.custom-select-wrapper.light .custom-select-option.highlighted {
    background: var(--bg-cream);
}

.custom-select-wrapper.light .custom-select-option.selected {
    color: var(--accent);
    background: var(--accent-soft);
}
