/* --------------------- */
/* Variablen & Globals   */
/* --------------------- */
:root {
    --font-primary: 'Geist Sans', sans-serif; /* Geist Sans von Vercel */
    --color-background: #f8f5f2; /* Heller, leicht warmer Hintergrund */
    --color-text: #333;
    --color-heading: #1a1a1a;
    --color-primary: #1921F5; /* Ein ruhiger Grünton als Akzent */
    --color-card-bg: #ffffff;
    --color-border: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
    --transition-fast: all 0.2s ease-in-out;

    /* Spacing - Verwende rem für Skalierbarkeit */
    --space-xs: 0.5rem;  /* 8px */
    --space-sm: 1rem;    /* 16px */
    --space-md: 1.5rem;  /* 24px */
    --space-lg: 2.5rem;  /* 40px */
    --space-xl: 4rem;    /* 64px */
    --space-section: 5rem; /* 80px */
}

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

html {
    scroll-behavior: smooth; /* Für sanftes Scrollen bei internen Links */
    font-size: 100%; /* Basis für rem Einheiten (meist 16px) */
}

body {
    font-family: var(--font-primary), sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Verhindert Leerraum unter Bildern */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover, a:focus {
    opacity: 0.8;
}

h1, h2, h3 {
    color: var(--color-heading);
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    font-weight: 600; /* Etwas fetter für Geist */
}

h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4rem); } /* Responsive Schriftgröße */
h2 { font-size: clamp(1.8rem, 4vw + 0.5rem, 2.8rem); }
h3 { font-size: clamp(1.2rem, 3vw + 0.2rem, 1.8rem); }
p  { font-size: clamp(1rem, 2vw + 0.5rem, 1.1rem); margin-bottom: var(--space-sm); }

.container {
    width: 90%;
    max-width: 1200px; /* Maximale Breite für große Bildschirme */
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.section-padding {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
}

.section-title {
    margin-bottom: var(--space-lg);
    text-align: center; /* Titel standardmäßig zentriert */
}
.section-title--right {
    text-align: right;
}


/* --------------------- */
/* Header                */
/* --------------------- */
.header {
    position: fixed;
    display: flex;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.85); /* Leicht transparenter Hintergrund */
    backdrop-filter: blur(10px); /* Milchglas-Effekt */
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-xs) 0; /* Weniger Padding oben/unten */
}

.header__container {
    display: flex;
    justify-content: space-between; /* Logo links, Nav rechts */
    align-items: center;
}

.header__logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-heading);
    text-decoration: none;
}

.header__nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-md); /* Abstand zwischen Menüpunkten */
}

.header__link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: var(--space-xs) 0;
    position: relative;
}

/* Unterstrich-Effekt beim Hover */
.header__link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.header__link:hover::after,
.header__link:focus::after {
    width: 100%;
}

/* --------------------- */
/* Hero Section          */
/* --------------------- */
.hero {
    position: relative;
    min-height: 90vh; /* Etwas weniger als volle Höhe, damit man sieht, dass mehr kommt */
    display: flex;
    align-items: center;
    color: var(--color-heading); /* Dunkler Text für besseren Kontrast auf hellem Grund */
    overflow: hidden; /* Verhindert, dass ::before überläuft */
}

.hero__background {
    position: absolute;
    inset: 0; /* Kurz für top: 0, right: 0, bottom: 0, left: 0 */
    background-image: url('../assets/hintergrund-hero.jpeg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    opacity: 0.45; /* Stark reduziert, um Textlesbarkeit zu gewährleisten */
    /*!* Optional: Leichter Parallax-Effekt beim Scrollen (JS wäre besser) *!*/
    /*!* background-attachment: fixed; *!*/
}


.hero__content {
    position: relative; /* Stellt sicher, dass der Inhalt über dem Hintergrund ist */
    z-index: 1;
}

.hero__text-wrapper {
    max-width: 540px; /* Begrenzt die Breite des Textes */
}

/* --------------------- */
/* Work Section          */
/* --------------------- */
.work__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive Spalten */
    gap: var(--space-lg); /* Größerer Abstand zwischen Projekten */
}

.project-card {
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden; /* Verhindert, dass Bild überläuft */
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.project-card__img {
    width: 100%;
    aspect-ratio: 16 / 10; /* Verhältnis für die Bilder */
    object-fit: cover; /* Stellt sicher, dass das Bild die Fläche füllt */
}

.project-card__content {
    padding: var(--space-md);
    flex-grow: 1; /* Sorgt dafür, dass der Content-Bereich wächst */
    display: flex;
    flex-direction: column;
}

.project-card__title {
    margin-bottom: var(--space-xs);
    font-size: 1.3rem; /* Angepasste Größe */
}

.project-card__description {
    font-size: 0.95rem;
    color: #666; /* Etwas helleres Grau f��r die Beschreibung */
    margin-bottom: 0; /* Kein unterer Rand bei der Beschreibung */
    flex-grow: 1; /* Schiebt Titel/Beschreibung nach oben, falls unterschiedlich lang */
}


/* --------------------- */
/* About Me Section      */
/* --------------------- */
.about__image-gallery {
    display: flex;
    flex-wrap: wrap; /* Erlaubt Umbruch auf kleinen Screens */
    gap: var(--space-md); /* Abstand zwischen den Bildern */
    justify-content: center; /* Zentriert die Bilder-Gruppe */
    align-items: flex-start; /* Falls Bilder leicht unterschiedliche Höhe haben */
    margin-top: var(--space-lg); /* Etwas Abstand zum Text */
}

.about__img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    /* Breite anpassen: Ca. 1/3 des Containers minus Gap, aber nicht zu gro�� */
    flex-basis: calc(33.333% - var(--space-md) * 2 / 3); /* Ca. 1/3 der Breite, berücksichtigt Lücken */
    flex-grow: 0; /* Nicht wachsen */
    flex-shrink: 1; /* Schrumpfen erlauben */
    max-width: 220px; /* Maximale Breite pro Bild */
    aspect-ratio: 4 / 5; /* Beispiel für einheitliches Seitenverhältnis (optional) */
    object-fit: cover; /* Stellt sicher, dass das Bild den Bereich füllt */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Sanfter Übergang für Hover */
    /* Entferne position: absolute, transform, z-index von den alten Regeln */
}

