/* ==========================================================================
   1. ИМПОРТ ШРИФТОВ И ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ
   ========================================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
   @import url('https://fonts.googleapis.com/css2?family=Alumni+Sans:wght@700&display=swap');
   
   :root {
       --background-color: #1a1a1a;
       --house-bg: #222222;
       --window-off-color: #4a4a4a;
       --window-on-color: #fffacd;
       --timeline-text-color: #cccccc;
       --text-color: #f0f0f0;
       --modal-bg: #2c2c2c;
       --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
   }
   
   
   /* ==========================================================================
      2. ОБЩИЕ СТИЛИ И СБРОСЫ (RESETS)
      ========================================================================== */
   
   * {
       box-sizing: border-box;
       margin: 0;
       padding: 0;
   }
   
   html {
       scrollbar-gutter: stable;
       background-color: var(--background-color);
   }
   
   body {
       min-height: 100vh;
       color: var(--text-color);
       font-family: var(--font-family);
       overflow-x: hidden;
       /* Градиентный фон для всего сайта */
       background: linear-gradient(to top, #00103e 30%, #a1c4fd 100%);
   }
   
   /* Стили для скроллбаров в Webkit-браузерах */
   ::-webkit-scrollbar {
       width: 8px;
   }
   ::-webkit-scrollbar-track {
       background: transparent;
   }
   ::-webkit-scrollbar-thumb {
       background-color: #4b4b4b;
       border-radius: 10px;
   }
   ::-webkit-scrollbar-thumb:hover {
       background-color: #bbb;
   }
   ::-webkit-scrollbar-button {
       display: none;
   }
   
   
   /* ==========================================================================
      3. ПРЕЛОАДЕР (TV STYLE)
      ========================================================================== */
   
      #preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        /* Цвет фона: Темно-синий */
        background-color: #152036; 
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    }
    
    #preloader.hidden {
        opacity: 0;
        visibility: hidden;
    }
 
    /* Контейнер для телевизора и текста */
    .preloader-container {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        /* НАСТРОЙКА ОБЩЕГО МАСШТАБА */
        transform: scale(1); 
    }
 
    /* Обертка самого телевизора */
    .tv-wrapper {
        position: relative;
        /* НАСТРОЙКА РАЗМЕРА ТЕЛЕВИЗОРА (Десктоп) */
        width: 500px;  /* <--- Меняй ширину тут */
        height: 380px; /* <--- Меняй высоту тут */
        display: flex;
        justify-content: center;
        align-items: center;
    }
 
    /* Картинка SVG (Рамка) */
    .tv-frame {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2; /* Рамка сверху */
        pointer-events: none;
    }
 
    /* Область экрана (Шум + Цифры) */
    /* Тебе нужно подогнать top/left/width/height, чтобы попасть в "экран" твоего SVG */
    .tv-screen-area {
        position: absolute;
        z-index: 1; /* Экран снизу */
        background-color: #000;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
 
        /* --- РУЧНАЯ НАСТРОЙКА ПОЛОЖЕНИЯ ЭКРАНА --- */
        /* Подбирай эти значения, чтобы шум был ровно внутри рамки */
        top: 12%;       
        left: 17%;       
        width: 67%;     
        height: 64%;    
        
        border-radius: 5% / 5%; /* Скругление углов экрана (как у кинескопа) */
    }
 
    /* Канвас с шумом */
    #preloader-noise {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.6; /* Чуть прозрачный, чтобы цифры читались лучше */
        image-rendering: pixelated; /* Пиксельный стиль */
    }
 
    /* Цифры процентов */
    #loader-percentage {
        position: relative;
        z-index: 3;
        font-family: 'Pixelify Sans', monospace; /* Или любой жирный шрифт */
        font-weight: 900;
        /* Цвет цифр: Темно-синий (как фон сайта) */
        color: #fff; 
        
        /* НАСТРОЙКА РАЗМЕРА ЦИФР */
        font-size: 100px; 
        line-height: 1;
    }
 
    /* Текст снизу (фразы) */
    #loading-text {
        margin-top: 30px;
        font-family: 'Montserrat', sans-serif;
        font-size: 18px;
        color: #ffffff;
        text-align: center;
        min-height: 24px; /* Чтобы не прыгало при смене текста */
        opacity: 0.8;
    }
 
    /* --- АДАПТИВ ДЛЯ МОБИЛЬНЫХ --- */
    @media (max-width: 768px) {
        .tv-wrapper {
            /* Делаем телевизор крупнее относительно экрана телефона */
            width: 320px; 
            height: 240px;
        }
        
        #loader-percentage {
            font-size: 80px;
        }
 
        /* Корректируем положение экрана для мобильного размера, если пропорции SVG те же */
        /* Обычно менять не надо, если width/height в % */
    }
   
   
   /* ==========================================================================
      4. ОСНОВНАЯ СТРУКТУРА И ФОН (LAYOUT & BACKGROUND)
      ========================================================================== */
   
   .timeline,
   .site-wrapper {
       display: flex;
       flex-direction: column-reverse;
       min-height: 100vh;
       
       /* ИЗМЕНЕНИЯ ЗДЕСЬ: */
       /* Используем opacity вместо visibility для плавности */
       opacity: 0; 
       transition: opacity 0.5s ease-in; /* Плавное появление сайта */
   }
   
   body.loaded .timeline,
   body.loaded .site-wrapper {
       /* Когда класс loaded добавлен - плавно проявляем */
       opacity: 1;
   }
   
   .site-wrapper {
       position: relative;
       z-index: 5;
       /* Фоновая картинка для нижней части сайта */
       background-image: image-set(
           url('img/Bg_bot.avif') type('image/avif'),
           url('img/Bg_bot.webp') type('image/webp'),
           url('img/Bg_bot.jpeg') type('image/jpeg')
       );
       background-position: center bottom;
       background-repeat: no-repeat;
   }
   
   .content-center {
       width: 840px;
       margin: 0 auto;
       position: relative;
   }
   
   /* Слои с облаками */
   /* Общие настройки для обоих облаков */
   .cloud-back,
   .cloud-front {
       position: absolute;
       left: 0;
       width: 100%;
       height: 1440px;
       background-position: center top;
       background-repeat: no-repeat;
       pointer-events: none;
   }

   /* --- НАСТРОЙКА ПОЗИЦИИ ДЛЯ ДЕСКТОПА --- */
   
   /* Задние облака */
   .cloud-back {
       background-image: image-set(
           url('img/cloud/cloud_back.avif') type('image/avif'),
           url('img/cloud/cloud_back.webp') type('image/webp'),
           url('img/cloud/cloud_back.png') type('image/png')
       );
       z-index: 2; 
       
       /* Двигай это число: */
       /* 0px - самый верх */
       /* 100px - опустить ниже */
       /* -100px - поднять выше */
       top: 0px; 
   }

   /* Передние облака */
   .cloud-front {
       background-image: image-set(
           url('img/cloud/cloud_front.avif') type('image/avif'),
           url('img/cloud/cloud_front.webp') type('image/webp'),
           url('img/cloud/cloud_front.png') type('image/png')
       );
       z-index: 11; 
       
       /* Двигай это число: */
       top: -87px; /* Например, опустим их чуть ниже задних для объема */
   }
   
   .cloud-back {
       background-image: image-set(
           url('img/cloud/cloud_back.avif') type('image/avif'),
           url('img/cloud/cloud_back.webp') type('image/webp'),
           url('img/cloud/cloud_back.png') type('image/png')
       );
       z-index: 2; /* Под сайтом */
   }
   
   .cloud-front {
       background-image: image-set(
           url('img/cloud/cloud_front.avif') type('image/avif'),
           url('img/cloud/cloud_front.webp') type('image/webp'),
           url('img/cloud/cloud_front.png') type('image/png')
       );
       z-index: 11; /* Над сайтом */
   }
   
   
   /* ==========================================================================
      5. ПЕРВЫЙ ЭКРАН (HERO SECTION)
      ========================================================================== */
   
   .hero {
       height: 508px;
       min-height: 300px;
       display: flex;
       flex-direction: column;
       justify-content: flex-end;
       align-items: center;
       text-align: center;
       padding: 40px 200px 60px;
       width: 100%;
       margin-top: -330px;
       position: relative;
       z-index: 11;
   }
   
    /* --- Стили заголовка с JS-шумом --- */
    /* --- Стили заголовка (Final Slow Fade) --- */
    .hero h1 {
        font-family: 'Alumni Sans', sans-serif;
        font-size: clamp(4rem, 12vw, 13rem);
        font-weight: 700;
        white-space: nowrap;
        text-align: center;
        line-height: 0.8;
        margin-bottom: 0;
        
        position: relative; 
        z-index: 12; 
        cursor: default;
    }

    .hero h1 span {
        /* 1. Шум работает ВСЕГДА фоном (чтобы не было рывков при старте/стопе) */
        background-image: var(--bg-noise-1);
        background-size: 75px 75px;
        -webkit-background-clip: text;
        background-clip: text;
        
        /* Запускаем анимацию кадров постоянно */
        animation: noise-frame-swap 0.2s steps(1) infinite;

        /* 2. По умолчанию текст БЕЛЫЙ (полностью скрывает шум под собой) */
        color: rgba(255, 255, 255, 1);
        
        /* 3. Очень медленный переход прозрачности (3 секунды) */
        transition: color 10s ease;
        
        /* Убираем любые свечения/тени */
        text-shadow: none; 
    }

    /* Ховер эффект */
    .hero h1:hover span {
        /* 4. При наведении текст плавно (за 3 сек) становится прозрачным,
        проявляя работающий шум */
        color: rgba(255, 255, 255, 0);
    }

    /* Кадры шума остаются теми же */
    @keyframes noise-frame-swap {
        0% { background-image: var(--bg-noise-1); }
        25% { background-image: var(--bg-noise-2); }
        50% { background-image: var(--bg-noise-3); }
        75% { background-image: var(--bg-noise-4); }
    }
   
   .hero p {
       font-size: 18px;
       line-height: 1.4;
       max-width: 750px;
       color: #ffffff;
   }
   
   .overlay-person {
       position: absolute;
       z-index: 15;
       pointer-events: none;
   }
   
   /* Позиционирование "людей" только на десктопе */
   @media (min-width: 1024px) {
       #person1 {
           bottom: 155px;
           left: calc(50% - 300px);
       }
       #person2 {
           bottom: 150px;
           left: calc(50% - 570px);
       }
   }
   
   /* Иконка скролла */
   .scroll-indicator {
       margin-top: 50px;
       margin-bottom: 50px;
   }
   
   .scroll-indicator .scroll-arrow {
       animation: arrow-flow 2s ease-in-out infinite;
   }
   
   
   /* ==========================================================================
      6. СЕТКА ДОМА (HOUSE GRID)
      ========================================================================== */
   
   .house {
       display: grid;
       grid-template-columns: repeat(3, 1fr);
       background-color: transparent;
       position: relative;
       z-index: 2; /* Между облаками */
       /* Маска для "рваных" краев */
       mask-border-source: url('img/edge-mask.png');
       mask-border-slice: 0 30 0 30 fill;
       mask-border-width: 0 10px 0 10px;
       mask-border-repeat: repeat;
       contain: layout paint;
       -webkit-mask-box-image-source: url('img/edge-mask.png');
       -webkit-mask-box-image-slice: 0 30 0 30 fill;
       -webkit-mask-box-image-width: 0 10px 0 10px;
       -webkit-mask-box-image-repeat: repeat;
   }
   
   .window {
       width: 100%;
       height: 220px;
       background-size: contain;
       background-position: center;
   }
   
   .window.lit {
       background-color: transparent;
       cursor: pointer;
       transition: box-shadow 0.2s ease-out;
   }
   
   /* Стили для параллакса в окнах */
   .window-parallax {
       position: relative;
       overflow: hidden;
   }
   
   .window-interior {
    position: absolute;
    width: 151px;
    height: 144px;
    top: 53%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    background-size: cover;
    background-position: center;
    z-index: 0;

    will-change: transform;
    backface-visibility: hidden;
    }

   
   .window-frame {
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       background-size: cover;
       background-position: center;
       z-index: 1;
       pointer-events: none;
   }
   
   /* Фреска (мурал) */
   .mural {
       grid-column: span 3;
       height: 660px;
       background-size: cover;
       background-position: center;
       background-repeat: no-repeat;
       cursor: pointer;
   }
   
   /* Подъезд */
   .house-entrance {
       grid-column: span 3;
       height: 330px;
       background-image: image-set(
           url('img/entrance.avif') type('image/avif'),
           url('img/entrance.webp') type('image/webp'),
           url('img/entrance.jpeg') type('image/jpeg')
       );
       background-size: cover;
       background-position: center;
   }
   
   
   /* ==========================================================================
      7. КРЫША / ПОДВАЛ (ROOF / FOOTER SECTION)
      ========================================================================== */
   
   .roof {
       display: flex;
       flex-direction: column;
       justify-content: center;
       align-items: center;
       padding: 80px 40px;
       min-height: 50vh;
       text-align: center;
       position: relative;
       z-index: 13;
   }
   
   .roof h2 {
       font-size: 2rem;
       margin-bottom: 20px;
       color: #1a2b4a;
   }
   
   .roof p {
       font-size: 1.1rem;
       color: #334a6e;
       margin-bottom: 30px;
       line-height: 1.8;
       max-width: 650px;
       margin-left: auto;
       margin-right: auto;
   }
   
   .social-icons {
       display: flex;
       flex-wrap: wrap;
       justify-content: center;
       gap: 15px;
       margin-top: 40px;
   }
   
   .social-icons a {
       display: inline-block;
       padding: 10px 25px;
       border: 1px solid #1a2b4a;
       border-radius: 5px;
       font-size: 0.9rem;
       color: #334a6e;
       text-decoration: none;
       letter-spacing: 0.05em;
       background-color: transparent;
       transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
   }
   
   .social-icons a:hover {
       background-color: #334a6e;
       color: #ffffff;
       border-color: #334a6e;
   }
   
   .creators-block {
       margin-top: 60px;
       margin-bottom: 40px;
       padding-top: 40px;
       border-top: 1px solid #1a2b4a;
       display: grid;
       grid-template-columns: repeat(3, 1fr);
       gap: 20px;
       max-width: 700px;
       margin-left: auto;
       margin-right: auto;
       text-align: center;
   }
   
   .creators-block h4 {
       font-size: 0.9rem;
       font-weight: 400;
       color: #1a2b4a;
       text-transform: uppercase;
       letter-spacing: 0.1em;
       margin-bottom: 15px;
   }
   
   .creators-block p {
       font-size: 1rem;
       color: #334a6e;
       line-height: 1.6;
       margin-bottom: 0;
   }
   
   
   /* ==========================================================================
      8. МОДАЛЬНЫЕ ОКНА (MODALS)
      ========================================================================== */
   
   /* --- 8.1 Общие стили для оверлеев и оберток --- */
   .modal-overlay {
       position: fixed;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       background-color: rgba(0, 0, 0, 0.3);
       backdrop-filter: blur(10px);
       display: flex;
       justify-content: center;
       align-items: center;
       z-index: 1000;
       opacity: 0;
       visibility: hidden;
       transition: opacity 0.3s, visibility 0.3s;
   }
   
   .modal-overlay.visible {
       opacity: 1;
       visibility: visible;
   }
   
   .modal-wrapper {
       position: relative;
       width: 80vw;
       height: 85vh;
       max-width: 1650px;
       max-height: 900px;
       transform: scale(0.9);
       transition: transform 0.3s;
   }
   
   .modal-overlay.visible .modal-wrapper {
       transform: scale(1);
   }
   
   /* --- 8.2 Стили для основного модального окна (с историей) --- */
   .modal-content {
       width: 100%;
       height: 100%;
       border-radius: 15px;
       box-shadow: 0 10px 40px rgba(0,0,0,0.5);
       overflow: hidden;
       background-color: var(--modal-bg);
       display: flex;
   }

    /* FIX: Отступы скроллбара для мобильной версии (здесь скроллится весь контент) */
    .modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 20px;
    margin-bottom: 20px;
    }
   
    .modal-story {
        position: static;
        width: 440px;
        height: 100%;
        flex-shrink: 0;
        background: #1D1D1D;
        overflow-y: auto;
        content-visibility: auto;
        contain-intrinsic-size: 1000px; 
    }

    .modal-story > div {
        padding: 30px 34px 60px;
    }

    .modal-story > div > * {
        margin: 0;
    }


    /* 1. Толщина */
    .modal-story::-webkit-scrollbar {
        width: 6px; 
    }

    /* 2. Цвет и скругление ползунка */
    .modal-story::-webkit-scrollbar-thumb {
        background-color: #4B4B4B; 
        border-radius: 1px;       
    }

    /* 3. Фон под скроллом */
    .modal-story::-webkit-scrollbar-track {
        background: transparent; 
        margin: 0px 0;          
    }

    /* ===============================================
    НАСТРОЙКИ ТЕКСТА И ЗАГОЛОВКОВ (Модалки + Муралы)
    =============================================== */

    /* 1. ЗАГОЛОВКИ (H2, H3) - Плотный межстрочный интервал */
    .modal-story h2, .modal-story h3,
    .mural-modal-story h2, .mural-modal-story h3 {
        line-height: 1.1 !important; /* Заголовки должны быть плотными */
        /* Тут размеры шрифтов, если захочешь поменять заголовки глобально */
        /* font-size: 32px; */ 
    }

    /* 2. ОБЫЧНЫЙ ТЕКСТ - Воздушный интервал для чтения */
    .modal-story p,
    .modal-story div:not(.caption-text):not(.share-block),
    .mural-modal-story p,
    .mural-modal-story div:not(.caption-text):not(.share-block) {
        font-size: 17px !important; 
        line-height: 1.6 !important;
        margin-top: 22px;            
    }

    /* --- АДАПТИВ ДЛЯ МОБИЛЬНЫХ (меньше 1024px) --- */
    @media (max-width: 1023px) {
        /* Текст на мобильных чуть меньше */
        .modal-story p,
        .modal-story div:not(.caption-text):not(.share-block),
        .mural-modal-story p,
        .mural-modal-story div:not(.caption-text):not(.share-block) {
            font-size: 16px !important; 
            line-height: 1.5 !important; 
        }
    }
    @media (min-width: 1024px) {
        .modal-story p, .modal-story div:not(.caption-text) { font-size: 16px; }
    }

    .modal-story h3 {
        font-size: 32px;
        margin-top: -10px;
    }
    
    /* ИСПРАВЛЕНО: Стили для нового подзаголовка H2 в модальных окнах */
    .modal-story h2,
    .mural-modal-story h2 {
        font-size: 1.5rem;
        font-weight: 400; /* 400 - это нормальный, не жирный шрифт */
        margin-top: 25px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    /* Цвет для H2 в основной (темной) модалке */
    .modal-story h2 {
        color: var(--text-color);
    }
    
    /* Цвет для H2 в модалке мурала (светлой) */
    .mural-modal-story h2 {
        color: #1a1a1a;
    }



        /* ===== Skeleton для медиа в модалках (img + webm) ===== */
    .img-skeleton{
        background: #2B2B2B url("img/icon/img.svg") center / 48px 48px no-repeat;
        overflow: hidden;
        position: relative;
    }

    .img-skeleton img,
    .img-skeleton video{
        display: block;
        width: 100%;
        height: auto;
        transition: opacity .2s ease;
        margin: 0 !important;
    }

    /* Отступ задаём контейнеру (вровень с текстом) */
    .modal-story picture,
    .mural-modal-story picture,
    .modal-story .img-skeleton-wrap,
    .mural-modal-story .img-skeleton-wrap {
        display: block;
        width: 100%;
        border-radius: 10px;
        overflow: hidden;
        line-height: 0;
        margin-top: 15px;
    }

    /* Скелет должен быть виден до загрузки */
    .modal-story picture.img-skeleton,
    .mural-modal-story picture.img-skeleton,
    .modal-story .img-skeleton-wrap.img-skeleton,
    .mural-modal-story .img-skeleton-wrap.img-skeleton{
        min-height: 160px;
    }

    /* Внутреннему медиа отступ НЕ даём, чтобы скелет не "торчал" */
    .modal-story picture img,
    .mural-modal-story picture img,
    .modal-story .img-skeleton-wrap img,
    .mural-modal-story .img-skeleton-wrap img,
    .modal-story .img-skeleton-wrap video,
    .mural-modal-story .img-skeleton-wrap video{
        display: block;
        width: 100%;
        height: auto;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    /* скрываем медиа, пока грузится / если упало */
    .img-skeleton.img-loading img,
    .img-skeleton.img-error img,
    .img-skeleton.img-loading video,
    .img-skeleton.img-error video{
        opacity: 0;
    }

    .img-skeleton.img-loaded img,
    .img-skeleton.img-loaded video{
        opacity: 1;
    }

    /* ВАЖНО: когда медиа загрузилось — убираем фон скелета,
       иначе он может "просвечивать" полосой над/вокруг картинки */
    .img-skeleton.img-loaded{
        background: none !important;
    }

.modal-story .caption-text {
        color: #998F8D;
        font-size: 14px;
        line-height: 1.3;
        margin-top: 10px;
    }

    .modal-story h3 + .caption-text {
        margin-top: 7px;
    }

    .modal-story p:empty,
    .modal-story div:empty {
        display: none;
    }
   
   .modal-media-area {
       position: relative;
       flex-grow: 1;
       height: 100%;
       display: grid;
       place-items: center;
       overflow: hidden;
   }

   /* Верхняя картинка (ТВ) в модалке */
    .modal-media-area picture{
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
    }

   
   .media-wrapper {
       position: relative;
       min-width: 100%;
       min-height: 100%;
   }
   
   .room-image {
       display: block;
       width: 100%;
       height: 100%;
       object-fit: cover;
       pointer-events: none;
       position: relative;
       z-index: 2;
   }
   
   .video-container {
       position: absolute;
       z-index: 1;
       width: 58%;
       height: 47%;
       top: 19%;
       left: 21%;
   }
   
   .video-container iframe {
       width: 100%;
       height: 100%;
       border: 0;
   }

   /* Кнопка "только плеер" (видна только на мобильных) */
    .media-fullscreen-toggle {
        position: absolute;
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        display: none;
        align-items: center;
        justify-content: center;
        border: none;
        padding: 0;
        background-color: rgba(25, 25, 25, 0.75);
        border-radius: 50%;
        cursor: pointer;
        z-index: 10;
        opacity: 1;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .media-fullscreen-toggle img {
        width: 100%;
        height: 100%;
        display: block;
    }

    .media-fullscreen-toggle:hover {
        opacity: 0.9;
        transform: scale(1.05);
    }    

    /* Режим: скрываем картинку телевизора, растягиваем плеер */
    #modal-overlay.video-only .modal-media-area picture {
        display: none;
    }

    #modal-overlay.video-only .video-container {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
        left: 0;
        aspect-ratio: 16 / 9;
        background: #000;
        border-radius: 12px;
        overflow: hidden;
        z-index: 2;
    }

   
   /* Анимация поиска каналов */
   #tv-tuning-animation {
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       background-color: #000;
       z-index: 3;
       display: flex;
       justify-content: center;
       align-items: center;
       overflow: hidden;
       opacity: 1;
       transition: opacity 0.5s ease;
   }
   
   #tv-tuning-animation.hidden {
       opacity: 0;
       pointer-events: none;
   }
   
   #tv-tuning-stage {
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       overflow: hidden;
   }
   
   #noise-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease;
    
    /* ВАЖНО: Убираем размытие! */
    /* Делает пиксели четкими и "хрустящими", как на старом мониторе */
    image-rendering: pixelated; /* Для Chrome/Edge/Opera */
    image-rendering: crisp-edges; /* Для Firefox */
    }
   
   .tuning-box {
       position: absolute;
       top: 50%;
       left: 50%;
       transform: translate(-50%, -50%);
       width: 380px;
       background-color: rgba(10, 10, 10, 0.75);
       padding: 15px 20px;
       border: 1px solid rgba(0, 200, 0, 0.4);
       font-family: 'Pixelify Sans', 'Courier New', monospace;
       font-size: 22px;
       color: #0c0;
       text-shadow: 0 0 5px #0c0;
       z-index: 3;
       opacity: 0;
       transition: opacity 0.5s ease;
   }
   .tuning-box.visible {
       opacity: 1 !important;
   }
   
   .tuning-header {
       display: flex;
       justify-content: space-between;
       margin-bottom: 15px;
   }
   
   .progress-bar-wrapper {
       width: 100%;
       height: 20px;
       border: 2px solid #0c0;
       padding: 3px;
       box-sizing: border-box;
   }
   
   #progress-bar-container {
       width: 100%;
       height: 100%;
       display: flex;
   }
   
   .progress-block {
       height: 100%;
       background-color: #0c0;
       box-shadow: 0 0 5px #0c0;
       margin-right: 5px;
   }
   
   #status-text {
       font-size: 18px;
       text-align: center;
       margin-top: 10px;
   }
   
   /* Глитч-эффект для блока поиска */
   .tuning-box::before,
   .tuning-box::after {
       content: '';
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       background-color: rgba(10, 10, 10, 0.75);
       border: 1px solid rgba(0, 200, 0, 0.4);
       z-index: -1;
       overflow: hidden;
   }
   .tuning-box::before {
       animation: glitch-top-fixed 2.5s infinite steps(1, end);
       clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
   }
   .tuning-box::after {
       animation: glitch-bottom-fixed 2.5s infinite steps(1, end);
       clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
   }
   
   /* Блок "Поделиться" */
   .share-block {
       position: absolute;
       bottom: 25px;
       left: 25px;
       z-index: 5;
       display: flex;
       flex-direction: column;
       gap: 12px;
   }
   
   .share-label {
       font-size: 14px;
       color: rgba(255, 255, 255, 0.6);
       margin: 0;
       padding: 0;
   }
   
   .share-buttons-wrapper {
       display: flex;
       gap: 8px;
   }
   
   .share-button {
       width: 40px;
       height: 40px;
       opacity: 0.4;
       background: none;
       border: none;
       padding: 0;
       cursor: pointer;
       transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
       position: relative;
       font-size: 0;
   }
   
   .share-button img {
       width: 100%;
       height: 100%;
       display: block;
       transition: filter 0.2s ease-in-out;
   }
   
   .share-button:hover {
       opacity: 1;
       transform: scale(1.05);
   }
   
   .share-button:hover img {
       filter: invert(1);
   }
   
   .share-button .copy-feedback {
    position: absolute;
    
    /* Позиционирование: Справа от иконки */
    top: 50%;
    left: 100%;
    
    /* ВАЖНО: Сбрасываем любые margin, которые могут прилететь из стилей мурала */
    margin: 0 !important; 
    margin-left: 10px !important; /* Только отступ слева */
    
    /* Центровка по вертикали */
    transform: translateY(-50%);
    
    /* Стили текста */
    background-color: #ffffff;
    color: #152036;
    padding: 6px 12px;
    border-radius: 5px;
    
    /* Сбрасываем высоту строки, чтобы текст был компактным */
    font-size: 13px;
    line-height: 1.2 !important; 
    
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    z-index: 10;
}
   
   .share-button.copied .copy-feedback {
       opacity: 1;
       visibility: visible;
   }
   
    /* ИСПРАВЛЕНО: Стили для блока "Поделиться" внутри модального окна мурала */
    .mural-modal-story .share-block {
        position: static;
        border-top: 1px solid #e0e0e0;
        /* ИСПРАВЛЕНО: Увеличиваем нижний отступ, чтобы иконки не прилипали к краю */
        margin: 40px 0 0 0px ; /* Формат: Верх | Бока | Низ */
        padding-top: 0px;
        padding-bottom: 70px;
    }

    /* ИСПРАВЛЕНО (Задача 2): Уменьшаем расстояние между подписью и иконками */
    .mural-modal-story .share-block .share-label {
        color: #555;
        margin-bottom: -40px; /* Уменьшаем отступ снизу */
    }

    .mural-modal-story .share-block .share-button {
        opacity: 0.5;
    }
    .mural-modal-story .share-block .share-button:hover {
        opacity: 1;
    }

    .mural-modal-story .share-block .share-button:hover img {
        filter: none;
    }

    /* --- 8.3 Стили для модального окна "Мурала" --- */

    /* ИСПРАВЛЕНО: Новые стили для обёртки, отвечающей за размер и позицию */
    .mural-modal-wrapper {
        position: relative;
        width: 90vw;
        max-width: 1000px;
        height: 85vh;
        transform: scale(0.9);
        transition: transform 0.3s;
    }

    #mural-modal-overlay.visible .mural-modal-wrapper {
        transform: scale(1);
    }

    .mural-modal-content {
        width: 100%;
        height: 100%;
        background-color: #ffffff;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        
        overflow-y: auto;
        
        /* ВАЖНО: Запрещаем горизонтальную прокрутку */
        overflow-x: hidden; 
        
        display: flex;
        justify-content: center;
    }

    /* Стили для скроллбара остаются те же, но применяются к .mural-modal-content */
    .mural-modal-content::-webkit-scrollbar { width: 8px; }
    .mural-modal-content::-webkit-scrollbar-track { 
        background: transparent; 
        /* ОПТИМИЗАЦИЯ: Отступы сверху и снизу, чтобы скроллбар не наезжал на скругленные углы */
        margin-top: 20px;
        margin-bottom: 20px;
    }
    .mural-modal-content::-webkit-scrollbar-thumb { background-color: #cccccc; border-radius: 10px; }
    .mural-modal-content::-webkit-scrollbar-thumb:hover { background-color: #aaaaaa; }

    /* --- 8.4 Кнопка "Закрыть" --- */
    /* ИСПРАВЛЕНО: Теперь кнопка позиционируется относительно .mural-modal-wrapper и не скроллится */
    #mural-modal-close {
        position: absolute;
        top: 25px;
        right: 25px;
        width: 24px;
        height: 24px;
        cursor: pointer;
        background: none;
        border: none;
        z-index: 1001;
        transition: transform 0.3s ease-in-out;
        font-size: 0; /* Прячем старый текстовый символ */
    }
   
 

    #mural-modal-overlay.visible .mural-modal-content {
        transform: scale(1);
    }

    .mural-modal-story {
        width: 100%;
        max-width: 800px;
        /* ИСПРАВЛЕНО: Оставляем только боковые отступы для текста */
        padding: 0 40px;
        box-sizing: border-box;
        text-align: left;
    }
    
    /* ИСПРАВЛЕНО: Добавляем невидимые отступы СВЕРХУ и СНИЗУ к самому блоку с текстом */
    .mural-modal-story::before,
    .mural-modal-story::after {
        content: '';
        display: block;
        height: 50px; /* Этот отступ должен быть равен border-radius модального окна */
    }

    /* ИСПРАВЛЕНО (Задача 1): Правило для принудительного сброса цвета текста, который задан в data.json */
    .mural-modal-story font {
        color: inherit !important;
        font-size: inherit !important;
    }

    .mural-modal-story h3 {
        font-size: 2.5rem;
        color: #1a1a1a;
        margin-bottom: 25px;
    }

    .mural-modal-story .caption-text {
        color: #555;
        font-size: 14px;
        line-height: 1.3;
        margin-top: 10px;
    }

    .mural-modal-story h3 + .caption-text {
        margin-top: 7px;
    }

    /* ИСПРАВЛЕНО (Задача 2): Специальное правило, чтобы подпись "прилипала" к картинке */
    .mural-modal-story div > img + .caption-text,
    .mural-modal-story img + .caption-text {
        margin-top: 7px;
    }

    .mural-modal-story p,
    .mural-modal-story div:not(.caption-text) {
        font-size: 18px;
        line-height: 1.5;
        color: #1a1a1a;
        margin-top: 22px;
        margin-bottom: 0;
    }

    .mural-modal-story img {
        display: block;
        width: 100%;
        height: auto;
        /* ИСПРАВЛЕНО (Задача 2): Убираем нижний отступ у картинки для сближения с подписью */
        margin: 30px 0 0 0;
        border-radius: 8px;
    }





    #mural-modal-close::before,
    #mural-modal-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 3px;
        /* Делаем линии темными */
        background-color: rgba(0, 0, 0, 0.7);
        transition: background-color 0.2s ease;
    }

    #mural-modal-close::before { transform: rotate(45deg); }
    #mural-modal-close::after { transform: rotate(-45deg); }

    #mural-modal-close:hover { transform: rotate(90deg); }
    #mural-modal-close:hover::before,
    #mural-modal-close:hover::after {
        /* Делаем линии ярче при наведении */
        background-color: #000;
    }
   
   /* Крестик для основного окна (только десктоп) */
   @media (min-width: 1024px) {
       .modal-close {
           position: absolute;
           top: 20px;
           right: 20px;
           width: 30px;
           height: 30px;
           cursor: pointer;
           background: none;
           border: none;
           z-index: 1001;
           transition: transform 0.3s ease-in-out;
           font-size: 0;
       }
   
       .modal-close::before,
       .modal-close::after {
           content: '';
           position: absolute;
           top: 50%;
           left: 0;
           width: 100%;
           height: 3px;
           background-color: rgba(255, 255, 255, 0.9);
           transition: background-color 0.2s ease;
       }
   
       .modal-close::before { transform: rotate(45deg); }
       .modal-close::after { transform: rotate(-45deg); }
   
       .modal-close:hover { transform: rotate(90deg); }
       .modal-close:hover::before,
       .modal-close:hover::after { background-color: #fff; }
   }
   
   
    /* ==========================================================================
    9. ТАЙМЛАЙН (TIMELINE)
    ========================================================================== */

    .timeline {
        position: absolute;
        top: 0;
        right: 20px;
        height: 800px;
        width: 150px;
        display: flex;
        pointer-events: none;
        z-index: 8;
        /* Явный сброс мобильных стилей для десктопа */
        background: none;
        padding-top: 0;
        bottom: auto;
        left: auto;
    }

    .timeline-viewport {
        height: 100%;
        width: 100%;
        position: relative;
        overflow: hidden;
        
        /* Маска накладывается на ОКНО просмотра, а не на контент */
        /* Градиент: прозрачный (0%) -> черный (15%) -> черный (85%) -> прозрачный (100%) */
        mask-image: linear-gradient(to bottom, 
            transparent 0%, 
            black 15%, 
            black 85%, 
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(to bottom, 
            transparent 0%, 
            black 15%, 
            black 85%, 
            transparent 100%
        );
    }

    .timeline-content {
        position: relative;
        width: 100%;
        height: 100%;
        
        /* Настройка маски */
        mask-image: linear-gradient(to bottom, 
            /* 1. ОТСТУП СВЕРХУ: Первые 50px вообще невидимы (сдвигаем маску ниже) */
            transparent 50px, 
            
            /* 2. КОНЕЦ РАЗМЫТИЯ СВЕРХУ: 50px (отступ) + 150px (длина размытия) = 200px */
            black 200px, 
            
            /* 3. НАЧАЛО РАЗМЫТИЯ СНИЗУ: За 150px до самого конца */
            black calc(100% - 150px), 
            
            /* 4. КОНЕЦ СНИЗУ: Полная прозрачность в самом низу */
            transparent 100%
        );
        
        -webkit-mask-image: linear-gradient(to bottom, 
            transparent 80px, 
            black 400px, 
            black calc(100% - 150px), 
            transparent 100%
        );
    }

    .timeline-track {
        /* Просто скрываем вертикальную линию, как ты просил */
        display: none; 
    }

    .timeline-entry {
        position: absolute;
        width: 100%;
        height: 0;
    }

    .tick {
        position: absolute;
        height: 1px;
        right: 0;
        transform-origin: right center;
        
        /* ОПТИМИЗАЦИЯ: Сообщаем браузеру, что элемент будет меняться */
        will-change: transform, background-color;
        /* Включаем GPU-ускорение */
        transform: translateZ(0); 
        backface-visibility: hidden;
    }
    .tick.month { width: 10px; }
    .tick.year { width: 20px; }

    .year-label {
        position: absolute;
        right: 40px;
        width: 100px;
        height: 40px;
        transform-origin: right center;
        overflow: visible;
        
        /* ОПТИМИЗАЦИЯ */
        will-change: transform;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Стили для самого текста внутри SVG */
    .year-label text {
        font-family: var(--font-family); /* Наследуем основной шрифт */
        font-size: 20px;
        fill: var(--timeline-text-color); /* Вместо 'color' в SVG используется 'fill' */
        transition: fill 0.3s ease-in-out; /* Анимируем цвет заливки */
    }
    
    /* Правило для смены цвета в "темном" режиме */
    .timeline.timeline-dark .year-label text {
        fill: #1a2b4a !important;
    }

    .timeline .tick,
    .timeline .timeline-track {
        transition: background-color 0.3s ease-in-out;
        background-color: var(--timeline-text-color);
    }

    .timeline.timeline-dark .year-label {
        color: #1a2b4a !important;
    }

    .timeline.timeline-dark .tick,
    .timeline.timeline-dark .timeline-track {
        background-color: #1a2b4a !important;
    }
   
   
   /* ==========================================================================
      10. АНИМАЦИИ (KEYFRAMES)
      ========================================================================== */
   
   @keyframes arrow-flow {
       0% {
           transform: translateY(5px);
           opacity: 0;
       }
       50% {
           transform: translateY(0);
           opacity: 1;
       }
       100% {
           transform: translateY(-2px);
           opacity: 0;
       }
   }
   
   @keyframes glitch-top-fixed {
       2%, 64% { transform: translate(2px, -2px); }
       4%, 60% { transform: translate(-2px, 2px); }
       62% { transform: translate(10px, -1px) skew(-10deg); }
   }
   
   @keyframes glitch-bottom-fixed {
       2%, 64% { transform: translate(-2px, 0); }
       4%, 60% { transform: translate(-2px, 0); }
       62% { transform: translate(-15px, 5px) skew(10deg); }
   }
   
   
/* ==========================================================================
    11. АДАПТИВНЫЕ СТИЛИ (MOBILE & TABLET)
    ========================================================================== */
   
@media (max-width: 1023px) {
   
    /* --- 11.1 Общие и фоновые стили --- */

    /* --- КОРРЕКЦИЯ ПОЛОЖЕНИЯ ОБЛАКОВ НА МОБИЛЬНЫХ --- */
    .cloud-back {
        top: 45vw; 
    }

    .cloud-front {
        /* Опускаем облака ниже. Можете менять это значение. */
        top: 72vw; 
    }

    body {
        background: linear-gradient(to top, #00103e 30%, #a1c4fd 100%);
    }
    .site-wrapper, main.content-center::before {
        background: none;
    }
    /* Заглушка для верхней части экрана */
    .site-wrapper::after {
    content: '';
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 500px;
    background-color: white;
    z-index: 13; 
    }
    .content-center {
        width: 100%;
        padding: 0 20px;
    }
    main.content-center {
        position: relative;
    }

    main.content-center::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    /* Фолбэк для старых браузеров */
    background-image: url('img/bg_top_mobile.jpeg');
    /* Для современных браузеров */
    background-image: -webkit-image-set(
        url('img/bg_top_mobile.avif') type('image/avif'),
        url('img/bg_top_mobile.webp') type('image/webp'),
        url('img/bg_top_mobile.jpeg') type('image/jpeg')
    );
    background-image: image-set(
        url('img/bg_top_mobile.avif') type('image/avif'),
        url('img/bg_top_mobile.webp') type('image/webp'),
        url('img/bg_top_mobile.jpeg') type('image/jpeg')
    );
    background-position: center bottom;
    background-size: 130% auto;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    }

    /* --- 11.2 Адаптация первого экрана (Hero) --- */
    .hero {
        padding: 40px 20px 170px;
        height: auto;
        min-height: 250px;
        margin-top: calc((50vw * 220 / 280) * -1.5);
        background-image: image-set(
            url('img/bg_bottom_mobile.avif') type('image/avif'),
            url('img/bg_bottom_mobile.webp') type('image/webp'),
            url('img/bg_bottom_mobile.jpeg') type('image/jpeg')
        );
        background-position: center calc((50vw * 220 / 280) * 1.5);
        background-size: 130% auto;
        background-repeat: no-repeat;
        z-index: 11;
    }
    .hero h1 {
        white-space: normal;
        text-transform: uppercase;
        font-size: clamp(3rem, 22vw, 8rem);
        line-height: 0.8;
        z-index: 11;
    }
    .hero h1 span {
        display: block;
        white-space: nowrap;
    }
    .hero p {
        font-size: 16px;
        position: relative;
        z-index: 13;
    }
    .scroll-indicator {
        position: relative;
        z-index: 13;
    }
    .overlay-person {
        height: auto;
        z-index: 12;
    }
    #person1 {
        width: 35vw;
        top: 33vw;
        right: 0vw;
    }
    #person2 {
        width: 16vw;
        top: 37vw;
        left: 5vw;
    }

    /* --- 11.3 Адаптация сетки дома --- */
    .house {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        z-index: 10;
        line-height: 0;
    }
    .window {
        height: 0;
        padding-bottom: calc(100% * 220 / 280);
        position: relative;
        border: none;
        background-size: cover;
        margin: -1px;
    }
    .window-interior {
        width: 69.3%;
        height: 65.5%;
    }
    .mural {
        grid-column: span 2;
        width: 100%;
        height: 0;
        padding-bottom: calc(100% * 660 / 559);
        position: relative;
    }
    .house-entrance {
        grid-column: span 2;
        width: 100%;
        height: 0;
        padding-bottom: calc(100% * 330 / 840 * 1.5);
        position: relative;
        background-image: image-set(
            url('img/entrance_mobile.avif') type('image/avif'),
            url('img/entrance_mobile.webp') type('image/webp'),
            url('img/entrance_mobile.jpeg') type('image/jpeg')
        );
    }

    /* --- 11.4 Адаптация подвала (Roof) --- */
    .roof { /* Это ваш header с текстом "Время идёт..." */
    /* 1. Сдвигаем ВНУТРЕННИЙ контент вниз */
    padding: 30vw 20px;

    /* 2. КОМПЕНСИРУЕМ пространство, чтобы дом остался на месте */
    margin-bottom: -54vw; 
    
    z-index: 14;
    }
    .creators-block {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* --- 11.5 Адаптация модальных окон --- */
    .modal-wrapper {
        width: 90vw;
    }
    .modal-content {
    flex-direction: column;
    
    /* 1. Включаем режим наложения. 
        Скроллбар будет лежать ПОВЕРХ контента, фон не будет обрезаться. */
    overflow-y: overlay !important;
    
    /* Убираем горизонтальный скролл */
    overflow-x: hidden;
    
    background: #1D1D1D;
    transform: none;
    
    /* Для плавности на iOS */
    -webkit-overflow-scrolling: touch;

    }

    /* --- НАСТРОЙКА СКРОЛЛБАРА (OVERLAY MODE) --- */
    
    /* 2. Делаем скроллбар тонким (4px) */
    .modal-content::-webkit-scrollbar {
        width: 4px;
        background: transparent; /* Сам контейнер скролла прозрачный */
    }

    /* 3. Трек (дорожка) ПОЛНОСТЬЮ прозрачная и без отступов */
    /* Важно: убираем margin, чтобы трек прижался к краю и не сдвигал контент */
    .modal-content::-webkit-scrollbar-track {
        background: transparent;
        margin: 20px 0; /* Оставляем отступ только сверху/снизу для красоты */
    }

    /* 4. Ползунок */
    .modal-content::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.4); 
        border-radius: 10px;
        
        /* ХИТРОСТЬ: Добавляем прозрачную границу вокруг ползунка.
        Это заставляет браузер рендерить его "внутри" трека корректнее в режиме overlay */
        border: 1px solid transparent;
        background-clip: content-box;
    }

    .modal-media-area {
        order: 1;
        flex-grow: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    /* Мобильное: увеличиваем блок ТВ+плеер примерно на 20% */
    #modal-overlay:not(.video-only) .modal-media-area .media-wrapper {
        transform: scale(1.2);
        transform-origin: top center;
        margin-bottom: 10vw; /* чтобы не налезало на "поделиться" */
    }

    #modal-overlay.video-only .modal-media-area .media-wrapper {
        transform: none;
        margin-bottom: 0;
    }

    .media-fullscreen-toggle {
        display: flex;
    }


    .media-wrapper {
        min-height: 0;
        order: 1;
    }
    .share-block {
        position: static;
        order: 2;
        align-items: flex-start;
        padding: 45px 20px 20px 20px;
    }

    /* video-only: убираем лишний "воздух" между видео и шарингом */
    #modal-overlay .modal-media-area .media-wrapper {
        margin-bottom: 0 !important;
    }

    #modal-overlay.video-only .modal-media-area .share-block {
        margin-top: clamp(-28px, -4vw, -12px);
        padding-top: 0;
    }

    .modal-story {
        order: 2;
        width: 100%;
        height: auto;
        overflow-y: visible;
    }
    .modal-story > div {
        padding: 0 20px 30px 20px;
        min-height: 0;
    }
    .modal-close {
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 1001;
        color: #fff;
        background-color: rgb(25, 25, 25);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        border: 2px solid rgb(25, 25, 25);
    }
    .modal-story::before,
    .modal-story::after {
        display: none;
    }

    /* ИСПРАВЛЕНО: Уменьшаем размер заголовка в мурале только для мобильных */
    .mural-modal-story h3 {
        font-size: 1.8rem; /* На десктопе сейчас 2.5rem */
    }
    .mural-modal-story {
    padding: 0px 30px;
    }
    .mural-modal-story div:not(.caption-text) {
    font-size: 17px;
    line-height: 1.5;
    color: #1a1a1a;
    margin-top: 22px;
    margin-bottom: 0;
    }
    

    /* --- 11.6 Адаптация таймлайна --- */
    .timeline {
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        right: auto;
        width: 100%;
        height: 120px;
        padding-top: 20px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 20%, transparent 100%);
        pointer-events: auto;
        z-index: 20;
        min-height: 0;
    }
    .timeline-viewport {
    /* Отключаем маску для мобильных телефонов */
    mask-image: none;
    -webkit-mask-image: none;
    overflow: hidden;
    }
    .timeline-content {
    display: flex;
    width: auto;
    height: 100%;
    
    /* ОБЯЗАТЕЛЬНО: Отключаем эту маску на мобильных */
    mask-image: none;
    -webkit-mask-image: none;
    }
    .timeline-track {
    width: 100%;
    height: 1px;
    top: 60px;
    left: 0;
    
    /* ОБЯЗАТЕЛЬНО: Убираем вертикальную маску на мобильных, иначе линия исчезнет */
    mask-image: none;
    -webkit-mask-image: none;
    }
    .timeline-entry {
        position: relative;
        top: auto;
        left: auto;
        height: 100%;
        width: 180px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }
    .tick {
    position: absolute !important;
    width: 1px !important;
    transform-origin: center bottom !important;
    }
    .tick.month {
        height: 6px !important;
        top: 54px !important;
    }
    .tick.year {
        height: 12px !important;
        top: 48px !important;
    }
    .year-label {
    position: absolute; right: auto;
    top: 25px; /* Приподняли на 5px (было 25px, но с новой точкой роста лучше 20px) */
    text-align: center; width: 100%;
    transform-origin: center bottom !important; /* Расти от нижней грани вверх */
    }
        /* --- FIX: Плашка "Скопировано" на мобильных --- */
    .share-button .copy-feedback {
        /* Отменяем позицию "справа" */
        left: 50% !important; 
        top: auto !important;
        
        /* Ставим позицию "сверху" */
        bottom: 130% !important; 
        
        /* Центруем */
        margin-left: 0 !important;
        transform: translateX(-50%) !important;
    }

    /* Рисуем маленький треугольничек снизу (опционально, для красоты) */
    .share-button .copy-feedback::after {
        content: '';
        position: absolute;
        top: 100%; /* Снизу плашки */
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #ffffff transparent transparent transparent;
    }
       
}

