@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* ==========================================================================
   THEME DESIGN TOKENS (Modern Tech-Forward Academic)
   Balancing prestigious academic authority with clean, modern digital innovation.
   ========================================================================== */
:root {
    /* Base Color Palette (Warm Paper & Intellectual Deep Blue) */
    --bg-color: #faf9f6;
    --bg-gradient: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(37, 99, 235, 0.04), transparent 75%);
    --header-bg: rgba(250, 249, 246, 0.88);
    
    --text-primary: #0f172a;        /* Slate 900 */
    --text-secondary: #334155;      /* Slate 700 - rich, highly readable */
    --text-muted: #64748b;          /* Slate 500 */
    
    --accent-color: #1e3a8a;        /* Deep Academic Blue */
    --accent-interactive: #2563eb;  /* Contemporary Cobalt Blue */
    --accent-hover: #1d4ed8;
    --accent-subtle: rgba(37, 99, 235, 0.07);
    --accent-border: rgba(37, 99, 235, 0.18);

    --border-color: #e2e8f0;
    --border-hover: rgba(37, 99, 235, 0.35);
    
    --card-bg: #ffffff;
    --card-subtle-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 4px 16px -2px rgba(15, 23, 42, 0.04);
    --card-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', "SF Mono", Consolas, monospace;

    /* Radius & Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-speed: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
    /* Base Color Palette (Deep Midnight Indigo-Slate & Luminous Sky Blue) */
    --bg-color: #0b0f19;
    --bg-gradient: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(56, 189, 248, 0.07), transparent 75%);
    --header-bg: rgba(11, 15, 25, 0.88);
    
    --text-primary: #f8fafc;        /* Slate 50 */
    --text-secondary: #cbd5e1;      /* Slate 300 */
    --text-muted: #64748b;          /* Slate 500 */
    
    --accent-color: #93c5fd;
    --accent-interactive: #38bdf8;  /* Luminous Sky Cyan */
    --accent-hover: #7dd3fc;
    --accent-subtle: rgba(56, 189, 248, 0.1);
    --accent-border: rgba(56, 189, 248, 0.22);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.4);
    
    --card-bg: #111827;             /* Elevated Slate 900 */
    --card-subtle-bg: #162032;
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   GLOBAL RESET & ACCESSIBILITY
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.72;
    letter-spacing: -0.01em;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--accent-subtle);
    color: var(--accent-interactive);
}

/* ==========================================================================
   LAYOUT & CONTAINER
   ========================================================================== */
.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.75rem;
    flex-grow: 1;
}

/* ==========================================================================
   FLOATING GLASSMORPHIC HEADER & NAVIGATION
   ========================================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 0;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    transition: color var(--transition-fast);
}

.logo-link:hover .logo-text {
    color: var(--accent-interactive);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    transition: color var(--transition-speed);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--accent-subtle);
}

.nav-link.active {
    color: var(--accent-interactive);
    background-color: var(--accent-subtle);
    font-weight: 600;
}

/* Remove old underline bar */
.nav-link::after {
    display: none;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
    background-color: var(--card-subtle-bg);
    border-color: var(--border-hover);
    color: var(--accent-interactive);
    transform: rotate(15deg) scale(1.05);
}

.theme-toggle-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2.75rem 0;
    margin-top: 5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: border-color var(--transition-speed);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   MAIN CONTENT & TYPOGRAPHY
   ========================================================================== */
main {
    padding: 3.5rem 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

h1 {
    font-size: 2.35rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.65rem;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color var(--transition-speed);
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ==========================================================================
   HOMEPAGE PROFILE & SIDEBAR
   ========================================================================== */
.profile-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3.5rem;
    align-items: start;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: sticky;
    top: 5.5rem;
}

.avatar-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--border-color), 0 10px 25px -4px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.avatar-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px var(--accent-interactive), 0 16px 32px -4px rgba(37, 99, 235, 0.15);
}

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

.profile-name {
    font-size: 1.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}

.profile-title {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 500;
}

.contact-list {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.contact-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
}

.contact-item a:hover {
    background-color: var(--card-subtle-bg);
    border-color: var(--accent-interactive);
    color: var(--accent-interactive);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.contact-item svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ==========================================================================
   TAGS / CHIPS (Clean, refined pill design - NOT terminal/nerd style)
   ========================================================================== */
.pub-tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    background-color: var(--accent-subtle);
    color: var(--accent-interactive);
    border: 1px solid var(--accent-border);
    margin-bottom: 0.6rem;
    transition: all var(--transition-fast);
}

.pub-tag:hover {
    transform: translateY(-1px);
    border-color: var(--accent-interactive);
    background-color: var(--card-bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Specific Journal Tag on Research Page (slightly distinguished) */
.pub-card .pub-tag {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
}

/* ==========================================================================
   HOMEPAGE TIMELINE & UPDATES
   ========================================================================== */
.timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin: 2rem 0;
    padding-left: 1.75rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.25rem;
}

.timeline-item:last-child {
    margin-bottom: 0.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1.75rem - 7px);
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background-color: var(--card-bg);
    border: 2px solid var(--accent-interactive);
    box-shadow: 0 0 0 3px var(--bg-color);
    transition: all var(--transition-speed);
}

