/* =========================================
   TSK STYLE - "Живой Ритм" Palette
   Warm Milk + Graphite + Terracotta + Beige
   ========================================= */

/* 1. VARIABLES & RESET */
:root {
    /* Colors: Живой Ритм */
    --color-primary: #C0563E;
    --color-primary-hover: #A84632;
    --color-accent: #E8DCC4;
    --color-bg: #F9F7F2;
    --color-bg-alt: #EDEBE6;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-muted: #555555;
    --color-border: rgba(26, 26, 26, 0.1);
  
    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --fs-base: 1rem;
    --fs-sm: 0.875rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2.5rem;
    --fs-3xl: 3.5rem;
    --lh-base: 1.7;
    --ls-heading: 0.02em;
  
    /* Spacing & Layout */
    --container-width: 1200px;
    --section-padding: 4rem 0;
    --border-radius: 12px;
    --header-height: 5rem;
  
    /* Effects */
    --shadow-card: 0 4px 20px rgba(26, 26, 26, 0.06);
    --shadow-hover: 0 8px 30px rgba(192, 86, 62, 0.12);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

/* ШРИФТЫ .woff2 INTER & COMORANT GARAMOND */
/* inter-300 - cyrillic_latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    src: url('../fonts/inter-v20-cyrillic_latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* inter-regular - cyrillic_latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/inter-v20-cyrillic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* inter-500 - cyrillic_latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    src: url('../fonts/inter-v20-cyrillic_latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* inter-600 - cyrillic_latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url('../fonts/inter-v20-cyrillic_latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* inter-700 - cyrillic_latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/inter-v20-cyrillic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* cormorant-garamond-regular - cyrillic_latin */
  @font-face {
      font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
      font-family: 'Cormorant Garamond';
      font-style: normal;
      font-weight: 400;
      src: url('../fonts/cormorant-garamond-v21-cyrillic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* cormorant-garamond-600 - cyrillic_latin */
    @font-face {
      font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
      font-family: 'Cormorant Garamond';
      font-style: normal;
      font-weight: 600;
      src: url('../fonts/cormorant-garamond-v21-cyrillic_latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* cormorant-garamond-700 - cyrillic_latin */
    @font-face {
      font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
      font-family: 'Cormorant Garamond';
      font-style: normal;
      font-weight: 700;
      src: url('../fonts/cormorant-garamond-v21-cyrillic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    
  /* Modern Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 2px; }

/* 2. LAYOUT UTILITIES */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: var(--section-padding); position: relative; }
.section--alt { background-color: var(--color-bg-alt); }
.section--surface { background-color: var(--color-surface); }

.section-header { text-align: center; margin-bottom: 2.5rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.section-header h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  letter-spacing: var(--ls-heading);
  margin-bottom: 1rem;
  color: var(--color-text); /* Графит вместо золотого градиента */
}
.section-header p { font-size: var(--fs-lg); color: var(--color-text-muted); }

/* Grid System */
.grid { display: grid; gap: 2rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* 3. COMPONENTS (Light Theme Adaptation) */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 2.5rem; font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--border-radius); border: none; cursor: pointer;
  transition: all var(--transition-base); min-height: 48px;
}
.btn--primary {
  background: var(--color-primary); color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(192, 86, 62, 0.25);
}
.btn--primary:hover {
  background: var(--color-primary-hover); transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(192, 86, 62, 0.35);
}
.btn--accent {
  background: var(--color-accent); color: var(--color-text); font-weight: 700;
  border: 1px solid rgba(26,26,26,0.1);
}
.btn--accent:hover { background: #DFD1B7; transform: translateY(-2px); }
.btn--outline {
  background: transparent; color: var(--color-text);
  border: 2px solid var(--color-border);
}
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--border-radius); overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: rgba(192, 86, 62, 0.2); }
.card__image { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card__content { padding: 2rem; }
.card__title { font-family: var(--font-heading); font-size: var(--fs-xl); margin-bottom: 0.75rem; color: var(--color-text); }
.card__text { color: var(--color-text-muted); margin-bottom: 1.5rem; font-size: var(--fs-sm); }

/* Spotlight */
.spotlight { display: flex; align-items: center; gap: 4rem; margin-bottom: 5rem; }
.spotlight:nth-child(even) { flex-direction: row-reverse; }
.spotlight__image { flex: 1; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-card); }
.spotlight__image img { width: 100%; height: 100%; object-fit: cover; }
.spotlight__content { flex: 1; }
.spotlight__content h3 { font-family: var(--font-heading); font-size: var(--fs-2xl); margin-bottom: 1.25rem; color: var(--color-text); }
.spotlight__content p { margin-bottom: 2rem; color: var(--color-text-muted); font-size: var(--fs-lg); }

@media (max-width: 768px) {
  .spotlight, .spotlight:nth-child(even) { flex-direction: column; gap: 2rem; }
}

/* Features */
.feature { text-align: center; padding: 2.5rem 1.5rem; border-radius: var(--border-radius); transition: all var(--transition-base); }
.feature:hover { background: rgba(232, 220, 196, 0.2); }
.feature__icon { font-size: 2.5rem; margin-bottom: 1.25rem; display: inline-block; color: var(--color-primary); }
.feature__title { font-family: var(--font-heading); font-size: var(--fs-lg); margin-bottom: 0.75rem; color: var(--color-text); }
.feature__text { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* Form (Light) */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: var(--fs-sm); color: var(--color-text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 1rem 1.25rem;
  background: var(--color-surface); border: 2px solid var(--color-border);
  border-radius: var(--border-radius); font-size: var(--fs-base); color: var(--color-text);
  transition: all var(--transition-base); min-height: 48px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary); 
  box-shadow: 0 0 0 3px rgba(192, 86, 62, 0.1); outline: none;
}
.form-checkbox { display: flex; align-items: flex-start; gap: 0.75rem; font-size: var(--fs-sm); color: var(--color-text-muted); }
.form-checkbox input { margin-top: 0.2rem; min-height: auto; width: auto; accent-color: var(--color-primary); }

/* =========================================
   TABLE (Light) + MOBILE CARD TRANSFORM
   ========================================= */
   .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-alt);
    color: var(--color-text);
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--fs-sm);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tr:nth-child(even) {
    background: rgba(237, 235, 230, 0.3);
}

tr:hover {
    background: rgba(192, 86, 62, 0.05);
}

/* Подзаголовок внутри ячейки (возраст, адрес) */
.td-sub {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* =========================================
   MOBILE: Table → Card List (no sidescroll)
   ========================================= */
@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: visible; /* Убираем горизонтальный скролл */
        border: none;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    /* Скрываем заголовки таблицы на мобильных */
    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    tr {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        margin-bottom: 1rem;
        padding: 0;
        box-shadow: var(--shadow-card);
    }

    tr:nth-child(even) {
        background: var(--color-surface); /* Убираем чередование цветов */
    }

    tr:hover {
        background: var(--color-surface);
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid var(--color-border);
        text-align: right;
        font-size: var(--fs-sm);
    }

    td:last-child {
        border-bottom: none;
    }

    /* Псевдоэлемент с названием колонки из data-label */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.05em;
        color: var(--color-text-muted);
        text-align: left;
        flex-shrink: 0;
        min-width: 80px;
    }

    /* Выделяем первую ячейку (группа/возраст) как заголовок карточки */
    td:first-child {
        background: var(--color-bg-alt);
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        padding: 1rem 1.25rem;
    }

    td:first-child strong {
        font-size: var(--fs-base);
    }

    .td-sub {
        margin-top: 0;
        margin-left: auto;
    }
}

/* 4. HEADER & NAVIGATION */
.header { position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height); z-index: 1000; transition: all var(--transition-base); }
.header--transparent { background: transparent; }
.header--solid { background: rgba(249, 247, 242, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--color-border); box-shadow: 0 2px 20px rgba(0,0,0,0.05); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.header__logo {
    display: inline-flex;      /* ← Было block/flex без направления */
    align-items: center;       /* ← Вертикальное центрирование */
    gap: 0.75rem;              /* ← Отступ между иконкой и текстом */
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.header__logo:hover {
    opacity: 0.8;
}

.header__logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;            /* ← Иконка не сжимается при узком экране */
}

.header__logo-text {
    line-height: 1;            /* ← Убираем лишние отступы текста */
}

/* Адаптация для мобильных: уменьшаем иконку и шрифт */
@media (max-width: 980px) {
    .header__logo {
        font-size: 1.35rem;
        gap: 0.5rem;
    }
    
    .header__logo-img {
        width: 32px;
        height: 32px;
    }
}
.nav__list { display: flex; gap: 2.5rem; align-items: center; }
.nav__link { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); transition: color var(--transition-base); }
.nav__link:hover { color: var(--color-primary); }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); margin: 5px 0; transition: var(--transition-base); }

