:root {
    --bg: #ffffff;
    --text: #2f2f2f;
    --muted: #5a5a5a;
    --border: #d9d9d9;
    --accent: #1f1f1f;
    --card-bg: #f8f8f8;
    --header-bg: rgba(255, 255, 255, 0.95);
    --surface: #ffffff;
    --bg-grad-start: #ffffff;
    --bg-grad-mid: #fcfcfc;
    --bg-grad-end: #f7f7f7;
    --focus: #2b2b2b;
}

html[data-theme="dark"] {
    --bg: #111418;
    --text: #e6ecf2;
    --muted: #b4beca;
    --border: #2a323d;
    --accent: #f2f4f7;
    --card-bg: #171d24;
    --header-bg: rgba(17, 20, 24, 0.92);
    --surface: #151b22;
    --bg-grad-start: #0f1318;
    --bg-grad-mid: #121820;
    --bg-grad-end: #151c24;
    --focus: #d7dee8;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-mid) 60%, var(--bg-grad-end) 100%);
    color: var(--text);
    line-height: 1.65;
    transition: background-color 0.35s ease, color 0.35s ease, background 0.35s ease;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.logo {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.logo img {
    display: block;
    max-height: 180px;
    max-width: 200px;
    object-fit: contain;
    width: auto;
}

.desktop-nav {
    display: flex;
    gap: 1.25rem;
}

.desktop-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.desktop-nav a,
.mobile-nav a,
.text-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.text-link:hover {
    color: var(--accent);
}

.desktop-nav a.active,
.mobile-nav a.active {
    color: var(--accent);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent);
    margin: 5px 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.mobile-nav.is-open {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 1rem 4%;
    border-bottom: 1px solid var(--border);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.theme-toggle:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.theme-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-moon {
    display: none;
}

html[data-theme="dark"] .icon-sun {
    display: none;
}

html[data-theme="dark"] .icon-moon {
    display: block;
}

.theme-toggle-mobile {
    width: calc(100% - 8%);
    margin: 0.8rem 4% 1rem;
    justify-content: center;
}

.section {
    padding: 4rem 0;
}

.hero {
    padding: 5.5rem 0 4.5rem;
}

.tag {
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--accent);
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.2;
    max-width: 760px;
}

.intro {
    max-width: 680px;
    color: var(--muted);
}

.btn {
    display: inline-block;
    margin-top: 1.1rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: filter 0.2s ease;
}

.btn:hover {
    filter: brightness(0.9);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.3rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
}

.project-link-preview {
    display: block;
    margin: 0.85rem 0 0.6rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 16 / 9;
}

.project-link-preview iframe {
    display: block;
    width: 250%;
    height: 250%;
    border: 0;
    transform: scale(0.4);
    transform-origin: top left;
}

.project-link-preview:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.contact-form {
    margin-top: 1rem;
    max-width: 700px;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin: 0.85rem 0 0.35rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.contact-form .btn {
    border: 0;
    cursor: pointer;
}

.form-alert {
    max-width: 700px;
    margin: 1rem 0;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 500;
}

.form-alert.is-success {
    background: #eef8ee;
    border-color: #b7dfb7;
    color: #1e5a1e;
}

.form-alert.is-error {
    background: #fbefef;
    border-color: #e7b7b7;
    color: #7b1e1e;
}

.contact-alt {
    margin-top: 1rem;
}

.about-lead {
    font-size: 1.05rem;
    max-width: 780px;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.about-photo-wrap {
    margin: 0 0 1.25rem;
}

.about-photo {
    display: block;
    width: min(260px, 100%);
    border-radius: 14px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: var(--surface);
}

.section-sub {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: var(--accent);
}

.timeline {
    border-left: 2px solid var(--border);
    padding-left: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.78rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 1rem;
    margin-bottom: 0.2rem;
}

.timeline-company {
    font-weight: 700;
    color: var(--text);
}

.timeline-period {
    font-size: 0.85rem;
    color: var(--muted);
}

.timeline-role {
    margin: 0 0 0.4rem;
    font-style: italic;
    color: var(--muted);
    font-size: 0.95rem;
}

.timeline-list {
    margin: 0.3rem 0 0 1rem;
    padding: 0;
    color: var(--text);
}

.timeline-list li {
    margin-bottom: 0.25rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-list li {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text);
}

.lang-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 400px;
}

.lang-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.lang-name {
    font-weight: 600;
    color: var(--text);
}

.lang-level {
    font-size: 0.88rem;
    color: var(--muted);
}

.cert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cert-list li {
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.cookie-banner {
    position: sticky;
    bottom: 0;
    z-index: 120;
    border-top: 1px solid var(--border);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.cookie-banner-copy {
    max-width: 760px;
}

.cookie-banner-copy strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.cookie-banner-copy p {
    margin: 0;
    color: var(--text);
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.cookie-banner-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.cookie-banner-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.cookie-banner-btn.is-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.cookie-banner-btn.is-primary:hover {
    filter: brightness(0.92);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--text);
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-btn {
    width: 34px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.lang-btn svg {
    width: 28px;
    height: 18px;
    border-radius: 4px;
}

.lang-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.lang-btn.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.impressum-list {
    margin: 1.5rem 0 0;
    max-width: 600px;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.6rem 1rem;
}

.impressum-list dt {
    font-weight: 700;
    color: var(--text);
}

.impressum-list dd {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 520px) {
    .impressum-list {
        grid-template-columns: 1fr;
    }

    .impressum-list dt {
        margin-top: 0.75rem;
    }
}

@media (max-width: 900px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .logo img {
        width: clamp(140px, 42vw, 180px);
        max-width: 100%;
        height: auto;
    }

    .desktop-nav {
        display: none;
    }

    .desktop-actions > .theme-toggle {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3.2rem 0;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-controls {
        width: 100%;
        justify-content: space-between;
    }

    .cookie-banner-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-banner-btn {
        flex: 1 1 140px;
    }
}
