/* ==========================================================================
   «Ночная стройка» — лендинг токенизации квадратных метров
   Страница = башня. Пользователь поднимается от котлована до пентхауса.
   True dark OLED luxury. Mobile-first, iPhone Safari — целевая платформа.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #0B0E13;
  --bg-deep: #07090D;
  --text: #F2F0EB;
  --text-dim: #9BA0A8;
  --label: #6E737C;

  --gold: #C9A96A;
  --gold-2: #E6C888;
  --gold-3: #FFF3D6;
  --gold-glow: rgba(201, 169, 106, 0.35);
  --gold-faint: rgba(201, 169, 106, 0.14);

  --emerald: #2E8B6E;
  --ruby: #A93F55;
  --sapphire: #3D5A9E;

  --font-display: 'Unbounded', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --fs-body: 17px;
  --fs-lede: clamp(17px, 2.1vw, 20px);
  --fs-h2: clamp(30px, 8.8vw, 72px);
  --fs-h3: clamp(20px, 3vw, 26px);
  --fs-num-big: clamp(28px, 8.6vw, 104px);

  --page-x: clamp(22px, 5vw, 64px);
  --section-y: clamp(90px, 16vw, 180px);

  --e-out: cubic-bezier(0.16, 1, 0.3, 1);
  --e-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  /* iOS Safari игнорирует overflow-x:hidden на body для панорамы страницы —
     clip на обоих корнях убирает горизонтальный скролл, не создавая скролл-контейнер */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  font-feature-settings: 'tnum';
}

img, svg, canvas { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; }
ol, ul { list-style: none; }

::selection { background: var(--gold); color: var(--bg); }

/* --------------------------------------------------------------------------
   СЛОЙ 0 — город позади (медленный параллакс)
   -------------------------------------------------------------------------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(140% 90% at 50% 110%, rgba(61, 90, 158, 0.10), transparent 55%),
    radial-gradient(120% 70% at 80% -10%, rgba(201, 169, 106, 0.05), transparent 60%),
    var(--bg-deep);
  will-change: transform;
}
.sky-city {
  position: absolute;
  left: 0; right: 0; bottom: -4%;
  width: 100%;
  height: 46%;
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   СЛОЙ 1 — башня-герой: 2.5D аксонометрия
   Плита = 3 узла (front/top/side), грани — статичные скьюы,
   анимируется только контейнер .floor (transform/opacity, GSAP scrub)
   -------------------------------------------------------------------------- */
.tower-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  perspective: 1200px;
  overflow: hidden; /* котлован/кран/гало не должны вылезать за вьюпорт (iOS-панорама) */
}
.tower-halo {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: min(560px, 100vw);
  height: 86%;
  transform: translateX(-50%);
  background: radial-gradient(50% 52% at 50% 62%, rgba(201, 169, 106, 0.24), transparent 70%);
  opacity: 0;
}
.tower3d {
  --tw: clamp(112px, 30vw, 190px);
  --td: 13px; /* глубина торца и бока */
  position: relative;
  width: var(--tw);
  height: 78svh;
  margin-bottom: 6svh;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  opacity: 0.38;
}
@media (min-width: 980px) {
  /* на десктопе тач-панорамы нет, а шкале цены нужно место справа от башни */
  .tower-stage { justify-content: flex-end; padding-right: 6vw; overflow: visible; }
  .tower3d { opacity: 0.95; --tw: clamp(140px, 12vw, 200px); }
}

/* финал: достроенная башня медленно дышит по орбите */
.tower3d.complete { animation: orbit 8s ease-in-out infinite alternate; }
@keyframes orbit {
  from { transform: rotateY(-6deg); }
  to   { transform: rotateY(6deg); }
}

.floor {
  position: absolute;
  left: 0;
  width: 100%;
}
.f-front {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(201, 169, 106, 0.16) 0 2px, transparent 2px 15px),
    rgba(201, 169, 106, 0.05);
  box-shadow: inset 0 0 0 1px rgba(201, 169, 106, 0.32);
}
/* зажжённые окна — второй слой, GPU-переход одной opacity */
.f-front::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 227, 160, 0.85) 2px 9px, transparent 9px 15px);
  opacity: 0;
  transition: opacity 0.45s var(--e-out);
}
.floor.lit .f-front::after { opacity: 1; }
.f-top {
  position: absolute;
  left: 0;
  top: calc(-1 * var(--td));
  width: 100%;
  height: var(--td);
  transform-origin: bottom left;
  transform: skewX(-45deg);
  background: linear-gradient(180deg, rgba(230, 200, 136, 0.6), rgba(230, 200, 136, 0.28));
  opacity: 0.7;
}
.f-side {
  position: absolute;
  right: calc(-1 * var(--td));
  top: 0;
  width: var(--td);
  height: 100%;
  transform-origin: top left;
  transform: skewY(-45deg);
  background: rgba(120, 96, 54, 0.55);
}

.pit {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -3px;
  height: 15px;
  background:
    linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.55) 12%, rgba(201, 169, 106, 0.55) 88%, transparent) top / 100% 1px no-repeat,
    repeating-linear-gradient(-45deg, rgba(201, 169, 106, 0.35) 0 1px, transparent 1px 14px) bottom / 100% 11px no-repeat;
}

