@charset "utf-8";
/* CSS Document */

:root {
    --gallery-blur: 25px;
    --gallery-brightness: 0.7;
    --gallery-opacity: 0.3;
    --gallery-speed: 0.15;
    --gallery-anim-speed: 0.05;
    --gallery-fade-speed: 2s;
    --gallery-zoom: 1.2;
    --video-radius: 50px;
    --video-border: 5px;
    --play-btn-size: 108px;
    --play-btn-opacity-min: 0.3;
    --play-btn-opacity-max: 0.9;
    --play-btn-blur: 4px;
    --play-flicker-speed: 1.9s;

    --btn-hover-highlight: 0.2;
    --btn-text-size: 18px;
    --btn-width: 100%;
    --gallery-img-radius: 3px;
    --gallery-glow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes playButtonFlicker {
    0%, 100% { opacity: var(--play-btn-opacity-max); transform: translate(-50%, -50%) scale(1); }
    50% { opacity: var(--play-btn-opacity-min); transform: translate(-50%, -50%) scale(0.95); }
}

@font-face {
  font-family: "font1";
  src: url("../fonts/font2.otf") format("opentype");
}

/* Font Application */
h1,
.contact-button {
    font-family: 'font1', sans-serif;
}

h1 {
    padding: 10px 10px 10px 26px;
    color: #F5782E;
    font-size: 65px;
    letter-spacing: 0px;
    background: transparent;
}

/* Заголовок-ссылка на главную страницу (для тематических страниц) */
.site-title-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease;
    overflow: hidden; /* Слова обрезаются при выезде, видны только внутри своего блока */
}

.site-title-link:hover {
    opacity: 0.8;
}

.site-title-link h1 {
    margin: 0;
}

/* --- Шапка: ряд с заголовком и иконками контактов --- */
.header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-right: 20px;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    color: #fff;
    border: 4px solid #F5782E; /* Оранжевая окантовка */
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-icon svg {
    width: 34px;
    height: 34px;
}

.contact-icon:hover {
    transform: scale(1.1);
}

/* Email — тёмно-красный фон, белая иконка */
.contact-icon-email {
    background-color: #B22222;
}

.contact-icon-email:hover {
    background-color: #D32F2F;
}

/* Telegram — синий фон, белая иконка */
.contact-icon-telegram {
    background-color: #229ED9;
}

.contact-icon-telegram:hover {
    background-color: #2AABEE;
}

/* Media query for screens smaller than 1000px */
@media (max-width: 999px) {
    #left-side, #right-side, #left-border, #right-border {
        display: none;
    }
    #wrapper {
        display: block;
    }
/* Reset styles */
     h1 {
        font-size: clamp(28px, 12vw, 50px);
        padding: 7px 0 !important;
        text-align: center !important;
        white-space: nowrap;
        width: 90% !important;
        max-width: 90vw;
        overflow: hidden;
        display: block;
        margin: 0 auto !important;
    }
    .contact-button {
        font-size: clamp(28px, 7vw, 40px);
        padding: 8px 16px;
    }
    .contact {
        min-height: 120px;
    }

    /* Иконки подстраиваются под высоту имени */
    .contact-icon {
        width: clamp(28px, 12vw, 50px);
        height: clamp(28px, 12vw, 50px);
    }
    .contact-icon svg {
        width: calc(clamp(28px, 12vw, 50px) * 0.5);
        height: calc(clamp(28px, 12vw, 50px) * 0.5);
    }

    /* Шапка в колонку, чтобы всё помещалось по ширине */
    .header-title-row {
        flex-direction: column;
        align-items: center;
        gap: 7px; /* 7px gap + 7px нижний padding имени = 14px, как и нижний отступ */
    }
    .header-contact {
        padding-right: 0;
        justify-content: center;
        padding-bottom: 14px; /* Нижний отступ = 14px */
    }

    /* На тематических страницах имя центрируется и не обрезается в узком режиме */
    .site-title-link {
        overflow: visible;
        display: block;
        width: 90%;
        max-width: 90vw;
        margin: 0 auto;
        text-align: center;
    }
    .site-title-link h1 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
}

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

