/*
Theme Name: normroma
*/

/* ================== ROOT / TOKENS ================== */

:root {
  --bg: #050509;
  --bg-soft: #080910;
  --text-main: #f5f5f8;
  --text-muted: #a1a1b5;
  --accent: #a259ff;
  --accent-soft: #392d70;
  --max-width: 1120px;

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* ================== GLOBAL ================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.site-main {
  background: var(--bg);
  transition:
    filter 0.8s ease,
    opacity 0.8s ease,
    transform 0.8s ease;
}

/* когда модалка открыта — размываем ТОЛЬКО внутренний main с контентом */
body.is-modal-open main#primary.site-main {
  filter: blur(10px);
  opacity: 0.85;
  transform: scale(0.99);
}

/* базовые отступы секций – при необходимости переопределяем локально */
section {
  padding: 96px 24px;
}

@media (max-width: 768px) {
  section {
    padding: 72px 16px;
  }
}

/* общий контейнер для простых блоков */
.hero__inner,
.portfolio__inner,
.contact__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ================== HERO (DESKTOP BASE) ================== */

.hero {
  position: relative;
  min-height: 100vh;
  background-color: #050509;
  color: #f5f5f7;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* ДЕСКТОП: центр */

  overflow: hidden;
  padding: 28vh 6vw 0;              /* ДЕСКТОП: без “28vh” */
  text-align: center;
}

.hero-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-subtitle {
  font-size: 14px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #8d8fa4;
  margin: 0 0 16px;
}

.hero-title {
  font-weight: 700;
  font-size: clamp(72px, 8.6vw, 140px);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0;
}

.hero-caption {
  font-size: 14px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #8d8fa4;
  margin: 18px 0 0;
}

/* Слой с фигурами */
.hero-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-shape {
  pointer-events: auto;
}

/* ОБЩИЕ НАСТРОЙКИ ДЛЯ ЛЮБОЙ ФИГУРЫ */
.hero-shape {
  position: absolute;
  top: 0;
  left: 0;

  /* Размер задаёт JS, но на всякий случай базовое значение */
  width: 140px;
  height: 140px;

  background-color: #4d4295;  /* основной фиолетовый для кругов/квадратов */
  opacity: 0.95;

  pointer-events: auto;       /* кликабельна */

  transform: translate3d(0, 0, 0);
  will-change: transform;

  z-index: 1;                 /* один уровень для всех фигур */
}

/* КРУГИ */
.hero-shape--circle {
  border-radius: 50%;
  opacity: 0.9;
}

/* КВАДРАТЫ (тут даже можно ничего не писать, но оставим на будущее) */
.hero-shape--square {
  border-radius: 0;
  opacity: 0.7;
}

/* ТРЕУГОЛЬНИКИ */
.hero-shape--triangle {
  /* тот же уровень z-index, те же клики, та же позиция — всё уже есть в .hero-shape */
  background-color: #4d4295;  /* чуть темнее фиолетовый, чтобы отличались */
  opacity: 0.8;               /* полупрозрачные, чтобы наслаивание было видно */

  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* базово: фигура умеет плавно менять transform и opacity */
.hero-shape {
  /* у тебя уже есть position / size / background и т.п. — их не трогаем */
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}

/* состояние "исчезает" — схлопывание к центру */
.hero-shape--vanish {
  transform: scale(0);
  opacity: 0;
}

/* мобильная адаптация hero */

/* === MOBILE ONLY: HERO = 1 экран, ABOUT появляется только при скролле (не трогаем десктоп) === */
@media (max-width: 768px) {
  /* убираем pin-сцену на мобилке, чтобы ABOUT не ложился поверх HERO */
  .hero-pin { height: auto !important; }
  .hero-pin .hero {
    position: relative !important;
    top: auto !important;
    height: 100svh !important;     /* корректнее на iOS, чем 100vh */
    min-height: 100svh !important;
  }
  .hero-pin .about-overlay {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    z-index: 0 !important;
  }

  /* центрируем текст в HERO по вертикали/горизонтали (только мобилка) */
  .hero {
    padding: 0 20px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }
  .hero-inner { margin-top: 0 !important; }

  /* крупнее заголовок и подпись (только мобилка) */
  .hero-title {
    font-size: clamp(80px, 17.5vw, 92px) !important;
    line-height: 1.07 !important;
  }
  .hero-caption {
    font-size: 10px !important;
    margin-top: 20px !important;
    letter-spacing: 0.28em !important;
  }
}

/* сцена hero + about (пин) */

.hero-pin {
  position: relative;
  height: 200vh; /* два экрана по 100vh */
}

.hero-pin .hero,
.hero-pin .about-overlay {
  height: 100vh;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 1;
  overflow: hidden;

  /* переменная, которой будем управлять из JS */
  --hero-dim: 0;
}

/* тёмный слой поверх Hero, который будет затемнять секцию */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #050509;        /* можешь поменять цвет затемнения */
  opacity: var(--hero-dim);   /* 0–1, задаётся из JS */
  pointer-events: none;       /* не мешает кликам по кнопкам в Hero */
  z-index: 3;
}