.crane {
  position: absolute;
  left: -12%;
  bottom: 0;
}
.crane-beacon { animation: beacon 2.2s ease-in-out infinite; }
@keyframes beacon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.price-scale { display: none; }
@media (min-width: 980px) {
  .price-scale {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    left: calc(100% + var(--td) + 26px);
    top: 0;
    bottom: 0;
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
  }
  .ps-rail {
    flex: 1;
    width: 1px;
    margin: 6px 0 6px 4px;
    background: rgba(201, 169, 106, 0.25);
    position: relative;
  }
  .ps-marker {
    position: absolute;
    left: -4px;
    top: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
  }
  .ps-now {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    font-style: normal;
    color: var(--gold);
  }
}

/* --------------------------------------------------------------------------
   HUD лифта
   -------------------------------------------------------------------------- */
.hud {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.22), 0 8px 30px rgba(0, 0, 0, 0.45);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s var(--e-out), transform 0.5s var(--e-out);
  pointer-events: none;
}
.hud.hud-on { opacity: 1; transform: none; }
.hud-sep {
  width: 1px;
  height: 12px;
  background: rgba(201, 169, 106, 0.35);
}
.hud-price-label { color: var(--text-dim); }
.hud-price { color: var(--gold-2); white-space: nowrap; }
@media (max-width: 379px) {
  .hud { gap: 8px; padding: 8px 12px; }
  .hud-price-label { display: none; }
}

/* --------------------------------------------------------------------------
   Чип параметров (низ)
   -------------------------------------------------------------------------- */
.params-chip {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translate(-50%, 120%);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.25), 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: transform 0.45s var(--e-out);
}
.params-chip:not([hidden]) { transform: translate(-50%, 0); }
.params-chip[hidden] { display: inline-flex; }
.params-chip b { font-weight: 700; color: var(--gold-2); }
.chip-cta {
  margin-left: 6px;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Контент — слой 2 (общая 3D-сцена)
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 2;
  perspective: 1200px;
}

section { padding: var(--section-y) 0; position: relative; }

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--page-x);
}
@media (min-width: 980px) {
  .section-inner { padding-right: calc(var(--page-x) + 300px); }
}

/* свет вместо границ: секции подсвечиваются сверху своим минералом */
.pitch::before, .mechanics::before, .math::before, .chart::before,
.p2p::before, .investor::before, .network::before, .franchise::before,
.legal::before, .offer::before, .contacts::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120vw);
  height: 340px;
  pointer-events: none;
  background: radial-gradient(55% 100% at 50% 0%, var(--section-glow, rgba(201,169,106,0.07)), transparent 70%);
}
.p2p { --section-glow: rgba(61, 90, 158, 0.10); }
.franchise { --section-glow: rgba(46, 139, 110, 0.09); }
.pitch { --section-glow: rgba(169, 63, 85, 0.06); }

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  text-shadow: 0 0 24px var(--gold-glow);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: clamp(28px, 5vw, 48px);
  max-width: 16ch;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(7, 9, 13, 0.9);
}
.section-title em {
  font-style: normal;
  color: var(--gold);
}

.section-lede, .chart-lede, .franchise-lede {
  font-size: var(--fs-lede);
  color: var(--text-dim);
  max-width: 58ch;
  margin-bottom: clamp(28px, 5vw, 48px);
  text-shadow: 0 1px 20px rgba(7, 9, 13, 0.9);
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 17px 34px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  transition: box-shadow 0.25s var(--e-out); /* transform ведёт GSAP-магнит */
  position: relative;
}
.cta-primary {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 55%, #A98A50);
  color: var(--bg-deep);
  box-shadow: 0 6px 40px var(--gold-glow), inset 0 1px 1px rgba(255, 243, 214, 0.7);
}
.cta-primary:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .cta-primary:hover, .cta-primary:focus-visible {
    box-shadow: 0 10px 55px var(--gold-glow), inset 0 1px 1px rgba(255, 243, 214, 0.7);
  }
}

.btn-ghost {
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.28);
  color: var(--text-dim);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s, box-shadow 0.2s;
}
.btn-ghost:focus-visible { color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(201, 169, 106, 0.2); }
}

/* --------------------------------------------------------------------------
   Hero — сцена «Проявление» (pinned, GSAP scrub)
   -------------------------------------------------------------------------- */
/* sticky-пиннинг (не ScrollTrigger pin): стейдж всегда во всю ширину вьюпорта,
   без захвата размеров и без svh/vh-разрыва — и мягче на iOS */
.reveal-hero { position: relative; z-index: 2; padding: 0; height: 350svh; }
.rv-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;              /* заголовок по центру экрана */
  background: var(--bg);
}

