@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;900&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    /* Brutalism Palette */
    --bg-main: #FFFFFF;
    --text-main: #000000;
    --border-color: #000000;
    --border-width: 3px;
    
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    /* Grid background pattern for extra technical feel */
    background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

section, footer {
    scroll-margin-top: 69px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.95;
    letter-spacing: -1px;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    border-left: var(--border-width) solid var(--border-color);
    border-right: var(--border-width) solid var(--border-color);
    background: var(--bg-main);
}

/* Navbar */
.navbar {
    border-bottom: var(--border-width) solid var(--border-color);
    border-top: var(--border-width) solid var(--border-color);
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* stretch to fill height for borders */
    position: relative;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    padding: 16px 24px;
    border-right: var(--border-width) solid var(--border-color);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
}

.nav-links li {
    display: flex;
}

.nav-links a {
    padding: 24px 32px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    border-left: var(--border-width) solid var(--border-color);
    transition: var(--transition);
}

.nav-links a:hover {
    background-color: var(--text-main);
    color: var(--bg-main);
}

.hamburger {
    display: none;
    padding: 20px;
    cursor: pointer;
    border-left: var(--border-width) solid var(--border-color);
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--text-main);
    display: block;
    margin-bottom: 6px;
}

/* Marquee / Ticker */
.marquee-container {
    border-bottom: var(--border-width) solid var(--border-color);
    overflow: hidden;
    white-space: nowrap;
    padding: 12px 0;
    background: var(--text-main);
    color: var(--bg-main);
    display: flex;
}

.marquee-content {
    display: flex;
    animation: marquee 25s linear infinite;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    border-bottom: var(--border-width) solid var(--border-color);
}

.hero-text {
    padding: 60px 40px;
    border-right: var(--border-width) solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 7vw, 6.5rem);
    margin-bottom: 20px;
    word-wrap: break-word;
}

.hero-text h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 40px;
}

.hero-image {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    background: #000;
}

/* TV Noise / Static Effect */
.hero-image::before {
    content: "";
    position: absolute;
    top: -5%; left: -5%; right: -5%; bottom: -5%;
    /* SVG Noise Data URI */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.35;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 2;
    animation: noiseJitter 0.2s infinite;
}

/* Scanlines Effect */
.hero-image::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 3;
    animation: scanScroll 10s linear infinite;
}

/* Thick TV Roll Bar */
.tv-roll {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.05) 10%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.05) 90%,
        transparent 100%
    );
    height: 100%;
    z-index: 4;
    pointer-events: none;
    animation: tvRoll 8s linear infinite;
    mix-blend-mode: overlay;
    transition: opacity var(--transition);
}

@keyframes tvRoll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Reduced contrast */
    filter: grayscale(100%) contrast(1.05);
    transition: filter var(--transition), transform 0.1s ease-out;
    position: relative;
    z-index: 1;
    transform: scale(1);
    will-change: transform;
}

.hero-image:hover img {
    filter: grayscale(0%) contrast(1.0);
}

/* Reduce interference on hover */
.hero-image:hover::before,
.hero-image:hover::after,
.hero-image:active::before,
.hero-image:active::after {
    opacity: 0;
}

.hero-image:hover .tv-roll,
.hero-image:active .tv-roll {
    opacity: 0.05;
}

@keyframes scanScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

@keyframes noiseJitter {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-2%, 0); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-1%, 2%); }
    60% { transform: translate(0, -1%); }
    70% { transform: translate(1%, 1%); }
    80% { transform: translate(-1%, -2%); }
    90% { transform: translate(1%, 0); }
    100% { transform: translate(0, 0); }
}

/* General Section Styling */
.section-header {
    padding: 40px;
    border-bottom: var(--border-width) solid var(--border-color);
}

.section-title {
    font-size: clamp(3rem, 5vw, 5rem);
}

/* Grid Layouts (Brutalism cols) */
.brutal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.brutal-col {
    padding: 40px;
    border-bottom: var(--border-width) solid var(--border-color);
    border-right: var(--border-width) solid var(--border-color);
}

.brutal-col:nth-child(even) {
    border-right: none;
}

.brutal-col:last-child, .brutal-col:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.brutal-col h3 {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

.brutal-col p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.media-image {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.media-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: var(--transition);
}

.media-image:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Video Hover Effect */
.media-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 5;
    pointer-events: none;
    border: 2px solid #fff;
    transition: var(--transition);
}



.hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.video-hover-container:hover .hover-video,
.video-hover-container.playing .hover-video {
    opacity: 1;
}

.video-hover-container:hover img,
.video-hover-container.playing img {
    opacity: 0;
}

/* Live Video Section */
.video-col {
    padding: 0; /* Убираем отступы, чтобы видео было на всю ширину колонки */
    display: flex;
    background: #000;
}

.brutal-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