.about-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 100vh;
  z-index: 2;
  background: #101012;
  display: flex;
  align-items: center;
}

/* ================== ABOUT (2 КОЛОНКИ) ================== */

.about {
  background: #101012;
}

/* общий контейнер about */
.about__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 80px;
  align-items: flex-start;
}

/* левая колонка – текст */
.about__content {
  flex: 1 1 0;
}

/* правая колонка – картинка / визуал */
.about__media {
  flex: 0 0 360px;
  height: 550px;
  background: #2b2344;
  border-radius: 0;
}

.about__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* --- ABOUT: анимация появления контента --- */

/* старт: содержимое секции About прозрачное и смещено влево */
.about__content,
.about__media {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 1s ease-out,
    transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* когда секция стала видимой */
.about.is-visible .about__content,
.about.is-visible .about__media {
  opacity: 1;
  transform: translateX(0);
}

/* картинка чуть позже текста */
.about.is-visible .about__media {
  transition-delay: 0.12s;
}

.about__title {
  margin: 0 0 24px;
  font-size: 40px;
  font-weight: 700;
  text-align: left;
}

.about__text {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 17px;
  text-align: left;
}

/* FIX: чтобы на десктопе не дублировалось */
.about__copy--desktop { display: block !important; }
.about__copy--mobile  { display: none !important; }

@media (max-width: 900px) {
  .about__copy--desktop { display: none !important; }
  .about__copy--mobile  { display: block !important; }
}

/* адаптив about */
@media (max-width: 900px) {
  .about__inner {
    flex-direction: column;
    padding: 40px 24px 80px;
    gap: 5px;
  }

  /* основной текст */
  .about__inner p,
  .about__text,
  .about__content {
    font-size: 15px;
    line-height: 17px;
  }

  /* заголовок — отдельно, свой интерлиньяж */
  .about__inner h1,
  .about__inner h2,
  .about__inner h3,
  .about__title {
    line-height: 1.1; /* крути это значение */
    margin-bottom: 14px; /* расстояние до основного текста */
  }

  .about__media {
    width: 100%;
    max-width: 420px;
    height: 320px;
    margin-top: 28px;
  }
}

/* ================== PORTFOLIO / SELECTED WORKS ================== */

/* контейнер секции портфолио */
.portfolio {
  position: relative;
  background: var(--bg);
  padding: 120px 0 160px;
}

/* контентный слой поверх дождя */
.portfolio__inner {
  position: relative;
  z-index: 2;
}

/* слой с фигурами */
.portfolio-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* заголовок блока */

.portfolio__header {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 5px;
}

.portfolio__title {
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 32px;
  position: relative;
}

.portfolio__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -16px;
  width: 120px;
  height: 3px;
  background: var(--accent);
}

/* один проект в портфолио */