@media (max-width: 980px) {
    /* Блокировка скролла сайта при открытом меню */
    body.menu-is-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
        /* top: var(--scroll-y, 0); /* ← Берёт значение из JS */
        /* left: 0;*/
    
    }

    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: var(--color-bg);
        padding: calc(var(--header-height) + 2rem) 2rem 2rem;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity var(--transition-base), visibility var(--transition-base);
        z-index: 999;
        display: flex;
        flex-direction: column;       /* ← Логотип сверху, список ниже */
        align-items: center;
        justify-content: center;
    }

    .nav.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav__list {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        list-style: none; /* Убедимся, что маркеры скрыты */
        margin: 0;
        padding: 0;
    }

    /* =========================================
       NAV LINKS - Stagger Animation Fix
       ========================================= */
    
    /* Базовое состояние: скрыто + подготовлено к анимации */
    .nav__link {
        color: var(--color-text) !important;
        font-size: var(--fs-xl);
        font-family: var(--font-heading);
        text-align: center;
        width: 100%;
        display: block;
        
        /* КЛЮЧЕВОЕ: начальное состояние для stagger */
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, 
                    transform 0.4s ease, 
                    color var(--transition-base);
    }

    /* Видимое состояние при открытом меню */
    .nav.is-open .nav__link {
        opacity: 1;
        transform: translateY(0);
    }

    /* ⚠️ ИСПРАВЛЕНО: nth-child применяется к LI, а не к .nav__link */
    .nav.is-open .nav__list li:nth-child(1) .nav__link { transition-delay: 0.15s; }
    .nav.is-open .nav__list li:nth-child(2) .nav__link { transition-delay: 0.22s; }
    .nav.is-open .nav__list li:nth-child(3) .nav__link { transition-delay: 0.29s; }
    .nav.is-open .nav__list li:nth-child(4) .nav__link { transition-delay: 0.36s; }
    .nav.is-open .nav__list li:nth-child(5) .nav__link { transition-delay: 0.43s; }
    .nav.is-open .nav__list li:nth-child(6) .nav__link { transition-delay: 0.50s; }
    .nav.is-open .nav__list li:nth-child(7) .nav__link { transition-delay: 0.57s; }

    /* При закрытии — убираем задержку, пункты исчезают одновременно */
    .nav:not(.is-open) .nav__link {
        transition-delay: 0s !important;
    }

    /* Кнопка "Записаться" */
    .nav__link.btn--accent {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: auto;
        min-width: 200px;
        margin-top: 1rem;
        text-align: center;
    }

    /* Бургер */
    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .menu-toggle span {
        transition: transform var(--transition-base), opacity var(--transition-base);
    }

    .menu-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Логотип в мобильном меню */
    .nav__logo-mobile {
        display: block;
        margin-bottom: 2rem;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    /* Появление логотипа при открытии меню (раньше всех пунктов) */
    .nav.is-open .nav__logo-mobile {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.05s; /* Появляется первым, до пунктов меню */
    }

    .nav__logo-mobile img {
        width: 120px;
        height: auto;
        display: block;
    }

    /* Корректировка padding .nav, чтобы логотип не прилипал к верху */
    .nav {
        padding-top: calc(var(--header-height) + 1rem);
    }
    
    /* ♿ Доступность: отключение анимации */
    @media (prefers-reduced-motion: reduce) {
        .nav {
            transition: none !important;
        }
        .nav__link {
            transition: none !important;
            opacity: 1 !important;
            transform: none !important;
        }
        .menu-toggle span {
            transition: none !important;
        }
    }    
}

