:root {
    --bg: #2a0f14;
    --bg-secondary: #3a141d;
    --surface: rgba(70, 25, 33, 0.84);
    --surface-strong: rgba(86, 28, 40, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(246, 201, 109, 0.16);
    --line-strong: rgba(246, 201, 109, 0.3);
    --text-main: #fffdfb;
    --text-soft: #f1ddd3;
    --text-faint: #dab8aa;
    --accent: #d72638;
    --accent-strong: #ef4444;
    --accent-warm: #f6c96d;
    --accent-warm-strong: #ffb648;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.36);
    --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.24);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 99, 120, 0.28), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 219, 136, 0.22), transparent 30%),
        linear-gradient(180deg, #44131c 0%, #531820 40%, #6a221c 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: visible;
}

body.nav-open {
    overflow: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -1;
    filter: blur(90px);
    opacity: 0.65;
}

body::before {
    width: 280px;
    height: 280px;
    top: 10%;
    left: -60px;
    background: rgba(255, 83, 112, 0.24);
}

body::after {
    width: 260px;
    height: 260px;
    right: -40px;
    bottom: 12%;
    background: rgba(255, 214, 123, 0.2);
}

p {
    text-align: left;
    text-justify: auto;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1320px, 94%);
    margin: 0 auto;
}

.header .container {
    width: min(1560px, 97%);
}

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 14px 0;
    backdrop-filter: none;
    background: transparent;
    border-bottom: 0;
}

.header-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(88, 22, 34, 0.95), rgba(60, 17, 26, 0.92)),
        rgba(60, 17, 26, 0.92);
    box-shadow: var(--shadow-md);
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
    flex: 0 0 auto;
}

.logo-mark {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.logo-mark img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.42));
}

.company-name {
    min-width: 0;
}

.company-kicker {
    margin-bottom: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
}

.company-name h2 {
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    line-height: 1.15;
    color: #f8fbff;
    font-weight: 700;
    white-space: nowrap;
}

.company-name span {
    display: inline-block;
    margin-top: 6px;
    color: #ffe8bd;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.navbar {
    margin-left: auto;
}

.navbar ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.24s ease, border-color 0.24s ease, color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.navbar a i {
    font-size: 0.92em;
    line-height: 1;
}

.navbar a:hover {
    transform: translateY(-2px);
    color: var(--text-main);
    border-color: var(--line-strong);
    background: rgba(215, 38, 56, 0.14);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.navbar a:focus-visible,
.menu-toggle:focus-visible,
.portal-toggle:focus-visible {
    outline: 3px solid rgba(255, 214, 123, 0.85);
    outline-offset: 3px;
}

.navbar .btn-contact {
    color: #2b0a0d;
    background: linear-gradient(135deg, var(--accent-warm), #ffe1a3);
    border-color: transparent;
    font-weight: 700;
}

.navbar .btn-contact:hover {
    color: #2b0a0d;
    background: linear-gradient(135deg, #ffd98f, #fff0c8);
}

.navbar .btn-login {
    color: #fff8f3;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    font-weight: 700;
}

.portal-item {
    display: none;
}

.portal-group {
    display: block;
    position: relative;
}

.portal-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    padding: 9px 12px;
    border-radius: 999px;
}

.portal-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-caret {
    font-size: 0.8rem;
    opacity: 0.92;
    transition: transform 0.22s ease;
}

.portal-toggle[aria-expanded="true"] .portal-caret {
    transform: rotate(180deg);
}

.portal-submenu {
    list-style: none;
    margin-top: 8px;
    display: none;
    gap: 8px;
    padding-left: 0;
}

.portal-submenu.active {
    display: grid;
}

.portal-group .portal-submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    width: max-content;
    max-width: min(92vw, 320px);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(96, 28, 41, 0.98), rgba(68, 20, 31, 0.98));
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.32);
    z-index: 1200;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
}

.portal-group .portal-submenu a {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.92rem;
    white-space: normal;
}

