/* Base typography and layout */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Глобальная переменная для высоты фиксированного хедера */
:root {
  --header-h: 64px; /* значение по умолчанию, переопределяется JS */
}

.scroll-container {
  width: 100vw;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  box-sizing: border-box;
  padding-top: var(--header-h, 64px);
  scroll-padding-top: var(--header-h, 64px);
}

/* Section layout */
.section {
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
  color: #000000;
  transition: background-color 0.5s ease;
  position: relative;
  overflow: hidden;
  background-image: none !important; /* отключить градиенты Tailwind */
  background-color: #F7F0E3; /* единый светло-бежевый фон */
  scroll-snap-stop: always;
}

/* Typography */
.title {
  font-size: 2rem;
  line-height: 2.5rem;
  margin-bottom: 1rem;
}
.subtitle {
  font-size: 1rem;
}

@media (min-width: 640px) {
  .title { font-size: 2rem; line-height: 3.5rem; }
  .subtitle { font-size: 1rem; }
}

@media (min-width: 1024px) {
  .title { font-size: 2rem; line-height: 2.5rem; }
}

/* Nav dots */
.nav-dots {
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dot.active {
  background-color: white;
  border: 2px solid #3b82f6;
  transform: scale(1.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nav-dots { right: 0.5rem; }
  .dot { width: 8px; height: 8px; }
  .scroll-container { height: calc(100svh - 30px); }
  /* Секции начинаются ниже меню и занимают видимую область ниже хедера */
  .section { 
    flex-direction: column; 
    justify-content: flex-start; 
    padding-top: 0; 
    min-height: calc((100svh - 30px) - var(--header-h, 64px));
  }
  .section .section-left,
  .section .section-right {
    padding: 1rem; /* компактный отступ на мобильных */
    height: calc(((100svh - 30px) - var(--header-h, 64px)) / 2);
    box-sizing: border-box;
    overflow: hidden;
  }
  .section .section-left img,
  .section .section-right img {
    display: block;
    width: auto;
    /* уменьшить высоту изображений в 2 раза относительно высоты половины секции */
    height: calc((((100svh - 30px) - var(--header-h, 64px)) / 4) - 16px);
    max-width: 100vw;
    object-fit: contain;
    margin: 0 auto;
  }
  .section .text-content { width: 100%; text-align: center; margin-top: 1rem; }
  /* 2/3 для текстовых половин, 1/3 для медиа (img/iframe) */
  .section .section-left:has(img),
  .section .section-right:has(img),
  .section .section-left:has(iframe),
  .section .section-right:has(iframe) {
    height: calc((((100svh - 30px) - var(--header-h, 64px)) / 3));
  }
  .section .section-left:not(:has(img)):not(:has(iframe)),
  .section .section-right:not(:has(img)):not(:has(iframe)) {
    height: calc((((100svh - 30px) - var(--header-h, 64px)) * 2 / 3));
  }
  .section .section-left:has(img) img,
  .section .section-right:has(img) img {
    height: calc((((100svh - 30px) - var(--header-h, 64px)) / 3) - 16px);
  }
  /* Дополнительный вертикальный отступ между секциями на мобильных */
  .section { margin-bottom: 24px; }
}

/* Header menu */
.header-menu-link {
  transition: color 0.2s, border-bottom 0.2s;
  padding: 0.5rem 0.75rem;
}
.header-menu-link.active {
  color: #111111;
  font-weight: 700;
  border-bottom: 2px solid #3b82f6;
}

/* Parallax halves */
.section-left, .section-right {
  will-change: transform, opacity;
  transform: translateZ(0);
  transition: transform 0.05s linear, opacity 0.15s ease-out;
}
/* Section images max height */
.section .section-left img,
.section .section-right img {
  max-height: 500px;
}

/* Animations for index pages */
.animate-up { animation: dfSlideUp 600ms ease both; }
.animate-down { animation: dfSlideDown 600ms ease both; }

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

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

/* Animations for contacts pages */
.animate-enter-up { animation: dfEnterUp 600ms ease both; }
.animate-enter-down { animation: dfEnterDown 600ms ease both; }
.enter-up { animation: dfEnterUp 600ms ease both; }
.enter-down { animation: dfEnterDown 600ms ease both; }

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

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

/* Contacts pages overrides (body has text-black class) */
.text-black .section {
  color: #000000;
  background-color: #ffffff;
  scroll-snap-stop: always;
}

html[lang="ru"] .text-black .header-menu-link.active {
  color: #000000;
  border-bottom: 2px solid #3b82f6;
}

html[lang="en"] .text-black .header-menu-link.active {
  color: #111827;
  border-bottom: 2px solid #1f2937;
}
/* Store badges sizing */
#appStoreBtn img,
#googlePlayBtn img {
  width: 100px;
  height: auto;
}

/* Prevent first section from hiding under fixed header */
#section1 {
  scroll-margin-top: var(--header-h, 64px);
}
@media (max-width: 768px) {
  #section1 .section-right { padding-top: 12px; }
}