:root {
    --bg:      #05100f;
    --card:    #091a1f;
    --border:  #0e2a31;
    --text:    #e8f4f6;
    --muted:   rgba(232,244,246,0.42);
    --accent:  #4a9fad;
    --acc-hov: #3a8a97;
    --tag-bg:  #071318;
}

body.light-mode {
    --bg:      #e4ecee;
    --card:    #d2dfe2;
    --border:  #a8c0c5;
    --text:    #0a1e22;
    --muted:   rgba(10,30,34,0.45);
    --accent:  #12363f;
    --acc-hov: #0a2830;
    --tag-bg:  #c0d4d8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    transition: background 0.3s, color 0.3s;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 8px;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}
.theme-toggle:hover        { transform: scale(1.08); border-color: var(--accent); }
.theme-toggle .icon        { width: 20px; height: 20px; }
.theme-toggle .sun-icon    { display: block; }
.theme-toggle .moon-icon   { display: none; }
body.light-mode .sun-icon  { display: none; }
body.light-mode .moon-icon { display: block; }

/* Canvas */
.main-bg {
    position: fixed;
    inset: 0;
    height: 100vh;
    background: var(--bg);
    transition: background 0.3s;
    z-index: 0;
}
.canvas {
    position: absolute;
    inset: 0;
    height: 100vh;
    overflow: hidden;
}
.connecting-dots, .canvas-2 { height: 100%; width: 100%; }

/* Hero */
/* --- Hero-Bereich (Responsive) --- */
.hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 100dvh verhindert Layout-Sprüngen durch Ein-/Ausblenden der Handy-Adressleiste */
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 1.5rem; /* Sicherheitsabstand zu den Bildschirmrändern auf Handys */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 850px;
    width: 100%;
}

/* Fluid Typography: font-size: clamp(MIN, BEVORZUGT, MAX) */
.hero-content h1 {
    /* Skaliert stufenlos: Auf kleinen Handys ~2.2rem, auf Desktop bis zu 4.8rem */
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    font-weight: 300;
    margin: 0;
    line-height: 1.15;
    word-break: break-word; /* Schützt vor Überlaufen bei sehr kleinen Screens */
}

.hero-subtitle {
    /* Skaliert auf Handys auf ~1.1rem, auf Desktop auf 1.75rem */
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    font-weight: 300;
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
    max-width: 650px;
}

.hero-subtitle span {
    color: var(--accent);
    font-weight: 400;
}

/* Tabs (Sticky Header) */
.tabs {
    position: sticky; /* Macht die Leiste haftend */
    top: 0;           /* Bleibt ganz oben am Rand kleben */
    z-index: 10;      /* Legt die Leiste über den Seiteninhalt beim Scrollen */

    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;

    background: var(--card);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

section[id] {
    scroll-margin-top: 70px;
}

.tab-link {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 1.5rem;
    height: 56px;
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}

.tab-link:hover, .tab-link.active {
    opacity: 1;
    border-bottom-color: var(--accent);
}

/* Page Content */
.page-content {
    position: relative;
    z-index: 1;
    background: var(--bg);
    transition: background 0.3s;
    padding: 4rem 2rem;
    min-height: 50vh;
}
.page-content section { max-width: 900px; margin: 0 auto; padding: 3rem 0; }
.page-content h2      { font-size: 2rem; font-weight: 400; margin: 0 0 0.25rem; }

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.skill-card {
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.skill-card h4   { margin: 0 0 0.85rem; font-size: 0.85rem; font-weight: 600; }
.badge-row img   { height: 24px; border-radius: 3px; }

/* Projekte */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
/* Container für die Vorschaubilder */
.project-img-wrapper {
    width: 100%;
    height: 180px;
    background: #02080a; /* Dunkler Hintergrund, der perfekt zum Theme passt */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.project-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Bild wird nie abgeschnitten */
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* Gibt den Screenshots einen schönen App-Card-Look */
}

/* Spezial-Anpassung für den Server mit weißem Hintergrund */
.project-img-wrapper img[src*="server"] {
    background: #ffffff;
    padding: 6px;
    mix-blend-mode: lighten; /* Verschmilzt das Weiß bei Bedarf sauber oder zeigt das Gerät ordentlich an */
}
.project-card:hover        { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.project-body              { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; flex-grow: 1; gap: 0.5rem; }
.project-title             { font-size: 1.1rem; font-weight: 600; margin: 0; }
.project-description       { font-size: 0.88rem; color: var(--muted); line-height: 1.6; flex-grow: 1; margin: 0; }
.project-tags              { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tag               { font-size: 0.72rem; font-family: ui-monospace, monospace; padding: 2px 8px; background: var(--tag-bg); color: var(--accent); border: 1px solid var(--border); border-radius: 3px; }
.project-links             { display: flex; gap: 0.75rem; margin-top: 0.25rem; }
.project-btn               { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; font-size: 0.82rem; font-weight: 500; text-decoration: none; border-radius: 5px; background: var(--border); color: var(--text); transition: background 0.2s, color 0.2s; }
.project-btn:hover         { background: var(--accent); color: var(--bg); }
.project-btn.primary       { background: var(--accent); color: var(--bg); }
.project-btn.primary:hover { background: var(--acc-hov); }

/* Dokumente */
.dokumente-card h3         { font-size: 1.05rem; font-weight: 500; margin: 0 0 0.4rem; }
.dokumente-card p          { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.25rem; }

/* Footer */
footer                     { position: relative; z-index: 2; text-align: center; padding: 20px; background: var(--card); color: var(--text); }
footer a, footer a:visited { color: var(--text); text-decoration: none; transition: color 0.2s; }
footer a:hover             { color: var(--accent); }

/* Kontakt Form */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

:is(input[type="text"], input[type="email"], input[type="password"], textarea) {
    background-color: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

::placeholder {
    color: var(--muted);
    opacity: 1;
}

:is(input[type="text"], input[type="email"], input[type="password"], textarea):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 159, 173, 0.25);
}

form textarea {
    resize: vertical;
    min-height: 120px;
}

form button[type="submit"] {
    background-color: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

form button[type="submit"]:hover {
    background-color: var(--acc-hov);
}
