/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0C6C83;
    --primary-teal: #01A289;
    --primary-lime: #86CA39;
    --primary-green: #4CB848;
    --white: #FFFFFF;
    --text-dark: #333333;
    --text-light: #666666;
    /* Logo sizing for navbar */
    --nav-logo-size: 110px; /* desktop default - adjust as needed */
    --nav-logo-overlap: 18px; /* how much the logo should hang over the navbar */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-teal));
    padding: 0.9rem 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* allow logo to overflow visually without increasing navbar size */
    overflow: visible;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* anchor for absolutely positioned logo */
    /* make room on the left so the absolute logo doesn't overlap the menu */
    padding-left: calc(var(--nav-logo-size) + 2rem);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.logo-link {
    display: block;
    text-decoration: none;
    position: absolute;
    left: 1rem;
    /* raise the logo so it overlaps the navbar more (negative moves it upward) */
    top: -10px;
    transform: none;
    z-index: 1002; /* above navbar contents */
}

.logo-image {
    width: var(--nav-logo-size);
    height: var(--nav-logo-size);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
    border: 4px solid var(--white);
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin-left: auto; /* push menu to the right */
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-lime);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    background-color: var(--primary-dark);
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: auto;
}

/* WebP Support für moderne Browser */
@supports (background-image: url('test.webp')) {
    .hero-section {
        background-image: url('../images/hero-bg.png'), url('../images/hero-bg.jpg');
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(12, 108, 131, 0.3) 0%, 
        rgba(1, 162, 137, 0.25) 50%, 
        rgba(134, 202, 57, 0.25) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.hero-title {
    font-size: 4.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6), 0 0 3px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6), 0 0 2px rgba(0, 0, 0, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-arrow {
    display: block;
    width: 50px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow:hover {
    background: var(--white);
    color: var(--primary-teal);
    transform: scale(1.1);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    color: var(--primary-dark);
    position: relative;
    padding-bottom: 1rem;
}

/* Werdegang - Person block (top-right) */
.werdegang-person {
    position: absolute;
    top: 140px; /* aligns with section padding; adjust if needed */
    right: 15rem;
    width: 140px;
    text-align: center;
    z-index: 5;
}

.werdegang-person-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: block;
    margin: 0 auto 0.75rem auto;
}

.werdegang-person-name {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1rem;
}

.werdegang-person-role {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Responsive: move into flow on small screens */
@media (max-width: 900px) {
    .werdegang-person {
        position: static;
        margin: 1rem auto 1.5rem auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        width: auto;
        justify-content: center;
        text-align: center;
    }

    .werdegang-person-img {
        width: 96px;
        height: 96px;
        border-width: 3px;
    }

    .werdegang-person-name {
        font-size: 1.05rem;
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal), var(--primary-lime));
    border-radius: 2px;
}

/* Werdegang Section */
.werdegang-section {
    padding: 6rem 0;
    position: relative;
    background: linear-gradient(180deg, var(--white) 0%, #f8f9fa 100%);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-teal), var(--primary-lime));
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 2rem;
    opacity: 1;
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-item.left .timeline-content::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 30px;
    width: 0;
    height: 0;
    border-left: 15px solid var(--white);
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}

.timeline-item.right .timeline-content::after {
    content: '';
    position: absolute;
    left: -15px;
    top: 30px;
    width: 0;
    height: 0;
    border-right: 15px solid var(--white);
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-lime));
    color: var(--white);
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.timeline-content h3 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.8;
}

@keyframes fadeInTimeline {
    to {
        opacity: 1;
    }
}

/* Services Section */
.services-section {
    padding: 6rem 0;
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.services-grid .service-card:nth-child(1) {
    grid-column: 2 / 4;
}

.services-grid .service-card:nth-child(2) {
    grid-column: 4 / 6;
}

.services-grid .service-card:nth-child(3) {
    grid-column: 6 / 8;
}

.services-grid .service-card:nth-child(n+4) {
    grid-column: span 2;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    border: 2px solid transparent;
}

.service-card:hover {
    border-color: var(--primary-teal);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-lime));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    color: var(--primary-dark);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background: var(--white);
    margin: 5% auto;
    padding: 1rem;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: sticky;
    top: 1rem;
    float: right;
    right: 0;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
    background: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    color: var(--primary-dark);
    background: #f0f0f0;
}

#modalTitle {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding: 0 2rem 1rem 2rem;
    border-bottom: 3px solid var(--primary-teal);
}