/* Hover-Effekt für die einzelnen Bilder */
.about__img:hover {
    transform: scale(1.05) translateY(-5px); /* Leicht vergrößern und anheben */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* Verstärkter Schatten beim Hover */
    z-index: 5; /* Stellt sicher, dass das gehoverte Bild über anderen ist (falls minimaler Überlap) */
}

/* Anpassung für kleinere Bildschirme in den Media Queries */
/* Füge dies innerhalb deiner `@media (max-width: 768px)` Regel hinzu oder passe sie an */
@media (max-width: 768px) {
    .about__container {
        grid-template-columns: 1fr; /* Stellt sicher, dass Text und Bilder untereinander sind */
        text-align: center;
    }
    .about__image-gallery {
        justify-content: center; /* Zentriert die Bilder auch im umgebrochenen Zustand */
    }
    .about__img {
        /* Auf Tablets evtl. 2 Bilder nebeneinander */
        flex-basis: calc(50% - var(--space-md) / 2); /* Ca. halbe Breite */
        max-width: 200px;
    }
}

/* Füge dies innerhalb deiner `@media (max-width: 480px)` Regel hinzu oder passe sie an */
@media (max-width: 480px) {
    .about__img {
        /* Auf Handys ein Bild pro Zeile */
        flex-basis: 80%; /* Breiter, da einzeln */
        max-width: 250px;
    }
}

/* --------------------- */
/* Contact Section       */
/* --------------------- */
.contact__subtitle {
    text-align: right;
    margin-top: calc(-1 * var(--space-lg)); /* Näher an den Titel rücken */
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.contact__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.contact-card {
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: var(--transition-fast);
    position: relative; /* Für den Pfeil */
    display: block; /* Macht den gesamten Bereich klickbar */
    color: var(--color-text); /* Standard Textfarbe für Links */
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.contact-card__icon {
    width: 40px; /* Feste Größe für Icons */
    height: 40px;
    margin-bottom: var(--space-sm);
}

.contact-card__title {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--color-heading);
}

.contact-card__text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.contact-card__arrow {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    font-size: 1.5rem;
    color: var(--color-primary);
    opacity: 0; /* Standardmäßig unsichtbar */
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-card:hover .contact-card__arrow {
    opacity: 1;
    transform: translateX(0);
}


/* --------------------- */
/* Footer                */
/* --------------------- */
.footer {
    padding: var(--space-lg) 0 var(--space-md) 0; /* Mehr Padding oben */
    margin-top: var(--space-section);
    color: #777; /* Hellgrauer Text */
}

.footer__container {
    text-align: center;
}

.footer__line {
    border: none;
    height: 1px;
    background-color: var(--color-border);
    width: 50%; /* Kürzere Linie */
    margin: 0 auto var(--space-md) auto; /* Zentrieren und Abstand unten */
}

.footer__text {
    font-size: 0.9rem;
    margin-bottom: 0;
}


/* --------------------- */
/* Media Queries (Beispiel) */
/* --------------------- */

@media (max-width: 768px) {
    :root {
        /* Kleinere Abstände für kleinere Bildschirme */
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-section: 4rem;
    }

    h1 { font-size: clamp(2rem, 8vw + 0.5rem, 3rem); }
    h2 { font-size: clamp(1.5rem, 6vw + 0.5rem, 2.2rem); }

    .header__nav {
        /* Hier könnte man ein Mobile Menu implementieren (z.B. Hamburger Icon) */
        /* Vorerst: Menüpunkte kleiner machen oder untereinander */
        gap: var(--space-sm);
    }
    .header__link {
        font-size: 0.9rem;
    }

    .hero {
        min-height: 70vh;
        text-align: center; /* Text zentrieren auf Mobile */
    }
    .hero__text-wrapper {
        margin: 0 auto; /* Zentriert den Textblock */
    }


    .about__container {
        grid-template-columns: 1fr; /* Spalten untereinander */
        gap: var(--space-lg);
        text-align: center;
    }
    .about__text-content {
        order: 1; /* Text zuerst */
    }
    .about__image-gallery {
        order: 2; /* Bilder danach */
        min-height: 250px; /* Etwas kleiner */
        margin-top: var(--space-md);
    }
    .about__img {
        width: 45%;
        max-width: 180px;
    }


    .section-title--right,
    .contact__subtitle {
        text-align: center; /* Rechtsbündige Titel auch zentrieren */
    }
    .contact__subtitle {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    .work__grid {
        grid-template-columns: 1fr; /* Nur eine Spalte für Projekte */
        gap: var(--space-md);
    }
    .contact__grid {
        grid-template-columns: 1fr; /* Nur eine Spalte für Kontakte */
        gap: var(--space-sm);
    }

    /* Header evtl. noch weiter anpassen */
    .header__logo { font-size: 1.2rem; }
    .header__menu { display: none; } /* Menü ausblenden -> Hamburger nötig */
}

/* --------------------- */
/* Typewriter Cursor     */
/* --------------------- */
.typewriter-cursor {
  display: inline-block;
  width: 1ch;
  animation: blink 0.7s steps(1) infinite;
}

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