/* ===== Шрифты: только локальные файлы, никаких внешних запросов (152-ФЗ) ===== */

/* Inter (variable: wght + opsz — на крупных кеглях автоматически становится Inter Display) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-cyrillic-opsz-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cormorant Garamond Italic 500 — акцентное слово и крупные цифры */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-cyrillic-500-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Палитра 60/30/10 =====
   Все цвета ниже — только эти переменные (и их смеси через color-mix). */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2a0f17; /* 60% — тёмный бордо */
  --surface: #f3e3dc; /* 30% — пудровый */
  --accent: #d9b26f; /* 10% — шампань-золото */
  --on-bg: #f3e3dc;
  --on-surface: #2a0f17;
  --on-accent: #2a0f17;
  /* Акцентный ТЕКСТ: на фоне страницы и на карточках */
  --accent-text: #d9b26f;
  --accent-text-surface: #7a5518;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3e3dc;
  --surface: #2a0f17;
  --accent: #d9b26f;
  --on-bg: #2a0f17;
  --on-surface: #f3e3dc;
  --on-accent: #2a0f17;
  --accent-text: #7a5518;
  --accent-text-surface: #d9b26f;
}

:root {
  /* Производные — только смеси базовых переменных */
  --muted: color-mix(in srgb, var(--on-bg) 74%, var(--bg));
  --muted-surface: color-mix(in srgb, var(--on-surface) 74%, var(--surface));
  --line: color-mix(in srgb, var(--on-bg) 16%, var(--bg));
  --line-surface: color-mix(in srgb, var(--on-surface) 14%, var(--surface));
  --pill: color-mix(in srgb, var(--on-bg) 8%, var(--bg));
  --shadow: color-mix(in srgb, var(--on-surface) 30%, transparent);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --radius: 22px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-optical-sizing: auto;
  line-height: 1.55;
  color: var(--on-bg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--accent-text);
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  color: var(--accent-text);
  letter-spacing: 0;
}

/* ===== Шапка ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header > .wrap {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  justify-self: start;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--pill);
  border: 1px solid var(--line);
}

.nav-pill a {
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-pill a:hover,
.nav-pill a[aria-current="page"] {
  color: var(--on-bg);
  background: color-mix(in srgb, var(--on-bg) 10%, var(--bg));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.theme-toggle,
.btn {
  font: inherit;
  cursor: pointer;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill);
  color: var(--on-bg);
}

/* Простое меню для телефона (без JS) */
.mnav {
  display: none;
  position: relative;
}

.mnav summary {
  list-style: none;
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.mnav summary::-webkit-details-marker {
  display: none;
}

.mnav nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: 0 20px 40px var(--shadow);
}

.mnav nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.mnav nav a:hover {
  background: color-mix(in srgb, var(--on-surface) 8%, var(--surface));
}

.mnav nav .btn {
  margin-top: 6px;
  color: var(--on-accent);
}

/* ===== Кнопки ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: filter 0.15s, background 0.15s;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.92rem;
}

.btn-ghost {
  background: transparent;
  color: var(--on-bg);
  border-color: color-mix(in srgb, var(--on-bg) 40%, var(--bg));
}

.btn-ghost:hover {
  filter: none;
  background: var(--pill);
}

/* ===== Первый экран ===== */
.hero {
  position: relative;
  padding: 56px 0 96px;
  overflow: clip;
  isolation: isolate;
}

/* Мягкое свечение снизу по центру */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 40px;
  width: min(1000px, 140vw);
  height: 560px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent), transparent);
  opacity: 0.5;
  filter: blur(70px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

.hero h1 {
  margin: 0 auto 28px;
  max-width: 1000px;
  font-size: clamp(2.3rem, 5.2vw, 4.125rem); /* ~66px на десктопе */
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
}

.hero h1 .accent {
  font-size: 1.14em;
  line-height: 0.9;
}

.hero-row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 620px) 1fr;
  gap: 32px;
  align-items: start;
}

.hero-center {
  text-align: center;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-stats {
  display: grid;
  gap: 22px;
  align-content: start;
}

.hero-stats--right {
  text-align: right;
}

.hero-stats p {
  margin: 0;
}

.stat-num {
  display: block;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: 3.1rem;
  line-height: 1;
  color: var(--on-bg);
}

.stat-label {
  display: block;
  margin-top: 6px;
  max-width: 20ch;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stats--right .stat-label {
  margin-left: auto;
}

/* ===== Парящие карточки ===== */
.float-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 64px;
  perspective: 1400px;
}

.fcard {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: 0 30px 60px -10px var(--shadow);
}

.fcard--left {
  margin-top: 40px;
  transform: rotateY(16deg);
  transform-origin: right center;
}

.fcard--right {
  margin-top: 40px;
  transform: rotateY(-16deg);
  transform-origin: left center;
}

.fcard--accent {
  background: var(--accent);
  color: var(--on-accent);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.fcard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 600;
}

.fcard-head span {
  color: var(--muted-surface);
  font-weight: 500;
}

.plan {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line-surface);
  font-size: 0.9rem;
}

.plan li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.plan .tag {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--line-surface);
  color: var(--on-surface);
}

.plan .tag--now {
  background: var(--accent);
  color: var(--on-accent);
}

.plan .tag--later {
  background: transparent;
  color: var(--muted-surface);
  border: 1px solid var(--line-surface);
}

.gauge {
  position: relative;
  margin: auto 0 0;
  text-align: center;
}

.gauge svg {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}

.gauge-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 34%;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: 4rem;
  line-height: 1;
}

.gauge-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted-surface);
}

/* ===== Секции ===== */
section {
  padding: 64px 0;
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.grid-4,
.grid-3 {
  display: grid;
  gap: 16px;
}

.card,
.step,
.author {
  background: var(--surface);
  color: var(--on-surface);
  border-radius: var(--radius);
  padding: 22px;
}

.card h3,
.step h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p,
.step p,
.author p {
  margin: 0;
  color: var(--muted-surface);
}

.author a {
  color: var(--accent-text-surface);
  font-weight: 650;
}

.how {
  counter-reset: how;
}

.step {
  counter-increment: how;
}

.step h3::before {
  content: counter(how);
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent-text-surface);
}

/* Скриншоты: телефон — прокручиваемая лента */
.shots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.shot {
  margin: 0;
  flex: 0 0 min(72vw, 260px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 36px var(--shadow);
}

.shot figcaption {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.note {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px;
}

.note p {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

.page {
  padding: 56px 0 96px;
}

.page h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.todo {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ===== Адаптив ===== */
@media (min-width: 720px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

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

@media (min-width: 900px) {
  .shots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    padding-bottom: 0;
  }

  .shot {
    flex: none;
  }
}

@media (min-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Планшет: убираем таблетку, оставляем простое меню */
@media (max-width: 1080px) {
  .nav-pill {
    display: none;
  }

  .mnav {
    display: block;
  }
}

/* Узкие экраны: цифры по бокам убираем, карточки друг под другом без наклона */
@media (max-width: 860px) {
  .hero-row {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    display: none;
  }

  .float-cards {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 440px;
    margin-inline: auto;
    margin-top: 48px;
    perspective: none;
  }

  .fcard--left,
  .fcard--right {
    margin-top: 0;
    transform: none;
  }

  .fcard--accent {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .header-cta {
    display: none;
  }

  .hero {
    padding: 32px 0 64px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  section {
    padding: 48px 0;
  }
}

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