html, body {
    min-height: 100vh;
    margin: 0 auto;
    background: #000000;
    font-family: sans-serif;
    overflow-x: hidden; /* Fix: prevent horizontal jiggle on mobile */
}

#wrapper {
    max-width: 1980px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    overflow-x: hidden; /* Fix: global wrapper constraint */
}

#main-container {
    flex: 1;
    background-color: rgba(4, 22, 26, 0.7); /* Semi-transparent */
}



/* Borders */
#left-border, #right-border {
    background-color: #C35311;
    width: 6px;
    flex-shrink: 0;
}

/* Side Parallax */
#left-side, #right-side {
    width: 150px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #000000;
}

.side-parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat-y;
    background-position: center top;
    pointer-events: none;
}

/* --- EDITING SECTION STYLES --- */
#editing-videos-container {
    padding: 3% 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

#editing-videos-container .video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-basis: clamp(280px, 40%, 500px);
    max-width: 500px;
}

#editing-videos-container .video-container {
    border: var(--video-border) solid #F5782E;
    width: 100%;
    line-height: 0;
    border-radius: var(--video-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}


#editing-videos-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* --- VFX SHOWREEL SECTION STYLES --- */
#vfx-showreel-container {
   padding: 3% 10px;
   display: flex;
   flex-direction: column;
   align-items: center;
}

#vfx-showreel-container .video-frame {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; /* Центрирование фрейма */
     margin-bottom: 0; /* Добавлено для уверенности */
}

#vfx-showreel-container #video-container {
    width: 100%;
    border: var(--video-border) solid #F5782E;
    line-height: 0;
    border-radius: var(--video-radius);
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: #000;
    aspect-ratio: 16 / 9;
}

/* На тематических страницах плеер имеет те же стили: рамка, закругление, 16:9 */
.theme-page #video-container {
    width: 100%;
    border: var(--video-border) solid #F5782E;
    line-height: 0;
    border-radius: var(--video-radius);
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: #000;
    aspect-ratio: 16 / 9;
}



#video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
    position: relative;
    z-index: 2;
}


#video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    border-radius: inherit;
    transition: none !important;
}

/* На тематических страницах превью заполняет 16:9 контейнер, как на главной */
.theme-page #video-preview {
    object-fit: cover;
}

/* Hide UI elements during preview */
.preview-active .custom-controls,
.preview-active .res-badge {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.preview-active .video-play-overlay {
    z-index: 10;
}


.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--play-btn-size);
    height: var(--play-btn-size);
    z-index: 10;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--play-btn-blur));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: calc(var(--video-border) * 0.6) solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    animation: playButtonFlicker var(--play-flicker-speed) infinite ease-in-out;
}

.video-play-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    width: 40%;
    height: 40%;
    margin-left: 5%;
}

/* --- CUSTOM VIDEO PLAYER UI --- */
.custom-video-player {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

/* Remove border and rounding in fullscreen */
.custom-video-player:fullscreen,
.custom-video-player:-webkit-full-screen {
    border: none !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
}

.custom-video-player:fullscreen video,
.custom-video-player:-webkit-full-screen video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
}

/* Base state for custom controls - hidden */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 15px 10px;
    z-index: 20;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
}

/* Active state triggered by JS */
.custom-video-player.controls-active .custom-controls {
    opacity: 1;
    transform: translateY(0);
}

/* Resolution Badge */
.res-badge {
    position: absolute;
    right: 15px;
    bottom: 80px; /* Above the control bar */
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: var(--res-badge-size);
    font-weight: var(--res-badge-weight);
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    border: none;
}

.custom-video-player.controls-active .res-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Strictly hide native browser controls across all engines */
video::-webkit-media-controls {
    display: none !important;
}
video::-webkit-media-controls-enclosure {
    display: none !important;
}
video::-moz-media-controls {
    display: none !important;
}
video::-ms-media-controls {
    display: none !important;
}
video::controls {
    display: none !important;
}

/* For mobile - show controls always or on tap */
@media (max-width: 768px) {
    .custom-controls {
        opacity: 1;
        transform: translateY(0);
        padding: 40px 10px 10px;
    }
}

