/* ==========================================================================
   Fungal — лендинг
   Тёмный редакторский грид: брутальные линейки, крупная типографика,
   фотография как основной материал. Один инверсный блок держит ритм.
   ========================================================================== */

/* --- 1. Токены ----------------------------------------------------------- */

:root {
  color-scheme: dark;

  --bone: #f4f1ea;
  --void: #08070c;
  --void-2: #0c0b12;
  --panel: #131120;
  --purple: #6b06ef;
  --purple-lt: #ab7dff;

  /* Пара fg/bg переопределяется в .invert — от неё зависят все компоненты */
  --fg: var(--bone);
  --bg: var(--void);
  --muted: #9c96a9;
  --faint: #6a6478;
  --rule: rgba(244, 241, 234, 0.11);
  --rule-2: rgba(244, 241, 234, 0.22);

  --sans: "Onest", ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --pad: clamp(18px, 4.2vw, 60px);
  --max: 1480px;
  --head: 66px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --swift: cubic-bezier(0.32, 0.72, 0, 1);
}

/* --- 2. База ------------------------------------------------------------- */

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

/* Зерно поверх всей страницы — сшивает фото и плоские плашки */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

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

::selection {
  background: var(--purple);
  color: #fff;
}

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

.skip {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 120;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--purple);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip:focus {
  top: 0;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- 3. Раскладка -------------------------------------------------------- */

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

.sec {
  position: relative;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  color: var(--fg);
}

.sec-pad {
  padding-block: clamp(56px, 8vw, 130px);
}

.invert {
  --fg: #0b0a11;
  --bg: var(--bone);
  --muted: #565062;
  --faint: #7d7788;
  --rule: rgba(11, 10, 17, 0.16);
  --rule-2: rgba(11, 10, 17, 0.3);
}

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

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.kicker i {
  position: relative;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--purple-lt);
}

.kicker i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--purple-lt);
  opacity: 0.45;
  animation: pulse 2.6s var(--ease) infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.07em;
  letter-spacing: -0.005em;
}

.h-display {
  font-size: clamp(2.9rem, 8.4vw, 7.2rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.052em;
  text-wrap: balance;
}

.h-sec {
  font-size: clamp(1.95rem, 4.6vw, 3.7rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.h-sub {
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.032em;
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.dim {
  color: var(--muted);
}

/* Шапка секции: индекс + заголовок + правая ремарка */
.shead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  align-items: end;
  gap: clamp(18px, 3vw, 72px);
  padding-bottom: clamp(28px, 4vw, 56px);
}

/* Индекс раздела: «01 — Витрина» */
.ix {
  display: block;
  margin-bottom: clamp(14px, 2vw, 26px);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ix b {
  color: var(--purple-lt);
  font-weight: 500;
}

.invert .ix b {
  color: var(--purple);
}

/* --- 5. Кнопки ----------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--purple);
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.32s var(--ease), color 0.32s var(--ease),
    border-color 0.32s var(--ease), transform 0.32s var(--ease);
}

.btn svg {
  flex: none;
  transition: transform 0.32s var(--ease);
}

.btn:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn:active {
  transform: scale(0.985);
}

.btn-line {
  background: none;
  border-color: var(--rule-2);
  color: var(--fg);
}

.btn-line:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.btn-sm {
  min-height: 42px;
  padding: 0 18px;
  font-size: 13.5px;
}

/* Текстовая ссылка с подчёркиванием, которое въезжает */
.tlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-weight: 500;
}

.tlink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.tlink:hover::after {
  transform: scaleX(1);
}

/* --- 6. Шапка ------------------------------------------------------------ */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  padding-top: env(safe-area-inset-top);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  backdrop-filter: blur(20px) saturate(140%);
  background: rgba(8, 7, 12, 0.72);
  transition: opacity 0.4s var(--ease);
}

.header.is-stuck {
  border-bottom-color: var(--rule);
}

.header.is-stuck::before {
  opacity: 1;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--head);
}

.logo {
  display: block;
  flex: none;
}

.logo img {
  width: auto;
  height: 25px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
}

.nav-list a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.3s var(--ease);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav-list a:hover {
  color: var(--fg);
}

.nav-list a:hover::after {
  transform: scaleX(1);
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  align-items: center;
  justify-content: center;
}

.burger span {
  position: relative;
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--fg);
  transition: background 0.2s var(--ease);
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.34s var(--swift), top 0.34s var(--swift);
}