/* Скрываем мобильный логотип на десктопе */
@media (min-width: 981px) {
    .nav__logo-mobile {
        display: none;
    }
}

/* 5. HERO SECTION */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative;
  background: linear-gradient(rgba(249,247,242,0.8), rgba(249,247,242,0.9)), url('../images/hero/hero.jpg') center/cover no-repeat;
  color: var(--color-text); padding: calc(var(--header-height) + 2rem) 1.5rem 4rem;
}
.hero__badge {
  display: inline-block; background: var(--color-accent); color: var(--color-text);
  padding: 0.5rem 1.75rem; border-radius: 50px; font-weight: 700;
  font-size: var(--fs-sm); margin-bottom: 2rem; text-transform: uppercase; letter-spacing: 0.1em;
}
.hero__title { font-family: var(--font-heading); font-size: var(--fs-3xl); line-height: 1.1; margin-bottom: 1.5rem; font-weight: 700; color: var(--color-text); }
.hero__subtitle { font-size: var(--fs-lg); color: var(--color-text-muted); margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Hero Animation Lines (Graphite instead of Gold) */
/* =========================================
   HERO SEQUENCE ANIMATION
   Order: Lines → Logo → H1+Subtitle → Buttons
   ========================================= */

/* Базовое состояние: всё скрыто до начала анимации */
.hero__line,
.hero__logo-text,
.hero__title,
.hero__subtitle,
.hero__actions {
    opacity: 0;
}

/* 1. ЛИНИИ (0s delay, 1s duration) */
.hero__line {
    position: absolute;
    left: 0;
    height: 2px;
    background: var(--color-text);
    width: 0;
    animation: lineExpand 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0s;
}
.hero__line--top { top: 0; }
.hero__line--bottom { bottom: 0; right: 0; left: auto; }

@keyframes lineExpand {
    from { width: 0; opacity: 1; }
    to { width: 100%; opacity: 1; }
}

/* 2. ЛОГОТИП "ТСК Стиль" (1s delay, 1s duration) */
.hero__logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0;
    animation: fadeScale 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1s;
}

