/* Base */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 30px;
}

:root {
    --section-competence-bg: #edf4f8;
    --section-portfolio-bg: #f6f1eb;
    --section-contact-bg: #eef5f1;
    --text-strong: #13212b;
    --text-body: #3d4c57;
    --text-soft: #687784;
    --accent-soft: #285f7a;
    --surface-card: rgba(255, 255, 255, 0.9);
    --navbar-bg: #212529;
    --navbar-offset: 70px;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Shared section typography */
.content-section {
    color: var(--text-body);
}

.section-heading {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.section-kicker {
    margin-bottom: 0.7rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
}

.section-title {
    margin-bottom: 0.85rem;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.section-intro {
    margin: 0 auto;
    max-width: 660px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-soft);
}

.content-section h3,
.content-section h4,
.content-section h5 {
    color: var(--text-strong);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.content-section p,
.content-section li,
.content-section .card-text,
.content-section label {
    color: var(--text-body);
}

.content-section .text-muted {
    color: var(--text-soft) !important;
}

/* Navbar */
.navbar-brand {
    font-size: 18px;
}

.brand-logos {
    flex-shrink: 0;
}

.brand-logo {
    height: 50px;
    filter: brightness(0) invert(1);
}

/* Hero */
.hero {
    height: 100vh;
    position: relative;
    background-image: url("images/hero.avif");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(0, 0, 0, 0.75),
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.75)
    );
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(2px);
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    display: inline-block;
    max-width: min(100%, 960px);
    padding: 40px 50px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-lead {
    max-width: 900px;
}

.hero-logo {
    height: 70px;
    opacity: 0.9;
    filter: brightness(0) invert(1);
}

/* Section backgrounds */
.competence-section {
    background: var(--section-competence-bg);
}

.portfolio-section {
    background: var(--section-portfolio-bg);
}

.contact-section {
    background: var(--section-contact-bg);
}

/* Competence */
.competence-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
}

.competence-tabs .tab {
    display: inline-block;
    margin: 0;
    padding-bottom: 6px;
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-soft);
    opacity: 0.7;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.competence-tabs .tab.active {
    color: var(--text-strong);
    opacity: 1;
}

.competence-tabs .tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: #0d6efd;
}

.competence-content {
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.competence-content p {
    line-height: 1.8;
}

.competence-content ul {
    padding-left: 1.1rem;
    color: var(--text-body);
}

.competence-content li {
    margin-bottom: 0.55rem;
    line-height: 1.65;
}

.comp-tab {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(80px);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.comp-tab.active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.comp-img {
    width: auto;
    max-height: 350px;
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(19, 33, 43, 0.12);
}

.nav-side {
    position: absolute;
    top: 0;
    z-index: 10;
    width: 90px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 50px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.25);
    transition: 0.3s;
}

.nav-side:hover {
    color: #0d6efd;
    background: rgba(0, 0, 0, 0.1);
}

.nav-side.left {
    left: calc(-50vw + 50%);
    background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
}

.nav-side.right {
    right: calc(-50vw + 50%);
    background: linear-gradient(to left, rgba(0, 0, 0, 0.08), transparent);
}

/* Portfolio */
.portfolio-section .card {
    overflow: hidden;
    border: 1px solid rgba(19, 33, 43, 0.08);
    border-radius: 16px;
    background: var(--surface-card);
    box-shadow: 0 12px 32px rgba(19, 33, 43, 0.08) !important;
}

.portfolio-section .card-img-top {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.portfolio-section .card-body {
    padding: 1.35rem;
}

.portfolio-section .card-title {
    margin-bottom: 0.55rem;
    color: var(--text-strong);
    font-weight: 750;
}

.portfolio-section .card-text {
    line-height: 1.7;
    color: var(--text-soft);
}

/* Contact */
.contact-card {
    position: relative;
    display: flow-root;
    padding: 22px;
    border: 1px solid rgba(19, 33, 43, 0.08);
    border-radius: 16px;
    background: var(--surface-card);
    box-shadow: 0 12px 32px rgba(19, 33, 43, 0.08);
    overflow-wrap: anywhere;
    transition: 0.25s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(19, 33, 43, 0.12);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-map {
    border: 0;
    border-radius: 12px;
}

.contact-logo {
    float: right;
    width: clamp(108px, 33%, 165px);
    max-width: 165px;
    height: auto;
    margin: 0 0 14px 18px;
    object-fit: contain;
    opacity: 0.9;
}

.contact-logo-large {
    width: clamp(216px, 66%, 330px);
    max-width: 330px;
}

.contact-card .btn {
    clear: both;
}

/* Tablet and mobile */
@media (max-width: 992px) {
    .navbar-collapse {
        position: absolute;
        top: var(--navbar-offset);
        right: 10px;
        left: auto;
        width: 220px;
        padding: 15px;
        border-radius: 12px;
        background: var(--navbar-bg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .navbar-brand {
        flex-shrink: 1;
        min-width: 0;
    }

    .navbar-toggler {
        position: absolute;
        top: 50%;
        right: 10px;
        z-index: 1051;
        padding: 6px 8px;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-50%);
    }

    .navbar > .container {
        padding-left: 12px;
        padding-right: 65px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-logo {
        width: clamp(82px, 24vw, 120px);
        max-width: 120px;
        margin: 0 0 10px 12px;
    }

    .contact-logo-large {
        float: none;
        display: block;
        width: clamp(120px, 34vw, 170px);
        max-width: 170px;
        margin: 0 0 12px 0;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: clamp(1.85rem, 8vw, 2.35rem);
    }

    .section-intro {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .brand-logo {
        height: 35px;
    }

    .navbar-brand {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 5px;
    }

    .navbar-brand span {
        font-size: 12px;
        line-height: 1.2;
    }

    .hero {
        min-height: 100svh;
        height: auto;
        padding: 110px 0 40px;
    }

    .hero .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-content {
        display: block;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        margin: 0 auto;
        padding: 24px 18px;
        border-radius: 16px;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .hero-content .lead {
        max-width: none !important;
        font-size: 1rem;
    }

    .hero-logos {
        display: none !important;
    }

    .competence-tabs {
        gap: 8px 14px;
        margin-bottom: 2rem !important;
    }

    .competence-tabs .tab {
        font-size: 0.95rem;
    }

    .competence-content {
        touch-action: pan-y;
    }

    .nav-side {
        display: none;
    }
}

@media (max-width: 380px) {
    .contact-logo {
        display: none;
    }
}