.burger span::before {
  top: -6px;
}

.burger span::after {
  top: 6px;
}

body.is-locked .burger span {
  background: transparent;
}

body.is-locked .burger span::before {
  top: 0;
  transform: rotate(45deg);
}

body.is-locked .burger span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Мобильное меню */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--head) + env(safe-area-inset-top) + 24px) var(--pad)
    calc(28px + env(safe-area-inset-bottom));
  background: var(--void);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

body.is-locked .drawer {
  opacity: 1;
  visibility: visible;
}

.drawer-list a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(1.7rem, 8vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.5s var(--ease);
}

body.is-locked .drawer-list a {
  transform: none;
  opacity: 1;
  transition-delay: calc(0.05s * var(--i, 0) + 0.08s);
}

.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-foot .btn {
  width: 100%;
}

/* --- 7. Герой ------------------------------------------------------------ */

/* Первый экран собран одной сеткой: текст и витрина в первом ряду,
   бегущая строка стилей — во втором, встык к нижней кромке экрана.
   Крайние колонки — поля, поэтому строка может уходить в край без 100vw. */
.hero {
  --hero-top: calc(var(--head) + env(safe-area-inset-top) + clamp(22px, 3vw, 44px));
  --ribbon: clamp(100px, 13vh, 152px);

  position: relative;
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--pad), 1fr)
    [main-start] minmax(0, calc(var(--max) * 0.54))
    [split] minmax(0, calc(var(--max) * 0.46))
    [main-end] minmax(var(--pad), 1fr)
    [full-end];
  grid-template-rows: 1fr auto;
  align-items: center;
  min-height: 100svh;
  padding-top: var(--hero-top);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 40%;
  opacity: 0.5;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, var(--void) 0%, rgba(8, 7, 12, 0.9) 34%, rgba(8, 7, 12, 0.42) 62%, rgba(8, 7, 12, 0.78) 100%),
    linear-gradient(180deg, rgba(8, 7, 12, 0.86) 0%, transparent 26%, var(--void) 100%),
    radial-gradient(120% 80% at 78% 18%, rgba(107, 6, 239, 0.34), transparent 58%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  grid-column: main-start / split;
  grid-row: 1;
  padding-right: clamp(20px, 4vw, 72px);
  padding-bottom: clamp(20px, 3vw, 40px);
}

.hero h1 {
  margin: clamp(16px, 2.2vw, 28px) 0 clamp(16px, 1.8vw, 24px);
  font-size: max(3rem, min(7.2rem, 7.8vw, 13vh));
}

.hero h1 em {
  font-style: normal;
  color: var(--purple-lt);
}

.hero .lead {
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 3vw, 38px);
}

/* Лента стилей — нижняя кромка первого экрана */
.hero-ribbon {
  position: relative;
  z-index: 1;
  grid-column: full;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, 0.5vw, 8px);
  height: var(--ribbon);
  overflow: hidden;
  border-top: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(8, 7, 12, 0.35), rgba(8, 7, 12, 0.78));
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

/* --- 8. Витрина ленты (демо мини-аппа) ----------------------------------- */

/* Ширину считаем от свободной высоты первого экрана, иначе витрина
   уезжает под сгиб на невысоких окнах */
.device {
  position: relative;
  z-index: 1;
  grid-column: split / main-end;
  grid-row: 1;
  width: min(392px, 100%, calc((100svh - var(--hero-top) - var(--ribbon) - 64px) * 0.548));
  margin-inline: auto;
}

.device::before {
  content: "";
  position: absolute;
  inset: -14% -10%;
  background: radial-gradient(closest-side, rgba(107, 6, 239, 0.42), transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.device-frame {
  position: relative;
  aspect-ratio: 9 / 16.4;
  overflow: hidden;
  border: 1px solid var(--rule-2);
  border-radius: 30px;
  background: #04040a;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(107, 6, 239, 0.14);
  cursor: pointer;
}

.device-tabs {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 14px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  font-weight: 500;
  pointer-events: none;
}

.device-tabs b {
  position: relative;
  color: #fff;
  font-weight: 600;
}

.device-tabs b::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  border-radius: 2px;
  background: #fff;
}

.feed-stack {
  position: absolute;
  inset: 0;
}

.feed-card {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 8%, 0) scale(1.02);
  transition: opacity 0.62s var(--ease), transform 0.72s var(--ease), visibility 0.72s;
}