/* 3. H1 + SUBTITLE (2s delay, 0.5s duration) */
.hero__title {
    animation: fadeInUp 0.5s ease-out forwards;
    animation-delay: 2s;
}

.hero__subtitle {
    animation: fadeInDown 0.5s ease-out forwards;
    animation-delay: 2s;
}

/* 4. BUTTONS (2.5s delay, 0.5s duration) */
.hero__actions {
    animation: fadeInUp 0.5s ease-out forwards;
    animation-delay: 2.5s;
}

/* Keyframes */
@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Preload state: блокируем анимации до загрузки страницы */
body.is-preload .hero__line,
body.is-preload .hero__logo-text,
body.is-preload .hero__title,
body.is-preload .hero__subtitle,
body.is-preload .hero__actions {
    animation-play-state: paused !important;
    opacity: 0 !important;
    width: 0 !important;
}

/* Reduced motion: мгновенное появление без анимаций */
@media (prefers-reduced-motion: reduce) {
    .hero__line,
    .hero__logo-text,
    .hero__title,
    .hero__subtitle,
    .hero__actions {
        animation: none !important;
        opacity: 1 !important;
        width: 100% !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
  .hero__title { font-size: var(--fs-2xl); }
  .hero { min-height: 80vh; }
}

/* 6. FOOTER */
.footer { background: var(--color-text); color: rgba(255,255,255,0.7); padding: 5rem 0 2rem; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 3rem; margin-bottom: 4rem; }
.footer__title { font-family: var(--font-heading); font-size: var(--fs-lg); margin-bottom: 1.5rem; color: var(--color-accent); }
.footer__links li { margin-bottom: 0.75rem; }
.footer__links a { color: rgba(255,255,255,0.7); transition: color var(--transition-base); }
.footer__links a:hover { color: var(--color-accent); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; text-align: center; font-size: var(--fs-sm); }

/* 7. PAGE-SPECIFIC */
.page-hero {
  padding: calc(var(--header-height) + 5rem) 0 5rem;
  background: linear-gradient(rgba(249,247,242,0.85), rgba(249,247,242,0.95)), url('../images/hero/hero.jpg') center/cover no-repeat;
  text-align: center; color: var(--color-text);
}
.page-hero h1 { font-family: var(--font-heading); font-size: var(--fs-3xl); margin-bottom: 1rem; color: var(--color-text); }
.breadcrumbs { font-size: var(--fs-sm); color: var(--color-text-muted); margin-bottom: 1.5rem; }
.breadcrumbs a:hover { color: var(--color-primary); }

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

/* =========================================
   ABOUT LIST + IPER-STYLE FAN ANIMATION
   ========================================= */

   .about-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 4rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.about-item:nth-child(even) {
    flex-direction: row-reverse;
}

.about-content {
    flex: 1 1 0;
    min-width: 0;
}

.card-fan-wrapper {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 320px;
    perspective: 1000px;
}

.card-fan {
    position: relative;
    width: 180px;
    height: 240px;
}

.fan-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 4px solid var(--color-surface);
    transition:
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.5s ease,
        box-shadow 0.5s ease,
        border-color 0.5s ease;
    transform-origin: bottom center;
    cursor: pointer;
    
    /* Начальное состояние: сложены в стопку */
    transform: rotate(0deg) translateX(0) scale(0.95);
    opacity: 0;
}

/* Раскрытое состояние веера: от задней карты к передней, по часовой стрелке. */
.about-item.is-visible .fan-card--1 {
    transform: rotate(0deg) translateX(0) translateY(0) scale(0.95);
    opacity: 1;
    z-index: 1;
    transition-delay: 0.1s;
    box-shadow: -5px 5px 20px rgba(26, 26, 26, 0.15);
}

.about-item.is-visible .fan-card--2 {
    transform: rotate(6deg) translateX(10px) translateY(0) scale(0.97);
    opacity: 1;
    z-index: 2;
    transition-delay: 0.25s;
    box-shadow: 0 10px 30px rgba(26, 26, 26, 0.2);
}

