/* ============================================================
   БАЗА: сброс, типографика, сетка и раскладка всех секций.
   Поверхности и кнопки — в components.css, цвета — в tokens.css.
   ============================================================ */


/* ---------- Сброс ---------- */

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

html {
  overflow-x: clip;                   /* страховка от горизонтальной прокрутки на телефоне */
  scroll-behavior: smooth;
  scroll-padding-top: 104px;          /* якоря не прячутся под шапкой */
}

body {
  margin: 0;
  background: var(--light-bottom);
  color: var(--ink-on-light);
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;                   /* никакой горизонтальной прокрутки */
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--ink); }

p { margin: 0; }

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-small);
  background: #16181b;
  color: #eef0f2;
  text-decoration: none;
}
.skip-link:focus { top: var(--s4); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* ---------- Типографика ---------- */

.h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--t-h1);
  line-height: 1.02;
  letter-spacing: -.025em;
}
.h1 .h1-second { color: var(--muted); }
.hero .h1 { max-width: 16ch; }

.h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: -.02em;
}

.h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--t-h3);
  line-height: 1.25;
  letter-spacing: -.01em;
}

.lead {
  max-width: 46ch;
  font-size: 18px;
  color: var(--muted);
}

.note { font-size: 13px; line-height: 1.5; color: var(--muted); }


/* ---------- Контейнер и заголовок секции ---------- */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  max-width: 760px;
}

.stack { display: flex; flex-direction: column; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: var(--s5);
  align-items: stretch;
}


/* ============================================================
   ШАПКА — светлое стекло, висит над всеми секциями
   ============================================================ */

.site-header {
  position: sticky;
  top: var(--s4);
  z-index: 70;            /* выше баннера про cookie: открытое меню ничем не перекрыто */
  max-width: 1240px;
  width: calc(100% - 32px);
  margin: var(--s4) auto -86px;      /* шапка «лежит» поверх первого экрана */
  padding: 8px 8px 8px var(--s5);
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}


.brand-text { display: flex; flex-direction: column; gap: 2px; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 17px;
  letter-spacing: .26em;
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 28px;
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: wrap;
}

.site-header .header-cta { margin-left: auto; }
.site-header { position: sticky; }   /* меню раскрывается под шапкой */

/* ---------- Кнопка «три полоски» и меню для телефона/планшета ---------- */

.burger {
  display: none;
  width: 48px;
  height: 48px;
  margin-left: auto;
  flex: none;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  position: relative;
  transition: background-color var(--base) var(--ease);
}
.burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--slow) var(--ease), opacity var(--base) var(--ease), top var(--slow) var(--ease);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 23px; }
.burger span:nth-child(3) { top: 30px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 23px; transform: rotate(-45deg); }
.burger:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.burger:hover { background: rgba(255, 255, 255, .85); }

.mobile-menu,
.mobile-menu.glass {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100svh - 120px);
  overflow: auto;
  /* почти непрозрачное стекло — пункты читаются поверх любого фото */
  background: linear-gradient(160deg, rgba(246, 247, 249, .97), rgba(232, 235, 239, .96));
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: inset 0 1px 0 #fff, 0 24px 60px rgba(18, 21, 26, .28);
  animation: menu-in var(--slow) var(--ease) both;
}
.mobile-menu[hidden] { display: none; }
.mobile-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--s4);
  border-radius: var(--radius-small);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  transition: background-color var(--fast) var(--ease);
}
.mobile-link:hover, .mobile-link:focus-visible { background: rgba(255, 255, 255, .7); outline: none; }
.mobile-menu .btn { margin-top: var(--s2); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }


/* ============================================================
   1. ПЕРВЫЙ ЭКРАН · светлая
   ============================================================ */

.hero { padding: 142px 0 var(--s9); }

.hero-inner { display: flex; flex-direction: column; gap: var(--s8); }

.hero-grid {
  display: grid;
  /* текстовая колонка шире: заголовок набран крупно (--t-h1) и не должен залезать на фото */
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  min-height: 640px;
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: 72px var(--s8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s6);
}

.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }

.hero-photo {
  position: relative;
  overflow: hidden;
  background: #2a2d31;
}
/* фото мягко растворяется к тексту: плавный переход цветом панели
   (без mask-image — в Safari маска вместе с движущимся фото могла скрывать картинку) */