.progress-area {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.progress-area:hover {
    height: 6px;
}

.progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #F5782E;
    border-radius: 2px;
    position: relative;
    box-shadow: 0 0 10px rgba(245, 120, 46, 0.4);
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-area:hover .progress-handle {
    transform: translateY(-50%) scale(1);
}

.controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent !important;
}

.showreel-main-frame,
.gallery-main-frame {
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Create stacking context for z-index: -1 children */
    background: transparent !important; /* Allow gallery bg to show */
    padding-bottom: 40px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #F5782E;
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

.time-display {
    color: #fff;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    accent-color: #F5782E;
    cursor: pointer;
}

.volume-container:hover #volume-slider {
    width: 80px;
    opacity: 1;
}


/* Force hide play overlay when playing */
.custom-video-player.playing .video-play-overlay {
    opacity: 0 !important;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1.5);
    transition: all 0.4s ease;
}

.custom-video-player.paused .video-play-overlay {
    opacity: 1 !important;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* --- RESOLUTION BUTTONS (REVERTED TO RECTANGLES) --- */
.resolution-button {
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    height: clamp(28px, 3.3vw, 50px);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.8); /* Непрозрачный тёмный фон */
    color: #F5782E;
    border: var(--video-border) solid #F5782E;
    font-size: var(--btn-text-size);
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    margin-left: -1px; /* Overlap borders */
    padding: 0 15px;
    box-sizing: border-box;
    border-radius: 0 !important; /* Force rectangular */
}

.resolution-button:first-child {
    margin-left: 0;
    border-bottom-left-radius: 20px !important; /* Умеренное закругление нижнего левого угла */
}

.resolution-button:last-child {
    border-bottom-right-radius: 20px !important; /* Умеренное закругление нижнего правого угла */
}

.resolution-button.active {
    background-color: #F5782E;
    color: #000;
}

.resolution-button:hover:not(.active) {
    background-color: rgba(245, 120, 46, var(--btn-hover-highlight));
    color: #fff;
}

/* Ширина кнопок и стыковка */
.button-container {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: calc(-1 * var(--video-border)); 
    background: none !important;
    position: relative;
    z-index: 2;
    width: 100%; /* Default to 100% of parent .video-item */
    max-width: var(--btn-container-width, 100%); /* Cap by admin controlled width */
}

/* Base Widths (to be overridden by CSS variables) */
#button-1080, #editing-button-1080-1, #editing-button-1080-2, #editing-button-1080-3,
#button-480, #editing-button-480-1, #editing-button-480-2, #editing-button-480-3 {
    width: var(--btn-outer-width, 122px);
}
#button-720, #editing-button-720-1, #editing-button-720-2, #editing-button-720-3 {
    width: var(--btn-middle-width, 82px);
}

/* --- VIDEO SECTION IMPROVEMENTS --- */
.showreel-inner-frame {
    display: flex;
    flex-direction: row; /* Back to row */
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    padding: 20px 0;
}

.video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min-content; /* Size to inner children for Editing */
    margin: 0;
    gap: 0 !important; /* SNUG FIT */
}

.showreel-item {
    width: 100%; /* Take full width of showreel-inner-frame */
    max-width: 1200px;
}

.video-frame,
.custom-video-player {
    width: 100%;
    position: relative;
}

.gallery-bg-parallax-container {
    position: absolute;
    top: -40%; /* Еще больше запас сверху */
    left: 0;
    width: 100%;
    height: 180%; /* Еще больше высота для маневра параллакса */
    z-index: -1; /* Behind content */
    pointer-events: none;
    overflow: hidden;
}

.gallery-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(var(--gallery-blur)) brightness(var(--gallery-brightness));
    opacity: 0;
    transform: scale(var(--gallery-zoom));
    transition: opacity var(--gallery-fade-speed) ease-in-out;
}

.gallery-bg-layer.active {
    opacity: 0;
    transition: opacity var(--gallery-fade-speed) ease-in-out;
}

