/* -----------------------------
   Design System (Ultra-Professional)
   Reused from DARE Lab architecture
-------------------------------- */
:root {
    /* Colors - Sophisticated Monochromatic Slate (HSL) */
    --h: 230;
    --s: 12%;

    --bg-h: 230;
    --bg-s: 10%;
    --bg-l: 4%;
    --bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
    --bg-subtle: hsl(var(--bg-h), var(--bg-s), 8%);

    --text: hsl(210, 20%, 96%);
    --text-muted: hsl(210, 10%, 65%);
    --text-dim: hsl(210, 8%, 45%);

    --brand: #ffffff;
    --accent-h: 217;
    --accent-s: 91%;
    --accent-l: 60%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);

    --border: hsla(0, 0%, 100%, 0.06);
    --border-strong: hsla(0, 0%, 100%, 0.12);

    --glass: hsla(var(--bg-h), var(--bg-s), 8%, 0.7);
    --glass-border: hsla(0, 0%, 100%, 0.05);
    --glass-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.03);

    --radius: 10px;
    --radius-lg: 16px;
    --max: 1200px;

    --font-serif: 'Instrument Serif', serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    --grid-gap: 2rem;
}

[data-theme="light"] {
    --bg-h: 210;
    --bg-s: 20%;
    --bg-l: 100%;
    --bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
    --bg-subtle: hsl(var(--bg-h), var(--bg-s), 97%);
    --text: hsl(220, 40%, 10%);
    --text-muted: hsl(215, 15%, 40%);
    --text-dim: hsl(215, 10%, 55%);
    --border: hsla(0, 0%, 0%, 0.08);
    --border-strong: hsla(0, 0%, 0%, 0.15);
    --glass: hsla(0, 0%, 100%, 0.8);
    --glass-border: hsla(0, 0%, 0%, 0.05);
    --glass-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.02);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* -----------------------------
   Base Styles
-------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.01) 0px, transparent 50%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.01em;
}

p {
    font-size: 1.05rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

.container {
    width: min(var(--max), calc(100% - 64px));
    margin: 0 auto;
}

/* -----------------------------
   Typography Utils
-------------------------------- */
.label {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.hero-btn {
    padding: var(--space-4) var(--space-10);
    font-size: var(--text-base);
}

.card-accent {
    background: var(--accent) !important;
    color: white !important;
}

.card-accent .label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-accent h3 {
    color: white !important;
    margin-bottom: var(--space-4);
}

.card-accent p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
}

.divider-top {
    margin-top: var(--space-6);
    border-top: 1px solid var(--border);
    padding-top: var(--space-6);
}

.card-accent .divider-top {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.profile-compact {
    padding: var(--space-6);
}

.profile-img-sm {
    margin-bottom: var(--space-4);
    width: 60px;
    height: 60px;
}

.heading-compact {
    font-size: var(--text-xl);
}

.text-compact {
    font-size: 0.85rem;
}

.section-spacing-sm {
    margin-top: var(--space-6);
}

/* Footer */
.footer-style {
    padding: var(--space-20) 0;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: var(--text-2xl);
    letter-spacing: -0.04em;
}

.footer-text {
    color: var(--text-dim);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.drawer-close {
    position: absolute;
    top: var(--space-8);
    right: var(--space-8);
}

/* -----------------------------
   Header
-------------------------------- */
.header {
    position: fixed;
    top: 1.5rem;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-pill {
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 hsla(0, 0%, 100%, 0.1);
    position: relative;
    overflow: hidden;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(15px);
    transition:
        opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.menu a.active {
    color: var(--text) !important;
    opacity: 1 !important;
}

.menu a.active::after {
    width: 100% !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2;
}

.brand span {
    font-size: 1.1rem;
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.menu {
    display: flex;
    gap: 1.5rem;
    z-index: 2;
}

.menu a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    padding: 0.5rem 0.25rem;
    position: relative;
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu a:hover {
    color: var(--text);
    opacity: 1;
}

.menu a:hover::after {
    width: 100%;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
}

.drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: var(--bg);
    z-index: 2000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.drawer.active {
    opacity: 1;
}

.drawer .menu {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.drawer .menu a {
    font-size: 1.75rem;
    font-family: var(--font-serif);
}

.btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn.primary {
    background: var(--text);
    color: var(--bg);
}

.btn.primary:hover {
    background: #fff;
    transform: translateY(-1px);
    opacity: 1;
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn.secondary:hover {
    background: var(--brand-muted);
    transform: translateY(-1px);
    opacity: 1;
}

.btn-theme {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.btn-theme:hover {
    color: var(--text);
}

/* CV Download Button */
.btn-cv {
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), 55%));
    color: #fff;
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(79, 138, 247, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-cv::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-cv:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 138, 247, 0.5);
    opacity: 1;
}

.btn-cv:hover::before {
    left: 100%;
}

.btn-cv:active {
    transform: translateY(0);
}

.cv-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.cv-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.cv-note {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

/* CV Loading Overlay */
#cv-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

#cv-loading-overlay.active {
    display: flex;
}

.cv-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cv-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes cv-spin {
    to {
        transform: rotate(360deg);
    }
}

#cv-print-container {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 794px;
    /* A4 width at 96 DPI */
    background: white;
    color: #1e293b;
}

/* -----------------------------
   Hero
-------------------------------- */
.hero {
    padding: 9rem 0 5rem 0;
    text-align: center;
}

.hero-profile {
    margin-bottom: 2rem;
}

.hero-avatar {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 3px solid var(--border-strong);
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hero .label {
    margin-bottom: 1.5rem;
    display: block;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 0.95;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 3.5rem) !important;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-muted) !important;
    text-transform: none;
    margin-bottom: 1rem !important;
    display: block;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    line-height: 1;
}

.hero p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    font-size: 1.15rem;
    line-height: 1.4;
}

.hero-affiliation {
    margin-bottom: 2rem;
}

.hero-affiliation span {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 400;
}

/* Hero Actions & Social Links */
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.social-links a {
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
    opacity: 1;
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* -----------------------------
   Bento Grid Layout
-------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

.bento-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 0.4s ease,
        box-shadow 0.4s ease;
    box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.1);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 24px hsla(0, 0%, 0%, 0.2), 0 0 0 1px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.1);
}

.bento-card:hover::before {
    opacity: 1;
}

.card-accent {
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), 50%)) !important;
    border-color: hsla(var(--accent-h), var(--accent-s), 100%, 0.1) !important;
}