.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, #e1e4e8 0, rgba(225, 228, 232, .85) 8%, rgba(225, 228, 232, 0) 26%);
}
.hero-photo.is-pan img { transform: scale(1.14); }
/* несколько фото на первом экране сменяют друг друга плавным наплывом */
.hero-photo img { opacity: 0; transition: opacity 1200ms var(--ease); }
.hero-photo img.is-on { opacity: 1; }
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
}

.hero-card {
  position: absolute;
  right: var(--s6);
  bottom: var(--s6);
  width: 300px;
  z-index: 3;
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* Четыре цифры под панелью */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0;
  padding: var(--s6) var(--s5);
}
.fact {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s2) var(--s5);
  border-left: 1px solid var(--line);
}
.fact:first-child { border-left: 0; }
.fact .num { font-size: clamp(40px, 4vw, 60px); }
.fact .num .ph { font-size: 16px; letter-spacing: 0; }


/* ============================================================
   2. СТАКАН: обычный блок, страница по нему прокручивается как обычно.
   Сверху стакан, под ним три карточки с цифрами и мыслями.
   ============================================================ */

.cup-scroll { position: relative; }

.cup-visual {
  position: relative;
  padding: var(--s8) 0 var(--s4);
  overflow: hidden;
}

.cup-figure {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(72vw, 880px);
  /* края фото растворяются в графитовом фоне: стакан «висит» в секции */
  -webkit-mask-image: radial-gradient(ellipse 34% 50% at 50% 50%, #000 64%, transparent 100%);
  mask-image: radial-gradient(ellipse 34% 50% at 50% 50%, #000 64%, transparent 100%);
}

/* тёплый свет за стаканом: статичная студийная подсветка */
.cup-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: min(70vw, 980px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(217, 160, 102, .2), rgba(168, 98, 46, .06) 38%, transparent 64%);
  pointer-events: none;
}

.cup-steps {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--s5);
  padding: 0 var(--s6) var(--s9);
  max-width: 1240px;
  margin: 0 auto;
}

.cup-step { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); }
.cup-step .num { font-size: clamp(56px, 6vw, 96px); }
.cup-step .h3 { font-size: clamp(22px, 2vw, 28px); }


/* ============================================================
   2. МОДЕЛЬ · тёмная
   ============================================================ */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--s7);
  align-items: center;
}

.card { padding: 28px var(--s6); }
.card-lg { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); }


/* ============================================================
   3. ЭКОНОМИКА · светлая
   ============================================================ */

.econ-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.econ-table th,
.econ-table td {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  text-align: right;
  vertical-align: baseline;
  font-weight: 400;
}
.econ-table th:first-child,
.econ-table td:first-child { text-align: left; color: var(--muted); padding-right: var(--s4); }
.econ-table thead th {
  border-top: 0;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.econ-table td.mono { white-space: nowrap; }
.econ-table tr.strong td { color: var(--ink); }
.econ-table tr.strong td .num { font-size: clamp(18px, 1.7vw, 24px); }
.econ-table td + td, .econ-table th + th { padding-left: var(--s4); }

.timeline-mini { display: flex; flex-direction: column; gap: var(--s3); }
.timeline-mini .track { display: flex; gap: 3px; background: transparent; height: 6px; }
.timeline-mini .track span { flex: 1 1 0; border-radius: 2px; background: var(--track); }
.timeline-mini .track span.seg-zero { background: rgba(198, 205, 214, .4); }
.timeline-mini .track span.on { background: var(--bar); }
.timeline-mini .scale { display: flex; justify-content: space-between; font-size: 12px; }


/* ============================================================
   4. ФОРМАТ · тёмная
   ============================================================ */

.num.format-price { font-size: clamp(56px, 6vw, 88px); }


/* ============================================================
   5. ПУТЬ К ОТКРЫТИЮ · светлая
   ============================================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.step .h3 { font-size: 20px; }
.step p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.step .mono { font-size: 13px; color: var(--muted); }


/* ============================================================
   7. СЕТЬ СЕГОДНЯ · светлая
   ============================================================ */

.founder { padding: var(--s4); display: flex; flex-direction: column; gap: 20px; }
.founder-photo {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  background: #2a2d31;
}
.founder-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.founder-quote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.4;
}


/* Галерея павильонов (в секции «Сеть сегодня») */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--s4);
}
.gallery-item {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-big);
  overflow: hidden;
  background: #2a2d31;
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 18px 40px rgba(18, 21, 26, .16);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .chip { position: absolute; left: var(--s3); bottom: var(--s3); }


/* ============================================================
   8. ОДИН ШАГ · тёмная
   ============================================================ */