/* Фон виден только у секции, находящейся в фокусе */
.showreel-main-frame.bg-active .gallery-bg-layer.active,
.gallery-main-frame.bg-active .gallery-bg-layer.active {
    opacity: var(--gallery-opacity);
}

/* Контент должен быть выше фона */
.gallery-main-frame .gallery {
    position: relative;
    z-index: 1;
}

/* --- ADMIN PANEL / TUNING PANEL --- */
#tuning-panel {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-height: 90vh;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(245, 120, 46, 0.3);
    border-radius: 12px;
    color: white;
    z-index: 10000;
    font-family: 'Outfit', sans-serif;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: none; /* Controlled by JS flex/none */
    flex-direction: column;
}

.admin-header {
    background: rgba(245, 120, 46, 0.1);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 120, 46, 0.2);
}

.admin-header h3 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 1px;
    color: #F5782E;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #888;
    padding: 8px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-weight: 600;
}

.tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: #F5782E;
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.tab-content.active {
    display: block;
}

.admin-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #F5782E;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-group {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: #ccc;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #F5782E;
    cursor: pointer;
}

.double-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


.value-display {
    float: right;
    color: #F5782E;
    font-weight: bold;
}

.admin-btn-primary {
    width: 100%;
    padding: 12px;
    background: #F5782E;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    text-transform: uppercase;
    font-size: 12px;
}

.admin-btn-primary:hover {
    background: #FF8A45;
    transform: translateY(-2px);
}

.admin-footer {
    padding: 10px;
    font-size: 9px;
    color: #666;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-header .close-btn {
    cursor: pointer;
    font-size: 20px;
    color: #888;
    transition: color 0.3s;
}

.admin-header .close-btn:hover {
    color: white;
}

/* --- ADMIN LOGIN OVERLAY --- */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.98);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-overlay .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

.login-box {
    text-align: center;
    width: 80%;
}

.login-icon {
    font-size: 40px;
    color: var(--theme-orange);
    margin-bottom: 20px;
}

.login-box h4 {
    font-size: 16px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.login-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 120, 46, 0.3);
    padding: 12px;
    color: white;
    text-align: center;
    font-size: 18px;
    border-radius: 6px;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.login-box input:focus {
    border-color: var(--theme-orange);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.error-msg {
    color: #ff4444;
    font-size: 10px;
    margin-top: 10px;
    min-height: 15px;
}

.login-hint {
    font-size: 9px;
    color: #444;
    margin-top: 20px;
}

/* Empty Blocks */
.empty-block01, .empty-block02, .empty-block03 {
    height: var(--separator-height, 7px);
    background-color: #C35311;
    margin: 0;
    display: block;
}

.empty-block05 {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #04161A;
}

.grad_l, .grad_r {
    height: 100%;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grad_l img, .grad_r img {
    height: 100%;
    width: 50px;
    display: block;
}

/* Gallery */
.gallery {
   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   gap: 15px;
   margin-top: 20px;
   padding: 10px;
}

.gallery a {
    display: block;
    line-height: 0;
    border: 3px solid #F5782E;
    border-radius: var(--gallery-img-radius);
    overflow: hidden;
    box-shadow: var(--gallery-shadow, 0 0 15px rgba(0,0,0,1));
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery img {
    width: 200px;
    height: 125px;
    object-fit: cover;
    display: block;
}

.gallery a:hover {
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: var(--gallery-glow);
}

/* Принудительный курсор для закрытия лайтбокса */
#lightbox {
    cursor: pointer;
}
.lb-dataContainer, .lb-outerContainer {
    cursor: default;
}

/* Vertical centering for Lightbox on Mobile (Take 3: Conditional Flex) */
@media screen and (max-width: 768px) {
    /* Only apply flex when NOT hidden by Lightbox2 JS */
    #lightbox:not([style*="display: none"]):not([style*="display:none"]) {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 10000 !important;
        overflow: hidden !important;
        background: transparent !important; /* Fix: removes the "bars" above/below image */
    }
    .lightboxOverlay {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        backdrop-filter: blur(25px); /* Maximized blur effect */
        background-color: rgba(0, 0, 0, 0.6) !important;
    }
    /* Reset JS-injected styles on children */
    .lb-outerContainer, .lb-dataContainer {
        top: auto !important;
        left: auto !important;
        margin: 0 auto !important;
        position: relative !important;
    }
}


/* Contact Section */
.contact {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    background-color:#04161A;
    padding: 20px;
}

.contact-button {
    letter-spacing: 2px;
    font-size: 45px;
    display: inline-block;
    padding: 10px 20px;
    background-color: #C35311;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    text-shadow: 3px 2px 3px rgba(0, 0, 0, 0.25);
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.contact-button:hover {
    background-color: #F5782E;
    transform: scale(1.03);
}

/* --- Section Titles (Legacy & Dynamic) --- */
#showreel-title, #gallery-title {
    display: flex;
    align-items: center;
    height: var(--plaque-height, 80px);
    margin-bottom: 0;
}

#showreel-title-left, #gallery-title-left {
    flex: 1;
}