.rv-media { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.rv-parallax { position: absolute; inset: -5%; will-change: transform; }
.rv-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.rv-day   { display: none; }        /* светлый день не используем — стартуем с ночи */
.rv-night { background-image: url(assets/render-night.webp); opacity: 1; }
.rv-glow  { position: absolute; inset: 0; opacity: 1; }
.rv-glow-img { background-image: url(assets/windows-glow.webp); mix-blend-mode: screen; }
@media (max-width: 640px) {
  .rv-night { background-image: url(assets/render-night-m.webp); }
  .rv-glow-img { background-image: url(assets/windows-glow-m.webp); }
}
/* дымка, чтобы заголовок читался поверх кадра с самого начала */
.rv-media::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(88% 60% at 50% 50%, rgba(7,9,13,0.5), transparent 72%),
    linear-gradient(180deg, rgba(7,9,13,0.34) 0%, transparent 34%, transparent 64%, rgba(7,9,13,0.5) 100%);
  pointer-events: none;
}
.rv-fade { position: absolute; inset: 0; z-index: 2; background: var(--bg); opacity: 0; pointer-events: none; }
.rv-outline { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; }
.rv-outline svg { width: 100%; height: 100%; display: block; }
.ol-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.ol-front { filter: drop-shadow(0 0 5px rgba(201,169,106,0.7)); }
.ol-weld { opacity: 0; filter: drop-shadow(0 0 9px #FFF3D6); }

.rv-hero-text {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--page-x);
}
.rv-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
  text-shadow: 0 2px 10px rgba(7, 9, 13, 0.75), 0 8px 50px rgba(7, 9, 13, 0.9);
}
.rv-tl { display: block; }
.rv-tl:nth-child(1) { font-size: clamp(46px, 12.5vw, 132px); }
.rv-tl:nth-child(2) { font-size: clamp(21px, 5.6vw, 54px); letter-spacing: -0.02em; }
.rv-tl:nth-child(3) { font-size: clamp(50px, 13.5vw, 142px); }
.rv-tl em { font-style: normal; color: var(--text); }
.rv-sub {
  font-size: var(--fs-lede);
  color: var(--text);
  max-width: 40ch;
  margin-bottom: 28px;
  text-shadow: 0 1px 8px rgba(7, 9, 13, 0.9), 0 2px 24px rgba(7, 9, 13, 0.95);
}

/* статичный фолбэк без анимаций: обычный экранный hero, без длинной прокрутки */
@media (prefers-reduced-motion: reduce) {
  .reveal-hero { height: 100svh; }
  .rv-stage { position: relative; }
  .rv-night { opacity: 1; }
  .rv-outline, .rv-fade { display: none; }
}
/* --------------------------------------------------------------------------
   Кокпит параметров
   -------------------------------------------------------------------------- */
.cockpit {
  border-radius: 26px;
  background: linear-gradient(175deg, rgba(13, 17, 24, 0.92), rgba(7, 9, 13, 0.88));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 0 0 1px rgba(201, 169, 106, 0.2),
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 243, 214, 0.08);
  padding: clamp(20px, 4vw, 36px);
}

.cockpit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.cr-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.cr-light {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.4), transparent);
}

.params-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 620px) { .params-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (min-width: 980px) { .params-grid { grid-template-columns: 1fr 1fr 1fr; gap: 26px 30px; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
}
.field input[type="number"] {
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(201, 169, 106, 0.16), inset 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 0;
  border-radius: 13px;
  padding: 13px 15px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  min-height: 50px;
  width: 100%;
  transition: box-shadow 0.25s var(--e-out), color 0.25s;
}
.field input[type="number"]:focus {
  outline: none;
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 24px rgba(201, 169, 106, 0.18);
}

/* Пересчитать */
.params-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-recalc {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-deep);
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 55%, #A98A50);
  box-shadow: 0 6px 30px var(--gold-glow), inset 0 1px 1px rgba(255, 243, 214, 0.7);
  transition: box-shadow 0.2s var(--e-out); /* transform ведёт GSAP-магнит */
  position: relative;
}
.btn-recalc svg { transition: transform 0.5s var(--e-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-recalc:hover { box-shadow: 0 10px 40px var(--gold-glow), inset 0 1px 1px rgba(255, 243, 214, 0.7); }
  .btn-recalc:hover svg { transform: rotate(-90deg); }
}
.btn-recalc.recalc-pulse svg { animation: recalcSpin 0.6s var(--e-out); }
@keyframes recalcSpin { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-recalc.recalc-pulse svg { animation: none; }
}

/* золотые риски на слайдерах */
.field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  cursor: pointer;
}
.field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(201, 169, 106, 0.5) 0 1px, transparent 1px calc(100% / 12)),
    rgba(201, 169, 106, 0.12);
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-3), var(--gold) 60%, #9A7C45);
  margin-top: -9px;
  box-shadow: 0 0 16px var(--gold-glow), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.field input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(201, 169, 106, 0.5) 0 1px, transparent 1px calc(100% / 12)),
    rgba(201, 169, 106, 0.12);
}
.field input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, var(--gold-3), var(--gold) 60%, #9A7C45);
  box-shadow: 0 0 16px var(--gold-glow), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.params-warn {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(169, 63, 85, 0.12);
  box-shadow: inset 0 0 0 1px rgba(169, 63, 85, 0.45);
  color: #E9A6B0;
  font-size: 14px;
}
.params-warn[hidden] { display: none; }
.field.field-invalid input[type="number"] {
  box-shadow: inset 0 0 0 1px var(--ruby), inset 0 2px 8px rgba(0, 0, 0, 0.35);
  color: #E9A6B0;
}

