/* ==========================================================================
   Дизайн-система «Маршрут»
   Тёплая бумага + чернильные плиты, кириллический гротеск Golos Text,
   моноширинный служебный слой JetBrains Mono, терракотовый сигнальный цвет.
   Mobile-first: всё написано от 375px и расширяется вверх.
   ========================================================================== */

:root {
  /* поверхности */
  --paper: #f3eee4;
  --paper-raise: #fbf9f4;
  --paper-alt: #eae2d2;
  --ink: #16140f;
  --ink-slab: #1b1913;
  --ink-soft: #3b362c;

  /* текст */
  --muted: #6d6558;
  --muted-ink: #a9a091;

  /* линии */
  --line: #dcd4c4;
  --line-strong: #c8bfab;
  --line-ink: rgba(243, 238, 228, 0.16);

  /* сигнал */
  --accent: #bf4626;
  --accent-deep: #93331a;
  --accent-ink: #e07a45;

  /* типографика */
  --sans: "Golos Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ритм */
  --gutter: 20px;
  --maxw: 1120px;
  --dock-h: 74px;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

summary {
  display: block;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* --------------------------------------------------------------- сетка */

.wrap {
  margin: 0 auto;
  max-width: var(--maxw);
  padding-inline: var(--gutter);
  width: 100%;
}

.section {
  padding-block: 56px;
  position: relative;
  scroll-margin-top: 8px;
}

.section + .section {
  border-top: 1px solid var(--line);
}

/* тёмные плиты сами себе разделитель */
.section-shift,
.section-author,
.section-closing,
.section-shift + .section,
.section-author + .section,
.section-closing + .section {
  border-top: 0;
}

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

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

h1 {
  font-size: clamp(1.95rem, 7.2vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.034em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.6rem, 5.6vw, 2.55rem);
  letter-spacing: -0.028em;
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
  line-height: 1.32;
}

p {
  margin: 0;
}

em {
  font-style: normal;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lede,
.section-lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 4vw, 1.2rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.lede {
  margin-top: 20px;
  max-width: 38ch;
}

.section-lede {
  margin-top: 16px;
  max-width: 54ch;
}

/* --------------------------------------------------- служебный слой */

.kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  gap: 10px;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.kicker-index {
  color: var(--accent);
  padding-right: 14px;
  position: relative;
}

.kicker-index::after {
  background: currentColor;
  content: "";
  height: 1px;
  opacity: 0.5;
  position: absolute;
  right: 0;
  top: 50%;
  width: 9px;
}

.kicker-light {
  color: var(--muted-ink);
}

.kicker-light .kicker-index {
  color: var(--accent-ink);
}

.eyebrow {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  gap: 10px;
  letter-spacing: 0.14em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.eyebrow-live {
  background: var(--accent);
  border-radius: 100px;
  color: var(--paper);
  padding: 4px 10px;
}

.text-link {
  border-bottom: 1px solid currentColor;
  display: inline-block;
  font-weight: 500;
  padding-bottom: 1px;
  transition: opacity 160ms ease;
}

.text-link:hover {
  opacity: 0.65;
}

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

.cta {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  gap: 12px;
  justify-content: space-between;
  letter-spacing: -0.012em;
  min-height: 58px;
  padding: 14px 20px;
  transition:
    transform 140ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
  width: 100%;
}

.cta:active {
  transform: translateY(1px);
}

.cta-hint {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
  white-space: nowrap;
}

.cta-solid {
  background: var(--ink);
  color: var(--paper);
}

.cta-solid:hover {
  background: var(--accent-deep);
}

.cta-light {
  background: var(--paper);
  color: var(--ink);
}

.cta-light:hover {
  background: #fff;
}

.cta-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.cta-ghost:hover {
  background: var(--paper-alt);
  border-color: var(--ink);
}

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

.site-header {
  align-items: center;
  backdrop-filter: saturate(150%) blur(12px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px var(--gutter);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  letter-spacing: -0.02em;
  width: 38px;
}

.site-header nav {
  display: none;
}

/* На мобильном главное действие живёт в нижней панели, поэтому в шапке
   ссылка тихая; на десктопе она становится основной кнопкой. */
.header-cta {
  border: 1px solid transparent;
  border-radius: 100px;
  color: var(--muted);
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 9px 2px;
  text-transform: uppercase;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.header-cta:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* --------------------------------------------------------------- подвал */

footer {
  background: var(--ink);
  color: var(--muted-ink);
  padding-block: 40px;
}

.footer-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.footer-inner .brand {
  border-color: var(--line-ink);
  color: var(--paper);
}

.footer-inner p {
  font-size: 0.9rem;
  max-width: 30ch;
}

.footer-inner > a:last-child {
  border-bottom: 1px solid var(--line-ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding-bottom: 2px;
}

/* ------------------------------------------------- нижняя панель действий */

.dock {
  align-items: center;
  backdrop-filter: saturate(170%) blur(14px);
  background: color-mix(in srgb, var(--paper-raise) 93%, transparent);
  border-top: 1px solid var(--line-strong);
  bottom: 0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  left: 0;
  padding: 10px var(--gutter);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  right: 0;
  z-index: 50;
}

.dock-price {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.dock-price b {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dock-price span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-cta {
  background: var(--ink);
  border-radius: 6px;
  color: var(--paper);
  flex: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 15px 20px;
  transition: background-color 160ms ease;
}

.dock-cta:active {
  background: var(--accent-deep);
}

/* ============================================================== планшет */

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
  }

  .section {
    padding-block: 76px;
  }

  .cta {
    min-width: 268px;
    width: auto;
  }
}

/* ============================================================= десктоп */

@media (min-width: 900px) {
  :root {
    --gutter: 40px;
    --dock-h: 0px;
  }

  body {
    font-size: 17px;
  }

  .section {
    padding-block: 104px;
    scroll-margin-top: 70px;
  }

  .site-header {
    padding-block: 14px;
  }

  .site-header nav {
    display: flex;
    font-family: var(--mono);
    font-size: 12px;
    gap: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .site-header nav a {
    color: var(--muted);
    padding-block: 4px;
    position: relative;
    transition: color 160ms ease;
  }

  .site-header nav a::after {
    background: var(--accent);
    bottom: 0;
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 200ms ease;
    width: 100%;
  }

  .site-header nav a:hover {
    color: var(--ink);
  }

  .site-header nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .header-cta {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 9px 18px;
    text-transform: none;
  }

  .header-cta:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
  }

  .dock {
    display: none;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-inner p {
    max-width: none;
  }
}

/* --------------------------------------------------------- доступность */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