.feed-card.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  z-index: 2;
}

.feed-card.is-out {
  opacity: 0;
  visibility: visible;
  transform: translate3d(0, -8%, 0) scale(0.985);
  z-index: 1;
}

.feed-card > picture,
.feed-card > picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.feed-card > picture img {
  object-fit: cover;
}

.feed-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 22%, rgba(0, 0, 0, 0.9) 84%);
}

.feed-rail {
  position: absolute;
  right: 10px;
  bottom: 132px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.feed-rail i {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.feed-rail i svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
}

.feed-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 0 76px 16px 16px;
  color: #fff;
}

.feed-seller {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.feed-seller svg {
  width: 13px;
  height: 13px;
  color: var(--purple-lt);
}

.feed-card h3 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

.feed-card h3 + p {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.3;
}

.feed-price {
  margin: 8px 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.feed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.feed-tags span {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11px;
  line-height: 1.5;
}

.feed-buttons {
  display: flex;
  gap: 8px;
}

.feed-buttons span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.feed-buttons span:first-child {
  flex: 1.6;
  background: var(--purple);
}

.feed-buttons span:last-child {
  flex: 1;
  background: rgba(255, 255, 255, 0.16);
}

/* Индикатор позиции слева от витрины */
.device-dots {
  position: absolute;
  top: 50%;
  left: -30px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
}

.device-dots button {
  display: block;
  width: 2px;
  height: 20px;
  border-radius: 2px;
  background: var(--rule-2);
  transition: background 0.4s var(--ease), height 0.4s var(--ease);
}

.device-dots button[aria-current="true"] {
  height: 34px;
  background: var(--purple-lt);
}

.device-hint {
  margin-top: 16px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
}

/* --- 9. Бегущая строка стилей ------------------------------------------- */

.ticker-row {
  display: flex;
  width: max-content;
  gap: 0;
  animation: slide 44s linear infinite;
}

.ticker-row + .ticker-row {
  animation-direction: reverse;
  animation-duration: 56s;
}

.ticker-row ul {
  display: flex;
  align-items: center;
  flex: none;
}

.ticker-row li {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 34px);
  padding-right: clamp(16px, 2.2vw, 34px);
  font-size: min(2.2rem, 3.2vw, 4.7vh);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.044em;
  white-space: nowrap;
}

.ticker-row li::after {
  content: "";
  width: clamp(6px, 0.7vw, 9px);
  height: clamp(6px, 0.7vw, 9px);
  flex: none;
  border-radius: 50%;
  background: var(--purple);
}

.ticker-row + .ticker-row li {
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 234, 0.32);
}

.ticker-row + .ticker-row li::after {
  background: none;
  border: 1px solid var(--rule-2);
}

@keyframes slide {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* --- 10. Как это работает (инверсный блок) ----------------------------- */

.how {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
  gap: clamp(24px, 4vw, 80px);
}

.how-rail {
  position: sticky;
  top: calc(var(--head) + 40px);
  align-self: start;
}

.how-rail h2 {
  margin-bottom: clamp(20px, 3vw, 40px);
}

.how-rail ol {
  border-top: 1px solid var(--rule);
}

.how-rail li {
  border-bottom: 1px solid var(--rule);
}

.how-rail a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.3s var(--ease), padding-left 0.4s var(--ease);
}

.how-rail a em {
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.how-rail a:hover,
.how-rail li.is-on a {
  color: var(--fg);
  padding-left: 8px;
}

.how-rail li.is-on a em {
  color: var(--purple);
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 15vw, 190px);
  align-items: start;
  gap: clamp(18px, 3vw, 44px);
  padding-block: clamp(26px, 3.6vw, 48px);
  border-top: 1px solid var(--rule);
}

.step:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-num {
  display: block;
  margin-bottom: clamp(12px, 1.6vw, 20px);
  color: transparent;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1px var(--rule-2);
}

.step h3 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.038em;
}

.step p {
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.6;
}

.step-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step-note::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple);
}

.step-shot {
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 3 / 4;
  background: rgba(11, 10, 17, 0.08);
}

.step-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- 11. Деньги --------------------------------------------------------- */

.money {
  position: relative;
  overflow: hidden;
}

.money-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.money-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 76% 30%;
  opacity: 0.62;
}

