:root {
    /* Base Colors */
    --color-bg-light: #f8f9fa;
    --color-bg-dark: #0f172a;

    --color-text-main-light: #1f2937;
    --color-text-muted-light: #4b5563;
    --color-text-main-dark: #f3f4f6;
    --color-text-muted-dark: #9ca3af;

    --color-primary: #2563eb;
    /* Royal Blue */
    --color-primary-hover: #1d4ed8;
    --color-accent: #3b82f6;
    --color-primary-dark: #93c5fd;
    /* Light blue — passes 4.5:1 on dark backgrounds */

    /* Card & UI */
    --card-bg-light: rgba(255, 255, 255, 0.85);
    --card-bg-dark: rgba(30, 41, 59, 0.7);
    --card-border-light: rgba(255, 255, 255, 0.6);
    --card-border-dark: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-dark: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);

    /* Contact form */
    --form-bg: white;
    --form-border: transparent;

    /* Fonts */
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Merriweather', serif;

    /* Animation durations */
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.6s;

    /* Spacing */
    --spacing-toolbar: 1.5rem;
    --padding-top-container: 6rem;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease;
    background-attachment: fixed;
    background-size: cover;
}

/* --- Theme Specifics --- */
body.light-theme {
    background-color: var(--color-bg-light);
    color: var(--color-text-main-light);
    /* Subtle mesh gradient for modern feel */
    background-image: radial-gradient(at 0% 0%, hsla(217, 91%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(203, 89%, 93%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(210, 92%, 90%, 1) 0, transparent 50%);
}

body.dark-theme {
    background-color: var(--color-bg-dark);
    color: var(--color-text-main-dark);
    background-image: radial-gradient(at 0% 0%, hsla(222, 47%, 11%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(222, 47%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(222, 47%, 11%, 1) 0, transparent 50%);

    --form-bg: #1e293b;
    --form-border: rgba(255, 255, 255, 0.1);
}

/* --- Skip Link (WCAG 2.4.1) --- */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    font-size: 0.875rem;
}

.skip-link:focus {
    top: 0;
}

/* --- Toolbar --- */
.toolbar {
    position: fixed;
    top: var(--spacing-toolbar);
    right: var(--spacing-toolbar);
    display: flex;
    gap: 0.75rem;
    z-index: 100;
}

.language-selector,
.theme-selector {
    background: var(--card-bg-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--card-border-light);
    padding: 0.3rem;
    border-radius: 9999px;
    /* Pill shape */
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
}

body.dark-theme .language-selector,
body.dark-theme .theme-selector {
    background: var(--card-bg-dark);
    border-color: var(--card-border-dark);
    box-shadow: var(--shadow-dark);
}

.toolbar button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: 9999px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: inherit;
    transition: background-color var(--duration-fast), color var(--duration-fast);
}

.toolbar button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.toolbar button.active,
.toolbar button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
}

body.dark-theme .toolbar button:focus-visible {
    outline: 2px solid var(--color-primary-dark);
}

body.dark-theme .toolbar button.active,
body.dark-theme .toolbar button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-primary-dark);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1000px;
    padding: var(--padding-top-container) 1.5rem 3rem;
    /* Top padding for toolbar */
    box-sizing: border-box;
    /* clip (not hidden) avoids creating a scroll container that would
       break position:sticky on the sidebar */
    overflow-x: clip;
}

.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
    /* Prevent grid from expanding beyond the viewport */
    min-width: 0;
}

/* Grid items must declare min-width: 0 or they expand to fit their content,
   blowing out the column and creating horizontal scroll on mobile. */
.profile-sidebar,
.content-area {
    min-width: 0;
}

/* --- Sidebar --- */
.profile-sidebar {
    position: sticky;
    top: var(--padding-top-container);
    text-align: center;
    animation: fadeIn var(--duration-slow) ease-out;
}

.profile-image-wrapper img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-light);
    border: 4px solid white;
    transition: transform var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

body.dark-theme .profile-image-wrapper img {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-dark);
}

/* Profile photo button (expands biography) */
.profile-image-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: inline-block;
    line-height: 0;
}

.profile-image-button:hover img {
    transform: scale(1.05);
    opacity: 0.85;
}

.profile-image-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 50%;
}

body.dark-theme .profile-image-button:focus-visible {
    outline-color: var(--color-primary-dark);
}

h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--color-text-main-light);
    letter-spacing: -0.02em;
}

body.dark-theme h1 {
    color: var(--color-text-main-dark);
}