.about-item.is-visible .fan-card--3 {
    transform: rotate(12deg) translateX(20px) translateY(0) scale(1);
    opacity: 1;
    z-index: 3;
    transition-delay: 0.4s;
    box-shadow: 5px 5px 20px rgba(26, 26, 26, 0.15);
}

@media (hover: hover) and (pointer: fine) {
    .card-fan:hover .fan-card--1 {
        transform: rotate(0deg) translateX(-174px) translateY(0) scale(0.92);
        transition-delay: 0s;
    }

    .card-fan:hover .fan-card--2 {
        transform: rotate(0deg) translateX(0) translateY(0) scale(0.92);
        transition-delay: 0.05s;
    }

    .card-fan:hover .fan-card--3 {
        transform: rotate(0deg) translateX(174px) translateY(0) scale(0.92);
        transition-delay: 0.1s;
    }
}

/* Click/tap brings the selected photo forward at double size. */
.card-fan .fan-card.fan-card--active {
    transform: rotate(0deg) translateX(0) translateY(-12px) scale(2);
    z-index: 10;
    box-shadow: 0 20px 50px rgba(192, 86, 62, 0.3);
    border-color: var(--color-primary);
    transition-delay: 0s;
}

/* Адаптивность */
@media (max-width: 768px) {
    .about-item, 
    .about-item:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .card-fan-wrapper {
        flex: 0 0 auto;
        width: 220px;
        height: 260px;
    }
    
    .card-fan {
        width: 140px;
        height: 190px;
    }
    
    .card-fan .fan-card.fan-card--active {
        transform: rotate(0deg) translateX(0) translateY(-8px) scale(2);
    }
}

/* =========================================
   WHY US CARDS ANIMATION (FIXED)
   ========================================= */

/* Начальное состояние: карточка занимает место, но контент скрыт */
#why-us .card {
  opacity: 0;
  transform: translateX(-40px);
  /* Фиксируем высоту, чтобы избежать скачков */
  min-height: 280px; 
  will-change: transform, opacity;
}

/* Чётные карточки выезжают справа */
#why-us .card:nth-child(even) {
  transform: translateX(40px);
}

/* Активное состояние: плавное появление БЕЗ изменения размеров */
#why-us .card.is-visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Контент карточки: скрыт изначально */
#why-us .card__content {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

/* Контент появляется ПОСЛЕ карточки */
#why-us .card.is-visible .card__content {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.75s ease-out 0.5s, transform 0.75s ease-out 0.5s;
}

/* Hover ТОЛЬКО после завершения анимации появления */
#why-us .card.is-visible:hover {
  transform: translateY(-6px) !important;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #why-us .card,
  #why-us .card__content {
      opacity: 1 !important;
      transform: none !important;
      transition: none !important;
      min-height: auto;
  }
}

/* =========================================
   COACHES - MOBILE FIRST BASE STYLES
   Horizontal Flip Carousel (Default View)
   ========================================= */

/* Заголовок секции (мобильная версия) */
.coaches-header {
  text-align: center;
  margin-bottom: 2rem;
}

.coaches-header h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.coaches-header p {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
}

/* Карусель */
.cm-carousel {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  scroll-padding-inline: 1.5rem;
  
  /* Скрытие скроллбара */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cm-carousel::-webkit-scrollbar {
  display: none;
}

/* Карточка */
.cm-card {
  flex: 0 0 80vw;
  max-width: 320px;
  aspect-ratio: 3/4;
  scroll-snap-align: center;
  perspective: 1000px;
  cursor: pointer;
}

.cm-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
}

.cm-card.is-flipped .cm-card__inner {
  transform: rotateY(180deg);
}

.cm-card__front,
.cm-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.cm-card__front {
  background: var(--color-surface);
}

.cm-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.6s ease;
}

.cm-card.is-flipped .cm-card__img {
  opacity: 0.5;
}

.cm-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cm-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  color: #fff;
  font-weight: 700;
}

.cm-card__role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: 600;
}

.cm-card__back {
  background: var(--color-text);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cm-card__back-content {
  color: #fff;
  width: 100%;
}

.cm-card__back-content h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 0.5rem;
}