.timeline-item:hover::before {
    background-color: var(--accent-interactive);
    transform: scale(1.25);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-interactive);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-content {
    font-size: 0.96rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline .pub-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-interactive);
    text-decoration: none;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    margin-top: 0.4rem;
    transition: all var(--transition-fast);
}

.timeline .pub-link-btn:hover {
    background-color: var(--accent-interactive);
    color: #ffffff;
    border-color: var(--accent-interactive);
    transform: translateX(3px);
}

/* ==========================================================================
   RESEARCH & PUBLICATIONS
   ========================================================================== */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.pub-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    position: relative;
}

.pub-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.pub-authors .author-self {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--accent-border);
    text-underline-offset: 3px;
}

.pub-venue {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.15rem;
}

.pub-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.pub-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all var(--transition-fast);
}

.pub-link-btn:hover {
    color: var(--accent-interactive);
    border-color: var(--accent-interactive);
    background-color: var(--accent-subtle);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.pub-link-btn svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Collapsible Abstract */
.abstract-container {
    margin-top: 1.15rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.85rem;
}

.abstract-toggle {
    background: none;
    border: none;
    color: var(--accent-interactive);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0;
    transition: opacity var(--transition-fast);
}

.abstract-toggle:hover {
    opacity: 0.85;
}

.abstract-toggle svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform var(--transition-fast);
}

.abstract-toggle.active svg {
    transform: rotate(180deg);
}

.abstract-text {
    display: none;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 0.75rem;
    padding: 1.1rem 1.25rem;
    background-color: var(--card-subtle-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-interactive);
    animation: fadeIn 0.3s ease;
}

/* NotebookLM Audio Brief Container */
.audio-brief-card {
    background: var(--card-subtle-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    margin: 1.25rem 0;
    transition: border-color var(--transition-speed);
}

.audio-brief-card:hover {
    border-color: var(--border-hover);
}

.audio-brief-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.audio-brief-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--accent-interactive);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audio-brief-player {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 100px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.audio-brief-player iframe {
    border: none;
    display: block;
    width: 100%;
    height: 100%;
}

[data-theme="dark"] .audio-brief-player iframe {
    filter: invert(0.9) hue-rotate(180deg);
}

/* Working papers list */
.research-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.research-list-item {
    position: relative;
    padding-left: 1.5rem;
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.research-list-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-interactive);
    font-weight: bold;
    font-size: 1.2rem;
    top: -2px;
}

/* ==========================================================================
   TEACHING & COURSES
   ========================================================================== */
.statement-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
}

.statement-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
}

.statement-content {
    flex-grow: 1;
    padding-right: 1.5rem;
}

.statement-content p {
    margin-bottom: 0;
}

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

.course-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

.course-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
}

.course-code {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-interactive);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.course-name {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.course-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.course-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   CV TIMELINE & DOWNLOAD
   ========================================================================== */
.cv-section {
    margin-bottom: 3.5rem;
}

.cv-download-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem 2.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

.cv-download-section:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
}

.cv-download-text h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
}

.cv-download-text p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--text-primary);
    color: var(--bg-color);
    text-decoration: none;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all var(--transition-speed);
    border: 1px solid var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background-color: var(--accent-interactive);
    border-color: var(--accent-interactive);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.cv-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.cv-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.cv-date {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-interactive);
    font-size: 0.85rem;
    padding-top: 0.15rem;
}

.cv-detail h4 {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.cv-institution {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.cv-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   BLOG POST ARTICLES
   ========================================================================== */
.post-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   PAGE ANIMATIONS & NATIVE VIEW TRANSITIONS
   ========================================================================== */
@view-transition {
    navigation: auto;
}

header {
    view-transition-name: site-header;
}

main {
    view-transition-name: site-main;
}

::view-transition-old(site-main) {
    animation: 120ms cubic-bezier(0.4, 0, 1, 1) both mainFadeOut;
}

::view-transition-new(site-main) {
    animation: 180ms cubic-bezier(0, 0, 0.2, 1) 30ms both mainFadeIn;
}

@keyframes mainFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-3px); }
}

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

::view-transition-group(site-header) {
    animation-duration: 200ms;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
    .fade-in {
        animation: none !important;
    }
}

.fade-in {
    animation: pageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    main {
        padding: 2.25rem 0;
    }

    .profile-section {
        grid-template-columns: 1fr;
        gap: 2.75rem;
    }

    .profile-sidebar {
        position: static;
        max-width: 340px;
        margin: 0 auto;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .cv-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .cv-date {
        font-size: 0.85rem;
        margin-bottom: 0.15rem;
    }

    .statement-card, .cv-download-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .statement-content {
        padding-right: 0;
    }
}

@media (max-width: 576px) {
    .header-container {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }

    .nav-controls {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    nav {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}