#showreel-title-middle, #gallery-title-middle {
    width: auto;
    height: var(--plaque-height, 80px);
}

#showreel-title-middle img, #gallery-title-middle img {
    width: auto;
    height: var(--plaque-height, 80px);
    display: block;
}

#showreel-title-right, #gallery-title-right {
    width: auto;
    height: var(--plaque-height, 80px);
    padding-left: var(--plaque-pad-l, 8px);
    padding-right: var(--plaque-pad-r, 20px);
    text-align: right;
    /* Lamp logic: font scales such that text-height + 7px gap = plaque height.
       Since we want 7px gap below, and there is a 7px separator above,
       the font size should be (PlaqueHeight - SeparatorHeight).
       We align-items: flex-start to let the text height define the block, 
       and if PlaqueHeight is 80 and Separator is 7, font is 73. 
       This leaves exactly 7px at the bottom. */
    font-size: calc(var(--plaque-height, 80px) - var(--separator-height, 7px));
    line-height: 1;
    color: #FFFFFF;
    background-color: #C35311;
    display: flex;
    align-items: flex-start; /* Preserves the top-aligned feel with a calculated bottom gap */
    text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.25);
    font-family: 'font1', sans-serif;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

/* --- Динамичное появление плашки целиком (по фокусу на разделе) --- */
#showreel-title, #gallery-title {
    justify-content: flex-end; /* Плашка прижата к правому краю */
}

.plaque-slide {
    display: inline-flex;
    align-items: center;
    height: var(--plaque-height, 80px);
    width: fit-content; /* Плашка занимает только свою длину, не растягивается */
    transform: translateX(100%);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.plaque-slide #showreel-title-left,
.plaque-slide #gallery-title-left {
    flex: 0 0 auto; /* Левая часть не растягивается */
}