/* --- ФРАЗА НА ОКНЕ --- */
.window-phrase {
    position: absolute;
    z-index: 10; 
    pointer-events: none; 
    
    /* == НАСТРОЙКА ПОЛОЖЕНИЯ И РАЗМЕРА == */
    top: 82%;          
    left: 50%;      
    transform: translate(-50%, -50%); 
    width: 80%;        
    text-align: center; 
    
    /* == ТИПОГРАФИКА == */
    font-family: var(--font-family); /* Или другой шрифт */
    font-size: 16px;  
    font-weight: 400;
    line-height: 1.2;
    color: rgba(255 255 255 / 51%); /* Белый полупрозрачный */
    /*mix-blend-mode: overlay; */
}



.window-phrase .word-wrap {
    display: inline-block;
    white-space: nowrap; 
}

/* Стиль для каждой буквы (класс .char) */
.window-phrase .char {
    opacity: 0;
    display: inline-block;
    transition: opacity 0.1s ease, transform 0.2s ease;
    transform: scale(1.3);
}

.window-phrase .char.visible {
    opacity: 1;
    transform: scale(1);
}

/* --- ПЛАВНОЕ ИСЧЕЗНОВЕНИЕ --- */
/* Когда мы добавляем этот класс JS-ом, буквы плавно гаснут */
.window-phrase.fading-out .char {
    opacity: 0 !important;
    transform: scale(1.1); /* Чуть увеличиваются при исчезновении (эффект дымки) */
    transition: opacity 0.5s ease, transform 0.5s ease !important; /* Время исчезновения */
}

/* --- АДАПТИВ ФРАЗЫ --- */
@media (max-width: 1023px) {
    .window-phrase {
        font-size: 11px !important; /* Был 18px, стал меньше */
        line-height: 1.1 !important;
        width: 80% !important; /* Чуть шире область, чтобы влезало */
    }
}