:root {
    --primary: #004d80;
    --primary-light: #e6f1f8;
    --accent: #f39c12;
    --text: #222;
    --muted: #666;
    --bg: #f7f9fb;
    --border: #dde5ee;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
    --radius: 14px;
    --spacing-xs: clamp(0.4rem, 0.8vw, 0.6rem);
    --spacing-sm: clamp(0.75rem, 1.5vw, 1rem);
    --spacing-md: clamp(1rem, 2vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 3vw, 2.5rem);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    /*contain: layout style;*/
    contain: style;
}

/* Mobile-First: Basis-Layout für alle Geräte */
.container {
    max-width: 100%;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--primary), #002b45);
    color: #fff;
    padding: var(--spacing-md) var(--spacing-sm);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

#brand-home {
    color: inherit;
}

.brand-logo {
    width: clamp(40px, 12vw, 48px);
    height: clamp(40px, 12vw, 48px);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(1rem, 3vw, 1.15rem);
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.brand h1 {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin: 0;
}

.brand p {
    margin: 0;
    font-size: 0.875rem;
    color: #d8e6f3;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: var(--spacing-xs);
    cursor: pointer;
    -webkit-appearance: none;
    color: #fff;
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-open {
    opacity: 1;
    max-height: 200px;
    margin-bottom: var(--spacing-sm);
}

.nav a {
    color: #eaf3fb;
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.nav a:hover, .nav a:focus {
    border-bottom-color: var(--accent);
    outline: none;
}

.nav a.nav-active {
    border-bottom-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Hero Mobile */
.hero {
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.hero h2 {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
    margin-top: 0;
    line-height: 1.3;
}

.hero p {
    margin: var(--spacing-xs) 0 var(--spacing-md);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: clamp(0.3rem, 0.8vw, 0.4rem) clamp(0.5rem, 1.2vw, 0.7rem);
    border-radius: 999px;
    background: rgba(0,0,0,0.2);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-sm);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
}

.hero-highlight {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius);
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    font-size: 0.9rem;
}

.hero-contact {
    background: #fff;
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 1.2rem);
    box-shadow: var(--shadow-md);
    color: var(--text);
    contain: layout;
}

.hero-contact h3 {
    margin-top: 0;
    font-size: clamp(1rem, 3vw, 1.1rem);
}

.hero-contact p {
    margin: var(--spacing-xs) 0;
    font-size: 0.9rem;
}

.hero-contact a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-word;
}

.muted {
    color: var(--muted);
    font-size: 0.875rem;
}

/* Main Content */
main {
    padding: clamp(1.5rem, 5vw, 2rem) 0 clamp(2rem, 6vw, 3rem);
}

.section-title {
    font-size: clamp(1.2rem, 4vw, 1.4rem);
    margin-bottom: var(--spacing-md);
    color: var(--primary);
}

.grid-2 {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 1.2rem);
    box-shadow: var(--shadow-sm);
    contain: layout;
}

.card h3 {
    margin-top: 0;
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: var(--primary);
}

ul {
    padding-left: clamp(1.2rem, 4vw, 1.4rem);
    margin: var(--spacing-xs) 0 var(--spacing-sm);
}

li {
    margin-bottom: var(--spacing-xs);
    font-size: 0.95rem;
}

.clients-list {
    padding-left: 0;
    margin: var(--spacing-sm) 0 0;
    font-size: 0.95rem;
}

.clients-list li {
    margin-bottom: var(--spacing-xs);
}

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

.clients-list a:hover {
    text-decoration: underline;
}

.impressum {
    font-size: 0.875rem;
}

.impressum p {
    margin: var(--spacing-xs) 0;
}

footer {
    border-top: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    background: #fff;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    min-height: unset;
    padding: 0 0.25rem;
}

/* Tablet & Desktop: Progressive Enhancement */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
    
    .brand {
        justify-content: flex-start;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .nav {
        flex-direction: row;
        opacity: 1;
        max-height: none;
        margin-bottom: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .grid-2 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
    
    .hero-grid {
        flex-direction: row;
        align-items: start;
    }
    
    .hero-contact {
        align-self: stretch;
    }
}

@media (min-width: 980px) {
    .container {
        max-width: 980px;
    }
    
    .grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

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

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111;
        --text: #eee;
        --muted: #aaa;
        --border: #333;
    }
    
    body {
        background: var(--bg);
    }
    
    .card, .hero-contact, footer {
        background: #222;
        color: var(--text);
    }
    
    header {
        color: #fff;
    }
}

/* Touch Targets mind. 44px */
a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

#mobile-menu-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 0.5rem;
    background: rgba(0, 45, 70, 0.9);
    border-bottom-right-radius: 10px;
}

#mobile-menu-bar .menu-toggle-fixed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    min-height: unset;
}

#mobile-menu-bar .menu-toggle-fixed span {
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

#scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    min-height: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 767px) {
    #scroll-top {
        width: 52px;
        height: 52px;
        font-size: 2rem;
        bottom: 1rem;
        right: 1rem;
        box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    }
}

@media (min-width: 768px) {
    #mobile-menu-bar { display: none !important; }
}

.client-thumb {
    float: left;
    max-height: 64px;
    width: auto;
    margin: 0 0.75rem 0.5rem 0;
    border-radius: 6px;
}

.clients-list li {
    overflow: hidden; /* clearfix für float */
}

.clients-list span.muted {
    display: block;
}
