:root {
    color-scheme: light dark;
    --bg-gradient: radial-gradient(circle at top, #eef2ff, #fdf2f8 40%, #ffffff 75%);
    --bg-gradient-dark: radial-gradient(circle at top, #0f172a, #111827 45%, #030712 80%);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-highlight: #6366f1;
    --card-bg: #ffffffd9;
    --card-border: rgba(99, 102, 241, 0.15);
    --chip-bg: rgba(99, 102, 241, 0.12);
    --chip-text: #4338ca;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.12);
    --surface-stronger: rgba(99, 102, 241, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient: var(--bg-gradient-dark);
        --text-primary: #e5e7eb;
        --text-secondary: #cbd5f5;
        --card-bg: rgba(15, 23, 42, 0.75);
        --card-border: rgba(99, 102, 241, 0.3);
        --chip-bg: rgba(129, 140, 248, 0.18);
        --chip-text: #a5b4fc;
        --shadow-soft: 0 20px 45px rgba(2, 6, 23, 0.6);
        --surface-stronger: rgba(99, 102, 241, 0.3);
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-gradient: radial-gradient(circle at top, #eef2ff, #fdf2f8 40%, #ffffff 75%);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-highlight: #6366f1;
    --card-bg: #ffffffd9;
    --card-border: rgba(99, 102, 241, 0.15);
    --chip-bg: rgba(99, 102, 241, 0.12);
    --chip-text: #4338ca;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.12);
    --surface-stronger: rgba(99, 102, 241, 0.12);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-gradient: var(--bg-gradient-dark);
    --text-primary: #e5e7eb;
    --text-secondary: #cbd5f5;
    --text-highlight: #a5b4fc;
    --card-bg: rgba(15, 23, 42, 0.75);
    --card-border: rgba(99, 102, 241, 0.3);
    --chip-bg: rgba(129, 140, 248, 0.18);
    --chip-text: #a5b4fc;
    --shadow-soft: 0 20px 45px rgba(2, 6, 23, 0.6);
    --surface-stronger: rgba(99, 102, 241, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    color: var(--text-highlight);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease-in;
    z-index: 1000;
}

.skip-link:focus {
    top: 1rem;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

header.site-hero {
    display: grid;
    gap: 1.75rem;
    padding: 3.5rem 2.5rem;
    border-radius: 28px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.site-hero__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-hero__nav a {
    text-decoration: none;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.theme-toggle {
    font: inherit;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-highlight);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: var(--chip-bg);
    color: var(--chip-text);
    border-color: transparent;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--text-highlight);
    outline-offset: 2px;
}

.theme-toggle__icon {
    font-size: 1.1rem;
    line-height: 1;
}

.theme-toggle__label {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.site-hero__name {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
}

.site-hero__title {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-highlight);
    font-weight: 600;
}

.site-hero__lead {
    margin: 0;
    font-size: 1.12rem;
    color: var(--text-secondary);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
    gap: 2.5rem;
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: 1.4rem;
}

.hero-spotlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.hero-spotlights li::before {
    content: "•";
    color: var(--text-highlight);
    margin-right: 0.5rem;
    font-weight: 700;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.hero-meta a {
    color: var(--text-highlight);
    text-decoration: none;
    font-weight: 500;
}

.hero-contact__reveal {
    font: inherit;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    color: var(--text-highlight);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.hero-contact__reveal:hover,
.hero-contact__reveal:focus-visible {
    background-color: var(--surface-stronger);
    border-color: var(--text-highlight);
    color: var(--text-primary);
}

.hero-contact__reveal:focus-visible {
    outline: 2px solid var(--text-highlight);
    outline-offset: 2px;
}

.hero-location {
    font-weight: 600;
    color: var(--text-highlight);
}

.hero-portrait {
    margin: 0;
    justify-self: end;
    width: min(260px, 100%);
    aspect-ratio: 3 / 4;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

section.section {
    margin-top: 3.5rem;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.section-header span {
    color: var(--text-secondary);
}

.timeline {
    display: grid;
    gap: 1.5rem;
}

.timeline-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.8rem 2rem;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 1rem;
    position: relative;
}

.timeline-card::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 4px;
    left: -2rem;
    top: 0;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.7), rgba(129, 140, 248, 0));
    border-radius: 999px;
}

.timeline-card h3 {
    margin: 0;
    font-size: 1.4rem;
}

.timeline-card .subtitle {
    color: var(--text-highlight);
    font-weight: 600;
}

.timeline-card .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

ul.highlights {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-soft);
}

.skill-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-highlight);
}

.skill-card ul {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0;
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.grid {
    display: grid;
    gap: 1.2rem;
}

.education-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.6rem 1.8rem;
    box-shadow: var(--shadow-soft);
}

.education-card p {
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.education-card__meta {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.35rem;
}

.education-card__meta .institution {
    font-weight: 600;
    color: var(--text-highlight);
    letter-spacing: 0.02em;
}

.education-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.education-card__details .location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.education-card__details .location::before {
    content: "📍";
}

.education-card__details .period {
    font-weight: 500;
}

.publications {
    margin-top: 1rem;
    display: grid;
    gap: 0.5rem;
}

.publications__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-highlight);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.publications__list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.publications__list a {
    color: var(--text-highlight);
    text-decoration: none;
    font-weight: 500;
}

.publication-outlet {
    color: var(--text-secondary);
}

.highlights-section .section-header {
    align-items: center;
}

.highlights-intro {
    margin: 0 0 2rem;
    color: var(--text-secondary);
    max-width: 720px;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.highlight-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.6rem 1.8rem;
    display: grid;
    gap: 0.9rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --highlight-paragraph-color: var(--text-secondary);
}

.highlight-card > * {
    position: relative;
    z-index: 1;
}

.highlight-card--with-media {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.4);
    --highlight-paragraph-color: rgba(248, 250, 252, 0.88);
}

.highlight-card--with-media .highlight-icon {
    text-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
}

.highlight-card--with-media a {
    color: #e0e7ff;
    text-decoration-color: rgba(224, 231, 255, 0.75);
}

.highlight-card--with-media a:hover,
.highlight-card--with-media a:focus-visible {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.85);
}

.highlight-card--with-media::before,
.highlight-card--with-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.highlight-card--with-media::before {
    background: var(--highlight-image);
    background-size: cover;
    background-position: center;
    transform: scale(1);
}

.highlight-card--with-media::after {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.7) 100%);
    opacity: 1;
}