.project-slide {
  min-height: 65vh;
  max-width: var(--max-width);
  margin: 0 auto 80px;
  padding: 0 5px;

  /* ДВЕ КОЛОНКИ НА ДЕСКТОПЕ — только flex, без grid */
  display: flex;
  align-items: center;
  gap: 30px;

  position: relative;

  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* левая колонка — текст */

.project-slide__content {
  flex: 0 0 40%;
  max-width: 520px;

  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.project-slide__year {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.project-slide__title {
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 700;
  margin: 0 0 18px;
  line-height: 1.1;
}

.project-slide__text {
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
}

.project-slide__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.project-slide__link:hover {
  opacity: 0.9;
  text-decoration: none;
}

.project-slide__link-arrow {
  font-size: 16px;
}

/* правая колонка — визуал */

.project-slide__visual {
  flex: 1 1 0;
  display: flex;
  justify-content: flex-end;
  margin-left: 0;
}

.project-slide__image-wrap {
  position: relative;
  height: 480px;
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  background: #31314c;    /* фон под картинку */

  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.6s ease-out,
    transform 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* фон под картинкой — чуть светлее фона */
.project-slide__image-bg {
  position: absolute;
  inset: 0;
  background: #31314c;
}

/* САМА КАРТИНКА — БЕЗ ИЗМЕНЕНИЙ В АНИМАЦИИ */

.project-slide__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* старт: картинка спрятана справа */
  clip-path: inset(0 100% 0 0);
  transform: scale(1.02);

  /* СНОВА анимируем clip-path ЧЕРЕЗ CSS — ТВОИ ЖЕ ЗНАЧЕНИЯ */
  transition:
    clip-path 1.3s cubic-bezier(0.33, 0.0, 0.2, 1) 0.8s,
    transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);

  z-index: 2;
}

/* при .is-inview картинка полностью раскрыта */
.project-slide.is-inview .project-slide__image {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

/* номер проекта в правом нижнем углу */

.project-slide__index {
  position: absolute;
  right: 40px;
  bottom: 5px;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 6;
}

/* шторка — ТОЖЕ БЕЗ ИЗМЕНЕНИЙ */

.project-slide__shutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5%;
  width: 40%;
  background: #7d5cc5;
  transform: translateX(-100%);
  pointer-events: none;
  z-index: 3;
}

/* ===== АНИМАЦИИ ДЛЯ PROJECT-SLIDE (ОРИГИНАЛЬНЫЕ) ===== */

.project-slide.is-inview {
  opacity: 1;
  transform: translateY(0);
}

.project-slide.is-inview .project-slide__content {
  opacity: 1;
  transform: translateX(0);
}

.project-slide.is-inview .project-slide__image-wrap {
  opacity: 1;
  transform: scale(1);
}

.project-slide.is-inview .project-slide__image {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

/* адаптив portfolio — одна колонка только на мобильных */

@media (max-width: 768px) {
  .portfolio__header {
    padding: 0 24px;
  }

  .project-slide {
    padding: 0 24px 80px;
    flex-direction: column;
    gap: 32px;
    min-height: auto;
  }

  .project-slide__content {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .project-slide__visual {
    margin-left: 0;
    width: 100%;
  }

  /* FIX 1: Ensure image gallery is visible on mobile */
  .project-slide__image-wrap {
    width: 100%;
    height: 280px;
    max-width: 100%;
  }

  /* FIX 1: Override clip-path so images are visible on mobile without .is-inview */
  .project-slide__image {
    clip-path: inset(0 0 0 0);
  }

  .project-slide__index {
    right: 16px;
    bottom: 8px;
  }

  /* ===== MOBILE TYPOGRAPHY: Reduce font sizes for better viewport fit ===== */
  
  /* Year label - more compact */
  .project-slide__year {
    font-size: 11px;
    margin-bottom: 10px;
    letter-spacing: 0.18em;
  }

  /* Project title - larger and more expressive for mobile */
  /* Усиленная специфичность для переопределения любых inline-стилей или ACF полей */
  article.project-slide .project-slide__title,
  .project-slide .project-slide__content .project-slide__title,
  .project-slide__title {
    font-size: clamp(32px, 7vw, 44px) !important; /* Унифицируем для всех проектов */
    line-height: 1.15 !important;
    margin: 0 0 14px !important;
    font-weight: 700 !important;
  }

  /* Description text - smaller and more compact */
  .project-slide__text {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 16px;
  }

  /* Link button - slightly smaller */
  .project-slide__link {
    font-size: 12px;
    letter-spacing: 0.18em;
  }
}

/* ========== PROJECT MODAL ========== */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 999;

  display: flex;              /* ВСЕГДА flex */
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);

  pointer-events: none;       /* по умолчанию НЕ кликабельно */
  opacity: 0;                 /* по умолчанию НЕ видно */
  transition: opacity 0.4s ease;  /* общая плавность контейнера */
}

.project-modal.is-open {
  opacity: 1;
  pointer-events: auto;       /* кликабельно только когда открыто */
}

/* фон под модалкой: затемнение, но БЕЗ blur — blur теперь на .site-main */
.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.project-modal.is-open .project-modal__backdrop {
  opacity: 1;
}

/* окно модалки – центр, fade + движение снизу вверх */
.project-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 80vh;
  max-height: 80vh;

  background: #19192593;
  border-radius: 0;
  padding: 32px 32px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;

    transition:
    opacity 0.55s ease-out,
    transform 0.55s ease-out;
}

/* анимация появления окна */
.project-modal.is-open .project-modal__dialog {
  animation: modal-fade-up 1s ease-out;
}

.project-modal.is-closing .project-modal__dialog {
  animation: modal-fade-down 0.8s ease-out forwards;
}

@keyframes modal-fade-up {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.project-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 10px;
  cursor: pointer;
  padding: 4px;
}

.project-modal__body {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 32px;

  flex: 1 1 auto;       /* ← РАСТЯГИВАЕМ ПО ВЫСОТЕ МОДАЛКИ */
  align-items: stretch;  /* обе колонки на полную высоту строки */

  overflow: hidden;      /* чтобы не было лишних полос в desktop-варианте */
  max-height: 100%;
}

.project-modal__year {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.project-modal__title {
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 18px;
}

.project-modal__description {
  font-size: 16px;
  color: var(--text-muted);
}

.project-modal__content {
  display: flex;
  flex-direction: column;
  justify-content:center; /* вертикальное центрирование текста */
}

/* ПРАВАЯ КОЛОНКА — слайдер */
.project-modal__gallery {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* область, где крутятся слайды */
.project-modal__slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* один слайд – занимает всю область, но по умолчанию спрятан */
.project-modal__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

/* активный слайд – показан */
.project-modal__slide.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* картинка тянется по высоте правой колонки */
/* картинка в модалке: показываем полностью (без обрезки) */
.project-modal__image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;

  object-fit: contain;      /* ключевое: НЕ режет */
  object-position: center;  /* центрируем */
  background: #10101200;         /* чтобы "поля" выглядели нормально */
}

/* Контейнер подсказки – ПОЛОЖЕНИЕ ВСЕГО БЛОКА (текст + стрелка) */
.project-modal__scroll-hint {
  position: absolute;
  bottom: 35px;   /* ДВИГАЕТ ВВЕРХ/ВНИЗ ВСЁ: слово + стрелка */
  left: 73%;      /* ДВИГАЕТ ВЛЕВО/ВПРАВО ВСЁ: слово + стрелка */
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Само слово SWIPE */
.project-modal__scroll-label {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  pointer-events: none;
  user-select: none;
  animation: swipe-bounce 1.8s infinite ease-in-out;

  margin-bottom: 0px;     /* РАССТОЯНИЕ МЕЖДУ SWIPE И СТРЕЛКОЙ */

  /* ТОНКАЯ НАСТРОЙКА ПОЛОЖЕНИЯ САМОГО ТЕКСТА */
  position: relative;
  top: 0;                 /* + вниз, - вверх ОТНОСИТЕЛЬНО СТРЕЛКИ */
  left: 0;                /* + вправо, - влево ОТНОСИТЕЛЬНО СТРЕЛКИ */
}

/* Белая V-образная стрелка с острыми углами */
.project-modal__scroll-arrow {
  width: 38px;
  height: 38px;
  display: block;

  border-left: 7px solid #ffffff;
  border-bottom: 7px solid #ffffff;
  border-radius: 0;

  transform: rotate(-45deg);   /* превращаем "угол" в V-стрелку вниз */
  animation: scroll-arrow-bounce 1.2s ease-in-out infinite;
  opacity: 0.8;
}

/* ОДИНАКОВОЕ поведение для текста SWIPE */
@keyframes swipe-bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(6px); /* вниз на 6px */
    opacity: 1;
  }
}

/* ОДИНАКОВОЕ поведение для стрелки, но с учётом её поворота */
@keyframes scroll-arrow-bounce {
  0%, 100% {
    transform: translateY(0) rotate(-45deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(6px) rotate(-45deg); /* тоже вниз на 6px */
    opacity: 1;
  }
}

/* мобилка */
@media (max-width: 768px) {
  .project-modal__dialog {
    padding: 24px 16px 20px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden; /* сам диалог не скроллится, скроллится только body */
    display: flex;
    flex-direction: column;
  }

  .project-modal__body {
    grid-template-columns: 1fr;
    flex: 1 1 auto;
    min-height: 0; /* важно для flex скролла */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: none; /* убираем ограничение, скролл будет работать */
    touch-action: pan-y; /* разрешаем вертикальный скролл на touch устройствах */
  }
  
  /* Убеждаемся, что модальное окно может скроллиться даже при position: fixed на body */
  .project-modal.is-open {
    touch-action: pan-y;
  }

  /* Скрываем SWIPE и стрелку на мобильных */
  .project-modal__scroll-hint {
    display: none !important;
  }

  /* Галерея в режиме вертикальной плёнки (вертикальный скролл, все фото видны) */
  .project-modal__gallery {
    width: 100%;
    overflow: visible; /* скролл будет на уровне body */
  }

  .project-modal__slider {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    position: relative;
    gap: 16px;
    padding-bottom: 16px;
  }

  .project-modal__slide {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    opacity: 1 !important;
    transform: none !important;
  }

  .project-modal__image {
    width: 100%;
    height: auto;
    object-fit: contain; /* показываем фото полностью */
    border-radius: 4px;
    display: block;
  }

  /* Подложка модального окна не скроллится */
  .project-modal__backdrop {
    position: fixed;
    overflow: hidden;
  }
}

/* ================== SKILLS ================== */

.skills {
  background: #101012; /* строго твой оттенок */
  position: relative;
}

.skills__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.skills__header {
  margin-bottom: 48px;
}

.skills__title {
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 700;
  margin: 0 0 16px;
}

.skills__subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 720px;
}

.skills__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.skills__col-title {
  margin: 0 0 16px;
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.skills__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills__item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--text-main);
  opacity: 0.92;
}