/* Название выезжает после того, как плашка приехала */
.plaque-text {
    display: inline-block;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s, opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

/* Когда секция в фокусе — плашка и название выезжают */
.showreel-main-frame.bg-active .plaque-slide,
.gallery-main-frame.bg-active .plaque-slide,
.showreel-main-frame.plaque-shown .plaque-slide,
.gallery-main-frame.plaque-shown .plaque-slide {
    transform: translateX(0);
}

.showreel-main-frame.bg-active .plaque-text,
.gallery-main-frame.bg-active .plaque-text,
.showreel-main-frame.plaque-shown .plaque-text,
.gallery-main-frame.plaque-shown .plaque-text {
    transform: translateX(0);
    opacity: 1;
}

/* --- Динамичное появление заголовка по словам (снизу) --- */
.header-title-row h1,
.site-title-link h1 {
    overflow: hidden; /* Слова обрезаются при выезде, видны только внутри своего блока */
}

.header-title-row .word,
.site-title-link .word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: wordIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header-title-row .word:nth-child(1),
.site-title-link .word:nth-child(1) {
    animation-delay: 0.2s;
}

.header-title-row .word:nth-child(2),
.site-title-link .word:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes wordIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Уменьшенный пустой блок (для тематических страниц) */
.empty-block-compact {
    height: calc(var(--separator-height, 7px) / 2) !important;
}

.empty-block05.compact {
    height: 25px !important;
}

/* Mobile optimization for plaques and video controls */
@media screen and (max-width: 768px) {
    #showreel-title, #gallery-title,
    #showreel-title-middle, #gallery-title-middle,
    #showreel-title-middle img, #gallery-title-middle img,
    #showreel-title-right, #gallery-title-right {
        /* Limit height on mobile even if admin set it higher */
        max-height: 44px; 
    }
    
    #showreel-title-right, #gallery-title-right {
        /* Force specific font for the height limit to keep 7px gap */
        font-size: 37px;
        line-height: 1;
        display: flex;
        align-items: flex-start;
    }

    .button-container {
        width: 85% !important;
        margin-left: auto;
        margin-right: auto;
        /* Narrower custom widths for mobile */
        --btn-outer-width: 98px;
        --btn-middle-width: 66px;
    }

    .resolution-button {
        height: 48px !important;
        font-size: 20px !important;
        width: var(--btn-middle-width) !important; /* Default for 720p */
        padding: 0 !important; /* Minimize internal padding for tight fit */
    }

    /* Target outer buttons specifically */
    #button-1080, #editing-button-1080-1, #editing-button-1080-2, #editing-button-1080-3,
    #button-480, #editing-button-480-1, #editing-button-480-2, #editing-button-480-3 {
        width: var(--btn-outer-width) !important;
    }
}

.gallery-main-frame #gallery-title {
    margin-bottom: 20px;
}

/* Дополнительные медиа-запросы */
@media (max-width: 768px) {
    .gallery img {
        width: 180px;
        height: 112px;
    }
    #editing-videos-container .video-item {
        flex-basis: clamp(280px, 45%, 450px);
    }
    
    .title-text {
        font-size: clamp(14px, 3vw, 18px); /* Smaller text on mobile */
        right: clamp(15px, 4vw, 25px);
    }
}

@media (max-width: 480px) {
    .gallery img {
        width: clamp(120px, 40vw, 150px);
        height: auto;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }
     .gallery {
        gap: 10px;
        padding: 10px 5px;
     }
     #vfx-showreel-container .video-frame {
        width: 95%;
     }
     #editing-videos-container {
        gap: 15px;
        padding: 3% 5px;
     }
     #editing-videos-container .video-item {
        flex-basis: 100%;
        max-width: 95%;
        margin: 0 auto;
    }
}

/* --- Индикатор загрузки видео --- */
.video-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #F5782E;
    border-radius: 50%;
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    animation: videoSpin 0.8s linear infinite;
    pointer-events: none;
}

.custom-video-player.loading .video-loading-indicator {
    opacity: 1;
    visibility: visible;
}

@keyframes videoSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Кнопка "наверх" --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(245, 120, 46, 0.9);
    border: 2px solid #F5782E;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

#back-to-top svg {
    width: 28px;
    height: 28px;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: #FF8A45;
    transform: translateY(-3px);
}

#back-to-top:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 3px;
}

/* --- Навигация по разделам --- */
.section-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    background-color: rgba(4, 22, 26, 0.5);
}

.section-nav a {
    color: #F5782E;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 2px solid transparent;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.section-nav a:hover {
    background-color: rgba(245, 120, 46, 0.15);
    border-color: #F5782E;
}

.section-nav a:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 2px;
}

/* --- Доступность: видимый фокус при навигации с клавиатуры --- */
:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Фокус на кнопках плеера */
.control-btn:focus-visible,
.resolution-button:focus-visible,
.tab-btn:focus-visible,
.admin-btn-primary:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 2px;
}

/* Фокус на ссылках галереи */
.gallery a:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 3px;
    transform: scale(1.05);
    border-color: #fff;
}

/* Фокус на контактных иконках */
.contact-icon:focus-visible {
    outline: 3px solid #F5782E;
    outline-offset: 3px;
    transform: scale(1.1);
}

/* Фокус на ползунках */
input[type="range"]:focus-visible {
    outline: 2px solid #F5782E;
    outline-offset: 3px;
}