.highlight-card--with-media:hover::before {
    transform: scale(1.08);
}

.highlight-card--with-media:hover::after {
    opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
    .highlight-card--with-media::before,
    .highlight-card--with-media::after {
        transition: none;
    }

    .highlight-card--with-media:hover::before {
        transform: none;
    }
}

.highlight-icon {
    font-size: 2rem;
}

.highlight-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.highlight-card p {
    margin: 0;
    color: var(--highlight-paragraph-color);
    line-height: 1.5;
}

.contact-card {
    display: grid;
    gap: 1rem;
    text-align: center;
}

.contact-copy {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.action-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.action-bar a {
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.75rem 1.6rem;
}

.action-bar a.primary {
    background: var(--chip-bg);
    color: var(--chip-text);
}

.action-bar a.secondary {
    border: 1px solid var(--card-border);
    color: var(--text-highlight);
}

.action-bar a.download {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.25);
}

.action-bar a.download:hover,
.action-bar a.download:focus-visible {
    filter: brightness(1.05);
}

footer.site-footer {
    margin-top: 4rem;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer .location {
    display: block;
    margin-top: 0.4rem;
}

@media (max-width: 768px) {
    header.site-hero {
        padding: 2.5rem 1.75rem;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-portrait {
        justify-self: start;
        width: min(220px, 60%);
    }

    .timeline-card::before {
        display: none;
    }
}