#modalBody {
    color: var(--text-light);
    line-height: 1.8;
    padding: 0 2rem 2rem 2rem;
}

#modalBody h4 {
    color: var(--primary-teal);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

#modalBody ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

#modalBody li {
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, #f8f9fa 0%, var(--white) 100%);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-lime));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-details h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.contact-details p {
    color: var(--text-light);
    line-height: 1.8;
}

.contact-details a {
    color: var(--primary-teal);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: var(--primary-dark);
}

.contact-notice {
    background: linear-gradient(135deg, rgba(12, 108, 131, 0.1), rgba(1, 162, 137, 0.1));
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-teal);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-notice i {
    color: var(--primary-teal);
    font-size: 1.5rem;
}

.contact-notice p {
    margin: 0;
    color: var(--text-dark);
}

.contact-map {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.contact-map iframe {
    border-radius: 15px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-teal));
    color: var(--white);
    padding: 3rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--white);
    color: var(--primary-teal);
    transform: translateY(-5px);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-lime);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copy {
    text-align: center;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .services-grid .service-card {
        grid-column: span 1 !important;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Responsive adjustments for the logo so it doesn't overlap awkwardly on smaller screens */
@media (max-width: 900px) {
    :root {
        --nav-logo-size: 90px;
        --nav-logo-overlap: 12px;
    }
    .nav-container {
        padding-left: calc(var(--nav-logo-size) + 1rem);
    }
}

@media (max-width: 768px) {
    /* On small screens revert logo into normal flow to keep navigation usable */
    :root {
        --nav-logo-size: 85px;
        --nav-logo-overlap: 0px;
    }
    .logo-link {
        position: absolute;
        transform: none;
        left: 1rem;
        top: -10px;
        padding-right: 0.5rem;
    }
    .nav-container {
        padding-left: calc(var(--nav-logo-size) + 2rem);
    }
}

@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.8rem 0;
        position: relative;
    }
    
    .nav-container {
        padding: 0 1rem 0 calc(var(--nav-logo-size) + 2rem);
        position: relative;
    }
    
    .logo-image {
        height: 85px;
        width: 85px;
    }
    
    .hamburger {
        display: flex;
        margin-left: auto;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: 0;
        background: linear-gradient(180deg, var(--primary-dark), var(--primary-teal));
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        padding: 0;
    }
    
    .nav-menu.active {
        max-height: 400px;
        padding: 1rem 0;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }
    
    .nav-link {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.05rem;
        background: transparent;
        border-radius: 0;
        transition: background 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        color: var(--white);
    }
    
    /* Hero Section */
    .hero-section {
        height: 70vh;
        min-height: 500px;
        background-position: 20% center;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .scroll-indicator {
        bottom: 2rem;
    }
    
    .scroll-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Sections */
    .werdegang-section,
    .services-section,
    .contact-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Timeline */
    .timeline {
        padding: 1rem 0;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left;
        padding: 1rem;
        padding-left: 60px;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .timeline-item .timeline-content::after {
        left: -15px !important;
        border-right: 15px solid var(--white) !important;
        border-left: none !important;
        top: 20px;
    }
    
    .timeline-date {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
    }
    
    .timeline-content p {
        font-size: 0.95rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .services-grid .service-card {
        grid-column: span 1 !important;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.2rem;
    }
    
    .service-card p {
        font-size: 0.95rem;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        margin: 10% auto;
        max-height: 80vh;
    }
    
    #modalTitle {
        font-size: 1.5rem;
    }
    
    #modalBody {
        font-size: 0.95rem;
    }
    
    .modal-close {
        right: 1rem;
        top: 1rem;
        font-size: 1.5rem;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .contact-details h3 {
        font-size: 1.1rem;
    }
    
    .contact-details p {
        font-size: 0.95rem;
    }
    
    .contact-notice {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .contact-notice i {
        font-size: 1.3rem;
    }
    
    .contact-map {
        height: 300px;
    }
    
    .contact-map iframe {
        height: 300px !important;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-social {
        gap: 1rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    
    .footer-copy {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    /* Sehr kleine Handys */
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    .service-card {
        padding: 1.5rem 1rem;
    }
    
    .modal-content {
        padding: 1.5rem 1rem;
    }
}

/* Optimierte Animationen für bessere Performance */
.service-card {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.contact-item {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-item.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Hardware-Acceleration für smooth scrolling */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hero-section,
.service-card,
.timeline-content,
.navbar {
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