@media (max-width: 768px) {
  .skills__grid {
    grid-template-columns: 1fr;
    gap: 24px; /* уменьшено с 32px */
  }

  /* Уменьшаем расстояния между строками в списке навыков */
  .skills__item {
    padding: 8px 0; /* уменьшено с 14px 0 */
  }

  /* Уменьшаем отступы заголовков колонок */
  .skills__col-title {
    margin-bottom: 12px; /* можно уменьшить если нужно */
  }
}

/* ===============================
   CONTACT SECTION — FIXED VERSION
   =============================== */

.contact {
  width: 100%;
  min-height: 100svh;
  background-color: #050509;
  padding: 120px 40px 60px;
  box-sizing: border-box;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  width: 100%;
}

/* Контейнер для картинки — ограничиваем ширину */
.contact__image {
  max-width: 420px;   /* Ты можешь изменить размер на 360 / 400 / 480 */
  width: 100%;
}

/* Картинка — теперь НОРМАЛЬНАЯ */
.contact__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Текстовые элементы */
.contact__title {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: 700;
}

.contact__email {
  font-size: 22px;
  margin-bottom: 16px;
}

.contact__email a {
  color: #ffffff;
  text-decoration: none;
}

.contact__links {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  justify-content: center; /* ← ВАЖНО */
}

