/* Critical CSS - above-the-fold: reset, variables, navbar, hero */

/* ========== reset.css ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    text-rendering: optimizeSpeed;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* ========== variables.css ========== */
:root {
    --brand-color: #ef7f1b;
    --bg-dark: #000000;
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --font-main: 'Roboto', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-xxl: 64px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1092px;
    --navbar-height: 90px;
    --z-skip: 9999;
    --z-navbar: 100;
    --z-modal: 10001;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 600ms ease;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --brand-color: #e62d4d;
        --text-gray: #e0e0e0;
    }

    :focus-visible {
        outline-width: 4px;
    }
}

/* ========== main.css: body, container, skip-link, navbar, hero ========== */
* {
    user-select: text;
}

button {
    user-select: none;
}

body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bg-dark);
    color: var(--text-light);
    padding: var(--space-sm) var(--space-md);
    z-index: var(--z-skip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    background: var(--brand-color);
    color: var(--text-light);
    padding: var(--space-xs) var(--space-sm);
    border: none;
    border-radius: 4px;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

button:hover {
    background: #cc6a15;
}

button:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    z-index: var(--z-navbar);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 2px;
    background: var(--brand-color);
}

.navbar__container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.5rem, 1.5vw, 1rem) clamp(1rem, 3vw, 2rem);
    min-height: 70px;
}

.navbar__logo img {
    height: auto;
    width: auto;
    max-height: clamp(50px, 8vw, 70px);
    max-width: clamp(150px, 20vw, 220px);
    display: block;
    object-fit: contain;
}

.navbar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: var(--space-xs);
    min-width: 44px;
    min-height: 44px;
}

.navbar__menu {
    display: flex;
    gap: clamp(0.5rem, 2vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar__link {
    color: var(--text-light);
    background: transparent;
    text-decoration: none;
    padding: var(--space-xs) clamp(0.5rem, 1.5vw, 1rem);
    border-radius: 4px;
    transition: color 0.35s ease, background 0.35s ease;
    display: block;
    font-size: clamp(14px, 1.5vw, 16px);
    white-space: nowrap;
}

.navbar__link:hover,
.navbar__link:focus {
    color: var(--bg-dark);
    background: var(--text-light);
    text-decoration: none;
}

.navbar__link--active {
    background: var(--brand-color);
    color: #000000;
}

.navbar__link--active:focus {
    background: var(--brand-color);
    color: #000000;
}

.navbar__link--active:hover {
    color: var(--bg-dark);
    background: var(--text-light);
}

@media (max-width: 991px) {
    .navbar__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar__menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-md);
        transform: translateX(100%);
        opacity: 0;
        transition: transform var(--transition-normal),
                    opacity var(--transition-normal);
        overflow-y: auto;
        border-top: 2px solid var(--brand-color);
        z-index: calc(var(--z-navbar) - 1);
    }

    .navbar__menu--open {
        transform: translateX(0);
        opacity: 1;
    }

    .navbar__link {
        font-size: 18px;
        padding: var(--space-md);
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

main {
    padding-top: calc(var(--navbar-height) + var(--space-xxl));
}

main:has(.eu-project-page),
main:has(.gallery-page-section),
main:has(.references-page-section) {
    padding-top: 0;
}

.hero-wrapper {
    background: #000;
}

.hero-container {
    position: relative;
    width: calc(100% - 2rem);
    max-width: 1400px;
    height: clamp(300px, 40vw, 600px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

@media (max-width: 576px) {
    .hero-container {
        height: clamp(250px, 50vw, 400px);
        margin: 0 auto;
        width: calc(100% - 1rem);
    }
}

@media (min-width: 1400px) {
    .hero-container {
        height: 600px;
    }
}

.hero__fallback-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero__fallback-picture img.hero__fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.5s ease;
}

.hero-container.video-ready .hero__fallback-picture {
    opacity: 0;
    pointer-events: none;
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.hero__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
    text-align: center;
}

.hero__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
}

.hero__slide--1 { animation: hero-slide-1 30s ease-in-out infinite; }
.hero__slide--2 { animation: hero-slide-2 30s ease-in-out infinite; }
.hero__slide--3 { animation: hero-slide-3 30s ease-in-out infinite; }

@keyframes hero-slide-1 {
    0% { opacity: 0; }
    4% { opacity: 1; }
    16% { opacity: 1; }
    20% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes hero-slide-2 {
    0% { opacity: 0; pointer-events: none; }
    33.33% { opacity: 0; pointer-events: none; }
    37.33% { opacity: 1; pointer-events: auto; }
    49.33% { opacity: 1; pointer-events: auto; }
    53.33% { opacity: 0; pointer-events: none; }
    100% { opacity: 0; pointer-events: none; }
}

@keyframes hero-slide-3 {
    0% { opacity: 0; }
    66.67% { opacity: 0; }
    70.67% { opacity: 1; }
    82.67% { opacity: 1; }
    86.67% { opacity: 0; }
    100% { opacity: 0; }
}

.hero__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    min-height: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero__phone {
    margin: 0;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero__slide--3 {
    font-size: clamp(32px, 5vw, 56px);
}

.hero__logo {
    max-height: 15em;
    height: auto;
    width: auto;
    max-width: min(960px, 90vw);
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

@media (prefers-reduced-motion: reduce) {
    .hero__slide--1 { opacity: 1; animation: none; }
    .hero__slide--2,
    .hero__slide--3 { opacity: 0; animation: none; }

    .hero__video {
        display: none;
    }

    .hero-container {
        background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    }
}
