/* Главная ayda-drive.kg — сайт услуги, держится на фотографиях (taste-skill: service/other).
   Экран — одна секция. Вход один раз на первом экране; два «момента»: главы «Как ездить»
   (картинка закреплена и меняется с шагом) и переключатель «день / ночь» в ценах.
   Движение — профиль Premium (motion-design): 350–600 мс, cubic-bezier(0.4, 0, 0.2, 1),
   без отскоков; ховеры < 100 мс на отклик, нажатие 120 мс. Без JS и при «уменьшить
   движение» всё видно сразу. */

.home {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-quick: 180ms;
  --t-std: 450ms;
  --t-slow: 900ms;
  --sodium: #f2a93b;
}

/* Lenis ведёт прокрутку сам: родная плавная прокрутка ему мешает. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.home section { scroll-margin-top: 72px; }

/* ---------- Шапка: прозрачная над фото, светлая после прокрутки ---------- */

.home .top {
  position: fixed;
  color: #fff;
  transition: background-color var(--t-std) var(--ease), color var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease), padding var(--t-std) var(--ease);
}
.home .top .nav a { color: rgba(255, 255, 255, 0.82); }
.home .top.is-solid {
  color: var(--ink);
  background: rgba(244, 246, 245, 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 12px;
}
.home .top.is-solid .nav a { color: var(--muted); }
.nav a {
  position: relative;
  transition: color var(--t-quick) var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms var(--ease);
}
.nav a:hover { color: inherit !important; }
.nav a:hover::after { transform: scaleX(1); }
.btn-sm { min-height: 44px; padding: 8px 18px; font-size: 15px; }
.btn-lg { min-height: 58px; padding: 14px 28px; font-size: 17px; }
.btn { transition: transform var(--t-quick) var(--ease), background-color var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease); }
.btn-glass {
  color: #fff;
  background: rgba(10, 20, 24, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.btn-glass:hover { background: rgba(10, 20, 24, 0.6); }
.btn-dark { background: var(--graphite); color: var(--lime); }
.btn-dark:hover { background: #22323a; }

.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  background: var(--lime);
  color: var(--on-lime);
}
.soon-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--on-lime);
  animation: soon-pulse 2.4s ease-in-out infinite;
}
@keyframes soon-pulse { 50% { opacity: 0.25; } }

/* ---------- Первый экран ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: #1d2b30;
  isolation: isolate;
}
.hero-photo, .hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-photo { z-index: -2; }
.hero-photo img { object-fit: cover; object-position: 50% 60%; }
.motion .hero-photo, .motion .hero-photo img { will-change: transform; backface-visibility: hidden; }
/* Фон живёт: фото едва заметно «дышит» — только на компьютерах, после входа. */
@media (hover: hover) and (min-width: 901px) {
  .motion .hero-photo img { animation: breathe 22s ease-in-out 2.6s infinite alternate; }
}
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.05); } }
/* затемнение только там, где текст: слева снизу и под шапкой */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 20, 24, 0.5) 0%, rgba(10, 20, 24, 0) 22%),
    linear-gradient(90deg, rgba(10, 20, 24, 0.62) 0%, rgba(10, 20, 24, 0.38) 38%, rgba(10, 20, 24, 0) 66%),
    linear-gradient(0deg, rgba(10, 20, 24, 0.72) 0%, rgba(10, 20, 24, 0.2) 45%, rgba(10, 20, 24, 0) 65%);
}
.hero-copy { padding-block: 140px clamp(48px, 9vh, 96px); }
.hero-title {
  font-weight: 800;
  font-size: clamp(88px, 15vw, 232px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-left: -0.04em;
}
.hero-lead {
  margin-top: clamp(16px, 2vw, 24px);
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}
.hero-lead b { color: #fff; font-weight: 600; }
.hero-more {
  position: relative;
  display: inline-block;
  margin-top: 28px;
  padding: 6px 0;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.hero-more::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--lime);
  transform-origin: left;
  transition: transform 300ms var(--ease);
}
.hero-more:hover::after { transform: scaleX(0.4); }

.mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.06em; }
.rise { display: inline-block; will-change: transform; }
.motion [data-enter] .rise { transform: translateY(110%); }
.motion [data-enter] .fade { opacity: 0; transform: translateY(16px); }
.motion [data-enter] .hero-photo img { transform: scale(1.14); }
/* шапка появляется после заголовка; страховка — сама через 4 с, если скрипт не загрузился */
.motion body.home > .top { opacity: 0; animation: top-failsafe 0s 4s forwards; }
@keyframes top-failsafe { to { opacity: 1; } }

