/* ==========================================================================
   Design-Tokens
   ========================================================================== */

:root {
    --bg: rgba(11, 14, 20, 1);
    --bg-img: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.85)), url('Gemini_Generated_Image_gbvvwvgbvvwvgbvv.jpg');
    --surface: rgba(20, 25, 37, 0.6);
    --surface-2: rgba(27, 33, 48, 0.4);

    --text: rgba(237, 239, 244, 1);
    --muted: rgba(136, 144, 166, 1);

    /* Funktionale Farben - jede mit genau EINER Bedeutung */
    --accent: rgba(61, 220, 132, 1);   /* online / ok / interaktiv */
    --warn: rgba(245, 165, 36, 1);     /* in Arbeit / Achtung */
    --danger: rgba(229, 72, 77, 1);   /* echter Fehlerzustand */

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --header-img: url('dasich.jpg');

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Scrollbar --- */

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 12px;
    background: transparent;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background-color: var(--bg);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background-color: var(--surface-2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
    opacity: 0.6;
}

html {
    scrollbar-color: var(--surface-2) var(--bg);
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

body {
    background-color: var(--bg);
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
}

.container {
    width: min(94%, 900px);
    margin: 0 auto;
    padding: clamp(16px, 4vw, 25px) 0 clamp(40px, 6vw, 60px);
}

/* Anker-Ziele nicht hinter der fixierten Nav verschwinden lassen */
#ueber-mich, #skills, #projekte, #werdegang {
    scroll-margin-top: 84px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topnav-inner {
    width: min(94%, 900px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 0;
    position: relative;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
}

.nav-links a {
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

.nav-links a[aria-current="page"] {
    color: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--surface);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }
    .nav-links.open {
        max-height: 300px;
    }
    .nav-links a {
        width: 100%;
        padding: 14px clamp(3%, 3vw, 25px);
        border-top: 1px solid var(--border);
    }
}

/* ==========================================================================
   Statusleiste (Live-Server-Status)
   ========================================================================== */

.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: clamp(24px, 5vw, 36px);
}

.statusbar .dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: clamp(12px, 4vw, 24px) 0 clamp(32px, 6vw, 48px);
}

header .header-text {
    flex: 1 1 260px;
}

header .h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

header .subtitle {
    color: var(--muted);
    font-size: clamp(1rem, 2.2vw, 1.05rem);
    margin-top: 6px;
}

header .header-img {
    flex: 0 0 auto;
    width: clamp(140px, 22vw, 200px);
    height: clamp(180px, 28vw, 260px);
    background-image: var(--header-img);
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Schlanker Seiten-Header für Unterseiten (Kontakt, Impressum, ...) */
.page-header {
    padding: clamp(12px, 4vw, 24px) 0 clamp(28px, 5vw, 40px);
}

.page-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--muted);
}

/* ==========================================================================
   Panels (Cards) & Typografie
   ========================================================================== */

.card {
    display: flex;
    flex-wrap: wrap;
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: clamp(16px, 4vw, 25px);
    margin-bottom: clamp(18px, 4vw, 22px);
}

.panel-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.02em;
    width: 100%;
    margin-bottom: 4px;
}

h2 {
    font-size: clamp(1.1rem, 2.6vw, 1.25rem);
    font-weight: 600;
    color: var(--text);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    width: 100%;
}

h3 {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    margin-top: 5px;
}

h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    margin: 16px 0 8px;
}

p { margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

ul {
    list-style: none;
}

ul > li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

ul > li::before {
    content: "›";
    color: var(--accent);
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0;
}

ol {
    list-style: none;
    counter-reset: item;
}
 
ol > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
    counter-increment: item;
}
 
ol > li::before {
    content: counter(item) ".";
    color: var(--accent);
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0;
}

/* ==========================================================================
   Tags / Chips
   (ersetzt die frühere Skills-Grid & dient gleichzeitig als Tech-Stack-
   Kennzeichnung pro Projekt — ein wiederverwendbares Element statt zwei.)
   ========================================================================== */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px 10px;
}

