/* =========================================
 * 1. RESET & VARIABLEN (Design System)
 * ========================================= */
:root {
    --bg-body: #F5F5F5;
    --bg-card: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #666666;
    --accent: #222222;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --overlay-text: #fff;
    --font-mono: ui-monospace, SFMono-Regular, "Segoe UI Mono", "Menlo", "Consolas", "Liberation Mono", "Courier New", monospace;
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --radius: 0px;
    --transition-slow: 0.8s cubic-bezier(0.2, 0, 0, 1);
}

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

html {
    scroll-behavior: smooth;
}

/* Mobile-First: Bilder niemals flach dehnen */
img {
    max-width: 100%;
    height: auto;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    letter-spacing: var(--tracking-normal);
    overflow-x: hidden;
    cursor: default;
    padding-top: 60px; /* Platz für Fixed Header */
}

h1, h2, h3, h4 {
    font-weight: 400;
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }

p { margin-bottom: var(--spacing-sm); max-width: 65ch; }
a { color: inherit; text-decoration: none; transition: opacity 0.3s ease; }
a:hover { opacity: 0.6; }

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* =========================================
 * 2. COMPONENTS & NAVIGATION
 * ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 245, 245, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

nav ul {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
}

nav a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

nav a:hover::after { width: 100%; }

/* =========================================
 * 3. SECTIONS (Hero & Wir)
 * ========================================= */
.hero {
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr; /* Mobile: immer 1 Spalte */
    gap: var(--spacing-lg);
    padding-top: var(--spacing-lg);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: Text über Bild */
    gap: var(--spacing-md);
    align-items: flex-start;
}

.hero-text {
    padding-right: var(--spacing-md);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 60vh; /* vorher 50 */
    width: 100%;
    max-width: 1200px;
	margin: 0 auto; /* Zentriere das Bild auf großen Bildschirmen */
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1) brightness(0.95);
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-image-wrapper:hover img {
    transform: scale(1.03);
    filter: grayscale(0%) contrast(1.1);
}

.section-wir {
    padding: var(--spacing-lg) 0;
    background: var(--bg-card);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.card {
    background: var(--bg-body);
    padding: var(--spacing-md);
    transition: background 0.3s ease;
}

.card:hover { background: #EAEAEA; }

/* =========================================
 * 4. PORTFOLIO
 * ========================================= */
.section-portfolio {
    padding: var(--spacing-lg) 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); 
    gap: 1px;
    background: #E0E0E0;
    padding: 1px;
}

.gallery-item {
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
    aspect-ratio: 10/9; /* vorher "3/4", Problem der Hochskalierung der Querbilder */
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.project-info {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 1.5rem;
	background: var(--overlay-bg);
	color: var(--overlay-text);
	/* Animationen für beide Zustände zentral definiert */
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.4s ease, transform 0.4s ease;
	box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: 0.9rem;
	pointer-events: none; /* Wichtig: Verhindert Interaktions-Konflikte */
}

/* Desktop-spezifisch: Nur bei echter Mausbedienung aktiv */
@media (hover: hover) {
	.gallery-item:hover .project-info {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Mobil & Click-Zustand: Wird durch das JavaScript gesteuert */
.gallery-item.is-active .project-info {
	opacity: 1;
	transform: translateY(0);
}

.project-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    /* font-family: var(--font-mono); */
    text-transform: uppercase;
    letter-spacing: var(--tracking-tight);
}

.project-info p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #ddd;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
 * 5. CONTACT
 * ========================================= */
.section-contact {
    padding: var(--spacing-lg) 0;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 Spalte */
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

input, textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #999;
    padding: 10px 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.3s;
    outline: none;
    width: 100%; /* Full width für Mobile */
    max-width: 100%;
}

input:focus, textarea:focus {
    border-bottom-color: var(--text-primary);
}

button.btn-primary {
    background: var(--text-primary);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
    width: 100%; /* Mobile: Full Width Button */
    min-height: 48px; /* Touch-Friendly */
    display: inline-block;
    text-align: center;
    /* cursor: pointer; */
}

button.btn-primary:hover {
    opacity: 0.8;
}

/* =========================================
 * 6. ANIMATIONS & FOOTER
 * ========================================= */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* 
 * Der Body sorgt für das Layout, behält aber seine Schriftart bei
 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    /* overflow-x: hidden; cursor: default; (falls noch nötig) */
}

/* 
 * Der Main Container füllt den Platz zwischen Header und Footer
 */
main {
    flex: 1;
}

footer {
    background: #111;
    color: #888;
    padding: var(--spacing-lg) 0;
    font-size: 0.85rem;
    line-height: 1.5; /* Besserer Lesabstand */
    flex-shrink: 0; /* Flex-Eigenschaften für den "Klebstoff"-Effekt */
    width: 100%;
    position: relative;
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; /* FlexWrap für Mobile */
}

.footer-logo {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}


/* =========================================
 * 7. 404
 * ========================================= */
.error-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	/* gap: var(--spacing-md); */
}


/* =========================================
 * MOBILE OPTIMIZATIONS (Tablet & Mobile)
 * ========================================= */
@media (max-width: 768px) {
    /* HEADER */
    .site-header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1rem;
    }

    nav ul {
        gap: var(--spacing-sm);
    }

    /* HERO SECTION */
    .hero {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding-top: var(--spacing-md);
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: var(--spacing-md);
    }

    .hero-image-wrapper {
        height: 55vh; /* vorher 40 */
    }

    /* WIR SECTION */
    .section-wir {
        padding: var(--spacing-md) 0;
    }

    .grid-3 {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* KONTAKT */
    .section-contact {
        padding: var(--spacing-md) 0;
    }

    .form-group {
        width: 100%;
    }

    button.btn-primary {
        width: 100%;
        min-height: 50px; /* Größere Touch-Zone */
    }

    /* FOOTER */
    footer {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md) 0;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    h1 {
        display: inline-block;
        white-space: nowrap;
        font-size: 3rem; /* Optional: Etwas kleiner, damit es besser passt */
    }

    /* TEXT ANIMATIONS für Mobile anpassen */
    .hero-text, .section-wir h2, .section-portfolio h2, .section-contact h3 {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
}

@media (max-width: 480px) {
    .hero-image-wrapper {
        height: 55vh;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile: Elemente animieren auf Scroll */
@media (max-width: 768px) {
    .card, .gallery-item {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.8s ease-out;
    }
}
