/* Add professional fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables */
:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #00ff41;
    --secondary-color: #1a1a1a;
    --border-color: #333;
    --header-height: 60px;
    --terminal-green: #00ff41;
    --terminal-cyan: #00ffff;
    --terminal-white: #ffffff;
    --terminal-amber: #ffb000;
    --glow-color: #00ff4180;
    --matrix-color: #008f11;
    --card-bg: rgba(26, 26, 26, 0.8);
    --glass-bg: rgba(0, 0, 0, 0.3);
}

/* Smooth scrolling for whole page */
html { scroll-behavior: smooth; }

/* Rendering hints for crisper text */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Matrix Background Effect */
body {
    position: relative;
    overflow-x: hidden;
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 100%);
    overflow: hidden;
}

.matrix-bg canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.18; /* Erhöht von 0.1 auf 0.25 für bessere Sichtbarkeit */
}

/* Terminal Text Effects */
.terminal-text {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    color: var(--terminal-green);
    text-shadow: 
        0 0 3px rgba(0, 255, 65, 0.6),
        0 0 6px rgba(0, 255, 65, 0.3);
    position: relative;
    letter-spacing: 1px;
}

.terminal-text::before {
    content: '> ';
    color: var(--terminal-cyan);
    text-shadow: 
        0 0 5px var(--terminal-cyan),
        0 0 10px var(--terminal-cyan);
}

/* Terminal Title with enhanced effects */
.terminal-title {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    color: var(--terminal-white);
    text-shadow: 
        0 0 6px rgba(0, 255, 65, 0.6),
        0 0 12px rgba(0, 255, 65, 0.35);
    position: relative;
    letter-spacing: 3px;
    font-weight: bold;
}

.terminal-title span {
    transition: opacity 0.1s ease;
}

.terminal-title::after {
    content: '_';
    color: var(--terminal-green);
    animation: cursor-blink 1.2s infinite;
    text-shadow: 
        0 0 4px rgba(0, 255, 65, 0.6),
        0 0 8px rgba(0, 255, 65, 0.35);
    margin-left: 5px;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    border-right: 2px solid var(--terminal-green);
    animation: typing 3.5s steps(40, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* prevent double cursor on animated hero title */
.hero .terminal-title::after { content: none; }

/* Cursor for terminal typing */
.tt-cursor {
    color: var(--terminal-green);
    margin-left: 5px;
    animation: cursor-blink 1.2s infinite;
    text-shadow: 0 0 5px var(--terminal-green), 0 0 10px var(--terminal-green);
}

/* Glowing Effects */
.glow {
    border: 1px solid var(--terminal-green);
    background: var(--card-bg);
    backdrop-filter: blur(6px);
    box-shadow: 
        0 0 4px rgba(0, 255, 65, 0.25),
        inset 0 0 8px rgba(0, 255, 65, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.glow:hover {
    box-shadow: 
        0 0 8px rgba(0, 255, 65, 0.45),
        0 0 16px rgba(0, 255, 65, 0.28),
        inset 0 0 12px rgba(0, 255, 65, 0.14);
    border-color: var(--terminal-cyan);
}

.glow-button {
    background: linear-gradient(45deg, var(--terminal-green), var(--terminal-cyan));
    color: var(--bg-color);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.28);
}

.glow-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.glow-button:hover::before {
    left: 100%;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 255, 65, 0.38);
}

/* Base Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 255, 65, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--terminal-green);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px var(--terminal-green);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--terminal-green);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 5px var(--terminal-green);
}

.nav-links a:hover {
    color: var(--terminal-green);
    text-shadow: 0 0 5px var(--terminal-green);
}

.nav-links a:hover::before {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--terminal-green);
    margin: 3px 0;
    transition: 0.3s;
    box-shadow: 0 0 3px var(--terminal-green);
}

/* Main Content */
main {
    margin-top: var(--header-height);
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 65, 0.05) 0%, transparent 70%);
    z-index: -1;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero .subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.hero .description {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0.7;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Sections */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
    text-align: center;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    transform: translateZ(0); /* stabilere Komposition ohne sichtbaren Unschärfeeffekt */
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--terminal-green), var(--terminal-cyan));
    box-shadow: 0 0 10px var(--terminal-green);
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--terminal-white);
}

.project-card p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-links a {
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    background: transparent;
}

.project-links a:hover {
    background: var(--terminal-green);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--terminal-green);
    transform: translateY(-1px);
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    opacity: 0.8;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 3rem;
}

.skill-tag {
    padding: 0.7rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--terminal-green);
    border-radius: 25px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--terminal-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--terminal-green);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.4);
}

/* Contact Section */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.contact-links a:hover {
    border-color: var(--terminal-green);
    color: var(--terminal-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-color);
    opacity: 0.7;
    font-family: 'Courier New', monospace;
}

/* Theme toggle button: minimal slider (no emoji) */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    padding: 0;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.06));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--terminal-green);
    box-shadow: 0 0 10px rgba(0,255,65,0.35);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
:root[data-theme="light"] .theme-toggle {
    background: #e5e7eb;
    border-color: #d1d5db;
}
:root[data-theme="light"] .theme-toggle::after {
    transform: translateX(18px);
    background: #10b981; /* softer green for light mode */
    box-shadow: 0 0 6px rgba(16,185,129,0.35);
}
.theme-toggle:hover {
    border-color: var(--terminal-green);
    box-shadow: 0 0 8px rgba(0,255,65,0.25);
}

/* Light theme refinements for contrast and reduced neon */
:root[data-theme="light"] {
    --bg-color: #f7f8fa;
    --text-color: #0b1220;
    --secondary-color: #ffffff;
    --border-color: #d7dbe2;
    --card-bg: rgba(255,255,255,0.85);
    --glass-bg: rgba(255,255,255,0.72);
    /* keep brand colors but they will glow less in light mode (see below) */
}
:root[data-theme="light"] .logo,
:root[data-theme="light"] .terminal-text,
:root[data-theme="light"] .terminal-title {
    text-shadow: none;
}
:root[data-theme="light"] .project-links a:hover,
:root[data-theme="light"] .glow:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
:root[data-theme="light"] footer {
    opacity: 0.9;
}

/* Keep header fixed; no auto-hide */
header { transition: transform .3s ease; }
/* header.header-hidden { transform: translateY(-100%); } */

/* 3D tilt support */
.projects-grid { perspective: 900px; }
.project-card { transform-style: preserve-3d; will-change: transform; }

/* Ensure Inter is the final applied body font (override duplicate at bottom) */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero .subtitle {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .skills {
        gap: 0.5rem;
    }

    section {
        padding: 3rem 1rem;
    }

    nav {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skill-tag {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--terminal-green);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--terminal-green);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--terminal-cyan);
    box-shadow: 0 0 10px var(--terminal-cyan);
}

/* Selection */
::selection {
    background: var(--terminal-green);
    color: var(--bg-color);
}
