/* Variable Definitions */
:root {
    --bg-color: #0d1216;
    /* Deep dark blue/charcoal */
    --text-color: #e0e0e0;
    --accent-color: #2c5844;
    /* Dark refined green */
    --accent-glow: #3e7a5e;
    --font-heading: 'Montserrat', sans-serif;
    /* Clean, Premium */
    --font-body: 'Lato', sans-serif;
    /* Highly readable, neutral */
    --transition-speed: 0.6s;

    /* Spacing Variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --container-padding: 2rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Base font size */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-glow);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: 1.5rem;
}

strong {
    font-weight: 700;
    color: #fff;
}

/* Layout Utilities */
.container {
    max-width: 1100px;
    /* Slightly tighter container for readability */
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Text Page styling relative to container */
/* Used for Impressum/Text pages to prevent too wide lines */
.text-content {
    max-width: 800px;
    margin: 0 auto;
}

.text-content h3 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.text-content h4 {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: var(--accent-glow);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    /* reduced padding slightly */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(13, 18, 22, 0.95), rgba(13, 18, 22, 0.8));
    backdrop-filter: blur(10px);
    transition: padding 0.3s ease;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.logo:hover {
    color: #ffffff;
    opacity: 0.8;
}

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

.nav-item {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.8;
    position: relative;
    font-weight: 500;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-glow);
    transition: width 0.3s ease;
}

.nav-item:hover {
    opacity: 1;
}

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

.nav-item.active {
    opacity: 1;
    color: #fff !important;
    font-weight: 700;
}

/* Special Styling for Contact Link */
.nav-item[href*="#contact"] {
    color: var(--accent-glow) !important;
    opacity: 1;
    font-weight: 600;
}

.nav-item[href*="#contact"]::after {
    display: none !important;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    /* Hero handles its own padding */
}

/* Mobile Default (Fullscreen Background) */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0.5;
    z-index: -1;
    filter: grayscale(10%) contrast(1.1);
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: var(--container-padding);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-transform: none;
    /* Keep ß as ß */
}

.hero-subtitle {
    font-size: 1rem;
    letter-spacing: 0.4em;
    font-weight: 300;
    opacity: 0.9;
}

/* Desktop Split Layout */
@media (min-width: 900px) {
    .hero {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .hero-content {
        flex: 1;
        text-align: left;
        padding-left: 12%;
        /* More breathing room */
        padding-right: 2rem;
        order: 1;
    }

    .hero-bg {
        position: relative;
        flex: 1;
        height: 100vh;
        width: 50%;
        opacity: 1;
        filter: grayscale(0%);
        order: 2;
        object-fit: cover;
        object-position: top center;
        mask-image: linear-gradient(to left, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to left, black 85%, transparent 100%);
    }

    .hero-title {
        font-size: 4.5rem;
        line-height: 1.1;
    }

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

/* Section Styling */
section {
    padding: var(--spacing-xl) 0;
    /* 6rem default */
}

.section-title {
    font-size: 2rem;
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
    margin: 1rem auto 0;
}

/* Footer Polish */
footer {
    padding: 5rem 0 3rem;
    background: #080b0e;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    /* Push to bottom if flex container */
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-title {
    margin-bottom: 2rem;
    color: var(--accent-glow);
    font-size: 1.2rem;
}

.footer-contact-info {
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.footer-email {
    /* Removed underline */
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

.footer-email:hover {
    color: var(--accent-glow);
}

.footer-phone {
    opacity: 0.7;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Social Links Grid */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    max-width: 800px;
    width: 100%;
}

.social-btn {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 140px;
    /* Uniform width */
    text-align: center;
    color: var(--text-color);
}

.social-btn:hover {
    border-color: var(--accent-glow);
    background: rgba(44, 88, 68, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.4;
    margin-bottom: 0;
}

.separator {
    margin: 0 0.5rem;
}

.impressum-link {
    text-decoration: underline;
    transition: color 0.3s ease;
}

.impressum-link:hover {
    color: #fff;
}

/* Mobile Footer Tweaks */
@media (max-width: 600px) {
    footer {
        padding: 3rem 0 2rem;
    }

    .social-links {
        display: grid;
        /* Grid on mobile for structure */
        grid-template-columns: 1fr 1fr;
        /* 2 columns */
        gap: 1rem;
        width: 100%;
        padding: 0 1rem;
        /* Padding to prevent edge touching */
    }

    .social-btn {
        width: 100%;
        min-width: 0;
        padding: 0.8rem 0.5rem;
        /* reduce side padding */
        font-size: 0.75rem;
    }
}

/* Vita List Styling - High End Polish */
.vita-section {
    max-width: 900px;
    margin: 0 auto 5rem;
}

.vita-category-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 2.5rem;
    color: var(--accent-glow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0.9;

    /* Sticky Positioning */
    position: sticky;
    top: 60px;
    /* Closer to navbar (reduced gap) */
    z-index: 5;
    background: var(--bg-color);
    /* Cover content scrolling behind */
    padding: 1rem 0;
    /* Add padding for hit area */
    margin-top: -1rem;
    /* Offset padding */
}

/* Modifier: Not Sticky */
.vita-category-title.no-sticky {
    position: static;
    margin-top: 0;
    padding-top: 0;
}

/* Vita Split Layout */
.vita-split-row {
    margin-bottom: 4rem;
}

.vita-split-main {
    flex: 1;
    min-width: 0;
}

.vita-split-side {
    display: none;
    /* Hidden on mobile */
    min-width: 300px;
    width: 300px;
    /* Fixed width */
    max-width: 300px;
    flex-direction: column;
    flex-shrink: 0;
    /* Prevent shrinking */
    margin-left: 4rem;
    /* Gap between main and side */
}

.vita-split-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
    object-fit: cover;
    /* Ensure aspect ratio */
}

.vita-split-img:hover {
    filter: grayscale(0%);
}

@media (min-width: 768px) {

    /* Enable Flex Layout on Desktop/Tablet */
    .vita-split-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
    }

    .vita-split-side {
        display: flex;
    }
}

.vita-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    /* Tighter Year Column */
    gap: 0.5rem 3rem;
    align-items: baseline;
    font-family: var(--font-body);
}

.vita-year {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.5;
    text-align: right;
    /* Right align years for clean edge */
    font-feature-settings: "tnum";
    /* Monospaced numbers */
}

.vita-content {
    display: flex;
    flex-direction: column;
    margin-bottom: 2.5rem;
    /* More breathing room */
    position: relative;
}

.vita-grid>*:last-child .vita-content {
    margin-bottom: 0;
}

.vita-role {
    font-size: 1.15rem;
    /* Larger role */
    font-weight: 600;
    /* refined bold */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
    color: #ffffff;
    /* Pure white */
}

.vita-details {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
    line-height: 1.6;
    color: #cccccc;
}

/* Skills specifically */
.skills-simple-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
}

.skill-cat-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #fff;
    opacity: 1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Removed border-bottom */
    padding-bottom: 0.5rem;
}

.skill-list li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    /* User requested larger */
    opacity: 0.9;
    font-weight: 300;
}