/* ==========================================================================
   Projekte
   ========================================================================== */

.project-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.project-item + .project-item {
    margin-top: clamp(20px, 4vw, 28px);
    padding-top: clamp(20px, 4vw, 28px);
    border-top: 1px solid var(--border);
}

.project-date {
    font-size: 0.85rem;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.status-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin: 4px 0 14px;
}

.badge-status {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    border-radius: 3px;
}

.badge-status.progress {
    background: rgba(245, 165, 36, 0.15);
    color: var(--warn);
    border: 1px solid rgba(245, 165, 36, 0.4);
}

.badge-status.ok {
    background: rgba(61, 220, 132, 0.15);
    color: var(--accent);
    border: 1px solid rgba(61, 220, 132, 0.4);
}

.badge-status.error {
    background: rgba(229, 72, 77, 0.15);
    color: var(--danger);
    border: 1px solid rgba(229, 72, 77, 0.4);
}

/* ==========================================================================
   Timeline / Werdegang
   ========================================================================== */

.timeline-item {
    width: 100%;
    border-left: 2px solid var(--border-strong);
    padding-left: 18px;
    margin-bottom: 28px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 2vw, 15px);
    margin-bottom: 1rem;
}

.time-item {
    flex: 1 1 200px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: clamp(10px, 2vw, 12px);
    border-radius: 6px;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.company-placeholder {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--muted);
    padding: 4px 10px;
    border: 1px dashed var(--border-strong);
    border-radius: 4px;
}

.company-placeholder:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* ==========================================================================
   Links & Buttons
   ========================================================================== */

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

a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

a:focus-visible,
.nav-toggle:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.contact-btn {
    display: inline-block;
    background-color: var(--accent);
    color: #0B0E14;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: opacity 0.2s ease;
}

.contact-btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

@media (max-width: 480px) {
    .contact-btn {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    border-top: 1px solid var(--border);
    padding: clamp(20px, 4vw, 30px) 0;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(16px, 3vw, 24px);
}

.footer-grid a {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-grid a:hover {
    color: var(--accent);
}

/* ==========================================================================
   Kontaktformular (kontakt.html)
   ========================================================================== */

.contact-card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: clamp(18px, 4vw, 30px);
    width: min(94%, 600px);
    margin: clamp(20px, 5vw, 40px) auto;
}

.contact-card h2 { margin-top: 0; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.2);
}

.form-group textarea {
    height: 140px;
    resize: vertical;
}

.btn-submit {
    background-color: var(--accent);
    color: #0B0E14;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.btn-submit:hover { filter: brightness(1.1); }
.btn-submit:active { transform: scale(0.98); }

.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(61, 220, 132, 0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.alert-error {
    background-color: rgba(229, 72, 77, 0.12);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.hp-field { display: none !important; }

/* ==========================================================================
   Rechtstexte (Impressum / Datenschutz)
   ========================================================================== */

.legal .card h2 {
    font-size: clamp(1.05rem, 2.4vw, 1.15rem);
}

.legal .card h3 {
    margin-top: 18px;
}

.legal address {
    font-style: normal;
    line-height: 1.7;
}

.legal .placeholder {
    color: var(--warn);
    background: rgba(245, 165, 36, 0.12);
    border-radius: 3px;
    padding: 0 4px;
}

.legal-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px dashed var(--border-strong);
    margin-top: 20px;
    padding-top: 16px;
}

/* ==========================================================================
   Dokumentenliste (Nachweise / Zeugnisse)
   ========================================================================== */

.doc-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 200px;
}

.doc-title {
    font-weight: 600;
    color: var(--text);
}

.doc-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.doc-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 7px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.doc-download:hover {
    background: var(--accent);
    color: #0B0E14;
    text-decoration: none;
}

.doc-download.disabled {
    color: var(--muted);
    border-color: var(--border);
    pointer-events: none;
    opacity: 0.6;
}