/* ==================== VARIABLES & RESET ==================== */

:root {
    --primary-blue: #1a3a52;
    --accent-blue: #264560;
    --light-bg: hsl(212.57, 68.63%, 92%);
    --white: #ffffff;
    --dark-text: #1a1a1a;
    --border-light: #e8e8e8;
    --transition: 0.3s ease;
    --hero-blue: hsl(212.57, 68.63%, 88%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== NAVIGATION ==================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #000000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
}

.site-title {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-right: auto;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-center {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    transition: color var(--transition), background-color var(--transition);
    position: relative;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.nav-link:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.14);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

/* ==================== HERO SECTION ==================== */

.hero {
    background: linear-gradient(180deg, #4a7fbf 0%, var(--hero-blue) 100%);
    padding: 5.5rem 2rem 0;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: end;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 1rem;
    max-width: 44rem;
}

.hero-title {
    font-size: 3.3rem;
    color: var(--white);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 0;
    letter-spacing: -0.7px;
    text-wrap: balance;
}

.hero-title-link {
    display: block;
    width: fit-content;
    transition: opacity var(--transition), transform var(--transition);
}

.hero-title-link:hover {
    opacity: 0.9;
    transform: translateX(4px);
}

.hero-title-secondary {
    max-width: none;
    margin-top: 2rem;
    margin-bottom: 2.4rem;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    color: var(--white);
}

.hero-cta {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    background-color: var(--white);
    color: #000;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
    border: 1px solid var(--white);
    width: fit-content;
}

.hero-cta:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.hero-image {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    position: relative;
}

.hero-image::after {
    content: '';
    position: absolute;
    right: 8%;
    bottom: 0.4rem;
    width: clamp(220px, 60%, 460px);
    height: 2rem;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 72%);
    filter: blur(6px);
    pointer-events: none;
}

.portrait {
    max-width: 100%;
    max-height: min(78vh, 46rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    display: block;
    transform: scale(1.08);
    transform-origin: right bottom;
    position: relative;
    z-index: 1;
}

/* ==================== SERVICES SECTIONS ==================== */

.section-title {
    font-size: 1.4rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.services-section {
    padding: 2.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.finance-section {
    background-color: var(--light-bg);
}

.entwicklung-section {
    background-color: var(--light-bg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.services-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3rem) / 3);
    gap: 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 0.5rem;
}

.services-carousel::-webkit-scrollbar {
    height: 10px;
}

.services-carousel::-webkit-scrollbar-thumb {
    background-color: rgba(26, 58, 82, 0.28);
    border-radius: 999px;
}

.service-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 2px;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    scroll-snap-align: start;
    min-height: 100%;
}

.finance-section .service-card {
    background-color: var(--white);
}

.entwicklung-section .service-card {
    background-color: var(--white);
}

.service-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.service-card h3 {
    font-size: 1.15rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
}

.section-link-row {
    margin-top: 1.25rem;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary-blue);
    font-size: 0.95rem;
    font-weight: 600;
    transition: color var(--transition), transform var(--transition);
}

.section-link:hover {
    color: var(--accent-blue);
    transform: translateX(4px);
}

/* ==================== REFERENCES SECTION ==================== */

.references-section {
    background-color: var(--light-bg);
    padding: 2.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.references-page {
    min-height: calc(100vh - 140px);
    border-top: 0;
}

.references-page-header {
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.references-kicker {
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.references-intro {
    max-width: 720px;
    color: #4f6270;
    font-size: 1rem;
}

.references-section .section-title {
    margin-bottom: 3rem;
}

.references-container {
    max-width: 1000px;
    margin: 0 auto;
}

.reference-item {
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.reference-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    cursor: default;
    transition: background-color var(--transition);
}

.reference-header:hover {
    background-color: transparent;
}

.reference-preview {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
}

.reference-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
}

.reference-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reference-text h3 {
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.reference-text p {
    font-size: 0.9rem;
    color: #666;
}

.reference-summary {
    display: grid;
    gap: 0.25rem;
    line-height: 1.55;
}

.reference-summary h3 {
    margin-bottom: 0.15rem;
}

.reference-summary p {
    margin: 0;
    color: #4e5d68;
}

.reference-summary-italic {
    font-style: italic;
}

.reference-summary a {
    color: #000000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
}

.reference-summary a:hover {
    color: #000000;
    text-decoration-thickness: 2px;
}

.reference-arrow {
    --arrow-rotation: 0deg;
    --arrow-scale: 1;
    color: var(--primary-blue);
    margin-left: 1rem;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    border-radius: 999px;
    background-color: rgba(26, 58, 82, 0.1);
    transition: transform var(--transition), color var(--transition), background-color var(--transition);
    flex-shrink: 0;
    transform: rotate(var(--arrow-rotation)) scale(var(--arrow-scale));
    display: none;
}

.reference-arrow polyline {
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reference-item.expanded .reference-arrow {
    --arrow-rotation: 180deg;
}

.reference-item:not(.expanded) .reference-header:hover .reference-arrow {
    --arrow-scale: 1.16;
    color: var(--accent-blue);
    background-color: rgba(38, 69, 96, 0.18);
    animation: arrowBoost 240ms ease-out 1;
}

.reference-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.reference-item.expanded .reference-content {
    max-height: 800px;
    overflow-y: auto;
}

.reference-detail {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
    max-height: 600px;
    overflow-y: auto;
    color: var(--dark-text);
}

.reference-detail h4 {
    font-size: 1rem;
    color: var(--primary-blue);
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 600;
}

.reference-detail h4:first-child {
    margin-top: 0;
}

.reference-detail p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 1rem;
}

.reference-detail ul {
    list-style: none;
    padding-left: 0;
}

.reference-detail ul li {
    font-size: 0.95rem;
    color: #444;
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.reference-detail ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

.reference-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.gallery-image {
    width: 100%;
    height: auto;
    border-radius: 2px;
    cursor: pointer;
    transition: transform var(--transition);
    border: 1px solid var(--border-light);
}

.gallery-image:hover {
    transform: scale(1.02);
}

/* ==================== FOOTER ==================== */

.footer {
    background-color: #000000;
    color: var(--white);
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-email {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    transition: color var(--transition);
}

.footer-email:hover {
    color: var(--white);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--white);
}

/* ==================== LIGHTBOX ==================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 2px;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--white);
    cursor: pointer;
    transition: transform var(--transition);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .site-title {
        flex: 0 0 100%;
        font-size: 1.2rem;
        margin-right: 0;
    }

    .nav-center {
        gap: 1rem;
        flex: 0 0 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 0;
        align-items: start;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-title-secondary {
        max-width: none;
        margin-top: 1.3rem;
        margin-bottom: 2rem;
        padding-top: 1rem;
    }

    .hero-image {
        justify-content: center;
        min-height: auto;
    }

    .hero-image::after {
        display: none;
    }

    .portrait {
        width: min(100%, 420px);
        max-height: 400px;
        transform: none;
    }

    .services-section,
    .references-section {
        padding: 1.5rem 1rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .services-carousel {
        grid-auto-columns: calc((100% - 1.5rem) / 2);
    }

    .reference-preview {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .reference-image {
        width: 100%;
        height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f7f9fb;
    }

    .reference-image img {
        object-fit: contain;
    }

    .reference-detail {
        max-height: 400px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem 1rem;
    }

    .site-title {
        font-size: 1rem;
    }

    .nav-center {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-title-secondary {
        margin-top: 1rem;
        padding-top: 0.8rem;
    }

    .hero-cta {
        padding: 0.7rem 1.5rem;
        font-size: 0.8rem;
    }

    .portrait {
        max-height: 300px;
        width: min(100%, 320px);
    }

    .service-card {
        padding: 1.5rem;
    }

    .services-carousel {
        grid-auto-columns: 100%;
    }

    .reference-gallery {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes arrowBoost {
    0% {
        transform: rotate(var(--arrow-rotation)) scale(1);
    }
    65% {
        transform: rotate(var(--arrow-rotation)) scale(1.28);
    }
    100% {
        transform: rotate(var(--arrow-rotation)) scale(1.16);
    }
}