/* световая волна пересчёта */
.tick-glow { animation: tick 0.9s var(--e-out); }
@keyframes tick {
  0% { color: var(--gold-3); text-shadow: 0 0 18px var(--gold-glow); }
  100% { color: inherit; text-shadow: none; }
}

/* --------------------------------------------------------------------------
   Суть — две сцены
   -------------------------------------------------------------------------- */
.pitch-scenes {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 7vw, 56px);
  margin-bottom: clamp(56px, 10vw, 90px);
}
@media (min-width: 860px) {
  .pitch-scenes { grid-template-columns: 1fr 1fr; gap: 48px; }
}

.pitch-scene { position: relative; padding-left: 22px; }
.pitch-scene::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 1px;
}
.pitch-old::before { background: linear-gradient(180deg, var(--ruby), transparent); box-shadow: 0 0 18px rgba(169, 63, 85, 0.5); }
.pitch-new::before { background: linear-gradient(180deg, var(--gold), transparent); box-shadow: 0 0 18px var(--gold-glow); }

.pitch-scene h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin-bottom: 12px;
}
.pitch-old h3 { color: var(--text-dim); }
.pitch-new h3 { color: var(--gold); }
.pitch-scene p { color: var(--text-dim); }
.pitch-new p { color: var(--text); }
.pitch-scene b { color: var(--gold-2); font-weight: 700; }

.ps-vis {
  position: relative;
  height: 64px;
  margin-bottom: 16px;
  overflow: hidden;
}
.ps-coin {
  position: absolute;
  top: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(169, 63, 85, 0.8);
  animation: coinFall 2.6s linear infinite;
}
.ps-coin:nth-child(1) { left: 12%; animation-delay: 0s; }
.ps-coin:nth-child(2) { left: 34%; animation-delay: 0.9s; }
.ps-coin:nth-child(3) { left: 56%; animation-delay: 1.7s; }
@keyframes coinFall {
  0% { transform: translateY(-14px); opacity: 0; }
  25% { opacity: 0.9; }
  85% { opacity: 0.6; }
  100% { transform: translateY(64px); opacity: 0; }
}
.ps-bank {
  position: absolute;
  right: 8%;
  bottom: 4px;
  width: 34px; height: 22px;
  box-shadow: inset 0 0 0 1.5px rgba(169, 63, 85, 0.7);
}
.ps-bank::before {
  content: '';
  position: absolute;
  left: -4px; right: -4px; top: -8px;
  height: 5px;
  box-shadow: inset 0 0 0 1.5px rgba(169, 63, 85, 0.7);
}
.ps-meter {
  position: absolute;
  bottom: 0;
  width: 13px; height: 13px;
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 12px rgba(201, 169, 106, 0.35);
  animation: meterRise 2.8s linear infinite;
}
.ps-meter:nth-child(1) { left: 10%; animation-delay: 0s; }
.ps-meter:nth-child(2) { left: 32%; animation-delay: 0.7s; }
.ps-meter:nth-child(3) { left: 54%; animation-delay: 1.4s; }
.ps-meter:nth-child(4) { left: 76%; animation-delay: 2.1s; }
@keyframes meterRise {
  0% { transform: translateY(14px); opacity: 0; }
  25% { opacity: 1; }
  85% { opacity: 0.7; }
  100% { transform: translateY(-64px); opacity: 0; }
}

.pitch-donut {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 5vw, 44px);
  align-items: center;
}
@media (max-width: 720px) {
  .pitch-donut { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
.donut-fill {
  transition: stroke-dashoffset 0.8s var(--e-out);
  filter: drop-shadow(0 0 14px rgba(201, 169, 106, 0.45));
}
.donut-num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  fill: var(--gold-2);
}
.donut-cap {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--text-dim);
}
.pitch-donut-caption {
  font-size: var(--fs-lede);
  max-width: 44ch;
}
.pitch-donut-caption b { color: var(--gold-2); }

/* --------------------------------------------------------------------------
   Механика — этажи по рельсу
   -------------------------------------------------------------------------- */
.steps-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 7vw, 60px);
  padding-left: 4px;
}
.steps-rail::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(201, 169, 106, 0.4) 12%, rgba(201, 169, 106, 0.4) 88%, transparent);
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: clamp(18px, 4vw, 32px);
  align-items: start;
  position: relative;
}
.step-glyph {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: var(--bg);
  border-radius: 50%;
  padding: 9px;
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.3), 0 0 26px rgba(201, 169, 106, 0.14);
}
.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(201, 169, 106, 0.55);
  margin-bottom: 8px;
}
.step h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.15;
}
.step p { color: var(--text-dim); max-width: 52ch; }
.step p b { color: var(--gold-2); font-weight: 700; }

/* --------------------------------------------------------------------------
   Математика — ведомость + слиток
   -------------------------------------------------------------------------- */
.math-intro {
  font-size: var(--fs-lede);
  color: var(--text-dim);
  margin-bottom: clamp(28px, 5vw, 44px);
}
.math-intro b { color: var(--text); }