.contact__link {
  color: #b46cff;
  font-size: 20px;
  transition: opacity .3s;
}

.contact__link:hover {
  opacity: 0.7;
}

.contact__copyright {
  margin-top: 24px;
  font-size: 15px;
  opacity: 0.5;
}

/* Мобильная версия */
@media (max-width: 768px) {
  .contact__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact__image {
    margin: 0 auto;
    max-width: 320px;
  }

  .contact__title {
    font-size: 36px;
  }
}

/* ХАРД-ФИКС РАСКЛАДКИ ПОРТФОЛИО */

@media (min-width: 769px) {
  .project-slide {
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) !important;
    column-gap: 30px !important;
    align-items: center;
  }

  .project-slide__content {
    margin-bottom: 0;
  }

  .project-slide__visual {
    margin-left: 0;
    display: flex;
    justify-content: flex-end;
  }
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;          /* размер круга */
  height: 140px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;

  mix-blend-mode: difference; /* инверсия цветов */
  background: white;          /* белый круг -> эффекта инверсии достаточно */
  
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  opacity: 0;                 /* скрыт пока мышь не двигается */
}

@media (min-width: 1025px) {
  html.has-custom-cursor,
  body.has-custom-cursor {
    cursor: none;
  }
}

/* Скрываем курсор на мобильных устройствах */
@media (max-width: 768px) {
  .custom-cursor {
    display: none !important;
  }
  
  html.has-custom-cursor,
  body.has-custom-cursor {
    cursor: auto !important;
  }
}

/* ===== ДОЖДЬ ФИГУР ДЛЯ СЕКЦИИ PORTFOLIO ===== */

