:root {
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-muted: rgba(255, 255, 255, 0.65);
    --color-line: rgba(255, 255, 255, 0.12);
}

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

html, body {
    height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
}

body {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

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

section {
    background: var(--color-bg);
    scroll-margin-top: 120px;
}

/* HEADER */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    padding: 28px 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
}

.logo video {
    height: 60px;
    margin-left: -30px;
}

.main-nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

.main-nav a {
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

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

/* HERO */
.hero {
    min-height: 100vh;
    padding: 240px 64px 0;
    position: relative;
}

.hero-content {
    max-width: 820px;
}

.hero-eyebrow {
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 16px;
}

/* LETTER ANIMATION */
.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    animation: letterUp 0.9s ease forwards;
}

.hero-title span:nth-child(n) {
    animation-delay: calc(0.04s * var(--i));
}

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

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 1.15;
    margin-bottom: 28px;
}

.hero-description {
    font-size: 18px;
    max-width: 640px;
    color: var(--color-muted);
}

/* HERO SLIDER — ВАЖНО: СКОРОСТЬ */
.hero-slider {
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
}

.slider-track {
    display: flex;
    gap: 24px;
    width: max-content;          /* КРИТИЧНО */
    animation: slideLoop 50s linear infinite;
    will-change: transform;
}

.slider-track img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    opacity: 0.85;
    flex-shrink: 0;
}

@keyframes slideLoop {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* PORTFOLIO */
.portfolio-wrapper {
    padding: 80px 64px;
    background: #000;
}

.portfolio-grid {
    column-width: 300px;
    column-gap: 24px;
}

.portfolio-item {
    break-inside: avoid;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.portfolio-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PORTFOLIO TAGS */
.portfolio-tags {
    display: flex;
    gap: 40px;
    margin: 32px 0 56px;
}

@media (max-width: 768px) {
    .portfolio-tags {
        flex-wrap: wrap;
        gap: 14px 20px;
        max-width: 100%;
    }

    .tag {
        white-space: nowrap;   /* чтобы текст внутри не ломался */
    }
}

.tag {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
    cursor: pointer;
    position: relative;
}

.tag:hover,
.tag.active {
    color: var(--color-text);
}

.tag::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 1px;
    background: var(--color-text);
    transition: width 0.3s ease;
}

.tag.active::after {
    width: 100%;
}

/* HEIGHTS */
.h-sm { height: 220px; }
.h-md { height: 320px; }
.h-lg { height: 420px; }
.h-xl { height: 540px; }

/* VIDEO MODAL */
.video-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.9);
    z-index: 300;
}

.video-modal.active {
    display: flex;
}

.video-container {
    position: relative;
}

.video-container video {
    max-width: 90vw;
    max-height: 85vh;
}

/* КРЕСТИК ВНУТРИ POPUP */
.video-close {
    position: absolute;
    top: 0;
    right: 5px;
    font-size: 32px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    text-shadow: 1px -1px 5px black;
    z-index: 2;
}

@media (max-width: 768px) {
    .video-close {
        top: -20px;
        right: -10px; /* чуть аккуратнее под палец */
    }
}

/* FOOTER */
.site-footer {
    padding: 48px 64px;
    border-top: 1px solid var(--color-line);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
    color: var(--color-muted);
}

/* ABOUT */
.about-wrapper {
    padding: 120px 64px;
}

.about-intro {
    max-width: 720px;
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-muted);
}

.about-grid {
    margin-top: 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 64px;
}

.about-item h3 {
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.about-item p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-muted);
    max-width: 420px;
}

/* ANIMATIONS */
.animate-slide-in {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.animate-slide-in.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-fade-up {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* FILTERING (JS REQUIRED) */
.portfolio-item.is-hiding {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}

.portfolio-item.is-removed {
    display: none;
}

/* MOBILE */
@media (max-width: 768px) {

    .site-header {
        flex-direction: row;          /* ВАЖНО */
        align-items: center;
        justify-content: space-between;
        padding: 16px 24px;
    }

    .logo video {
        height: 42px;                 /* уменьшенный логотип */
        margin-left: -16px;           /* сохраняем фирменный сдвиг */
    }

    .main-nav ul {
        flex-direction: row;
        gap: 14px;
        margin-top: 0;                /* убираем сдвиг вниз */
    }

    .main-nav a {
        font-size: 11px;              /* чуть компактнее */
        letter-spacing: 0.1em;
    }
}


/* FOOTER SOCIAL ICONS */
.footer-social {
    display: flex;
    gap: 14px;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    color: var(--color-muted);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.social-link:hover {
    color: var(--color-text);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}

.social-link svg {
    display: block;
}

/* WhatsApp icon fine-tuning */
.social-link.whatsapp svg {
    transform: translateX(-1.2px);
}

.social-link img {
    display: block;
    width: 42px;
    height: 42px;
}
/* CONTACT SECTION */
.contact-section {
    padding: 140px 64px;
    border-top: 1px solid var(--color-line);
    background: #000;
}

.contact-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

/* LEFT */
.contact-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(36px, 5vw, 56px); /* тот же уровень, что About */
    margin-bottom: 24px;
}

.contact-text {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-muted);
    max-width: 520px;
}

/* RIGHT */
.contact-social-block {
    display: flex;
    justify-content: center;
    gap: 36px;
}

/* EXTRA LARGE ICONS */
.social-link.xlarge {
    width: 88px;
    height: 88px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
            transform 0.3s ease,
            border-color 0.3s ease,
            background 0.3s ease;
}

.social-link.xlarge img {
    width: 54px;
    height: 54px;
}

.social-link.xlarge:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.04);
}

@media (max-width: 768px) {

    .contact-section {
        padding: 100px 32px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 56px;
        text-align: center;
    }

    .contact-text {
        margin: 0 auto;
    }

    .contact-social-block {
        gap: 24px;
    }

    .social-link.xlarge {
        width: 68px;
        height: 68px;
    }

    .social-link.xlarge img {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 768px) {
    .footer-social {
        display: none;
    }
}

.footer-copyright {
    font-size: 13px;
    color: var(--color-muted);
}

@media (max-width: 768px) {
    .footer-copyright {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .about-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {

    .site-header {
        padding: 16px;
    }

    .hero {
        padding: 180px 16px 0;
    }

    .portfolio-wrapper,
    .about-wrapper,
    .contact-section,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.video-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* =========================
   VIDEO MODAL (POPUP)
   TS AGENCY
========================= */

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;
}

.video-modal.is-open {
    display: flex;
}

/* Overlay */
.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

/* Video window (content-based, not full screen) */
.video-container {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;

    background: #000;
    border-radius: 12px;
    overflow: hidden;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Inner video wrapper */
.video-content {
    width: 100%;
    height: 100%;
}

.video-content iframe,
.video-content video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* Close button */
.video-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;

    border: none;
    border-radius: 50%;

    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    transition: background 0.2s ease;
}

.video-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* =========================
   MOBILE TUNING
========================= */

@media (max-width: 480px) {
    .video-container {
        max-width: 92vw;
        border-radius: 10px;
    }

    .video-close {
        top: 8px;
        right: 8px;
    }
}

.logo-image {
    width: 125px;
    margin-left: -15px;
}