/* =========================================================
   ГЛАВНАЯ СТРАНИЦА
   ========================================================= */


/* =========================================================
   ЛОКАЛЬНЫЙ ШРИФТ MONTSERRAT
   ========================================================= */

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-semibold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-extrabold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}


/* =========================================================
   ПЕРЕМЕННЫЕ
   ========================================================= */

:root {
  --primary: #099197;
  --primary-rgb: 9, 145, 151;

  --accent-on-dark: #b5decc;
  --accent-on-light: #762c19;

  /* Главная страница использует светлую тему */
  --accent: var(--accent-on-light);

  /*
    Общий цвет имени «ЮЛИЯ» и названий направлений.

    Коричневый вариант: #762c19
    Серый вариант:      #707070
  */
  --home-heading-color: #762c19;

  --bg: #f5f5f5;
  --bg-card: #ffffff;

  --text: #2a2a2a;
  --text-muted: #707070;
  --text-light: #3a3a3a;

  --border: #e0e0e0;
  --focus: var(--accent-on-light);

  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
}


/* =========================================================
   БАЗОВЫЕ НАСТРОЙКИ
   ========================================================= */

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

html {
  scroll-behavior: smooth;
}

body.home-page {
  display: flex;
  flex-direction: column;

  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;

  background: var(--bg);
  color: var(--text);

  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.6;
}

.home-page button,
.home-page input,
.home-page textarea,
.home-page select {
  font: inherit;
}

.home-page a:focus-visible,
.home-page button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.home-page [hidden] {
  display: none !important;
}


/* =========================================================
   НАВИГАЦИЯ
   ========================================================= */

.home-page .main-nav--home {
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}

.home-page .main-nav--home .nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 28px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.home-page .main-nav--home .nav-item {
  min-width: 0;
}

.home-page .main-nav--home .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 6px 0;

  border-bottom: 2px solid transparent;

  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;

  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.home-page .main-nav--home .nav-link:hover,
.home-page .main-nav--home .nav-link:focus-visible,
.home-page .main-nav--home .nav-link--active,
.home-page .main-nav--home .nav-link[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}


/* =========================================================
   ОСНОВНОЙ КОНТЕНТ
   ========================================================= */

.home-page main {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-width: 0;
  margin-top: 0;
  padding: var(--sp-2xl) var(--sp-md);
}

.home-page .container {
  width: 100%;
  max-width: 1200px;
  min-width: 0;
}


/* =========================================================
   ЗАГОЛОВОК
   ========================================================= */

.home-page .hero-section {
  margin-bottom: var(--sp-xl);

  text-align: center;

  animation: homeFadeIn 0.8s ease-out;
}

.home-page .main-title {
  margin-bottom: var(--sp-lg);

  font-size: clamp(32px, 7vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;

  overflow-wrap: anywhere;
}

.home-page .main-title .highlight,
.home-page .main-title .regular {
  display: inline-block;
}

/* «КОРОЛЕВА» */

.home-page .main-title .highlight {
  color: var(--primary);
}

/* «ЮЛИЯ» */

.home-page .main-title .regular {
  color: var(--home-heading-color);
}


/* =========================================================
   КАРТОЧКИ НАПРАВЛЕНИЙ
   ========================================================= */

.home-page .directions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);

  min-width: 0;
}

.home-page .direction-card {
  position: relative;
  isolation: isolate;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-width: 0;
  min-height: 300px;
  padding: 0;

  overflow: hidden;

  background: var(--bg-card);
  border: none;

  color: var(--home-heading-color);
  text-align: center;
  text-decoration: none;
  cursor: pointer;

  transition: transform 0.3s ease;

  animation: homeSlideUpIn 0.8s ease-out backwards;
}

.home-page .direction-card:nth-child(1) {
  animation-delay: 0.2s;
}

.home-page .direction-card:nth-child(2) {
  animation-delay: 0.4s;
}

.home-page .direction-card:nth-child(3) {
  animation-delay: 0.6s;
}


/* Фоновое изображение */

.home-page .card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0.3;

  transition: opacity 0.3s ease;
}


/* Название */

.home-page .card-content {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-width: 0;
  padding: 24px 12px;
}

