/* ================================================================
   Анастасия Шматко — portfolio
   CSS перенесён из исходных страниц Tilda без изменения визуальной логики.
   ================================================================ */

/* ===== ГЛАВНАЯ ===== */
@font-face {
    font-family: 'Favorit';
    src: url('../fonts/FavoritPro-Book.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  * { box-sizing: border-box; }

  :root {
    --as-text-color: #000000;
    --as-text-color-opposite: #ffffff;
    --as-edge: 24px;
    --as-col-w: 160px;
    --as-col-gap: 48px;
    --as-max: 1400px;
  }

  html, body {
    background: #F3F3F3;
  }
  body {
    margin: 0;
    font-family: 'Favorit', Arial, sans-serif;
    background: #F3F3F3;
    color: #111;
    overscroll-behavior-y: none;
  }
  html { overscroll-behavior-y: none; }

  .as-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    pointer-events: none;
  }
  .as-header-inner {
    max-width: var(--as-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px var(--as-edge);
  }
  .as-header a, .as-header * { pointer-events: auto; }

  .as-name {
    font-family: 'Favorit', Arial, sans-serif;
    font-weight: 400;
    font-size: 28px;
    color: var(--as-text-color);
    line-height: 1.35;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: color 0.25s ease;
  }
  .as-name .role { color: inherit; }

  .as-contacts {
    display: grid;
    grid-template-columns: var(--as-col-w) var(--as-col-w);
    column-gap: var(--as-col-gap);
    font-family: 'Favorit', Arial, sans-serif;
    font-weight: 400;
    font-size: 28px;
    color: var(--as-text-color);
  }
  .as-contacts a {
    display: block;
    color: var(--as-text-color);
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.25s ease;
  }
  .as-contacts a:hover { color: var(--as-text-color); }

  .as-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 40;
  }
  .as-footer-inner {
    max-width: var(--as-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 160px 160px;
    padding: 24px var(--as-edge) 32px;
    font-family: 'Favorit', Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--as-text-color);
  }
  .as-footer-links {
    grid-column: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .as-footer a { color: var(--as-text-color); text-decoration: none; transition: color 0.25s ease; }
  .as-footer a:hover { color: var(--as-text-color); }

  /* Обязательная по закону РФ пометка об Instagram/Meta — мелким шрифтом,
     не нарушает визуальную композицию футера. */
  .legal-note {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    color: var(--as-text-color, #999999);
    opacity: 0.85;
    margin-top: 4px;
    white-space: nowrap;
  }
  @media (max-width: 640px) {
    .legal-note { white-space: normal; }
  }

  /* Подсказка-стрелка внизу главной: показывает, что есть ещё проекты ниже
     по скроллу. По фидбеку нескольких бета-тестеров это было неочевидно,
     особенно на мобильном, где первый проект легко принять за единственный. */
  .as-scroll-hint {
    position: fixed;
    left: 50%;
    bottom: 92px;
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    font-family: 'Favorit', Arial, sans-serif;
    font-size: 26px;
    line-height: 1;
    color: var(--as-text-color);
    cursor: pointer;
    opacity: 0.85;
    animation: as-scroll-hint-bounce 1.8s ease-in-out infinite;
    transition: opacity 0.3s ease, color 0.25s ease;
  }
  .as-scroll-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
  }
  @keyframes as-scroll-hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
  }
  @media (max-width: 640px) {
    .as-scroll-hint { bottom: 110px; }
  }

  .as-scroll-track { position: relative; }

  .as-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .as-project {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  .as-project.is-active {
    opacity: 1;
    transform: scale(1.03);
    pointer-events: auto;
    z-index: 2;
  }

  .as-project-link {
    position: absolute;
    inset: 0;
    display: block;
    cursor: pointer;
  }

  .as-project-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }

  .as-marker {
    position: absolute;
    left: 0; right: 0;
    height: 100vh;
    height: 100dvh;
    pointer-events: none;
  }

  .as-tooltip {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -140%);
    background: #fff;
    color: #000;
    font-family: 'Favorit', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 14px;
    border-radius: 100px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 60;
  }
  .as-tooltip.is-visible { opacity: 1; }

  @media (max-width: 640px) {
    .as-header-inner {
      flex-direction: column;
      align-items: flex-start;
      gap: 14px;
      padding: 20px 20px;
    }
    .as-name { font-size: 17px; line-height: 1.3; }
    .as-contacts {
      font-size: 15px;
      grid-template-columns: auto auto;
      column-gap: 28px;
    }
    .as-footer-inner {
      padding: 16px 20px;
      font-size: 13px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
    .as-footer-links { flex-direction: row; gap: 20px; }
    .as-tooltip { display: none; }
    /* фон на мобильном теперь берётся из --mobile-bg, который выставляется
       JS-ом индивидуально под каждый проект (см. массив projects, поле mobileBg) */
    .as-project {
      background-size: contain !important;
      background-color: var(--mobile-bg, var(--as-text-color-opposite));
    }
  }

/* ===== СТРАНИЦА КЕЙСА ===== */
@font-face {
    font-family: 'Favorit';
    src: url('../fonts/FavoritPro-Book.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  * { box-sizing: border-box; }

  :root {
    --as-edge: 24px;
    --as-col-w: 160px;
    --as-col-gap: 48px;
    --as-max: 1400px;
  }

  body {
    margin: 0;
    font-family: 'Favorit', Arial, sans-serif;
    color: #000;
    background: #fff;
    padding-bottom: 100px;
  }

  /* ===== ХЕДЕР — полоса на всю ширину, содержимое в колонке 1400px ===== */
  .cs-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    background: #fff;
  }
  .cs-header-inner {
    max-width: var(--as-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px var(--as-edge);
  }
  .cs-name {
    font-family: 'Favorit', Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    line-height: 1.35;
  }
  .cs-contacts {
    display: grid;
    grid-template-columns: var(--as-col-w) var(--as-col-w);
    column-gap: var(--as-col-gap);
    font-size: 28px;
  }
  .cs-contacts a {
    display: block;
    color: #000;
    text-decoration: none;
    line-height: 1.5;
  }
  .cs-contacts a:active { text-decoration: underline; text-underline-offset: 3px; }

  /* ===== ВСТУПЛЕНИЕ — та же колонка 1400px, так что заголовок
     встаёт ровно под "Анастасия Шматко", а сведения — под Instagram/Behance ===== */
  .cs-intro-wrap {
    max-width: var(--as-max);
    margin: 0 auto;
    padding: 160px var(--as-edge) 0;
  }
  /* Строка 1: заголовок баланс-выровнен с первой строкой meta ("Теги").
     Строка 2: описание баланс-выровнено со второй+ строками meta ("Формат", "Год") —
     оба выравнивания настоящие CSS baseline-выравнивания, без ручных отступов в px,
     поэтому корректны при любых метриках шрифта. */
  .cs-intro-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 48px;
    margin-bottom: 10px;
  }
  .cs-intro-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 48px;
  }
  .cs-title {
    font-size: 44px;
    font-weight: 400;
    margin: 0;
    line-height: 1.15;
  }
  .cs-description {
    font-size: 18px;
    line-height: 1.3;
    max-width: 701px;
    margin: 0;
    color: #000;
    padding-bottom: 64px;
  }

  /* — правый "слот" такой же ширины, как вся пара колонок хедера
     (col-w + gap + col-w), но сведения стоят ТОЛЬКО в первой половине —
     то есть под E-mail/Telegram, а не под Instagram/Behance — */
  /* — левый край совпадает с E-mail/Telegram, но сама колонка шире,
     чтобы длинные значения вроде "Иннокентий Келейников" не переносились —
     она занимает место, где раньше пустовал зазор до Instagram/Behance — */
  .cs-meta-slot {
    width: calc(var(--as-col-w) * 2 + var(--as-col-gap));
    flex-shrink: 0;
  }
  .cs-meta {
    width: 100%;
  }
  .cs-meta-row { margin-bottom: 10px; }
  .cs-meta-row:last-child { margin-bottom: 0; }
  /* Гарантируем те же ~64px до галереи и со стороны meta-колонки (последняя
     строка — "Год"/2026), независимо от того, какая из двух колонок
     (описание или meta) окажется выше в конкретном кейсе. */
  #csMetaRest .cs-meta-row:last-child { padding-bottom: 64px; }
  .cs-meta-label {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    color: #858585;
  }
  .cs-meta-value {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    color: #000;
  }

  @media (max-width: 900px) {
    .cs-title { font-size: 30px; }
    /* На десктопе cs-intro-top/bottom нужны только для baseline-выравнивания
       заголовка с "Теги" и описания с "Форматом". На мобильном это не нужно —
       разворачиваем оба блока (display:contents убирает сами обёртки, оставляя
       их детей) и собираем заголовок, описание и весь meta-блок в одну колонку
       в естественном порядке, чтобы "Теги" и "Формат/Год" не были разорваны
       описанием на две группы. */
    .cs-intro-wrap {
      padding-top: 120px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .cs-intro-top,
    .cs-intro-bottom { display: contents; }
    .cs-title { order: 1; }
    .cs-description { order: 2; }
    .cs-meta-slot { order: 3; width: 100%; }
  }

  /* ===== ГАЛЕРЕЯ — та же колонка 1400px, фото с отступом друг от друга ===== */
  .cs-gallery {
    max-width: var(--as-max);
    margin: 0 auto;
    padding: 0 var(--as-edge) 0;
  }
  .cs-photo {
    margin: 0 0 30px; /* отступ между фото — сокращён в 2 раза от исходных 60px */
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  .cs-photo:last-child { margin-bottom: 0; }
  .cs-photo.is-visible { opacity: 1; transform: translateY(0); }
  .cs-photo img { width: 100%; display: block; cursor: zoom-in; }
  .cs-caption { padding: 10px 0 0; font-size: 13px; color: #666; }

  .cs-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 100;
  }
  .cs-lightbox.is-open { opacity: 1; pointer-events: auto; }
  .cs-lightbox img { max-width: 100%; max-height: 100%; cursor: zoom-out; }

  .cs-arrows {
    max-width: var(--as-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 40px var(--as-edge);
  }
  .cs-arrows a { font-size: 26px; color: #000; text-decoration: none; }
  .cs-arrows a:hover { opacity: 0.6; }

  /* ===== ФУТЕР — та же колонка 1400px ===== */
  .cs-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    z-index: 40;
  }
  .cs-footer-inner {
    max-width: var(--as-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 160px 160px;
    padding: 24px var(--as-edge) 32px;
    font-family: 'Favorit', Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #000;
  }
  .cs-footer-links {
    grid-column: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .cs-footer a { color: #000; text-decoration: none; }
  .cs-footer a:hover { color: #000; }

  @media (max-width: 640px) {
    .cs-header-inner { padding: 20px; flex-direction: column; gap: 14px; }
    .cs-name { font-size: 17px; }
    /* На узких экранах хедер разбивается на 3 строки (имя+роль, затем
       2 ряда контактов) и становится заметно выше, чем на планшете —
       поднимаем отступ сверху у контента кейса, чтобы заголовок не
       заезжал под фиксированный хедер. */
    .cs-intro-wrap { padding-top: 190px; }
    .cs-contacts { font-size: 15px; grid-template-columns: auto auto; column-gap: 24px; }
    .cs-arrows { flex-wrap: wrap; gap: 16px; }
    .cs-footer-inner {
      padding: 16px 20px;
      font-size: 13px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
    .cs-footer-links { flex-direction: row; gap: 20px; }
  }