/* Farben: hell als Standard, dunkel nach Systemeinstellung oder per Umschalter.
   data-theme auf <html> ueberstimmt die Systemeinstellung. */
:root {
    --bg: #fbfaf7;
    --text: #1d1d1b;
    --muted: #63615b;
    --line: #e3e1da;
    --control: #8a877f;
    --accent: #1f5c99;
    --falcos: #2b7a25;
    --falcos-soft: rgb(67 165 59 / 0.55);
    --falcos-glow: rgb(67 165 59 / 0.4);
    --ovgu: #7a003f;
    --ovgu-soft: rgb(122 0 63 / 0.5);
    --ovgu-glow: rgb(158 0 82 / 0.35);
    --efellows: #a84f00;
    --efellows-soft: rgb(254 124 9 / 0.6);
    --efellows-glow: rgb(254 124 9 / 0.4);
    color-scheme: light;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Fira Code', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #161615;
        --text: #e9e7e2;
        --muted: #a29f97;
        --line: #2e2d2a;
        --control: #6f6c66;
        --accent: #8db8e6;
        --falcos: #5cc152;
        --falcos-soft: rgb(92 193 82 / 0.5);
        --falcos-glow: rgb(67 165 59 / 0.6);
        --ovgu: #e0468f;
        --ovgu-soft: rgb(224 70 143 / 0.55);
        --ovgu-glow: rgb(224 70 143 / 0.6);
        --efellows: #fe7c09;
        --efellows-soft: rgb(254 124 9 / 0.55);
        --efellows-glow: rgb(254 124 9 / 0.65);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #161615;
    --text: #e9e7e2;
    --muted: #a29f97;
    --line: #2e2d2a;
    --control: #6f6c66;
    --accent: #8db8e6;
    --falcos: #5cc152;
    --falcos-soft: rgb(92 193 82 / 0.5);
    --falcos-glow: rgb(67 165 59 / 0.6);
    --ovgu: #e0468f;
    --ovgu-soft: rgb(224 70 143 / 0.55);
    --ovgu-glow: rgb(224 70 143 / 0.6);
    --efellows: #fe7c09;
    --efellows-soft: rgb(254 124 9 / 0.55);
    --efellows-glow: rgb(254 124 9 / 0.65);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* Beim Wechsel von Hell und Dunkel keine Farbuebergaenge */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0; }

p { margin: 0 0 1em; }

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--text);
    color: var(--bg);
    padding: 8px 12px;
    z-index: 10;
}
.skip-link:focus { left: 8px; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Kopfzeile */
.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Markenfarben beim Hover: Falcos gruen, OVGU beere, e-fellows orange */
.falcos-link, .ovgu-link, .efellows-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px dashed var(--brand-soft);
    padding-bottom: 1px;
    transition: color 0.25s ease, text-shadow 0.25s ease, border-color 0.25s ease;
}
.falcos-link:hover, .falcos-link:focus-visible,
.ovgu-link:hover, .ovgu-link:focus-visible,
.efellows-link:hover, .efellows-link:focus-visible {
    color: var(--brand);
    border-bottom-color: var(--brand);
    border-bottom-style: solid;
    text-shadow: 0 0 14px var(--brand-glow);
}
.falcos-link { --brand: var(--falcos); --brand-soft: var(--falcos-soft); --brand-glow: var(--falcos-glow); }
.ovgu-link { --brand: var(--ovgu); --brand-soft: var(--ovgu-soft); --brand-glow: var(--ovgu-glow); }
.efellows-link { --brand: var(--efellows); --brand-soft: var(--efellows-soft); --brand-glow: var(--efellows-glow); white-space: nowrap; }

/* Kopfzeile breiter als der Text, damit Name, Menue und Sprache in eine Zeile passen */
.site-header .wrap { max-width: 980px; }

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 60px;
    flex-wrap: wrap;
}

.site-name {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-right: auto;
}

.nav {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    white-space: nowrap;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
}
.nav a {
    background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
    padding-bottom: 2px;
    transition: background-size 0.25s ease, color 0.2s ease;
}
.nav a:hover { color: var(--text); background-size: 100% 2px; }
.nav a.active { color: var(--text); background-size: 100% 2px; }

.lang-btn {
    font: inherit;
    font-size: 0.85rem;
    color: var(--muted);
    background: none;
    border: 1px solid var(--control);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--muted);
    background: none;
    border: 1px solid var(--control);
    border-radius: 4px;
    cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn svg[hidden] { display: none; }

.lang-btn:hover { color: var(--text); border-color: var(--muted); }

@media (max-width: 820px) {
    .header-inner { gap: 4px 16px; padding-top: 12px; padding-bottom: 12px; }
    .header-inner nav { order: 3; width: 100%; }
    .section { scroll-margin-top: 104px; }
    html { scroll-padding-top: 110px; }
    .nav { flex-wrap: wrap; gap: 2px 16px; }
}

@media (max-width: 600px) {
    .intro { margin-top: 36px; gap: 16px; }
    .portrait { width: 72px; height: 72px; }
    h1 { font-size: 1.6rem; }
    .role { font-size: 0.95rem; }
}

/* Einstieg: dezentes Punktraster, laeuft nach unten aus */
body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 560px;
    z-index: -1;
    background-image: radial-gradient(rgb(128 128 128 / 0.22) 1px, transparent 1px);
    background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
    pointer-events: none;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f9e5b;
}
.status-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #2f9e5b;
    animation: ping 2s ease-out 3;
}
@keyframes ping {
    0% { transform: scale(1); opacity: 0.6; }
    80%, 100% { transform: scale(2.6); opacity: 0; }
}

.quick-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 28px 0;
}
.quick-facts li {
    border-top: 2px solid var(--accent);
    padding-top: 8px;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}