.card-accent::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.card-medium {
    grid-column: span 2;
}

.bento-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.bento-card .role {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Profile Styles */
.profile-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.scholar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 1rem;
    font-weight: 500;
}

.scholar-link:hover {
    text-decoration: underline;
    opacity: 1;
}

/* -----------------------------
   Contact List
-------------------------------- */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-item a {
    color: var(--accent);
}

.contact-item a:hover {
    text-decoration: underline;
    opacity: 1;
}

.contact-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Profiles List */
.profile-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.profile-links-list .scholar-link {
    margin-top: 0;
    font-size: 0.9rem;
}

/* -----------------------------
   Tag Cloud
-------------------------------- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* -----------------------------
   Timeline (Education)
-------------------------------- */
.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-strong);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2.25rem;
    top: 1.75rem;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 3px var(--accent);
    z-index: 1;
}

.timeline-card {
    margin-left: 0;
}

.institution-text {
    font-size: 0.9rem !important;
    color: var(--text-dim) !important;
    font-style: italic;
    margin-top: 0.25rem;
}

.thesis-text {
    font-size: 0.88rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.04);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.advisor-text {
    font-size: 0.85rem !important;
    color: var(--text-dim) !important;
    margin-top: 0.5rem;
}

/* -----------------------------
   Positions Grid
-------------------------------- */
.positions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--grid-gap);
}

.position-list {
    margin-top: 1rem;
}

.position-entry {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.position-entry:last-child {
    border-bottom: none;
}

.position-date {
    flex-shrink: 0;
    width: 110px;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    padding-top: 0.1rem;
    letter-spacing: 0.02em;
}

.position-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.position-details strong {
    font-size: 0.9rem;
    color: var(--text);
}

.position-details .institution-text {
    font-size: 0.82rem !important;
    margin-top: 0 !important;
}

/* -----------------------------
   Publications
-------------------------------- */
.pub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pub-tab {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.pub-tab:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.pub-tab.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.pub-panel {
    display: none;
}

.pub-panel.active {
    display: block;
}

.pub-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pub-counter;
}

.pub-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.pub-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-strong);
    align-items: center;
}