.cta-photo {
  position: relative;
  min-height: 460px;
  border-radius: var(--radius-big);
  overflow: hidden;
  border: 1px solid rgba(198, 205, 214, .16);
  background: #2a2d31;
}
.cta-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta-plate {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
}


/* ============================================================
   9. ВОПРОСЫ · светлая
   ============================================================ */

.faq-panel {
  padding: var(--s7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s7);
  align-items: flex-start;
}
.faq-head { flex: 1 1 280px; }
.faq-list { flex: 999 1 520px; min-width: 0; border-bottom: 1px solid var(--line); }


/* ============================================================
   ПОДВАЛ
   ============================================================ */

.site-footer {
  background: linear-gradient(155deg, #1a1d22 0%, #101216 46%, #0a0b0e 100%);
  padding: var(--s8) 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s6);
  justify-content: space-between;
  align-items: flex-start;
}
.footer-docs { display: flex; flex-direction: column; gap: 10px; }
.footer-docs .nav-link { font-size: 14px; }


/* ---------- Плавающая панель: только на телефоне ---------- */

.mbar { display: none; }


/* ---------- Плавное появление блоков ---------- */

/* сдвиг через translate, чтобы не мешать transform у реакций на мышь */
.js .reveal {
  opacity: 0;
  translate: 0 12px;
  transition: opacity var(--slow) var(--ease), translate var(--slow) var(--ease),
              transform var(--slow) var(--ease), box-shadow var(--slow) var(--ease), border-color var(--base) var(--ease);
}
.js .reveal.is-in { opacity: 1; translate: none; }


/* ============================================================
   ПЛАНШЕТ И НЕБОЛЬШИЕ НОУТБУКИ (до 980 px)
   ============================================================ */

@media (max-width: 980px) {
  .site-nav { display: none; }                         /* меню не помещается в одну строку — вместо него «три полоски» */
  .burger { display: block; }
  .site-header .header-cta { margin-left: auto; }
  .site-header .header-cta + .burger { margin-left: 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; height: clamp(300px, 52vw, 460px); }
  .hero-photo::after { background: linear-gradient(0deg, #e2e5e9 0, rgba(226, 229, 233, .8) 10%, rgba(226, 229, 233, 0) 38%); }
  .hero-text { padding: var(--s4) var(--s7) var(--s7); }
  .hero-card { display: none; }                        /* окупаемость и так видна в цифрах */
}


/* ============================================================
   ТЕЛЕФОН (до 760 px)
   ============================================================ */

@media (max-width: 760px) {
  .wrap { padding: 0 var(--s4); }
  .section { padding: var(--s8) 0; }
  .hide-m { display: none !important; }

  .site-header { padding: 10px var(--s4); min-height: 60px; margin-bottom: -76px; }

  .hero { padding-top: 92px; padding-bottom: var(--s8); }
  .facts { padding: var(--s3) var(--s5); }
  .hero-actions .btn { width: 100%; }
  .fact { border-left: 0; border-top: 1px solid var(--line); padding: var(--s5) 0; }
  .fact:first-child { border-top: 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; height: 340px; }
  .hero-photo::after { background: linear-gradient(0deg, #e2e5e9 0, rgba(226, 229, 233, .8) 10%, rgba(226, 229, 233, 0) 38%); }
  .hero-text { padding: var(--s2) var(--s5) var(--s6); gap: var(--s5); }
  .hero-card { display: none; }      /* окупаемость и так видна в цифрах */

  .card, .card-lg { padding: var(--s5); }
  .faq-panel { padding: var(--s5); gap: var(--s5); }
  .faq-q { font-size: 19px; }

  /* Стакан крупно, карточки под ним друг под другом */
  .cup-visual { padding: var(--s6) 0 0; }
  .cup-figure { width: 128vw; max-width: none; margin-left: calc(50% - 64vw); }
  .cup-steps { padding: 0 var(--s4) var(--s8); gap: var(--s3); }

  /* таблица экономики: суммы переносятся, чтобы влезть в 360 px */
  .econ-table { font-size: 14px; }
  .econ-table td.mono { white-space: normal; }
  .econ-table td + td, .econ-table th + th { padding-left: var(--s2); }
  .econ-table tr.strong td .num { font-size: 20px; white-space: normal; }
  .cup-step .num { font-size: 64px; }

  .site-footer { padding-bottom: 112px; }             /* плавающая кнопка не закрывает подвал */
  .mbar {
    display: flex;
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    margin: 0 12px;
    z-index: 30;
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-menu { animation: none; }
  .burger span { transition: none; }
  .hero-photo img { transition: none; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
}