.quick-facts strong { display: block; color: var(--text); font-size: 1rem; }

@media (max-width: 600px) {
    .quick-facts { grid-template-columns: 1fr; gap: 10px; }
}

.intro {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 56px 0 24px;
}

.portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }

.role { color: var(--muted); margin: 4px 0 0; }

.lead { font-size: 1.125rem; }

.links-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Abschnitte */
.section {
    margin-top: 72px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 72px;
}

.section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.section h3 { font-size: 1.05rem; font-weight: 600; }

#ueber-mich h3 { margin: 24px 0 6px; }
#ueber-mich h3:first-of-type { margin-top: 0; }

.meta {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 2px 0 8px;
}

/* Projekte */
.project {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 40px;
}

.project .img-btn { width: 100%; }

.project-img {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 436;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.project p { margin-bottom: 0.5em; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}
.tags li {
    font-size: 0.78rem;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgb(128 128 128 / 0.12);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

.img-btn {
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    align-self: start;
    border-radius: 4px;
}

/* Bildansicht */
.lightbox {
    border: 0;
    padding: 0;
    background: none;
    max-width: min(92vw, 1100px);
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.8); }
.lightbox img { max-height: 86vh; width: auto; border-radius: 6px; }
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: 0;
    cursor: pointer;
}

.project-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

@media (max-width: 600px) {
    .project { grid-template-columns: 1fr; gap: 12px; }

}

.sub { margin: 8px 0 12px; }

.plain-list { padding-left: 1.2em; margin: 0; }
.plain-list li { margin-bottom: 8px; }

/* E-Woche */
#ewoche h3 { margin: 28px 0 8px; }
.ewoche-figure { margin: 8px 0 0; }
.ewoche-figure .img-btn { display: block; width: 100%; }
.ewoche-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}
.ewoche-figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* Werdegang: Linie fuellt sich beim Scrollen, Punkte werden aktiv */
.cv-wrap {
    position: relative;
    padding-left: 28px;
    margin-bottom: 36px;
}

.cv-wrap::before,
.cv-progress {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    width: 2px;
    border-radius: 1px;
}
.cv-wrap::before { bottom: 6px; background: var(--line); }
.cv-progress { height: 0; max-height: calc(100% - 12px); background: var(--accent); }

.cv { list-style: none; padding: 0; margin: 0; }

.cv li {
    position: relative;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.cv-date {
    color: var(--muted);
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}

.cv p { margin: 4px 0 0; }

.cv li::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--bg);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.cv li.active::before { border-color: var(--accent); background: var(--accent); }

@media (max-width: 600px) {
    .cv li { grid-template-columns: 1fr; gap: 0; }
}

/* Kurzangaben */
.facts {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 16px;
    margin: 0;
}

.facts dt { color: var(--muted); font-size: 0.92rem; padding-top: 2px; }
.facts dd { margin: 0; }

@media (max-width: 600px) {
    .facts { grid-template-columns: 1fr; gap: 0; }
    .facts dd { margin-bottom: 10px; }
}

.copy-btn {
    font: inherit;
    font-size: 0.85rem;
    color: var(--muted);
    background: none;
    border: 1px solid var(--control);
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 8px;
    cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }

/* Projekte: leichter Hover */
@media (hover: hover) {
    .project:hover .project-img {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgb(0 0 0 / 0.12);
    }
}

/* Einblenden beim Scrollen, nur mit JS und ohne reduzierte Bewegung */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* Konsole: bewusst immer dunkel */
.terminal {
    background: #141413;
    color: #d9d6cf;
    border: 1px solid #2c2b28;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 0.86rem;
    line-height: 1.55;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: #1d1c1a;
    border-bottom: 1px solid #2c2b28;
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a3936; }
.terminal-bar em { font-style: normal; color: #8c8981; margin-left: 8px; font-size: 0.8rem; }

.terminal-body {
    height: 260px;
    overflow-y: auto;
    padding: 12px 14px 4px;
}
.terminal-body p { margin: 0 0 4px; }
.terminal-body .t-result { white-space: pre-wrap; margin: 0 0 12px; color: #c9c5bc; }

.t-prompt { color: #8db8e6; white-space: nowrap; }
.t-info { color: #9a978f; }

.terminal-cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 12px;
}

.terminal-input-row input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: #f1efea;
    font: inherit;
    font-size: 16px; /* verhindert Zoom auf iOS */
    caret-color: #8db8e6;
}
.terminal-input-row input:focus { outline: none; }
.terminal:focus-within { border-color: #8db8e6; outline: 2px solid var(--accent); outline-offset: 2px; }

.terminal-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.preset-btn {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
    background: none;
    border: 1px solid var(--control);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
}
.preset-btn:hover { color: var(--text); border-color: var(--muted); }

/* Zurueck nach oben */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 6;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: none;
    background: var(--text);
    color: var(--bg);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; }
.back-to-top:hover { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .js-reveal .reveal, .back-to-top, .project-img, .cv li::before { transition: none; }
    .terminal-cursor, .status-dot::after { animation: none; }
    .nav a { transition: none; }
}

/* Fusszeile */
.site-footer {
    margin-top: 96px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 20px;
    padding-bottom: 32px;
}

.footer-inner p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Rechtstexte */
.legal { padding-top: 48px; }
.legal h1 { font-size: 1.75rem; margin-bottom: 24px; }
.legal h2 { font-size: 1.1rem; margin: 32px 0 8px; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }

.nav-back { color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.nav-back:hover { color: var(--text); }

/* Druck: nur der Inhalt */
@media print {
    .site-header, .back-to-top, #konsole, .terminal-presets, .copy-btn, body::before { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; }
    .section { margin-top: 32px; break-inside: avoid-page; }
    .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}