.math-lines {
  display: flex;
  flex-direction: column;
  margin-bottom: clamp(48px, 9vw, 80px);
}
.math-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 18px 0;
  position: relative;
}
.math-line::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 106, 0.28), transparent 80%);
}
.ml-label {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
  margin-bottom: 2px;
}
.ml-expr {
  color: var(--text-dim);
  font-size: 17px;
  align-self: end;
}
.ml-expr b { color: var(--text); font-weight: 600; }
.ml-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-2);
  font-size: clamp(22px, 5.6vw, 34px);
  letter-spacing: -0.02em;
  text-align: right;
  white-space: nowrap;
  align-self: end;
  text-shadow: 0 0 30px rgba(201, 169, 106, 0.25);
}
.ml-note {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-dim);
}
.ml-note b { color: var(--gold-2); }

/* СЛИТОК */
.ingot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(28px, 5vw, 46px) clamp(22px, 4vw, 40px);
  border-radius: 22px;
  background:
    radial-gradient(120% 160% at 50% -30%, rgba(201, 169, 106, 0.16), transparent 60%),
    linear-gradient(175deg, rgba(13, 17, 24, 0.9), rgba(7, 9, 13, 0.85));
  box-shadow:
    0 0 0 1px rgba(201, 169, 106, 0.3),
    0 30px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 243, 214, 0.12);
  margin-bottom: 22px;
  overflow: hidden;
}
.ingot-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ingot-value {
  font-family: var(--font-display);
  font-size: var(--fs-num-big);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: nowrap;
  background: linear-gradient(105deg, #8A6F3C 0%, var(--gold-2) 38%, var(--gold-3) 50%, var(--gold-2) 62%, #8A6F3C 100%);
  background-size: 220% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ingot-badge {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--emerald);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(46, 139, 110, 0.45);
}

/* посадка слитка (кувырок — GSAP); класс .ingot-in триггерит блик и вспышку ребра */
.ingot.ingot-in .ingot-value {
  animation: ingotSheen 1.8s ease-in-out 0.15s forwards;
}
@keyframes ingotSheen {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.ingot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 90% at 50% 55%, rgba(201, 169, 106, 0.28), transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.ingot.ingot-in::after { animation: ingotFlash 0.7s 0.5s var(--e-out); }
@keyframes ingotFlash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

.math-outro { color: var(--text-dim); }
.math-outro b { color: var(--text); }

/* --------------------------------------------------------------------------
   График — сварочный шов
   -------------------------------------------------------------------------- */
.chart-canvas {
  padding: clamp(8px, 2vw, 24px) 0;
  margin-bottom: 22px;
  overflow: hidden; /* свечения линий не должны раздвигать страницу */
}
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-grid line {
  stroke: rgba(201, 169, 106, 0.13);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart-grid text {
  font-size: 13px;
  fill: var(--text-dim);
  font-family: var(--font-body);
}
.chart-line { stroke-linecap: round; stroke-linejoin: round; }
.chart-line-token { filter: drop-shadow(0 0 8px rgba(201, 169, 106, 0.5)); }
.weld-spark circle { filter: drop-shadow(0 0 6px #FFF3D6); }
.chart-endpoints circle { fill: var(--gold-2); filter: drop-shadow(0 0 10px var(--gold-glow)); }
.chart-endpoints text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  fill: var(--gold-2);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  font-size: 14px;
  color: var(--text-dim);
  align-items: center;
}
.chart-legend i {
  display: inline-block;
  width: 26px;
  height: 3px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 2px;
}
.chart-legend .chart-gap { color: var(--gold); }
.chart-legend b { color: var(--gold-2); }

/* --------------------------------------------------------------------------
   P2P — парящий телефон (сапфир)
   -------------------------------------------------------------------------- */
.p2p-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@media (min-width: 940px) {
  .p2p-grid { grid-template-columns: 1fr 320px; gap: 60px; }
}
.p2p-text p { margin-bottom: 16px; }
.p2p-list { margin: 22px 0; }
.p2p-list li {
  padding: 12px 0 12px 26px;
  position: relative;
  color: var(--text-dim);
}
.p2p-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sapphire);
  box-shadow: 0 0 12px rgba(61, 90, 158, 0.8);
}
.p2p-list b { color: var(--gold-2); }
.p2p-punch {
  font-family: var(--font-display);
  font-weight: 600;
  color: #7D9BD8;
  font-size: var(--fs-h3);
  line-height: 1.3;
  margin-top: 26px;
  text-shadow: 0 0 40px rgba(61, 90, 158, 0.4);
}

.p2p-phone { justify-self: center; perspective: 900px; }
.phone-float { animation: phoneFloat 7s ease-in-out infinite; will-change: transform; }
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.phone-frame {
  width: min(280px, 78vw);
  aspect-ratio: 9 / 19;
  background: #14171E;
  border-radius: 42px;
  padding: 12px;
  position: relative;
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.09),
    0 50px 110px rgba(0, 0, 0, 0.6),
    0 0 90px rgba(61, 90, 158, 0.22);
  transform-style: preserve-3d;
}
/* transition для tilt включается только после GSAP-входа, чтобы не драться с ним */
.phone-frame.tilt-ready { transition: transform 0.25s var(--e-out); }
.phone-notch {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px; height: 22px;
  background: #000;
  border-radius: 999px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--bg-deep);
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 42px 14px 12px;
  gap: 12px;
}
.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 8px 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.phone-pair { font-size: 10px; color: var(--text-dim); }
.phone-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--gold-2);
}
.phone-book {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  overflow: hidden;
}
.ob-side { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.ob-asks { justify-content: flex-end; }
.ob-mid {
  text-align: center;
  padding: 6px 0;
  box-shadow: 0 -1px 0 rgba(255,255,255,0.05), 0 1px 0 rgba(255,255,255,0.05);
}
.ob-spread { color: var(--text-dim); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.ob-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  animation: obBreathe 3.4s ease-in-out infinite;
}
.ob-row:nth-child(odd) { animation-delay: 1.1s; }
.ob-row:nth-child(3n) { animation-delay: 2.2s; }
@keyframes obBreathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
.ob-row .ob-bg { position: absolute; inset: 0; opacity: 0.14; }
.ob-row .ob-price, .ob-row .ob-qty { position: relative; z-index: 1; }
.ob-asks .ob-price { color: #D87A8D; }
.ob-bids .ob-price { color: #5FBF9F; }
.ob-asks .ob-bg { background: var(--ruby); }
.ob-bids .ob-bg { background: var(--emerald); }
.ob-row.matched { animation: obFlash 0.6s ease-out; }
@keyframes obFlash {
  0% { background: rgba(46, 139, 110, 0.75); }
  100% { background: transparent; }
}
.phone-tabs { display: flex; gap: 8px; padding-top: 9px; box-shadow: 0 -1px 0 rgba(255,255,255,0.06); }
.phone-tabs .pt {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 9px;
  font-size: 11px;
  color: var(--text-dim);
}
.phone-tabs .pt.active {
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  color: var(--bg-deep);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Инвестор — две башни
   -------------------------------------------------------------------------- */
.investor-panel {
  border-radius: 26px;
  background: linear-gradient(175deg, rgba(13, 17, 24, 0.9), rgba(7, 9, 13, 0.85));
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.18), 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: clamp(24px, 4vw, 42px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 940px) {
  .investor-panel { grid-template-columns: 300px 1fr; gap: 60px; }
}
.field-lg input[type="number"] { font-size: 30px; padding: 16px 18px; }
.inv-controls { display: flex; flex-direction: column; gap: 26px; }

.inv-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  height: 300px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  position: relative;
}
.inv-bars::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.4), transparent);
}
.inv-bar { height: 100%; display: flex; flex-direction: column; gap: 4px; }
.inv-bar-cap {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
}
.inv-bar-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 5.4vw, 30px);
  line-height: 1.1;
  white-space: nowrap;
  margin-bottom: 12px;
}
.inv-bar-track {
  position: relative;
  flex: 1;
  min-height: 40px;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.inv-bar-fill {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  transition: transform 0.8s var(--e-spring);
  will-change: transform;
}
/* этажная штриховка внутри золотой башни */
.inv-bar-token .inv-bar-fill {
  background:
    repeating-linear-gradient(180deg, transparent 0 9px, rgba(7, 9, 13, 0.4) 9px 10px),
    linear-gradient(180deg, var(--gold-2), rgba(201, 169, 106, 0.35));
}
.inv-bar-token .inv-bar-val { color: var(--gold-2); text-shadow: 0 0 26px var(--gold-glow); }
.inv-bar-deposit .inv-bar-fill {
  background: linear-gradient(180deg, rgba(138, 143, 152, 0.5), rgba(138, 143, 152, 0.12));
}
.inv-bar-deposit .inv-bar-val { color: var(--text-dim); }

.inv-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 620px) { .inv-metrics { grid-template-columns: 1fr; } }
.inv-metrics > div { padding: 10px 0; }
.inv-metrics span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
  margin-bottom: 4px;
}
.inv-metrics b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 5vw, 30px);
  color: var(--gold-2);
}
.inv-compare {
  font-size: var(--fs-lede);
  color: var(--text-dim);
  margin-bottom: 22px;
  max-width: 44ch;
}
.inv-compare b { color: var(--gold-2); font-weight: 700; }