.home-page .card-title {
  max-width: 100%;

  color: var(--home-heading-color);
  font-size: clamp(18px, 2.3vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;

  overflow-wrap: anywhere;
  text-transform: uppercase;
  text-shadow: none;
}


/* Бирюзовая обводка */

.home-page .direction-card::before {
  position: absolute;
  inset: 0;
  z-index: 2;

  border: 1px solid var(--primary);

  box-shadow:
    inset 0 0 18px rgba(var(--primary-rgb), 0.16);

  content: '';
  opacity: 0;
  pointer-events: none;

  transition: opacity 0.3s ease;
}


/* Наведение — только на устройствах с мышью */

@media (hover: hover) and (pointer: fine) {
  .home-page .direction-card:hover {
    transform: translateY(-6px);
  }

  .home-page .direction-card:hover .card-bg {
    opacity: 0.4;
  }

  .home-page .direction-card:hover .card-title {
    color: var(--home-heading-color);
  }

  .home-page .direction-card:hover::before {
    opacity: 1;
  }
}


/* Управление клавиатурой */

.home-page .direction-card:focus-visible::before {
  opacity: 1;
}


/* =========================================================
   АНИМАЦИИ
   ========================================================= */

@keyframes homeSlideUpIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* =========================================================
   ФУТЕР
   ========================================================= */

.home-page footer {
  flex-shrink: 0;

  margin-top: auto;
  padding: var(--sp-lg) var(--sp-md);
  padding-bottom: max(
    var(--sp-lg),
    env(safe-area-inset-bottom, 0px)
  );

  background: var(--bg-card);
  border-top: none;

  text-align: center;
}

.home-page .footer-content {
  width: 100%;
  max-width: 1200px;
  min-width: 0;
  margin: 0 auto;
}

.home-page .footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px var(--sp-lg);

  margin-bottom: var(--sp-md);

  font-size: 13px;
}

.home-page .footer-links a {
  max-width: 100%;

  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;

  overflow-wrap: anywhere;

  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.home-page .footer-links .vk-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border-radius: 6px;
}

.home-page .footer-links .vk-link svg {
  display: block;
}

.home-page .footer-links .privacy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  max-width: 100%;

  font-weight: 600;
}

.home-page .footer-links a:hover {
  color: var(--accent);
}

.home-page .footer-links .vk-link:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

.home-page .footer-bottom {
  padding-top: var(--sp-md);

  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}


/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================= */

@media (max-width: 768px) {
  .home-page main {
    padding: 20px 16px;
  }

  .home-page .hero-section {
    margin-bottom: 16px;
    animation: none;
  }

  .home-page .main-title {
    margin-bottom: 12px;

    font-size: clamp(26px, 6.5vw, 38px);
    line-height: 1.12;
    letter-spacing: -0.7px;
  }

  .home-page .main-nav--home {
    margin-top: 8px;
    margin-bottom: 16px;
  }

  .home-page .main-nav--home .nav-menu {
    gap: 0 22px;
  }

  .home-page .main-nav--home .nav-link {
    min-height: 44px;
    padding: 6px 0;

    font-size: 14px;
  }

  .home-page .directions-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .home-page .direction-card {
    /*
      vh — запасной вариант.
      svh учитывает открытые панели браузера.

      Задаётся минимальная высота:
      при увеличении текста карточка может вырасти.
    */
    min-height: clamp(88px, 16vh, 140px);
    min-height: clamp(88px, 16svh, 140px);

    animation: none;
  }

  .home-page .card-content {
    padding: 16px;
  }

  .home-page .card-title {
    font-size: clamp(21px, 5vw, 26px);
    line-height: 1.2;
  }

  .home-page footer {
    padding: 10px 16px;
    padding-bottom: max(
      10px,
      env(safe-area-inset-bottom, 0px)
    );
  }

  .home-page .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 14px;

    margin-bottom: 4px;

    font-size: 12px;
  }

  .home-page .footer-links .privacy-link {
    flex: 0 1 auto;
    min-width: 0;
  }

  .home-page .footer-bottom {
    padding-top: 4px;

    font-size: 11px;
    line-height: 1.5;
  }
}


/* =========================================================
   НЕВЫСОКИЕ ЭКРАНЫ ТЕЛЕФОНОВ
   ========================================================= */

@media (max-width: 768px) and (max-height: 700px) {
  .home-page main {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .home-page .hero-section {
    margin-bottom: 10px;
  }

  .home-page .main-title {
    margin-bottom: 8px;
  }

  .home-page .main-nav--home {
    margin-top: 4px;
    margin-bottom: 10px;
  }

  .home-page .directions-grid {
    gap: 10px;
  }

  .home-page .direction-card {
    min-height: clamp(80px, 15vh, 105px);
    min-height: clamp(80px, 15svh, 105px);
  }
}


/* =========================================================
   ОЧЕНЬ УЗКИЕ ЭКРАНЫ
   ========================================================= */

@media (max-width: 360px) {
  .home-page .main-title {
    font-size: 25px;
  }

  .home-page .main-nav--home .nav-menu {
    gap: 0 16px;
  }

  .home-page .main-nav--home .nav-link {
    font-size: 13px;
  }

  .home-page .card-title {
    font-size: 21px;
  }

  .home-page .footer-links {
    gap: 4px 10px;
  }

  .home-page .footer-links .privacy-link {
    font-size: 11px;
  }
}


/* =========================================================
   УМЕНЬШЕНИЕ ДВИЖЕНИЯ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .home-page *,
  .home-page *::before,
  .home-page *::after {
    animation: none !important;
    transition: none !important;
  }

  .home-page .direction-card:hover {
    transform: none;
  }
}