.cm-card__back-content ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cm-card__back-content li {
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.cm-card__back-content strong {
  color: var(--color-accent);
  font-weight: 600;
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

/* =========================================
   COACHES DESKTOP - GSAP PIN (Mobile-First)
   Only active on screens >= 981px
   ========================================= */
   @media (min-width: 981px) {
    /* Скрываем мобильную карусель на десктопе */
    .cm-carousel,
    .coaches-header {
        display: none;
    }

    .cd-pin-wrap {
        width: 100%;
        background: var(--color-surface);
    }

    .cd-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: calc(100vh - 80px); /* Было 100vh */
        width: 100%;
        max-width: var(--container-width); /* Ограничиваем ширину контента */
        margin: 0 auto; /* Центрируем grid внутри белого фона */
        }

    /* LEFT: Visual Stack */
    .cd-visual-stack {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .cd-visual-item {
        position: absolute;
        inset: 0;
        clip-path: inset(50%);
        will-change: clip-path;
    }

    .cd-visual-item.is-active {
        clip-path: inset(0%);
    }

    .cd-visual-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }

    .cd-progress-track {
        position: absolute;
        bottom: 2rem;
        left: 2rem;
        right: 2rem;
        height: 2px;
        background: rgba(26, 26, 26, 0.1);
        z-index: 10;
    }

    .cd-progress-bar {
        width: 100%;
        height: 100%;
        background: var(--color-primary);
        transform-origin: left;
        transform: scaleX(0);
        will-change: transform;
    }

    /* RIGHT: Text Stack */
    .cd-text-stack {
        position: relative;
        height: 100%;
        padding: 4rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: var(--color-bg);
    }

    .cd-header-fixed {
        position: absolute;
        top: 1rem;
        left: 4rem;
        right: 4rem;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 1rem;
        z-index: 5;
    }

    .cd-header-fixed h2 {
        font-family: var(--font-heading);
        font-size: var(--fs-2xl);
        margin-bottom: 0.5rem;
        color: var(--color-text);
    }

    .cd-header-fixed p {
        font-size: var(--fs-lg);
        color: var(--color-text-muted);
    }

    .cd-text-list {
        position: relative;
        width: 100%;
        height: 100%;
    }

    .cd-text-item {
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        transform: translateY(-50%);
        opacity: 0;
        visibility: hidden;
        will-change: opacity, transform;
    }

    .cd-text-item.is-active {
        opacity: 1;
        visibility: visible;
    }

    .cd-name {
        font-family: var(--font-heading);
        font-size: var(--fs-2xl);
        line-height: 1.2;
        margin-bottom: 0.5rem;
        color: var(--color-text);
    }

    .cd-role {
        font-size: var(--fs-sm);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--color-primary);
        font-weight: 700;
        margin-bottom: 2rem;
    }

    .cd-stats {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .cd-stats li {
        font-size: 0.95rem;
        color: var(--color-text-muted);
        line-height: 1.6;
    }

    .cd-stats strong {
        color: var(--color-text);
        font-weight: 600;
        display: inline-block;
        min-width: 120px;
    }
}

/* =========================================
   COACHES RESPONSIVE VISIBILITY (Mobile-First Fix)
   ========================================= */

/* По умолчанию (мобильная версия): десктопный pin-wrap скрыт */
.cd-pin-wrap {
  display: none;
}

/* На десктопе: показываем pin-wrap, скрываем мобильную карусель */
@media (min-width: 981px) {
  .cd-pin-wrap {
      display: block; /* Или grid, если внутри используется grid-layout */
  }
  
  .cm-carousel,
  .coaches-header {
      display: none;
  }
}

/* Блокируем горизонтальный скролл страницы, но НЕ внутри iframe */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    /* Разрешаем touch-action внутри iframe */
    touch-action: pan-y;
}

/* Явно разрешаем все touch-действия внутри карты */
iframe[src*="yandex.ru/map-widget"] {
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* =========================================
   MODAL WINDOW - Contact Options
   ========================================= */
   .modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal__content {
    background-color: var(--color-surface);
    margin: auto;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease-out;
    
    /* Центрирование по вертикали */
    top: 50%;
    transform: translateY(-50%);
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(calc(-50% - 20px)); }
    to { opacity: 1; transform: translateY(-50%); }
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-base);
    line-height: 1;
    padding: 0.25rem;
}

.modal__close:hover { color: var(--color-primary); }

.modal__title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.modal__subtitle {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Группы контактов */
.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-group__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    text-align: center;
}

/* Мессенджеры */
.messenger-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.messenger-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    transition: all var(--transition-base);
}

.messenger-link svg {
    width: 28px;
    height: 28px;
    fill: currentColor; /* ← Иконка наследует белый цвет */
}

/* Telegram: фирменный синий фон + белая иконка */
.messenger-link--tg {
    background: #FFFFFF;
    color: #229ED9;
}

/* WhatsApp: фирменный зелёный фон + белая иконка */
.messenger-link--wa {
    background: #FFFFFF;
    color: #25D366;
}

/* MAX: фирменный синий фон + многоцветная иконка (НЕ инвертируем!) */
.messenger-link--max {
    background: #FFFFFF;
    color: #0077FF;
}

