/* ==========================================================================
   Haze — лендинг. Та же тёмная система, что в приложении: нейтральные
   поверхности, белый акцент, а цветом говорит только время.
   Токены скопированы из src/styles.css приложения намеренно — страница
   должна выглядеть его продолжением, а не соседним продуктом.
   ========================================================================== */

:root {
  --bg: #08090a;
  --surface: #0f1011;
  --surface-2: #151617;
  --surface-3: #1c1e1f;

  --border: #242628;
  --border-strong: #313437;

  --text: #f2f3f4;
  --text-2: #c2c8cd;
  --text-3: #9ba1a6;
  --text-4: #848a8f;

  --accent: #f2f3f4;
  --accent-text: #08090a;

  /* Статусы таймингов приложения. На странице — только как акценты разделов. */
  --t-normal: #5b9dff;
  --t-soon: #f2b544;
  --t-due: #ff8f3f;
  --t-overdue: #ff5c5c;
  --t-done: #4ade80;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 140ms;
  --base: 240ms;

  --wrap: 1120px;
  --gutter: 20px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  /* Якорь не должен уезжать под липкую шапку. */
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Блокировка прокрутки под ящиком. iOS Safari игнорирует overflow: hidden
   на body, поэтому страница фиксируется на своей позиции (top выставляет JS),
   а прокрутка возвращается при закрытии. */
body.isLocked {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

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

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.12;
  font-weight: 700;
}

h1 { font-size: clamp(34px, 6vw, 60px); }
h2 { font-size: clamp(27px, 4vw, 40px); }
h3 { font-size: 19px; letter-spacing: -0.015em; }

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.center { text-align: center; }

.skipLink {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 0 0 var(--r-sm) 0;
  text-decoration: none;
}
.skipLink:focus { left: 0; }

/* ------------------------------ шапка ----------------------------------- */

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 9, 10, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--base) var(--ease);
  padding-top: env(safe-area-inset-top);
}
.siteHeader[data-scrolled] { border-bottom-color: var(--border); }

.headerInner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 9px; }

.navDesktop {
  display: flex;
  gap: 26px;
  font-size: 15px;
}
.navDesktop a {
  color: var(--text-3);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--fast) var(--ease);
}
.navDesktop a:hover,
.navDesktop a:focus-visible { color: var(--text); }

/* ------------------------------ кнопки ---------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 44px — нижняя граница тапаемой зоны, та же, что в приложении. */
  min-height: 46px;
  padding: 12px 22px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.button:active { transform: scale(0.98); }

.buttonPrimary { background: var(--accent); color: var(--accent-text); }
.buttonPrimary:hover { opacity: 0.9; }

.buttonGhost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.buttonGhost:hover { background: var(--surface-2); }

.buttonBig { min-height: 54px; padding-inline: 32px; font-size: 17px; }
.buttonWide { width: 100%; }

.iconButton {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* --------------------------- бургер и ящик ------------------------------ */

.burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
}
.burger span {
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--base) var(--ease), opacity var(--fast) var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.drawerOverlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--base) var(--ease);
}
.drawerOverlay[data-open] { opacity: 1; }

.drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(100%);
  transition: transform var(--base) var(--ease);
}
.drawer[data-open] { transform: translateX(0); }

.drawerHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}
.drawerTitle {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

.drawerNav {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}
.drawerNav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 10px;
  border-radius: var(--r-md);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}
.drawerNav a:active { background: var(--surface-2); }

.drawerFoot { margin-top: auto; display: grid; gap: 10px; }
.drawerNote { color: var(--text-4); font-size: 14px; line-height: 1.45; }

/* ------------------------------- герой ---------------------------------- */

.hero {
  padding-top: clamp(40px, 7vw, 84px);
  padding-bottom: clamp(48px, 8vw, 96px);
  /* Тёплое пятно за телефоном: единственное место, где цвет не про время,
     поэтому он максимально приглушён. */
  background:
    radial-gradient(900px 480px at 78% -6%, rgba(255, 143, 63, 0.10), transparent 62%),
    radial-gradient(700px 420px at 10% 0%, rgba(91, 157, 255, 0.08), transparent 60%);
}

/* Телефон занимает обе строки справа, факты уходят под текст своей строкой:
   в одну строку с текстом они переносились по два и читались как обрывок. */
.heroInner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "text shot"
    "facts shot";
  align-items: start;
  gap: clamp(24px, 5vw, 64px);
}
.heroText { grid-area: text; }
.heroShot { grid-area: shot; align-self: center; }
.heroFacts { grid-area: facts; }

.kicker {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 16px;
}

.lead {
  margin-top: 18px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
  max-width: 34em;
}

.heroActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.heroNote {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-4);
}

.heroFacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.heroFacts li { display: flex; flex-direction: column; }
.heroFacts strong { font-size: 19px; letter-spacing: -0.02em; }
.heroFacts span { font-size: 14px; color: var(--text-4); }

.heroShot { display: flex; justify-content: center; }

/* ------------------------------ телефон --------------------------------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  border: 9px solid #17191b;
  border-radius: 40px;
  background: #17191b;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.phone img { border-radius: 31px; }
.phoneLarge { max-width: 336px; }

.phoneRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.phoneRow .phone { max-width: 258px; }
/* Второй телефон — вспомогательный: он всегда чуть меньше и приглушён,
   чтобы взгляд не метался между двумя равными кадрами. */
.phoneBehind {
  max-width: 214px !important;
  opacity: 0.68;
  transform: scale(0.94);
}

/* ------------------------------ разделы --------------------------------- */

.section { padding: clamp(52px, 8vw, 104px) 0; }
.sectionAlt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sectionInner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
.sectionReverse .sectionText { order: 2; }
.sectionReverse .sectionShot { order: 1; }

.sectionText h2 { margin-bottom: 16px; }
.sectionText > p { color: var(--text-2); max-width: 34em; }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-normal);
  margin-bottom: 14px;
}
.eyebrow[data-accent="soon"] { color: var(--t-soon); }
.eyebrow[data-accent="due"] { color: var(--t-due); }
.eyebrow[data-accent="overdue"] { color: var(--t-overdue); }
.eyebrow[data-accent="done"] { color: var(--t-done); }

.checkList {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.checkList li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
  font-size: 16px;
}
.checkList li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-4);
}

.sectionShot { display: flex; justify-content: center; }

/* сетка «что ещё внутри» */
.grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
}
.grid h3 { margin-bottom: 8px; }
.grid p { color: var(--text-3); font-size: 15px; }

/* шаги установки */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 26px 0 30px;
  padding: 0;
  display: grid;
  gap: 18px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  color: var(--text-3);
  font-size: 16px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.steps strong { display: block; color: var(--text); font-weight: 600; }

/* ------------------------------ финал ----------------------------------- */

.cta {
  padding: clamp(56px, 9vw, 112px) 0;
  text-align: center;
  background:
    radial-gradient(620px 320px at 50% 0%, rgba(255, 143, 63, 0.10), transparent 68%);
}
.ctaInner { display: grid; justify-items: center; gap: 18px; }
.ctaInner p { color: var(--text-3); max-width: 32em; }
.ctaInner .button { margin-top: 10px; }

.siteFooter {
  border-top: 1px solid var(--border);
  padding: 36px 0 calc(36px + env(safe-area-inset-bottom));
  background: var(--surface);
}
.footerInner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.footerBrand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}
.footerBrand img { border-radius: 8px; }
.footerNav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; }
.footerNav a { color: var(--text-3); text-decoration: none; }
.footerNav a:hover { color: var(--text); }
.footerNote {
  width: 100%;
  color: var(--text-4);
  font-size: 14px;
}

/* ------------------------------ фокус ----------------------------------- */

:focus-visible {
  outline: 2px solid var(--t-normal);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ----------------------------- появление -------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
[data-reveal][data-shown] { opacity: 1; transform: none; }

/* ------------------------------ адаптив --------------------------------- */

@media (max-width: 960px) {
  .navDesktop,
  .headerCta { display: none; }
  .burger { display: flex; }

  /* На телефоне порядок другой: сначала слова, потом сам экран приложения,
     и только под ним короткие факты — иначе до скриншота надо листать. */
  .heroInner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "shot"
      "facts";
  }
  .sectionInner { grid-template-columns: 1fr; }
  /* На узком экране картинка всегда под текстом, чем бы ни был порядок
     на десктопе: иначе «перевёрнутые» разделы начинаются со скриншота
     без единого слова объяснения. */
  .sectionReverse .sectionText { order: 1; }
  .sectionReverse .sectionShot { order: 2; }

  .heroText { text-align: left; }
  .heroShot { margin-top: 8px; }

  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }

  .grid { grid-template-columns: 1fr; }

  .heroActions .button { flex: 1 1 100%; }

  /* Второй телефон на узком экране пришлось бы ужать до нечитаемого: от пары
     остаётся главный кадр, и он же становится крупнее. */
  .phoneBehind { display: none; }
  .phoneRow .phone { max-width: 260px; }

  /* Три колонки фактов на 320-360px превращаются в лесенку из обрывков. */
  .heroFacts { grid-template-columns: 1fr; gap: 14px; }
}

/* Движение выключено — страница просто стоит на месте. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