.profile-details {
    margin: 0.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-detail {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--color-text-muted-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

body.dark-theme .profile-detail {
    color: var(--color-text-muted-dark);
}

.profile-detail i {
    font-size: 0.85rem;
    color: var(--color-text-muted-light);
    opacity: 0.8;
}

body.dark-theme .profile-detail i {
    color: var(--color-text-muted-dark);
}

.profile-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color var(--duration-fast), transform 0.1s;
    width: 100%;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.contact-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.linkedin-button {
    background-color: #0077b5;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 119, 181, 0.2);
}

.linkedin-button:hover {
    background-color: #006097;
}

/* --- Main Content --- */
.content-area {
    background: var(--card-bg-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--card-border-light);
    box-shadow: var(--shadow-light);
    animation: slideUp 0.7s ease-out;
}

body.dark-theme .content-area {
    background: var(--card-bg-dark);
    border-color: var(--card-border-dark);
    box-shadow: var(--shadow-dark);
}

p {
    line-height: 1.75;
    /* Reset the UA default top margin so the first paragraph doesn't add
       extra space on top of .content-area's padding (spacing is handled by
       margin-bottom here and by the margin-top on headings). */
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: var(--color-text-muted-light);
}

body.dark-theme p {
    color: var(--color-text-muted-dark);
}

.intro-text {
    font-size: 1.15rem;
    color: var(--color-text-main-light);
}

body.dark-theme .intro-text {
    color: var(--color-text-main-dark);
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

body.dark-theme h2 {
    color: var(--color-text-main-dark);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

h2 i {
    color: var(--color-primary);
    font-size: 1.2rem;
}

a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: color var(--duration-fast), opacity var(--duration-fast);
}

a:focus-visible {
    outline: 2px dashed var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

body.dark-theme a {
    color: var(--color-accent);
}

body.dark-theme a:focus-visible {
    outline-color: var(--color-accent);
}

a:hover {
    opacity: 0.8;
}

/* Suppress underline in navigation/button contexts */
.toolbar a,
.contact-button,
.skip-link,
.toc li a,
sup.citation a {
    text-decoration: none;
}

/* Bio toggle buttons — inline, styled as links */
.bio-toggle-btn,
.bio-collapse-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    color: var(--color-primary);
    display: inline;
    text-decoration: none;
}

.bio-toggle-btn:hover,
.bio-collapse-btn:hover {
    opacity: 0.8;
}

.bio-toggle-btn:focus-visible,
.bio-collapse-btn:focus-visible {
    outline: 2px dashed var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

body.dark-theme .bio-toggle-btn,
body.dark-theme .bio-collapse-btn {
    color: var(--color-accent);
}

body.dark-theme .bio-toggle-btn:focus-visible,
body.dark-theme .bio-collapse-btn:focus-visible {
    outline-color: var(--color-accent);
}

/* Info icon inside biography name button */
.bio-info-icon {
    font-size: 0.85em;
    opacity: 0.55;
    vertical-align: middle;
    transition: opacity var(--duration-fast);
}

.bio-toggle-btn:hover .bio-info-icon,
.bio-collapse-btn:hover .bio-info-icon {
    opacity: 0.9;
}

/* --- Bio Inline Transition Animations --- */
@keyframes bioExitAnim {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

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

.bio-exiting {
    animation: bioExitAnim 0.2s ease-out forwards;
    pointer-events: none;
}

.bio-entering {
    animation: bioEnterAnim 0.35s ease-out forwards;
}

/* --- Form Overlay --- */
#form-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) ease, visibility var(--duration-normal) ease;
}

#form-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#contact-form {
    background: var(--form-bg);
    border: 1px solid var(--form-border);
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    opacity: 0;
    transition: transform var(--duration-normal) ease, opacity var(--duration-normal) ease;
    position: relative;
}

#form-overlay.visible #contact-form {
    transform: translateY(0);
    opacity: 1;
}

#close-form {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted-light);
    transition: color var(--duration-fast);
}

body.dark-theme #close-form {
    color: var(--color-text-muted-dark);
}

#close-form:hover {
    color: var(--color-text-main-light);
}

#close-form:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

body.dark-theme #close-form:focus-visible {
    outline-color: var(--color-primary-dark);
}

.form-content h2 {
    margin-top: 0;
    border-bottom: none;
    font-size: 1.75rem;
    justify-content: center;
}

.form-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-main-light);
}

body.dark-theme .form-content label {
    color: var(--color-text-main-dark);
}

.form-content input,
.form-content textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    margin-bottom: 1.25rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #f9fafb;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

body.dark-theme .form-content input,
body.dark-theme .form-content textarea {
    background-color: #334155;
    border-color: #475569;
    color: white;
}

.form-content input:focus,
.form-content textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-status {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
    transition: opacity var(--duration-normal);
}

.form-status.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Field-level Error Messages (WCAG 3.3.1) */
.error-message {
    display: none;
    color: #991b1b;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 1.75rem;
    background-color: #fee2e2;
    border-left: 3px solid #dc2626;
    border-radius: 0.25rem;
    position: relative;
}

/* Non-color error indicator (WCAG 1.4.1) */
.error-message::before {
    content: "⚠";
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    line-height: 1;
}

body.dark-theme .error-message {
    color: #fecaca;
    background-color: rgba(127, 29, 29, 0.3);
}

/* Invalid Input State */
.form-content input[aria-invalid="true"],
.form-content textarea[aria-invalid="true"] {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
}

body.dark-theme .form-content input[aria-invalid="true"],
body.dark-theme .form-content textarea[aria-invalid="true"] {
    border-color: #ef4444;
    background-color: rgba(127, 29, 29, 0.2);
}