.portfolio-rain {
  position: absolute;      /* привяжем к документу через JS */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  pointer-events: none;    /* не мешает кликам по проектам */
  overflow: hidden;
  z-index: 0; 
}

body.is-modal-open .portfolio-rain {
  filter: blur(8px);
  transition: filter 0.4s ease;
}

/* базовая фигура */
.portfolio-rain__shape {
  position: absolute;
  top: 0;
  left: 0;

  width: 120px;             /* реальные размеры задаст JS */
  height: 120px;

  background-color: #6959d0;
  opacity: 1;

  pointer-events: none;
  will-change: transform, opacity;
}

/* круг */
.portfolio-rain__shape--circle {
  background-color: rgb(120, 105, 221);
  border-radius: 50%;
}

/* квадрат */
.portfolio-rain__shape--square {
  background-color: rgb(116, 107, 174);
  border-radius: 0;
}

/* треугольник */
.portfolio-rain__shape--triangle {
  background-color: rgb(120, 105, 221);
  opacity: 0.45;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* ================== SKILLS (PIN + SHAPES) ================== */

.skills {
  background: #101012;        /* строго этот оттенок */
  min-height: 100vh;          /* секция во весь экран */
  position: relative;
  overflow: hidden;           /* чтобы фигуры красиво "уезжали" */
  will-change: opacity;       /* оптимизация для анимации opacity */
}

/* контент поверх */
.skills__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* фоновой слой */
.skills__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* общие свойства фигур */
.skills__shape {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  will-change: transform;
  pointer-events: none;
}

/* круг слева */
.skills__shape--circle {
  width: min(62vh, 560px);
  height: min(62vh, 560px);
  left: -8vw;                 /* стартовая "врезка" слева */
  border-radius: 50%;
  background: rgba(161, 89, 255, 0.2); /* прозрачность №1 */
  filter: blur(0px);
}

/* треугольник справа */
.skills__shape--tri {
  width: min(62vh, 560px);
  height: min(62vh, 560px);
  right: -10vw;               /* стартовая "врезка" справа */
  background: rgba(158, 84, 255, 0.103); /* прозрачность №2 (другая) */
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: translateY(-50%) rotate(0deg);
}

/* чтобы Contact точно был поверх Skills при наезде */
.contact {
  position: relative;
  z-index: 5;
}

@media (max-width: 768px) {
  .skills {
    padding: 60px 20px 40px; /* уменьшено для лучшего размещения на экране */
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center; /* центрируем контент вертикально */
  }
  
  .skills__header {
    margin-bottom: 32px; /* уменьшено с 48px */
  }
}

/* фиксируем геометрию картинки, чтобы не было скачка при загрузке */
.contact__image {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 5;   /* подстрой под свою картинку */
}

.contact__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================== OPTIONAL FOOTER (если будешь использовать) ================== */

.footer,
.footer-section {
  text-align: center;
}

.footer-heading {
  display: block;
  margin: 0 0 32px;
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.footer-email {
  display: block;
  margin: 0 0 32px;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 600;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-copy {
  margin-top: 8px;
  font-size: 13px;
}

/* ========== CUSTOM CURSOR: ВАЖНО ========== */
.custom-cursor{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;       /* курсор выше прелоадера */
  pointer-events: none;
}

/* ===== Language switcher (added for RU/EN/ES) ===== */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  background: rgba(20, 16, 32, 0.55);
  backdrop-filter: blur(6px);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
}
.lang-switcher a, .lang-switcher span {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity .2s ease;
}
.lang-switcher a:hover {
  opacity: 1;
}
.lang-switcher .lang-item-current a,
.lang-switcher span.lang-item-current {
  opacity: 1;
  font-weight: 700;
  border-bottom: 1px solid currentColor;
}
@media (max-width: 640px) {
  .lang-switcher { top: 10px; right: 10px; padding: 6px 10px; gap: 8px; }
  .lang-switcher a, .lang-switcher span { font-size: 11px; }
}
/* ===== Language switcher on the front page: centered under CREATIVE DIRECTOR ===== */
.lang-switcher--hero {
	position: static;
	margin: 22px auto 0;
	justify-content: center;
	border-radius: 0;
	width: fit-content;
}
@media (max-width: 640px) {
	.lang-switcher--hero { margin-top: 16px; }
}
.lang-switcher li {
	list-style: none;
	margin: 0;
	padding: 0;
}