/* ===== CSS VARIABLES (Corporate Identity) ===== */
:root {
    /* Corporate Identity Colors */
    --color-primary: #8B0000;      /* Dunkelrot - Akzente */
    --color-text: #000000;         /* Schwarz - Text */
    --color-background: #FFFFFF;   /* Weiß - Hintergrund */
    --color-lines: #CCCCCC;        /* Hellgrau - Linien/Sektionen */
    --color-text-light: #666666;   /* Grau - Sekundärtext */
    
    /* Spacing & Layout */
    --container-max-width: 1200px;
    --section-padding: clamp(4rem, 8vw, 8rem);
    --grid-gap: clamp(1.5rem, 3vw, 2rem);
    
    /* Typography - Fluid Scaling */
    --font-size-xs: clamp(0.75rem, 2vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 2.5vw, 1rem);
    --font-size-base: clamp(1rem, 3vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 3.5vw, 1.25rem);
    --font-size-xl: clamp(1.25rem, 4vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 5vw, 2rem);
    --font-size-3xl: clamp(2rem, 6vw, 2.5rem);
    --font-size-4xl: clamp(2.5rem, 8vw, 3.5rem);
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
    --animation-bounce: bounce 2s infinite;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(139, 0, 0, 0.2);
    --shadow-lg: 0 8px 25px rgba(139, 0, 0, 0.3);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--color-lines);
    background: var(--color-background);
    color: var(--color-text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-normal), color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { width: 20px; height: 20px; }

/* Toggle icon visibility depending on theme */
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ===== DARK THEME OVERRIDES ===== */
:root[data-theme="dark"] {
    --color-text: #EAEAEA;
    --color-background: #0B0B0B;
    --color-lines: #2A2A2A;
    --color-text-light: #A0A0A0;
}

[data-theme="dark"] body {
    background-color: var(--color-background);
    color: var(--color-text);
}

[data-theme="dark"] .navbar {
    background: rgba(10, 10, 10, 0.8);
    border-bottom-color: var(--color-lines);
}

[data-theme="dark"] .modal-content {
    background: var(--color-background);
    color: var(--color-text);
}

/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    font-size: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
    font-size: var(--font-size-base);
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-background);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 600;
    text-align: center;
    margin-bottom: clamp(2rem, 6vw, 4rem);
    color: var(--color-text);
    letter-spacing: -0.02em;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-lines);
    transition: all var(--transition-normal);
    transform: translateY(0);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    height: 40px;
    width: auto;
    transition: transform var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
}

.brand-text {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(1.5rem, 4vw, 2rem);
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: color var(--transition-normal);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, var(--color-background) 0%, #F8F8F8 100%);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="%23CCCCCC" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>') center/cover;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: 0 clamp(1rem, 4vw, 2rem);
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: var(--color-text-light);
    margin-bottom: clamp(2rem, 6vw, 2.5rem);
    line-height: 1.4;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: var(--color-background);
    padding: clamp(0.75rem, 3vw, 1rem) clamp(1.5rem, 4vw, 2.5rem);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: #A00000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.button-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
}

.cta-button:hover .button-icon {
    transform: translateX(2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: var(--animation-bounce);
    opacity: 0.7;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    transform: rotate(45deg);
}

.scroll-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== ABOUT SECTION ===== */
.about {
    padding: var(--section-padding) 0;
    background: #F8F8F8;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(2rem, 8vw, 4rem);
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.about-content.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.about-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.about-name {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.xing-button,
.linkedin-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: all var(--transition-normal);
    color: var(--color-background);
}

.xing-button {
    background: #026466;
}

.xing-button:hover {
    background: #014a4c;
    transform: translateY(-2px);
}

.linkedin-button {
    background: #0077B5;
}

.linkedin-button:hover {
    background: #005885;
    transform: translateY(-2px);
}

.xing-button svg,
.linkedin-button svg {
    width: 20px;
    height: 20px;
}

.about-image {
    display: flex;
    justify-content: center;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    border: 4px solid var(--color-accent);
    transition: all var(--transition-normal);
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(139, 0, 0, 0.3);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--color-text);
    color: var(--color-background);
    padding: clamp(2rem, 6vw, 3rem) 0 clamp(1rem, 3vw, 2rem);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--grid-gap);
    align-items: start;
}

.footer-info h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: var(--font-size-lg);
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: var(--color-lines);
    font-size: var(--font-size-sm);
}

.footer-info a {
    color: var(--color-lines);
    text-decoration: none;
    transition: color var(--transition-normal);
}

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

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-link {
    background: none;
    border: none;
    color: var(--color-lines);
    text-decoration: none;
    transition: color var(--transition-normal);
    cursor: pointer;
    font-size: var(--font-size-sm);
    text-align: left;
    padding: 0;
}

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

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--color-background);
    margin: 5% auto;
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn var(--transition-normal) ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-normal);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--color-primary);
}

.modal-text h3 {
    color: var(--color-primary);
    margin: 1.5rem 0 1rem;
    font-size: var(--font-size-lg);
}

.modal-text h4 {
    color: var(--color-text);
    margin: 1rem 0 0.5rem;
    font-size: var(--font-size-base);
}

.modal-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

.modal-text ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-text a {
    color: var(--color-primary);
    text-decoration: none;
}

.modal-text a:hover {
    text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Simplified for mobile - could add hamburger menu */
    }
    
    .brand-text {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 90vh;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .scroll-indicator,
    .modal {
        display: none !important;
    }
    
    .hero {
        height: auto;
        page-break-after: always;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* ===== DARK THEME LATE OVERRIDES (ensure header switches) ===== */
:root[data-theme="dark"] .navbar {
    background: rgba(12, 12, 12, 0.9) !important;
    border-bottom-color: var(--color-lines) !important;
    backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .navbar.scrolled {
    background: rgba(12, 12, 12, 0.95) !important;
    box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .nav-link {
    color: var(--color-text);
}

:root[data-theme="dark"] .nav-link::after {
    background: var(--color-primary);
}

/* Dark theme surfaces: keep backgrounds consistently near-black */
:root[data-theme="dark"] .hero {
    background: var(--color-background);
}

:root[data-theme="dark"] .hero-background {
    opacity: 0.05; /* reduce grid brightness in dark mode */
}

:root[data-theme="dark"] .about {
    background: var(--color-background);
}

:root[data-theme="dark"] .footer {
    background: var(--color-background);
    color: var(--color-text);
}

:root[data-theme="dark"] .footer-info p,
:root[data-theme="dark"] .footer-info a,
:root[data-theme="dark"] .footer-link {
    color: var(--color-text-light);
}

:root[data-theme="dark"] .footer-info a:hover,
:root[data-theme="dark"] .footer-link:hover {
    color: var(--color-primary);
}

/* Dark theme contrast fixes for buttons on colored backgrounds */
:root[data-theme="dark"] .cta-button {
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(160, 0, 0, 0.35);
}

:root[data-theme="dark"] .xing-button,
:root[data-theme="dark"] .linkedin-button {
    color: #FFFFFF;
}
