/* 1. Farben */
:root {
    --background: #101c30;
    --surface: #17263d;

    --text: #e7edf5;
    --text-muted: #b0bfd2;

    --primary: #b8d4f5;
    --primary-hover: #e0edff;
    --accent: #8bbcff;

    --border: #34465e;
    --page-gutter: 24px;
}

/* 2. Technische Basis */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--background);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;
    line-height: 1.7;
}

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

a {
    color: var(--primary);
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}

a:hover {
    color: var(--primary-hover);
}

a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.25;
}

p {
    margin-top: 0;
}

/* 3. Gemeinsame Inhaltsbreite */
.site-header,
.site-main,
.site-footer {
    width: 100%;
    max-width: 1000px;
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

.site-main {
    padding-block: 48px;
}

.site-main--home {
    padding-block: 0;
}

/* 4. Kopfbereich */
.site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 24px;
    padding-block: 24px;
    border-bottom: 1px solid var(--border);
}

.site-brand {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.site-brand:hover {
    color: var(--primary);
}

.site-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
}

/* 5. Navigation */
.nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list a {
    display: inline-block;
    padding-block: 10px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 6px;
}

.nav-list a[aria-current="page"] {
    font-weight: 600;
}

/* 6. Sprachauswahl */
.language-switcher {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
}

.language-list a:hover {
    background-color: var(--surface);
    color: var(--primary-hover);
}

.language-list a[aria-current="true"] {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 6px;
}

/* 7. Vorstellung */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-areas: "copy portrait";
    align-items: center;
    gap: 40px;
    padding-block: 88px 64px;
}

.hero-copy {
    grid-area: copy;
    min-width: 0;
}

.hero-portrait {
    grid-area: portrait;
    width: 240px;
    border-radius: 12px;
}

@media (max-width: 760px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "portrait" "copy";
        gap: 28px;
    }

    .hero-portrait {
        width: 180px;
        justify-self: center;
    }
}

.hero h1 {
    margin: 0 0 24px;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.hero p {
    max-width: 680px;
    color: var(--text-muted);
    font-size: 18px;
}

.hero .hero-subtitle {
    margin-bottom: 24px;
    color: var(--primary);
    font-size: 20px;
    font-weight: 500;
}

/* 8. Weiterführende Links im Hero-Bereich */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 28px;
}

.hero-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 0;
    color: var(--primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.hero-actions .button:hover {
    color: var(--primary-hover);
    text-decoration-thickness: 2px;
}

/* 9. Ausgewählte Projekte */
.featured-projects {
    padding-block: 32px 64px;
}

.featured-projects h2 {
    margin: 0 0 28px;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 600;
}

.project-list {
    display: grid;
    gap: 16px;
}

/* Offene Projektabschnitte statt geschlossener Karten */
.project-card {
    min-width: 0;
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.project-card h3 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 600;
}

.project-card p {
    max-width: 680px;
    color: var(--text-muted);
}

.project-card strong {
    color: var(--text);
    font-weight: 600;
}

.project-card img {
    margin-bottom: 24px;
    border-radius: 8px;
}

.image-placeholder {
    padding: 40px 20px;
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text-muted);
    text-align: center;
}

/* Skills: flexible Spalten und umbrechende Inhalte auch auf kleinen Displays. */
.skills-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-block: 24px 40px;
}

.skills-table th,
.skills-table td {
    padding: 12px clamp(8px, 2vw, 16px);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.skills-table th:first-child {
    width: 34%;
}

.skills-table thead {
    background-color: var(--surface);
}

.skills-table td {
    color: var(--text-muted);
}

/* 10. Footer */
.site-footer {
    padding-block: 28px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}

.site-footer p {
    margin: 0;
}

/* 11. Sprunglink für Tastaturbedienung */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 12px 16px;
    border-radius: 6px;
    background-color: var(--surface);
    color: var(--text);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

.skip-link:hover {
    color: var(--primary-hover);
}

/* 12. Kleine Bildschirme */
@media (max-width: 600px) {
    :root {
        --page-gutter: 20px;
    }

    .site-main {
        padding-block: 32px;
    }

    .site-main--home {
        padding-block: 0;
    }

    .site-header {
        gap: 12px 16px;
        padding-block: 20px;
    }

    .nav-list {
        gap: 4px 16px;
    }

    .hero {
        padding-block: 56px 40px;
    }

    .hero p {
        font-size: 17px;
    }

    .hero .hero-subtitle {
        font-size: 19px;
    }

    .hero-actions {
        gap: 8px 24px;
    }

    .featured-projects {
        padding-block: 24px 48px;
    }
}

/* Bei wenig Platz bleiben die Sprachlinks rechts in einer eigenen Zeile. */
@media (max-width: 420px) {
    .site-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .language-switcher {
        grid-column: 1;
        grid-row: 2;
    }

    .site-navigation {
        grid-row: 3;
    }
}

/* Sprachflaggen als SVG statt systemabhängiger Flaggen-Emojis. */
.language-list .language-flag {
    width: 24px;
    height: 16px;
    flex: 0 0 24px;
    object-fit: cover;
    border-radius: 2px;
}
.project-card details { margin-block: 20px; }
.project-card summary { cursor: pointer; margin-bottom: 16px; }
.project-card summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