/* Gallery Full Width Layout (Masonry) */
.gallery-container {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 1200px) {
    .gallery-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

.gallery-grid {
    /* CSS Columns for Masonry Staggered effect */
    column-count: 1;
    /* Default mobile */
    column-gap: 1.5rem;
    width: 100%;
}

@media (min-width: 600px) {
    .gallery-grid {
        column-count: 2;
        /* 2 Columns on desktop/tablet */
    }
}

.gallery-item {
    position: relative;
    break-inside: avoid;
    /* Prevent splitting across columns */
    margin-bottom: 1.5rem;
    /* Space between items vertically */
    display: inline-block;
    /* Essential for avoiding breaks in some browsers */
    width: 100%;
    background: transparent;
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    /* Remove whitespace */
    transition: filter 0.3s ease;
    border-radius: 0;
}

.gallery-item:hover .gallery-img {
    filter: brightness(1.1);
}

.gallery-credit {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
    opacity: 0.4;
    color: var(--text-color);
    text-align: right;
}

/* Contact/About tweak */
.about-grid {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES
----------------------------------------------------------------- */

@media (max-width: 900px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-xl: 4rem;
        /* Reduce section spacing */
    }

    .navbar {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 3rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* Fix for mobile hero image cutoff */
    .hero-bg {
        top: 25px;
        /* Navbar height offset - Adjusted to 25px per user request */
        height: calc(100% - 25px);
        object-position: top center;
    }
}

@media (max-width: 600px) {
    :root {
        --container-padding: 1.25rem;
    }

    /* Navbar Mobile */
    .navbar {
        flex-direction: column;
        gap: 1rem;
        background: rgba(13, 18, 22, 0.98);
        /* More opaque */
        padding: 1rem;
    }

    .nav-links {
        gap: 1.2rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-item {
        font-size: 0.8rem;
    }

    /* Vita Mobile */
    .vita-grid {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        margin-bottom: 1.5rem;
    }

    .vita-year {
        text-align: left;
        color: var(--accent-glow);
        font-weight: 700;
        font-size: 0.9rem;
        margin-bottom: 0px;
    }

    .vita-content {
        margin-bottom: 1.5rem;
        padding-left: 0;
    }

    .vita-role {
        font-size: 1.1rem;
    }

    .skills-simple-container {
        grid-template-columns: 1fr;
        /* Stack skills on mobile */
        gap: 2rem;
    }

    /* About Mobile */
    .about-grid {
        flex-direction: column-reverse;
        gap: 2rem;
    }

    .about-grid>div {
        width: 100%;
        min-width: 0;
    }
}

/* Vita Layout (Sidebar) */
.vita-layout {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.vita-main {
    flex: 1;
}

.vita-split-side {
    display: none;
    /* Hidden on mobile */
    min-width: 300px;
    width: 300px;
    /* Fixed width */
    max-width: 300px;
    flex-direction: column;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.vita-split-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
    object-fit: cover;
    /* Ensure aspect ratio */
}

.vita-split-img:hover {
    filter: grayscale(0%);
}

@media (min-width: 768px) {
    .vita-split-side {
        display: flex;
    }
}


@media (max-width: 600px) {
    .vita-category-title {
        top: 85px;
    }
}