/* --------------------------------------------------------------------------
   Сеть
   -------------------------------------------------------------------------- */
.net-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: center;
}
@media (min-width: 940px) {
  .net-grid { grid-template-columns: 1fr 1fr; gap: 60px; }
}
.net-text p { margin-bottom: 16px; }
.net-text b { color: var(--gold-2); }

.net-counter {
  margin-top: 34px;
  padding: 26px 0 0;
  position: relative;
}
.net-counter::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 106, 0.45), transparent);
}
.net-counter-cap {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
  margin-bottom: 10px;
}
.net-counter-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(46px, 12vw, 84px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(105deg, #8A6F3C, var(--gold-2) 45%, var(--gold-3) 55%, var(--gold-2) 65%, #8A6F3C);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.net-counter-sub {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 10px;
}
.net-canvas-wrap {
  aspect-ratio: 1 / 1;
  max-height: 440px;
  position: relative;
}
.net-canvas { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   Франшиза (изумруд)
   -------------------------------------------------------------------------- */
/* карта мира: тёмные континенты + города, в которых «строятся» домики */
.franchise-map {
  position: relative;
  margin: clamp(28px, 5vw, 44px) 0;
  aspect-ratio: 950 / 620;
  max-height: 480px;
}
.wm-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wm-cities {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wm-city { opacity: 0; }
.map-live .wm-city {
  animation: cityIn 0.5s var(--e-out) forwards;
  animation-delay: calc(var(--i) * 0.45s);
}
@keyframes cityIn { to { opacity: 1; } }
.wc-dot {
  fill: var(--emerald);
}
.wm-city-anchor .wc-dot { fill: var(--gold); }
.wc-ring {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.wm-city-anchor .wc-ring { stroke: var(--gold); }
.map-live .wc-ring {
  animation: ringPulse 2.6s ease-out infinite;
  animation-delay: calc(var(--i) * 0.45s + 0.2s);
}
@keyframes ringPulse {
  0% { transform: scale(0.25); opacity: 0.9; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* домик отстраивается линией — line-draw */
.wc-house {
  fill: none;
  stroke: var(--gold-2);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.map-live .wc-house {
  animation: buildHouse 0.9s ease forwards;
  animation-delay: calc(var(--i) * 0.45s + 0.2s);
}
@keyframes buildHouse { to { stroke-dashoffset: 0; } }
.wc-label {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  fill: var(--text-dim);
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(11, 14, 19, 0.85);
  stroke-width: 4px;
}
.wm-city-anchor .wc-label {
  font-weight: 600;
  fill: var(--gold);
}
.franchise-punch {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  margin-top: clamp(24px, 4vw, 40px);
}

/* --------------------------------------------------------------------------
   Законность
   -------------------------------------------------------------------------- */
.legal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: center;
}
@media (min-width: 840px) {
  .legal-grid { grid-template-columns: 320px 1fr; gap: 60px; }
}
.legal-doc { perspective: 1000px; padding: 12px; }
.legal-flip {
  position: relative;
  transform-style: preserve-3d;
}
.legal-flip.tilt-ready { transition: transform 0.2s var(--e-out); }
.legal-doc-back {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    radial-gradient(80% 80% at 50% 40%, rgba(201, 169, 106, 0.12), transparent 70%),
    linear-gradient(160deg, #171B23, #0B0E13);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(201, 169, 106, 0.3);
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.legal-doc-back span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 64px;
  color: var(--gold);
  opacity: 0.8;
}
.legal-doc-inner {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.legal-doc-inner {
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #F2F0EB 0%, #E4E0D7 100%);
  border-radius: 4px;
  padding: 32px 24px;
  color: #1a1a1a;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(201, 169, 106, 0.12);
  overflow: hidden;
}
.legal-doc-inner::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 2px;
  pointer-events: none;
}
/* гильош — защитная сетка настоящих бланков */
.legal-doc-guilloche {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 88% 8%, transparent 0 5px, rgba(7, 90, 150, 0.05) 5px 6px),
    repeating-radial-gradient(circle at 8% 96%, transparent 0 5px, rgba(7, 90, 150, 0.05) 5px 6px);
}
.legal-doc-header { border-bottom: 1px solid rgba(0,0,0,0.15); padding-bottom: 14px; margin-bottom: 20px; position: relative; }
.legal-doc-logo {
  height: 24px;
  width: auto;
  margin-bottom: 10px;
}
.legal-doc-type {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
}
.legal-doc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 16px;
  line-height: 1.2;
}
.legal-doc-issuer { font-size: 12px; color: #666; margin-bottom: 8px; line-height: 1.4; }
.legal-doc-date { font-size: 11px; color: #999; font-style: italic; }
.legal-doc-stamp {
  position: absolute;
  right: 24px;
  bottom: 32px;
  width: 90px; height: 90px;
  border: 3px solid #A93F55;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #A93F55;
  transform: rotate(-8deg);
  opacity: 0.85;
}
.legal-facts li {
  padding: 17px 0 17px 34px;
  position: relative;
  font-size: var(--fs-lede);
}
.legal-facts li + li::before {
  content: '';
  position: absolute;
  top: 0; left: 34px; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 106, 0.22), transparent);
}
.fact-check {
  position: absolute;
  left: 0; top: 21px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--emerald);
  box-shadow: 0 0 14px rgba(46, 139, 110, 0.35);
}
.fact-check::after {
  content: '';
  position: absolute;
  left: 5px; top: 5px;
  width: 8px; height: 4px;
  border-left: 1.5px solid var(--emerald);
  border-bottom: 1.5px solid var(--emerald);
  transform: rotate(-45deg);
}
.legal-punch {
  margin-top: clamp(28px, 5vw, 44px);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  color: var(--text-dim);
  line-height: 1.35;
}
.legal-punch em { font-style: normal; color: var(--gold); }

/* --------------------------------------------------------------------------
   Оффер — ведомость этажей
   -------------------------------------------------------------------------- */
.offer-ledger {
  display: flex;
  flex-direction: column;
  margin-bottom: clamp(48px, 9vw, 80px);
  position: relative;
  padding-left: 6px;
}
.offer-ledger::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(201, 169, 106, 0.4) 10%, rgba(201, 169, 106, 0.4) 90%, transparent);
}
.ledger-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: clamp(18px, 4vw, 30px);
  padding: clamp(18px, 3vw, 26px) 0;
  align-items: start;
}
.lr-num {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(201, 169, 106, 0.35), 0 0 26px rgba(201, 169, 106, 0.15);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-2);
}
.ledger-row h3 {
  font-family: var(--font-display);
  font-size: clamp(18px, 4.6vw, 23px);
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.2;
}
.ledger-row p { color: var(--text-dim); max-width: 54ch; }
.ledger-row b { color: var(--gold-2); }