body.dark-theme .form-status.success {
    background-color: rgba(22, 101, 52, 0.3);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

body.dark-theme .form-status.error {
    background-color: rgba(153, 27, 27, 0.3);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn var(--duration-slow) ease-out;
}

#en-version {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AI Disclaimer --- */
.ai-disclaimer {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.75rem;
}

body.dark-theme .ai-disclaimer {
    background: rgba(37, 99, 235, 0.12);
}

.ai-disclaimer > i {
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.ai-disclaimer p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text-muted-light);
}

body.dark-theme .ai-disclaimer p {
    color: var(--color-text-muted-dark);
}

/* --- Biography Section Sub-headings --- */
#pt-bio-full h2,
#en-bio-full h2 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: var(--color-text-main-light);
}

body.dark-theme #pt-bio-full h2,
body.dark-theme #en-bio-full h2 {
    color: var(--color-text-main-dark);
}

#pt-bio-full h3,
#en-bio-full h3 {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--color-primary);
}

body.dark-theme #pt-bio-full h3,
body.dark-theme #en-bio-full h3 {
    color: var(--color-primary-dark);
}

/* Analysis Tables */
.analysis-table-wrapper {
    overflow-x: auto;
    /* max-width keeps the wrapper inside the card on narrow viewports */
    max-width: 100%;
    margin: 1.25rem 0;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-theme .analysis-table-wrapper {
    border-color: rgba(255, 255, 255, 0.08);
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.analysis-table caption {
    caption-side: top;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 0.8rem 0.5rem;
    text-align: left;
    color: var(--color-text-main-light);
    background: rgba(37, 99, 235, 0.04);
}

body.dark-theme .analysis-table caption {
    color: var(--color-text-main-dark);
    background: rgba(37, 99, 235, 0.08);
}

.analysis-table th {
    background: rgba(37, 99, 235, 0.08);
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(37, 99, 235, 0.2);
    color: var(--color-text-main-light);
}

body.dark-theme .analysis-table th {
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-text-main-dark);
    border-bottom-color: rgba(96, 165, 250, 0.3);
}

.analysis-table td {
    padding: 0.6rem 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    vertical-align: top;
    color: var(--color-text-muted-light);
    line-height: 1.5;
}

body.dark-theme .analysis-table td {
    border-top-color: rgba(255, 255, 255, 0.07);
    color: var(--color-text-muted-dark);
}

.analysis-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

body.dark-theme .analysis-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Races (marathons) table: shares the analysis-table look. Numeric columns
   (date, distance, time) stay on a single line so each keeps its natural
   width; the wrapper handles horizontal scroll on narrow viewports. */
.races-table .race-num {
    white-space: nowrap;
}

/* Dotted underline cue for the elevation/segments tooltip */
.analysis-table abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* References Section */
.references-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-theme .references-section {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.references-section h2 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-main-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-theme .references-section h2 {
    color: var(--color-text-main-dark);
}

.references-list {
    margin: 0;
    padding-left: 1.5rem;
}

.references-list li {
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 0.4rem;
    color: var(--color-text-muted-light);
    word-break: break-word;
}

body.dark-theme .references-list li {
    color: var(--color-text-muted-dark);
}

.references-list a {
    font-weight: 400;
    font-size: 0.85rem;
}

.references-note {
    font-size: 0.8rem;
    margin-top: 0.75rem;
    font-style: italic;
    color: var(--color-text-muted-light);
}

body.dark-theme .references-note {
    color: var(--color-text-muted-dark);
}

/* Citations & TOC */
sup.citation a {
    text-decoration: none;
    font-weight: 600;
    padding: 0 0.1rem;
    border-bottom: none;
}

sup.citation a:hover {
    text-decoration: underline;
}

.toc {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

body.dark-theme .toc {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(96, 165, 250, 0.1);
}

.toc h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-family: var(--font-serif);
    color: var(--color-text-main-light);
}

body.dark-theme .toc h2 {
    color: var(--color-text-main-dark);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toc li a {
    font-size: 0.95rem;
    color: var(--color-primary);
    text-decoration: none;
    line-height: 1.4;
    border-bottom: none;
    display: inline-block;
}

body.dark-theme .toc li a {
    color: var(--color-accent);
}

.toc li a:hover {
    text-decoration: underline;
}

.toc .toc-sub {
    margin-top: 0.6rem;
    padding-left: 1.2rem;
    gap: 0.4rem;
}

.toc .toc-sub li a {
    font-size: 0.82rem;
    opacity: 0.85;
}

/* Reduced motion override (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto !important;
    }

    .fade-in {
        animation: none;
        opacity: 1;
    }

    .bio-exiting,
    .bio-entering {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profile-sidebar {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .container {
        padding-top: 5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .content-area {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}

/* --- Print Styles --- */
@media print {

    .toolbar,
    #form-overlay,
    .profile-actions,
    .skip-link {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        padding-top: 1rem;
        max-width: 100%;
    }

    .profile-grid {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }

    .profile-sidebar {
        position: static;
    }

    .content-area {
        background: white;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        font-weight: 400;
    }

    a[href^="#"]::after,
    .contact-link::after {
        content: "";
    }
}