.portal-group .portal-submenu.active {
    display: grid;
}

.navbar .btn-login:hover {
    color: #fff8f3;
    background: linear-gradient(135deg, #ef4c57, #ff6673);
}

.menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(215, 38, 56, 0.12);
}

.section {
    padding: clamp(28px, 4.2vw, 46px) 0;
}

.light-bg {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(246, 201, 109, 0.05));
}

.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(95, 28, 42, 0.92), rgba(70, 22, 31, 0.92));
    box-shadow: var(--shadow-lg);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(246, 201, 109, 0.28);
}

.section-card {
    padding: 30px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ff5a67;
    text-shadow: 0 0 14px rgba(255, 90, 103, 0.28);
}

.section-label::before {
    content: "";
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.section-title,
.licence-hero h1,
.client-hero h1 {
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-weight: 700;
}

.section-title {
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    margin-bottom: 16px;
}

.licence-hero h1,
.client-hero h1 {
    font-size: clamp(2.7rem, 6vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-word-animated {
    display: inline-block;
    color: transparent;
    padding: 0 0.04em 0.08em;
    background: linear-gradient(100deg, #fffdfb 0%, #fffdfb 30%, #f6c96d 44%, #ffffff 50%, #d72638 58%, #fffdfb 72%, #fffdfb 100%);
    background-size: 280% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    filter:
        drop-shadow(0 2px 0 rgba(246, 201, 109, 0.22))
        drop-shadow(0 14px 26px rgba(0, 0, 0, 0.24));
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: background-position, opacity;
    animation: heroWordShimmer 7.5s ease-in-out infinite alternate;
}

@keyframes heroWordShimmer {
    0% {
        background-position: 100% 50%;
        opacity: 0.94;
    }
    100% {
        background-position: 0% 50%;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-word-animated {
        animation: none;
    }
}

.section-title::after {
    content: "";
    display: block;
    width: 86px;
    height: 3px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.text-justify {
    color: var(--text-soft);
    text-align: justify;
    line-height: 1.85;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.licence-hero,
.client-hero {
    padding: 96px 0 62px;
    text-align: center;
    background: transparent;
}

.licence-hero .container,
.client-hero .container {
    text-align: center;
}

.licence-hero p,
.client-hero p {
    width: min(720px, 100%);
    margin: 12px auto 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.75;
}

.hero + .section,
.project-hero + .section,
.licence-hero + .section,
.client-hero + .client-section {
    position: relative;
    padding-top: clamp(30px, 4.8vw, 52px);
}

.hero + .section::before,
.project-hero + .section::before,
.licence-hero + .section::before,
.client-hero + .client-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(246, 201, 109, 0.26), transparent);
    pointer-events: none;
}

.reveal-target {
    opacity: 0;
    transform: translateY(28px);
}

.reveal-target.in-view {
    animation: fadeUp 0.7s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(246, 201, 109, 0.24);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .reveal-target {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1080px) {
    .header-shell {
        padding: 14px;
    }

    .navbar a {
        padding: 10px 13px;
        font-size: 0.92rem;
    }

    .company-name h2 {
        font-size: 1.12rem;
        white-space: normal;
    }
}

@media (max-width: 1920px) and (min-width: 861px) {
    .navbar ul {
        gap: 8px;
    }

    .navbar a {
        padding: 9px 12px;
        font-size: 0.9rem;
    }

}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .header {
        position: sticky;
    }

    .header-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        position: relative;
        gap: 14px;
        transition: border-radius 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }

    .header-shell.menu-open {
        border-color: rgba(246, 201, 109, 0.32);
        box-shadow: 0 24px 46px rgba(0, 0, 0, 0.32);
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .navbar {
        grid-column: 1 / -1;
        width: 100%;
        margin-left: 0;
        max-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-12px);
        transition: max-height 0.34s ease, opacity 0.28s ease, transform 0.28s ease;
    }

    .navbar.active {
        max-height: var(--mobile-nav-max-height, calc(100dvh - 128px));
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .navbar ul {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px;
        border-radius: 22px;
        border: 1px solid var(--line);
        background:
            linear-gradient(180deg, rgba(96, 28, 41, 0.98), rgba(68, 20, 31, 0.98));
        box-shadow: 0 24px 44px rgba(0, 0, 0, 0.3);
    }

    .navbar a,
    .portal-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 13px 16px;
        border-radius: 16px;
    }

    .portal-item {
        display: none;
    }

    .portal-group {
        display: block;
        padding-top: 6px;
        margin-top: 4px;
        border-top: 1px solid rgba(246, 201, 109, 0.16);
    }

    .portal-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding: 13px 16px;
        border: 1px solid transparent;
        text-decoration: none;
        font-weight: 700;
        font-size: inherit;
        line-height: 1.2;
        cursor: pointer;
    }

    .portal-toggle-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .portal-caret {
        font-size: 0.82rem;
        opacity: 0.92;
        transition: transform 0.22s ease;
    }

    .portal-toggle[aria-expanded="true"] .portal-caret {
        transform: rotate(180deg);
    }

    .portal-group .portal-submenu {
        position: static;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        display: none;
        gap: 8px;
    }

    .portal-group .portal-submenu.active {
        display: grid;
    }

    .portal-submenu li {
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .portal-submenu.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .portal-submenu.active li:nth-child(1) { transition-delay: 0.02s; }
    .portal-submenu.active li:nth-child(2) { transition-delay: 0.05s; }
    .portal-submenu.active li:nth-child(3) { transition-delay: 0.08s; }

    .portal-submenu a {
        min-height: 42px;
        padding: 11px 14px;
        font-size: 0.9rem;
    }

    .navbar li {
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .navbar.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .navbar.active li:nth-child(1) { transition-delay: 0.03s; }
    .navbar.active li:nth-child(2) { transition-delay: 0.06s; }
    .navbar.active li:nth-child(3) { transition-delay: 0.09s; }
    .navbar.active li:nth-child(4) { transition-delay: 0.12s; }
    .navbar.active li:nth-child(5) { transition-delay: 0.15s; }
    .navbar.active li:nth-child(6) { transition-delay: 0.18s; }
    .navbar.active li:nth-child(7) { transition-delay: 0.21s; }
    .navbar.active li:nth-child(8) { transition-delay: 0.24s; }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar li,
    .header-shell {
        transition: none !important;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 10px 0;
    }

    .header-shell {
        border-radius: 20px;
    }

    .logo-mark {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    .logo-mark img {
        width: 62px;
        height: 62px;
    }

    .company-kicker {
        font-size: 0.72rem;
    }

    .company-name h2 {
        font-size: 0.98rem;
    }

    .company-name span {
        font-size: 0.74rem;
    }

    .section {
        padding: 24px 0;
    }

    .section-card {
        padding: 22px;
    }

    .licence-hero,
    .client-hero {
        padding: 78px 0 50px;
    }

    .licence-hero h1,
    .client-hero h1 {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
    }
}

@media (max-width: 389px) {
    .header .container {
        width: min(1560px, 98.5%);
    }

    .header-shell {
        gap: 10px;
        padding: 10px 11px;
        border-radius: 16px;
    }

    .logo-area {
        gap: 10px;
    }

    .logo-mark {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .logo-mark img {
        width: 54px;
        height: 54px;
    }

    .company-name h2 {
        font-size: 0.9rem;
        line-height: 1.1;
    }

    .company-name span {
        margin-top: 4px;
        font-size: 0.66rem;
        letter-spacing: 0.05em;
    }

    .navbar ul {
        padding: 10px;
        gap: 6px;
    }

    .navbar a,
    .portal-toggle {
        min-height: 40px;
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 0.88rem;
    }

    .portal-submenu {
        gap: 6px;
        margin-top: 6px;
    }

    .portal-submenu a {
        min-height: 39px;
        padding: 9px 12px;
        font-size: 0.85rem;
    }
}