/* Возвращаем цвет при наведении и когда запущено */
.brutal-video:hover,
.brutal-video:focus,
.brutal-video:active,
.brutal-video.playing {
    filter: grayscale(0%);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.2rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Buttons */
.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 20px 40px;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
    color: var(--bg-main);
    background: var(--text-main);
    border: var(--border-width) solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.btn-outline {
    background: var(--bg-main);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--text-main);
    color: var(--bg-main);
}

/* Header Action Button (Portfolio Download) */
.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.section-header-with-action .section-title {
    font-size: clamp(2.6rem, 4.2vw, 4.5rem);
    white-space: nowrap;
}

.btn-header-action {
    flex-shrink: 0;
    padding: 14px 26px;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Clients / Logos Carousel */
.logo-carousel {
    overflow: hidden;
    white-space: nowrap;
    border-bottom: var(--border-width) solid var(--border-color);
    background: var(--bg-main);
}

.logo-track {
    display: inline-flex;
    animation: logoScroll 60s linear infinite;
}

@keyframes logoScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.logo-track:hover {
    animation-play-state: paused;
}

.client-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 80px;
    border-right: var(--border-width) solid var(--border-color);
    flex-shrink: 0;
}

.client-logo img {
    max-height: 80px;
    filter: grayscale(100%) contrast(1.5);
    transition: var(--transition);
}

.client-logo:hover img {
    filter: none;
}

/* Fix for yellow logos like Premier */
.client-logo img.logo-premier {
    filter: brightness(0);
}

.client-logo:hover img.logo-premier {
    filter: none;
}

/* Scale up specific small logos */
.client-logo img.logo-large {
    transform: scale(1.5);
}



/* Image Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: var(--border-width) solid var(--border-color);
}

.gallery-item {
    border-right: var(--border-width) solid var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
    height: 300px;
    overflow: hidden;
}

.gallery-item:nth-child(4n) {
    border-right: none;
}
.gallery-item:nth-last-child(-n+4) {
    border-bottom: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(100%);
    transition: var(--transition);
}

.gallery-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Footer */
.footer {
    padding: 80px 40px;
    text-align: center;
    border-bottom: var(--border-width) solid var(--border-color);
}

.footer h2 {
    font-size: clamp(2rem, 6vw, 6rem);
    margin-bottom: 40px;
    word-wrap: break-word;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.contact-links a:hover {
    text-decoration: underline;
}

.copyright {
    font-weight: 700;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 1024px) {
    .brutal-grid {
        grid-template-columns: 1fr;
    }
    .brutal-col {
        border-right: none !important;
        border-bottom: var(--border-width) solid var(--border-color) !important;
    }
    .brutal-col:last-child {
        border-bottom: none !important;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item:nth-child(2n) {
        border-right: none;
    }
    .gallery-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    /* Navbar: убираем пустую ячейку между логотипом и гамбургером */
    .logo {
        border-right: none;
        flex: 1;
        font-size: 1.5rem;
        padding: 16px 20px;
    }
    .nav-links {
        display: none;
    }
    .nav-links.active {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: -3px;
        width: calc(100% + 6px);
        background: var(--bg-main);
        border: var(--border-width) solid var(--border-color);
        border-top: none;
        z-index: 1000;
    }
    .nav-links.active a {
        border-left: none;
        border-bottom: var(--border-width) solid var(--border-color);
        width: 100%;
        text-align: center;
    }
    .nav-links.active li:last-child a {
        border-bottom: none;
    }
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 16px 20px;
    }

    /* Hero Section & Buttons: ровные одинаковые кнопки на всю ширину */
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-text {
        padding: 40px 20px;
        border-right: none;
        border-bottom: var(--border-width) solid var(--border-color);
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 14px;
    }
    .hero-buttons .btn {
        width: 100%;
        padding: 18px 20px;
        font-size: 1.05rem;
        white-space: nowrap;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    /* Headers & Направления: крупный доминирующий заголовок и аккуратная кнопка */
    .section-header {
        padding: 30px 20px;
    }
    .section-title {
        font-size: clamp(2.6rem, 8vw, 3.8rem);
    }
    .section-header-with-action {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 30px 20px;
    }
    .section-header-with-action .section-title {
        font-size: clamp(2.6rem, 8vw, 3.8rem);
        white-space: normal;
        line-height: 1;
    }
    .btn-header-action {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 0.95rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .brutal-col {
        padding: 30px 20px;
    }

    /* Logos Carousel: всегда сохраняем разделительные линии между всеми логотипами */
    .client-logo {
        padding: 24px 45px;
        border-right: var(--border-width) solid var(--border-color) !important;
        border-bottom: none !important;
    }
    .client-logo img {
        max-height: 50px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item {
        border-right: none !important;
        border-bottom: var(--border-width) solid var(--border-color) !important;
        height: 450px;
    }
    .gallery-item:last-child {
        border-bottom: none !important;
    }

    /* Contact Links */
    .contact-links {
        flex-direction: column;
        gap: 20px;
    }
}