.money-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(92deg, var(--void) 6%, rgba(8, 7, 12, 0.9) 40%, rgba(8, 7, 12, 0.35) 78%),
    radial-gradient(90% 70% at 8% 92%, rgba(107, 6, 239, 0.36), transparent 60%);
}

.money-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
}

.money-num {
  font-size: clamp(6.5rem, 17vw, 15rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.075em;
}

.money-num span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--rule-2);
}

.money-num small {
  display: block;
  margin-top: clamp(12px, 1.6vw, 22px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.money h2 {
  margin-bottom: clamp(14px, 2vw, 22px);
}

.money-list {
  margin-top: clamp(22px, 3vw, 36px);
  border-top: 1px solid var(--rule);
}

.money-list div {
  display: grid;
  grid-template-columns: clamp(120px, 20%, 190px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 28px);
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.money-list dt {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.7;
  text-transform: uppercase;
}

.money-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* --- 12. Правила -------------------------------------------------------- */

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.rules article {
  padding: clamp(24px, 3vw, 42px);
  background: var(--bg);
}

.rules svg {
  width: 26px;
  height: 26px;
  margin-bottom: clamp(18px, 2.4vw, 28px);
  color: var(--purple-lt);
}

.rules h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.rules p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* --- 13. Финальный призыв ----------------------------------------------- */

.start {
  position: relative;
  overflow: hidden;
  background: var(--void-2);
}

.start::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 120%;
  background: radial-gradient(52% 52% at 50% 0%, rgba(107, 6, 239, 0.4), transparent 68%);
  pointer-events: none;
}

.start-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
}

.start h2 {
  font-size: clamp(2.4rem, 6.4vw, 5.4rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.start p {
  max-width: 32rem;
  margin-top: clamp(14px, 2vw, 22px);
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: clamp(24px, 3vw, 38px);
}

.start-handle {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 10px;
  border-radius: 6px;
  background: var(--bone);
  color: #0b0a11;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.85);
  transform: rotate(-2.4deg);
  transition: transform 0.5s var(--ease);
}

.qr:hover {
  transform: rotate(0deg) scale(1.02);
}

.qr img {
  width: clamp(124px, 12vw, 168px);
  height: auto;
}

.qr figcaption {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* --- 14. Подвал --------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(34px, 4vw, 60px) calc(clamp(28px, 3vw, 44px) + env(safe-area-inset-bottom));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 60px);
}

.footer-brand img {
  height: 22px;
  width: auto;
  margin-bottom: 16px;
}

.footer-brand p {
  max-width: 24rem;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
}

.footer h4 {
  margin-bottom: 14px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer li + li {
  margin-top: 9px;
}

.footer li a {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.3s var(--ease);
}

.footer li a:hover {
  color: var(--fg);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(30px, 4vw, 56px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- 15. Липкая кнопка на мобильных ------------------------------------- */

.dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  display: none;
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 7, 12, 0), rgba(8, 7, 12, 0.92) 34%);
  transform: translateY(130%);
  transition: transform 0.5s var(--swift);
}

.dock.is-on {
  transform: none;
}

.dock .btn {
  width: 100%;
}

/* --- 16. Появление при скролле ------------------------------------------ */

/* Скрываем только когда скрипт точно работает: без JS контент виден сразу */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 70ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* --- 17. Юридические страницы ------------------------------------------- */

.legal {
  max-width: 44rem;
  padding-top: calc(var(--head) + env(safe-area-inset-top) + clamp(40px, 7vw, 84px));
  padding-bottom: clamp(56px, 8vw, 110px);
}

.legal h1 {
  margin: clamp(14px, 2vw, 22px) 0 clamp(18px, 2.4vw, 28px);
  font-size: clamp(2rem, 5.4vw, 3.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.legal h2 {
  margin: clamp(30px, 4vw, 48px) 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.72;
}

.legal p + p {
  margin-top: 12px;
}

.legal ul {
  display: grid;
  gap: 10px;
}

.legal li {
  position: relative;
  padding-left: 18px;
}

.legal li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--purple-lt);
}

.legal a:not(.btn) {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s var(--ease);
}

.legal a:not(.btn):hover {
  text-decoration-color: var(--purple-lt);
}

.legal-back {
  margin-top: clamp(34px, 5vw, 60px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

/* --- 18. Адаптив -------------------------------------------------------- */

/* Невысокое окно ноутбука: поджимаем герой, чтобы витрина и строка стилей
   целиком оставались на первом экране */
@media (min-width: 1181px) and (max-height: 830px) {
  .hero {
    --hero-top: calc(var(--head) + env(safe-area-inset-top) + 20px);
    --ribbon: 92px;
  }

  .hero h1 {
    margin-block: 14px 14px;
    font-size: min(4.6rem, 7vw, 12vh);
  }

  .hero .lead {
    font-size: 1rem;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .device-hint {
    margin-top: 10px;
  }
}

@media (max-width: 1180px) {
  /* Одна колонка, порядок: текст → стили → витрина */
  .hero {
    grid-template-columns:
      [full-start] var(--pad)
      [main-start] minmax(0, 1fr)
      [main-end] var(--pad)
      [full-end];
    grid-template-rows: none;
    min-height: 0;
    row-gap: clamp(30px, 5vw, 52px);
    padding-bottom: clamp(34px, 6vw, 60px);
  }

  .hero-copy {
    grid-column: main;
    grid-row: auto;
    order: 1;
    padding-right: 0;
    padding-bottom: 0;
  }

  .hero-ribbon {
    grid-row: auto;
    order: 2;
    height: auto;
    padding-block: clamp(14px, 2.4vw, 20px);
    border-bottom: 1px solid var(--rule);
  }

  /* В одну колонку размер считаем от ширины, а не от высоты экрана */
  .ticker-row li {
    font-size: clamp(1.5rem, 5.8vw, 2.2rem);
  }

  .hero h1 {
    font-size: clamp(2.9rem, 8.4vw, 6rem);
  }

  .hero .lead {
    max-width: 42rem;
  }

  .device {
    grid-column: main;
    grid-row: auto;
    order: 3;
    width: min(360px, 100%);
  }

  .device-dots {
    left: -24px;
  }

  .money-inner,
  .how {
    grid-template-columns: minmax(0, 1fr);
  }

  .how-rail {
    position: static;
  }

  .how-rail ol {
    display: none;
  }

  .money-num {
    font-size: clamp(6rem, 24vw, 11rem);
  }
}

@media (max-width: 900px) {
  :root {
    --head: 58px;
  }

  .nav-list,
  .nav .btn {
    display: none;
  }

  .burger {
    display: flex;
  }

  .dock {
    display: block;
  }

  .hero-bg img {
    object-position: 62% 26%;
    opacity: 0.6;
  }

  /* На узком экране широкий фиолетовый радиал заливал весь герой */
  .hero-bg::after {
    background:
      linear-gradient(180deg, rgba(8, 7, 12, 0.72) 0%, rgba(8, 7, 12, 0.5) 30%, rgba(8, 7, 12, 0.94) 76%, var(--void) 100%),
      radial-gradient(70% 34% at 84% 6%, rgba(107, 6, 239, 0.34), transparent 70%);
  }

  .shead,
  .start-inner {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    align-items: start;
    gap: 18px;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
  }

  .step-shot {
    order: -1;
    aspect-ratio: 16 / 10;
    margin-bottom: 4px;
  }

  .rules {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr {
    display: none;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* Место под липкую кнопку, чтобы не перекрывала реквизиты */
  .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .device {
    max-width: 320px;
  }

  .device-frame {
    max-height: none;
    border-radius: 24px;
  }

  .device-dots {
    top: auto;
    bottom: -26px;
    left: 50%;
    flex-direction: row;
    transform: translateX(-50%);
  }

  .device-dots button {
    width: 20px;
    height: 2px;
  }

  .device-dots button[aria-current="true"] {
    width: 34px;
    height: 2px;
  }

  .device-hint {
    margin-top: 40px;
  }

  .money-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
}

/* Компактная шапка юридических страниц: там нет мобильного меню,
   поэтому ссылки должны выживать на узком экране */
@media (max-width: 900px) {
  .nav-compact .nav-list {
    display: flex;
    gap: 16px;
  }

  .nav-compact .nav-list a {
    font-size: 13px;
  }

  .nav-compact .btn {
    display: inline-flex;
  }
}

@media (max-width: 620px) {
  .nav-compact .nav-list li + li {
    display: none;
  }
}

/* --- 19. Уважение к настройкам ------------------------------------------ */

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

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .ticker-row {
    animation: none;
    transform: none;
  }
}
