:root {
    --bg-base: #f5f2ec;
    --text-primary: #1a1816;
    --text-secondary: rgba(26, 24, 22, 0.76);
    --text-muted: rgba(26, 24, 22, 0.52);
    --c-ueber: #8a7d6c;
}

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

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    background: var(--bg-base);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

#p5-background {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10 !important;
    pointer-events: none !important;
    opacity: 0.95;
}

#p5-background canvas {
    width: 100%;
    height: 100%;
}

#readability-scrim {
    z-index: 0;
}

.nav-home {
    position: fixed;
    top: clamp(20px, 3.5vw, 40px);
    left: clamp(20px, 4.5vw, 60px);
    z-index: 102;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    opacity: 0.85;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-home:hover {
    opacity: 1;
    transform: translateX(-3px);
}

.nav-home::before {
    content: "←";
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
}

.header {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(60px, 8vw, 100px) clamp(20px, 4vw, 50px) clamp(24px, 4vw, 40px);
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2vw, 22px);
}

.planet-accent-tag {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(26, 24, 22, 0.28);
    color: var(--text-primary);
    backdrop-filter: blur(4px);
    margin-bottom: 0;
}

.title {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin: 0;
}

.ueber-portrait {
    display: block;
    width: clamp(148px, 22vw, 216px);
    height: clamp(148px, 22vw, 216px);
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(26, 24, 22, 0.16);
    box-shadow:
        0 12px 32px rgba(26, 24, 22, 0.16),
        0 0 0 6px rgba(138, 125, 108, 0.12);
    background: #17171a;
}

.ueber-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 58%;
    transform: scale(1.5);
    transform-origin: center center;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.lang-btn {
    position: fixed;
    top: clamp(20px, 3.5vw, 40px);
    right: clamp(20px, 4.5vw, 60px);
    z-index: 102;
    background: transparent;
    border: 1px solid rgba(26, 24, 22, 0.25);
    border-radius: 4px;
    padding: 8px 14px;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.lang-btn:hover {
    border-color: var(--text-primary);
    background: rgba(26, 24, 22, 0.04);
}

.ueber-main {
    position: relative;
    z-index: 5;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px) clamp(72px, 10vw, 120px);
}

.ueber-intro {
    text-align: center;
    margin-bottom: clamp(56px, 8vw, 88px);
}

.ueber-intro__headline {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0 0 18px;
}

.ueber-intro__role {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(12px, 1.3vw, 15px);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    max-width: 22em;
    margin: 0 auto 28px;
    line-height: 1.45;
}

.ueber-intro__lead,
.ueber-intro__body,
.ueber-intro__pi {
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 1.55vw, 19px);
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 1.25em;
}

.ueber-intro__pi {
    margin-bottom: 0;
}

.ueber-section-title {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(14px, 1.4vw, 16px);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 clamp(28px, 4vw, 40px);
}

.ueber-vita,
.ueber-teaching {
    margin-bottom: clamp(56px, 8vw, 88px);
}

.ueber-teaching__lead {
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 1.5vw, 18px);
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-secondary);
    text-align: center;
    max-width: 36em;
    margin: -12px auto 32px;
}

.teach-bars {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.teach-bar__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 10px;
}

.teach-bar__head span {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 500;
    color: var(--text-primary);
}

.teach-bar__head strong {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.teach-bar__track {
    height: 8px;
    border-radius: 999px;
    background: rgba(26, 24, 22, 0.08);
    overflow: hidden;
}

.teach-bar__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--c-ueber);
    transform-origin: left center;
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.teach-bars.is-ready .teach-bar__fill {
    width: var(--teach-pct, 0);
}

@media (prefers-reduced-motion: reduce) {
    .teach-bar__fill {
        transition: none;
    }
}

.teach-bar__note {
    font-family: "Inter", sans-serif;
    font-size: clamp(13px, 1.2vw, 15px);
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 10px 0 0;
}

.vita-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vita-item {
    display: grid;
    grid-template-columns: minmax(7.5rem, 9.5rem) 1fr;
    gap: 16px 28px;
    padding: 18px 0;
    border-top: 1px solid rgba(26, 24, 22, 0.1);
}

.vita-item:last-child {
    border-bottom: 1px solid rgba(26, 24, 22, 0.1);
}

.vita-item__period {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(13px, 1.2vw, 15px);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    padding-top: 2px;
}

.vita-item__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vita-item__body strong {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(16px, 1.5vw, 19px);
    font-weight: 500;
    color: var(--text-primary);
}

.vita-item__body span {
    font-family: "Inter", sans-serif;
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ueber-projects {
    text-align: center;
}

.ueber-projects__lead {
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 1.5vw, 18px);
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 36em;
    margin: -12px auto 28px;
}

.ueber-projects__nav.project-index {
    align-items: stretch;
    text-align: left;
    max-width: 36em;
    margin: 0 auto;
}

.ueber-projects .project-index__row {
    font-size: clamp(14px, 1.35vw, 16px);
}

body.lang-fade {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
    .teach-bar__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .vita-item {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 16px 0;
    }

    .ueber-projects .project-index__body {
        grid-template-columns: 1fr;
    }

    .ueber-projects .project-index__host {
        justify-self: start;
    }
}

.ueber-projects .project-index__head {
    text-align: left;
    max-width: 36em;
    margin: 0 auto 10px;
}

html.theme-dark .ueber-intro__headline,
html.theme-dark .ueber-section-title,
html.theme-dark .vita-item__body strong,
html.theme-dark .teach-bar__head span,
html.theme-dark .teach-bar__head strong,
html.theme-dark .title {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html.theme-dark .teach-bar__track {
    background: rgba(255, 250, 244, 0.1);
}

html.theme-dark .teach-bar__fill {
    background: #c4b8a6;
}