.offer-paths { margin-bottom: clamp(48px, 9vw, 80px); }
.paths-intro {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--text-dim);
  margin-bottom: 24px;
}
.paths-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.path {
  padding: clamp(20px, 4vw, 30px) clamp(20px, 4vw, 32px);
  border-radius: 18px;
  position: relative;
  transition: opacity 0.3s var(--e-out);
}
.path h4 {
  font-family: var(--font-display);
  font-size: clamp(18px, 4.6vw, 22px);
  font-weight: 600;
  margin-bottom: 6px;
}
.path p { color: var(--text-dim); }
.path-dim {
  opacity: 0.5;
  box-shadow: inset 0 0 0 1px rgba(138, 143, 152, 0.18);
}
@media (hover: hover) and (pointer: fine) {
  .path-dim:hover { opacity: 0.35; }
}
.path-gold {
  background:
    radial-gradient(120% 200% at 50% -60%, rgba(201, 169, 106, 0.2), transparent 60%),
    linear-gradient(175deg, rgba(13, 17, 24, 0.9), rgba(7, 9, 13, 0.85));
  box-shadow:
    0 0 0 1px var(--gold),
    0 24px 70px rgba(201, 169, 106, 0.18),
    inset 0 1px 0 rgba(255, 243, 214, 0.15);
}
.path-gold h4 { color: var(--gold-2); }
.path-gold p { color: var(--text); }