/* Шторка входа: только с анимацией и только в первый заход за сессию (класс .intro). */
.curtain { display: none; }
.motion.intro .curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--lime);
  /* страховка: если скрипт не загрузился, шторка не закроет сайт */
  animation: curtain-failsafe 0s 4s forwards;
}
@keyframes curtain-failsafe { to { visibility: hidden; } }
.curtain-mark { width: 88px; height: 88px; overflow: visible; }
.curtain-mark .half-a { fill: var(--graphite); }
.curtain-mark .half-b { fill: #ffffff; }

/* ---------- Как ездить: главы ---------- */

.how { padding-block: clamp(88px, 11vw, 140px); }
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "title media" "chapters media";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.how-copy { display: contents; }
.how-copy h2 { grid-area: title; }
.chapters { grid-area: chapters; }
.how-media { grid-area: media; }
.how h2, .prices h2 {
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.chapters { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: ch; }
.chapter {
  counter-increment: ch;
  position: relative;
  padding: 28px 0 28px 64px;
  border-top: 1px solid var(--line);
  transition: opacity var(--t-std) var(--ease);
}
.chapter::before {
  content: counter(ch);
  position: absolute;
  left: 0;
  top: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}
.chapter.is-on::before { background: var(--lime); box-shadow: none; }
.chapter h3 { font-weight: 700; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; }
.chapter p { margin-top: 10px; color: var(--muted); max-width: 42ch; font-size: 17px; }

.how-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  background: var(--graphite);
}
.frame { position: absolute; inset: 0; margin: 0; }
.frame > img { width: 100%; height: 100%; object-fit: cover; }
.motion .frame { opacity: 0; transition: opacity var(--t-std) var(--ease); }
.motion .frame > img { transform: scale(1.04); transition: transform 1200ms var(--ease); }
.motion .frame.is-on { opacity: 1; }
.motion .frame.is-on > img { transform: scale(1); }
.motion .chapter { opacity: 0.4; }
.motion .chapter.is-on { opacity: 1; }

@media (min-width: 901px) {
  .how-media { position: sticky; top: 14vh; }
  .motion .chapter { min-height: 40vh; }
}

/* ---------- Цены: «день / ночь» ---------- */

.prices {
  padding-block: clamp(88px, 11vw, 140px);
  background: var(--surface);
  transition: background-color 600ms var(--ease), color 600ms var(--ease);
}
.prices.is-night { background: var(--graphite); color: #f3f6f5; }
.prices-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.daynight {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 600ms var(--ease);
}
.is-night .daynight { background: #22323a; box-shadow: none; }
.dn {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.is-night .dn { color: #a7b6b2; }
.dn.is-on { background: var(--lime); color: var(--on-lime); }
.is-night .dn.is-on { background: var(--sodium); color: #1d1405; }
.classes {
  list-style: none;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  transition: border-color 600ms var(--ease);
}
.is-night .classes, .is-night .cls { border-color: #2a3c44; }
.cls { display: flex; flex-direction: column; gap: 10px; padding: 28px 24px 8px; border-left: 1px solid var(--line); }
.cls:first-child { border-left: 0; padding-left: 0; }
.cls-name { color: var(--muted); font-weight: 600; }
.is-night .cls-name, .is-night .cls-meta, .is-night .prices-note, .is-night .cls-price { color: #a7b6b2; }
.cls-price { color: var(--muted); font-size: 18px; white-space: nowrap; }
.cls-price b {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 108px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 600ms var(--ease);
}
.is-night .cls-price b { color: var(--sodium); }
.cls-meta { color: var(--muted); font-size: 14px; line-height: 1.5; }
.prices-note { margin-top: 36px; max-width: 60ch; color: var(--muted); }

/* ---------- Финал ---------- */

.go { background: var(--lime); color: var(--on-lime); padding-block: clamp(72px, 10vw, 128px); overflow: hidden; }
.go-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.go-title { font-weight: 800; font-size: clamp(52px, 9vw, 150px); line-height: 0.92; letter-spacing: -0.04em; margin-left: -0.03em; }
.go :focus-visible { outline-color: var(--graphite); }

.foot-credits { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- Узкие экраны ---------- */

@media (max-width: 900px) {
  .how-grid { grid-template-columns: 1fr; grid-template-areas: "title" "media" "chapters"; grid-template-rows: auto; }
  .how-media { aspect-ratio: 4 / 3; position: sticky; top: 68px; z-index: 1; margin-top: 24px; }
  .chapters { margin-top: 8px; }
  .home .top.is-solid { background: var(--canvas); }
  .how-copy h2 { max-width: none; }
  .classes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cls:nth-child(3) { border-left: 0; padding-left: 0; }
  .cls:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .hero-title { font-size: clamp(76px, 25vw, 120px); }
  .cls { padding: 22px 14px 18px; }
  .cls:nth-child(odd) { padding-left: 0; }
  .soon-pill { min-height: 34px; padding: 0 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .home * { transition: none !important; }
}