.pub-header span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.pub-header .q-label {
    min-width: 80px;
    text-align: center;
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-year {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    margin-top: 0.1rem;
    letter-spacing: 0.03em;
}

.pub-content p {
    font-size: 0.9rem !important;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.pub-content strong {
    color: var(--text);
}

.pub-content em {
    color: var(--text);
    font-style: italic;
}

.doi-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.doi-link:hover {
    background: rgba(59, 130, 246, 0.1);
    opacity: 1;
}

.pub-q {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-strong);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 100%;
    margin-top: 0;
}

/* -----------------------------
   Courses
-------------------------------- */
.course-list {
    margin-top: 1rem;
}

.course-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.course-row:last-child {
    border-bottom: none;
}

.course-name {
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
}

.course-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* -----------------------------
   Sections
-------------------------------- */
section {
    padding: 4.5rem 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.section-title h2 {
    font-size: 3.5rem;
}

/* -----------------------------
   Animations
-------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------
   Responsive
-------------------------------- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        width: calc(100% - 32px);
    }

    .nav-pill {
        width: calc(100% - 32px);
        justify-content: space-between;
        gap: 1rem;
    }

    .nav-pill .menu,
    .nav-pill .btn.primary,
    .nav-pill .btn-theme {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .hero-avatar {
        width: 100px;
        height: 100px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 1.5rem;
    }

    .social-links {
        gap: 1.5rem;
    }

    .social-links svg {
        width: 24px;
        height: 24px;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .positions-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bento-card {
        padding: 1.5rem;
    }

    .card-large,
    .card-medium {
        grid-column: span 1;
    }

    section {
        padding: 3rem 0;
    }

    .hero {
        padding: 6rem 0 4rem 0;
    }

    .footer-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer-flex .menu {
        flex-direction: column;
        gap: 0.75rem;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: -1.75rem;
    }

    .position-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .position-date {
        width: auto;
    }

    .course-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .course-meta {
        margin-left: 0;
    }

    .pub-item {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .pub-header {
        display: none;
    }

    .pub-q {
        display: inline-flex;
        align-self: flex-start;
        min-width: auto;
        font-size: 1.5rem;
        padding: 0.35rem 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .bento-card {
        padding: 1.25rem;
    }

    section {
        padding: 2.5rem 0;
    }
}

.project-budget {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.08);
    border: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    letter-spacing: 0.05em;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.project-budget::before {
    content: "Budget";
    font-size: 0.55rem;
    text-transform: uppercase;
    opacity: 0.55;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.card-accent .project-budget {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.selected-badge::before {
    content: '★';
    font-size: 0.8rem;
}

/* -----------------------------
   Analysis & Graphs
-------------------------------- */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), hsl(var(--accent-h), var(--accent-s), 75%));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 8px 24px hsla(0, 0%, 0%, 0.15);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-source {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.metric-number {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.metrics-note {
    font-size: 0.75rem !important;
    color: var(--text-dim) !important;
    text-align: center;
    margin-bottom: 2.5rem;
    font-style: italic;
}

.analysis-divider {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 0 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}

.analysis-divider h3 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.project-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    max-height: 420px;
}

.project-charts-col-stacked {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-charts-col-stacked .chart-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.project-charts-col-stacked .chart-card h4,
.project-charts-col-stacked .chart-card .chart-desc {
    text-align: left;
}

.project-charts-col-stacked .chart-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.project-charts-col-stacked .chart-wrapper {
    min-height: 0;
    height: 170px;
    width: 200px;
    flex-shrink: 0;
}

.project-budget-card {
    display: flex;
    flex-direction: column;
}

.project-budget-card .chart-wrapper {
    flex: 1;
    min-height: 0;
    max-height: 380px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.analysis-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 8px 20px hsla(0, 0%, 0%, 0.12);
}

.chart-card h4 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.chart-desc {
    font-size: 0.78rem !important;
    color: var(--text-dim) !important;
    margin-bottom: 1.25rem !important;
    margin-top: 0 !important;
}

.chart-legend-inline {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.chart-legend-inline span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-legend-inline i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 260px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive */
@media (max-width: 768px) {
    .metrics-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .metric-card {
        padding: 1.25rem 0.75rem;
    }

    .metric-number {
        font-size: 2.25rem;
    }

    .metric-source {
        font-size: 0.55rem;
        padding: 0.15rem 0.4rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .analysis-grid-3 {
        grid-template-columns: 1fr;
    }

    .project-charts-row {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .project-charts-col-stacked .chart-card {
        flex-direction: column;
    }

    .project-charts-col-stacked .chart-wrapper {
        width: 100%;
        height: 200px;
    }

    .chart-card {
        padding: 1.25rem;
    }

    .chart-wrapper {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .metric-number {
        font-size: 1.75rem;
    }
}