/* --------------------------------------------------------------------------
   Контакты — пентхаус
   -------------------------------------------------------------------------- */
.contacts {
  min-height: 72svh;
  display: flex;
  align-items: center;
  padding-bottom: calc(var(--section-y) + env(safe-area-inset-bottom) + 40px);
}
.contacts .section-inner { width: 100%; }
.contacts-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: clamp(24px, 4vw, 40px);
}
.contact-item {
  font-family: var(--font-display);
  font-size: clamp(20px, 5.6vw, 30px);
  font-weight: 600;
  color: var(--gold-2);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
  text-shadow: 0 0 40px rgba(201, 169, 106, 0.3);
}
.contact-item-static { color: var(--text-dim); font-size: 16px; font-family: var(--font-body); font-weight: 500; text-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  a.contact-item:hover { color: var(--gold-3); }
}

/* --------------------------------------------------------------------------
   WOW-слой: прогресс, зерно, курсор-глоу, border-beam, shine
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 90;
  background: linear-gradient(90deg, var(--gold), var(--gold-3));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* плёночное зерно — статичная текстура, люкс-фактура */
.grain {
  position: fixed;
  inset: 0;
  z-index: 74;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* мягкий золотой прожектор за курсором (десктоп) */
.cursor-glow {
  position: fixed;
  left: 0; top: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  z-index: 72;
  pointer-events: none;
  background: radial-gradient(circle, rgba(201, 169, 106, 0.07), transparent 62%);
  opacity: 0;
  will-change: transform;
}
@media (hover: none), (pointer: coarse) { .cursor-glow { display: none; } }

/* бегущий золотой луч по контуру панели */
@property --beam { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.beam { position: relative; }
.beam::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(from var(--beam),
    transparent 0deg 288deg,
    rgba(230, 200, 136, 0.95) 324deg,
    rgba(255, 243, 214, 0.6) 336deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}
.beam-live::before { animation: beamrot 7s linear infinite; }
@keyframes beamrot { to { --beam: 360deg; } }

/* блик, проезжающий по золотым кнопкам */
.cta-primary, .btn-recalc { overflow: hidden; }
.cta-primary::before, .btn-recalc::before {
  content: '';
  position: absolute;
  top: -30%; bottom: -30%;
  width: 34%;
  left: 0;
  border-radius: 2px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-180%) skewX(-22deg);
  animation: shinemove 4.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shinemove {
  0%, 68% { transform: translateX(-180%) skewX(-22deg); }
  86%, 100% { transform: translateX(460%) skewX(-22deg); }
}

/* --------------------------------------------------------------------------
   Reduced motion: все 3D-переходы → мгновенные состояния (GSAP не создаётся)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .crane-beacon { display: none; }
  .tower3d.complete { animation: none; }
  .phone-float { animation: none; }
  .ps-coin, .ps-meter { animation: none; opacity: 0.6; }
  .ob-row { animation: none; }
  .wm-city { opacity: 1; animation: none; }
  .wc-house { stroke-dashoffset: 0; animation: none; }
  .wc-ring { display: none; }
}

[hidden] { display: none !important; }