/* ВАЖНО: для MAX убираем fill: currentColor, 
   так как у него многоцветный SVG с градиентами */
   .messenger-link--max svg {
    fill: none; /* ← Сбрасываем заливку, чтобы градиенты работали */
}

/* Hover-эффекты */
.messenger-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.messenger-link--tg:hover { background: #FFFFFF; }
.messenger-link--wa:hover { background: #FFFFFF; }
.messenger-link--max:hover { background: #FFFFFF; }

/* Кнопки VK и Телефон */
.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--fs-base);
    text-decoration: none;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.contact-btn svg { flex-shrink: 0; }

.contact-btn--vk {
    background: #0077FF;
    color: #fff;
}

.contact-btn--vk:hover {
    background: #0066DD;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 255, 0.3);
}

.contact-btn--phone {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.contact-btn--phone:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .modal__content {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    
    .messenger-link {
        width: 48px;
        height: 48px;
    }
    
    .messenger-link svg { width: 24px; height: 24px; }
    
    .contact-btn {
        padding: 0.875rem 1.25rem;
        font-size: var(--fs-sm);
    }
}

  /* =========================================
   TIGHT LINE-HEIGHT FOR MULTI-LINE HEADINGS
   ========================================= */

.section-header h2,
.page-hero__title,
.spotlight__content h3,
.cd-name {
    line-height: 1.15;
}

/* Если заголовок явно разбит <br>, убираем лишний margin у <br> */
h2 br,
h3 br {
    display: block;
    content: "";
    margin-bottom: 0.15em;
}

/* =========================================
   CARD WITH IMAGE BACKGROUND (Hero-style)
   ========================================= */

   .card--image-bg {
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
    border: none;
}

.card--image-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15; /* Прозрачность фото — регулируйте 0.1–0.25 */
    z-index: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.card--image-bg:hover::before {
    opacity: 0.22;
    transform: scale(1.05);
}

/* Затемнение/осветление для читаемости текста */
.card--image-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(249, 247, 242, 0.92) 0%,
        rgba(249, 247, 242, 0.85) 50%,
        rgba(249, 247, 242, 0.92) 100%
    );
    z-index: 1;
}

.card--image-bg > * {
    position: relative;
    z-index: 2;
}

/* Фоновые изображения для конкретных карточек */
.card--bg-kids-1::before {
    background-image: url('../images/directions/detskie-tancy/kids-early.jpg');
}

.card--bg-kids-2::before {
    background-image: url('../images/directions/detskie-tancy/kids-beginner.jpg');
}

.card--bg-kids-3::before {
    background-image: url('../images/directions/detskie-tancy/kids-sport.jpg');
}

/* =========================================
   PINNED PHOTO CARDS (Scroll Effect)
   ========================================= */

   .pin-cards-container {
    position: relative;
}

.pin-card {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.pin-card__photo {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.pin-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Background state — photo fades to backdrop */
.pin-card__photo.is-background {
    opacity: 0.15;
    filter: blur(2px);
}

.pin-card__content {
    position: relative;
    z-index: 2;
    background: linear-gradient(
        to top,
        rgba(249, 247, 242, 0.98) 0%,
        rgba(249, 247, 242, 0.95) 50%,
        transparent 100%
    );
    padding: 5rem 2.5rem 2.5rem;
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-card__content.is-visible {
    transform: translateY(0);
}

.pin-card__content h3 {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.age-badge {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 0.35rem 1.25rem;
    border-radius: 50px;
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.pin-card__content p {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin: 0;
    font-size: var(--fs-lg);
}

/* Progress dots (optional) */
.pin-cards-dots {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.pin-cards-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(192, 86, 62, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pin-cards-dot.is-active {
    background: var(--color-primary);
    transform: scale(1.3);
}

/* Mobile adaptation */
@media (max-width: 768px) {
    .pin-card {
        min-height: 500px;
    }
    
    .pin-card__content {
        padding: 4rem 1.5rem 1.5rem;
    }
    
    .pin-card__content h3 {
        font-size: var(--fs-xl);
    }
    
    .pin-cards-dots {
        display: none;
    }
}

/* =========================================
   MARQUEE GALLERY (Responsive: 2 mob / 4 desk)
   ========================================= */
   .marquee-gallery {
    position: relative;
    display: grid;
    /* Десктоп: 4 колонки */
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    height: 600px;
    overflow: hidden;
    padding: 0 1.5rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.marquee-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    will-change: transform;
}

.marquee-track {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.marquee-track picture,
.marquee-track img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--border-radius);
    display: block;
    cursor: pointer; /* ← Указатель при наведении */
    transition: transform 0.4s ease; /* ← Плавный zoom */
}

.marquee-track img:hover {
    transform: scale(1.05); /* ← Scale on hover */
}


/* Направления и скорости */
.marquee-col--1 { animation: marqueeUp 35s linear infinite; }
.marquee-col--2 { animation: marqueeDown 42s linear infinite; }
.marquee-col--3 { animation: marqueeUp 38s linear infinite; }
.marquee-col--4 { animation: marqueeDown 45s linear infinite; }

@keyframes marqueeUp {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

@keyframes marqueeDown {
    from { transform: translateY(-50%); }
    to { transform: translateY(0); }
}

/* Градиентные маски */
.marquee-fade {
    position: absolute;
    left: 0; right: 0;
    height: 80px;
    z-index: 10;
    pointer-events: none;
}
.marquee-fade--top { top: 0; background: linear-gradient(to bottom, var(--color-surface), transparent); }
.marquee-fade--bottom { bottom: 0; background: linear-gradient(to top, var(--color-surface), transparent); }

/* =========================================
   MOBILE: 2 колонки через CSS Grid reflow
   Все 4 колонки остаются в DOM, но визуально
   перестраиваются в 2 колонки без потери фото
   ========================================= */
@media (max-width: 768px) {
    .marquee-gallery {
        grid-template-columns: repeat(2, 1fr);
        height: 450px;
        gap: 0.5rem;
    }
    
    /* Скрываем пустые колонки 3 и 4 на мобильных,
       т.к. JS заполняет только 2 */
    .marquee-col--3,
    .marquee-col--4 {
        display: none;
    }
}

@media (min-width: 769px) {
    .marquee-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ♿ prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .marquee-col {
        animation: none !important;
    }
}

/* =========================================
   LIGHTBOX STYLES
   ========================================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.is-open .lightbox__img {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox__caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--fs-sm);
    text-align: center;
    max-width: 80vw;
}

/* ♿ prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .marquee-track img:hover {
        transform: none !important;
    }
    .lightbox,
    .lightbox__img {
        transition: none !important;
    }
}

/* =========================================
   BLOG CARDS & ARTICLE
   ========================================= */
   .blog-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: var(--fs-sm);
}

.blog-card__date {
    color: var(--color-text-muted);
}

.blog-card__tag {
    background: var(--color-accent);
    color: var(--color-text);
    padding: 0.2rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card__meta .card__title a {
    transition: color var(--transition-base);
}

.blog-card .card__title a:hover {
    color: var(--color-primary);
}

/* Типографика статьи */
.article-content p {
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

.article-content h2 {
    color: var(--color-text);
    line-height: 1.2;
}

.article-content ul li,
.article-content ol li {
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.article-content strong {
    color: var(--color-text);
}

.article-content a:not(.btn) {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content a:not(.btn):hover {
    color: var(--color-primary-hover);
}

/* =========================================
   COOKIE CONSENT BANNER
   ========================================= */
   .cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    animation: cookieSlideUp 0.4s ease;
}

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

.cookie-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner__text {
    margin: 0;
    flex: 1;
    min-width: 260px;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.6;
}

.cookie-banner__text a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__text a:hover {
    color: var(--color-primary-hover, #a84a3a);
}

.cookie-banner__btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
    .cookie-banner__btn {
        width: 100%;
    }
}
/* Кнопка закрытия (отказ) */
.cookie-modal__close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 2;
}
.cookie-modal__close:hover,
.cookie-modal__close:focus-visible {
    background: var(--color-bg-alt);
    color: var(--color-text);
    outline: none;
}

/* Cookie consent: выглядит как модалка записи, но компактнее и поверх неё */
#cookieModal {
    z-index: 2000; /* выше модалки записи */
}

.modal__content--cookie {
    max-width: 440px;
    text-align: center;
}

.modal__content--cookie .modal__subtitle {
    font-size: var(--fs-sm);
    line-height: 1.7;
}

.modal__content--cookie .modal__subtitle a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Блокировка скролла, пока cookie-окно открыто */
body.cookie-modal-open {
    overflow: hidden;
}

/* =========================================
   404 ERROR PAGE
   ========================================= */
   .error-404 {
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1rem 4rem;
}

.error-404__content {
    animation: error404FadeUp 0.7s ease both;
}

@keyframes error404FadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.error-404__number {
    font-family: var(--font-heading);
    font-size: clamp(120px, 26vw, 300px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--color-primary) 0%, #D98A6F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-primary); /* fallback */
    margin-bottom: 0.5rem;
}

.error-404__title {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    color: var(--color-text);
    margin-bottom: 1rem;
}

.error-404__text {
    font-size: var(--fs-base);
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 2rem;
}

.error-404__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}