/* =====================================================================
   ElementCraft — лендинг под платный трафик
   Дизайн 1a (Claude Design → перенос в vanilla): «воксельный
   кинематографичный» — тёмный фон, видео-герой, топбар по центру,
   IP сразу на экране, инструкция 3-в-ряд, сворачиваемый футер.
   Бренд-токены с ecdonate.ru: Pikseli (заголовки) + PixeloidSans (тело),
   акцент #FF9900.
   ===================================================================== */

/* ----------  ШРИФТЫ (самохост, сабсет Latin+Cyrillic)  ---------- */
@font-face {
  font-family: "Pikseli";
  src: url("../fonts/pikseli.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "PixeloidSans";
  src: url("../fonts/pixeloidsans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "PixeloidSans";
  src: url("../fonts/pixeloidsans-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ----------  ТОКЕНЫ  ---------- */
:root {
  /* фон / поверхности */
  --bg:      #0a0a0d;
  --bg-1:    #101016;
  --bg-2:    #15151d;
  --bg-3:    #1d1d27;
  --panel:   rgba(17, 17, 23, 0.85);

  /* текст */
  --ink:      #f3efe6;   /* тёплый «пергаментный» белый */
  --ink-dim:  #c3bdae;
  --ink-mute: #7d776a;

  /* бренд-акцент (буквы EC / огонь) */
  --accent:       #ff9900;
  --accent-2:     #ffb84d;
  --accent-press: #b96f06;

  /* четыре стихии (считаны с логотипа) */
  --fire:    #ff5a1f;  --fire-2:  #ff9024;
  --water:   #2f86ff;  --water-2: #67d4ff;
  --earth:   #74c447;  --earth-2: #9c6b3f;
  --air:     #e7e1ff;  --air-2:   #b3bcef;

  /* линии / тени */
  --line:    rgba(243, 239, 230, 0.10);
  --line-2:  rgba(243, 239, 230, 0.18);
  --shadow:  0 18px 50px rgba(0, 0, 0, 0.55);

  /* геометрия */
  --r:    6px;
  --r-lg: 14px;
  --maxw: 1140px;

  --font-display: "Pikseli", "PixeloidSans", ui-monospace, monospace;
  --font-body: "PixeloidSans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----------  СБРОС / БАЗА  ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

/* скроллбар полностью скрыт (страница листается колесом/тачем/клавишами) */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* атмосферный градиент-меш за всем контентом */
  background-image:
    radial-gradient(120% 80% at 85% -10%, rgba(255, 90, 31, 0.10), transparent 55%),
    radial-gradient(100% 70% at 10% 0%, rgba(47, 134, 255, 0.08), transparent 50%),
    radial-gradient(90% 90% at 50% 120%, rgba(116, 196, 71, 0.06), transparent 60%);
  /* без background-attachment:fixed — он заставляет браузер перерисовывать весь
     фон-меш на каждый scroll-тик (дорого, особенно на мобильных GPU). Градиент
     и так плавно перетекает по документу при обычном скролле. */
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; line-height: 1.05; }

::selection { background: var(--accent); color: #1a1206; }

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

.skip-link {
  position: absolute; left: 12px; top: -120px; z-index: 200;
  background: var(--accent); color: #1a1206; padding: 10px 16px;
  border-radius: var(--r); font-family: var(--font-display);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 5vw, 40px); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* =====================================================================
   ГЕРОЙ — flex-колонка: топбар · центр (flex:1) · подсказка снизу.
   min-height чуть меньше вьюпорта, чтобы верх секции «Как зайти»
   выглядывал снизу как подсказка листать (дизайн 1a).
   ===================================================================== */
.hero {
  position: relative;
  min-height: calc(100svh - 84px);
  display: flex; flex-direction: column;
  overflow: hidden; text-align: center;
  background: var(--bg);
}
.hero__video, .hero__poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero > picture { position: absolute; inset: 0; z-index: 0; }
.hero__poster { background: var(--bg-1) center/cover no-repeat; }
.hero__video { opacity: 0; transition: opacity 0.8s var(--ease); z-index: 0; }
.hero__video.is-ready { opacity: 1; }
/* затемняющий оверлей: виньетка + низ потемнее под текст */
.hero__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(140% 120% at 50% 40%, rgba(10, 10, 13, 0.08) 0%, rgba(10, 10, 13, 0.28) 62%, rgba(10, 10, 13, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 10, 13, 0.62) 0%, rgba(10, 10, 13, 0.10) 24%, rgba(10, 10, 13, 0.20) 56%, rgba(10, 10, 13, 0.94) 100%);
}
/* тонкая dither-сетка поверх — пиксельная текстура */
.hero__scrim::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

/* ----------  Верхняя панель (техподдержка + донат) — по центру  ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(10px, 1.5vw, 16px);
  padding: clamp(12px, 1.8vh, 20px) clamp(16px, 4vw, 34px);
  background: linear-gradient(180deg, rgba(10, 10, 13, 0.55), transparent);
}
.topbar[hidden] { display: none; }   /* скрыт на рекламных подсылках (main.js); [hidden] перебивает display:flex */
.tbtn {
  /* PixeloidSans, а не Pikseli: в Pikseli кириллическая «Д» рисуется как «А»
     (ломала бы «техпоДДержка»/«Донат»). PixeloidSans отрисовывает «Д» верно. */
  font-family: var(--font-body); font-weight: 700; font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1; white-space: nowrap;
  padding: 11px 20px; border-radius: var(--r);
  border: 2px solid var(--line-2); color: var(--ink);
  /* без backdrop-filter:blur — кнопки стоят поверх играющего видео, blur пришлось бы
     пересчитывать каждый видео-кадр (постоянная GPU-нагрузка). Полупрозрачного фона
     достаточно для читаемости. */
  background: rgba(15, 15, 20, 0.6);
  transition: transform 0.15s var(--ease), border-color 0.2s, background 0.2s, filter 0.2s;
}
.tbtn:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ----------  Центр экрана: лого + тэглайн + онлайн + IP-карта  ---------- */
.hero__center {
  position: relative; z-index: 5; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(14px, 2.6vh, 24px);
  padding-top: clamp(14px, 3vh, 28px); padding-bottom: clamp(10px, 2vh, 18px);
}
.hero__logo {
  width: clamp(136px, 15vw, 224px); height: auto;
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.65));
}
.hero__tagline {
  font-family: var(--font-display); color: var(--ink);
  font-size: clamp(16px, 2.2vw, 26px); letter-spacing: 0.04em; line-height: 1.1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}
.hero__tagline b { color: var(--accent); }

/* живой онлайн с пульсирующей точкой */
.hero__online {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-dim);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
.hero__online[hidden] { display: none; }   /* [hidden] перебивает inline-flex (пока онлайн не загрузился / сервер офлайн) */
.online-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--earth); box-shadow: 0 0 8px var(--earth);
  animation: online-blink 1.8s ease-in-out infinite;
}
@keyframes online-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ----------  IP-карта  ---------- */
.ipcard {
  position: relative; isolation: isolate;
  width: min(520px, 100%);
  display: flex; flex-direction: column; gap: clamp(11px, 1.5vh, 14px);
  padding: clamp(18px, 2.4vw, 24px) clamp(16px, 2.4vw, 24px) clamp(18px, 2.2vw, 22px);
  /* var(--panel) уже почти непрозрачен (0.85), поэтому blur за ним почти не виден —
     убран, чтобы не пересчитывать backdrop поверх играющего видео каждый кадр. */
  background: var(--panel);
  border: 2px solid rgba(255, 153, 0, 0.42); border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
/* мягкое пульс-свечение вокруг карты — притягивает взгляд к IP */
.ipcard::before {
  content: ""; position: absolute; inset: -10px; z-index: -1; border-radius: 24px;
  background: radial-gradient(closest-side, rgba(255, 150, 30, 0.45), transparent 76%);
  filter: blur(20px); pointer-events: none;
  /* will-change: держим слой на GPU — blur растрируется один раз, а бесконечная
     анимация трогает только opacity (композит), не пере-блюрит каждый кадр в
     окне загрузки LCP. */
  will-change: opacity;
  animation: ip-glow 3s ease-in-out infinite;
}
@keyframes ip-glow { 0%, 100% { opacity: 0.32; } 50% { opacity: 0.6; } }

.ipcard__label {
  font-family: var(--font-display); font-size: clamp(12px, 1.5vw, 14.5px);
  letter-spacing: 0.03em; color: var(--ink-dim); text-align: center; line-height: 1.35;
}
/* IP-поле */
.ip-value {
  min-width: 0; width: 100%;
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0.02em;
  font-size: clamp(20px, 3.6vw, 33px);
  color: var(--ink); background: var(--bg);
  border: 2px dashed var(--line-2); border-radius: var(--r);
  padding: clamp(13px, 1.6vw, 17px) clamp(12px, 1.6vw, 16px);
  display: flex; align-items: center; justify-content: center;
  user-select: all; -webkit-user-select: all; cursor: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ip-value b { color: var(--accent); }

/* строка кнопки: кнопка на всю ширину + ярлык бонуса на её правом верхнем углу */
.ipcard__btnrow { position: relative; margin-top: clamp(4px, 0.8vh, 8px); }
.ipcard__bonus {
  position: absolute; top: 0; right: 12px; transform: translateY(-52%); z-index: 3;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 700; font-size: clamp(11px, 1.2vw, 13px);
  color: #0c1f0a; background: linear-gradient(180deg, #9be06a, var(--earth));
  border: 2px solid var(--bg); border-radius: 999px; padding: 4px 11px;
  box-shadow: 0 4px 12px rgba(116, 196, 71, 0.45);
  pointer-events: none; animation: bonus-pulse 2.2s var(--ease) infinite;
}
@keyframes bonus-pulse {
  0%, 100% { transform: translateY(-52%) scale(1); }
  50%      { transform: translateY(-52%) scale(1.07); }
}
.btn-copy {
  width: 100%; text-align: center; white-space: nowrap;
  font-family: var(--font-display); font-size: clamp(17px, 1.7vw, 20px);
  color: #2a1900; background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: var(--r); padding: clamp(14px, 1.7vw, 17px) 20px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.45), inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 5px 0 var(--accent-press);
  transition: transform 0.1s var(--ease), filter 0.2s, box-shadow 0.1s;
}
.btn-copy:hover { filter: brightness(1.06); }
.btn-copy:active { transform: translateY(4px); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), 0 1px 0 var(--accent-press); }
.btn-copy.is-done { color: #0c1f0a; background: linear-gradient(180deg, #9be06a, var(--earth)); box-shadow: inset 2px 2px 0 rgba(255,255,255,.5), 0 5px 0 #3f7a22; }
.copy-status { min-height: 18px; font-size: 14px; color: var(--ink-dim); text-align: center; }
.copy-status.is-fail { color: var(--fire-2); }

/* Акцентный CTA-«клавиша» — используется на 404 (кнопка «На главную»). */
.btn-play {
  display: inline-block; font-family: var(--font-display);
  font-size: clamp(15px, 1.6vw, 18px); color: #2a1900;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: var(--r); padding: 13px 28px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.45), inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 5px 0 var(--accent-press);
  transition: transform 0.1s var(--ease), filter 0.2s, box-shadow 0.1s;
}
.btn-play:hover { filter: brightness(1.06); }
.btn-play:active { transform: translateY(4px); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), 0 1px 0 var(--accent-press); }

/* ----------  Подсказка «листай к инструкции»  ---------- */
.hero__hint {
  position: relative; z-index: 5;
  display: flex; justify-content: center;
  padding: 0 20px clamp(14px, 2.2vh, 22px);
}
.scrollhint {
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: clamp(13px, 1.4vw, 15px); color: #d8d2c4;
  animation: hint-bob 1.9s ease-in-out infinite;
}
.scrollhint__label { border-bottom: 1px dotted rgba(243, 239, 230, 0.4); padding-bottom: 2px; }
.scrollhint__arrow { color: var(--accent); font-size: 1.25em; line-height: 1; }
.scrollhint:hover .scrollhint__label { color: var(--accent); border-color: var(--accent); }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* =====================================================================
   СЕКЦИЯ «КАК ЗАЙТИ» (шаги 3 в ряд)
   ===================================================================== */
.join {
  position: relative; z-index: 5;
  padding: clamp(34px, 6vw, 60px) 0;
  background: var(--bg-1); border-top: 2px solid var(--line);
}
/* градиентная полоска четырёх стихий по верхней кромке секции */
.join::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--fire), var(--accent) 30%, var(--earth) 60%, var(--water) 100%);
}
.join .container { max-width: 1040px; }
.join__title { font-size: clamp(22px, 3.4vw, 34px); text-align: center; margin-bottom: 22px; }

/* Шаги: карточки в ряд (auto-fit → на узком в 1 колонку), картинка сверху + подпись */
.join__steps {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px;
  counter-reset: jstep;
}
.jstep {
  counter-increment: jstep;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(0, 0, 0, 0.24); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 12px;
}
.jstep__media { position: relative; }
.jstep__media::before {
  content: counter(jstep);
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #2a1900;
  font-family: var(--font-display); font-size: 16px;
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.jstep__shot {
  width: 100%; height: auto; display: block;
  border: 2px solid var(--line-2); border-radius: var(--r); image-rendering: auto;
}
.jstep__cap { text-align: center; color: var(--ink-dim); font-size: 14px; line-height: 1.45; }
.jstep__cap b {
  /* PixeloidSans-bold, не Pikseli: в заголовках есть «Д» («Добавь», «Заходи»),
     Pikseli рисует её как «А». Читаемость важнее декора. */
  display: block; color: var(--ink); font-family: var(--font-body); font-weight: 700;
  font-size: 16px; margin-bottom: 2px;
}

/* Бонус новичку — клик по полоске плавно раскрывает состав (аккордеон вниз) */
.bonus {
  max-width: 640px; margin: 0 auto;
  border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 153, 0, 0.12), rgba(0, 0, 0, 0.22));
}
.bonus__bar {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; background: transparent; border: 0; color: var(--ink);
  font: inherit; cursor: pointer; text-align: left;
}
.bonus__label { font-family: var(--font-display); font-size: 18px; display: inline-flex; align-items: center; gap: 9px; }
.bonus__sign {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 153, 0, 0.16);
  border: 1.5px solid var(--accent); color: var(--accent);
  display: inline-grid; place-items: center; line-height: 1;
  font-family: var(--font-body); font-weight: 700; font-size: 18px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.bonus__bar:hover .bonus__sign, .bonus.is-open .bonus__sign { background: var(--accent); color: #2a1900; }
/* раскрывающийся состав (плавный max-height + opacity) */
.bonus__wrap {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.42s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.3s var(--ease);
}
.bonus.is-open .bonus__wrap { max-height: 480px; opacity: 1; }
.bonus__list { list-style: none; margin: 0; padding: 4px 18px 16px; display: grid; gap: 8px; }
.bonus__list li { position: relative; padding-left: 18px; font-size: 14px; color: var(--ink); }
.bonus__list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* =====================================================================
   ФУТЕР — сворачиваемый: одна кнопка «Информация и контакты», детали по клику
   ===================================================================== */
.footer {
  position: relative; z-index: 5;
  background: var(--bg-1); border-top: 1px solid rgba(243, 239, 230, 0.08);
  padding: 14px 0 18px;
}
.footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.footer__toggle {
  font-family: var(--font-body); font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--ink-mute); display: inline-flex; align-items: center; gap: 8px; padding: 8px 6px;
}
.footer__toggle-label { border-bottom: 1px dotted rgba(243, 239, 230, 0.24); padding-bottom: 2px; }
.footer__toggle:hover { color: var(--ink-dim); }
.footer__caret { display: inline-block; transition: transform 0.25s var(--ease); }
.footer.is-open .footer__caret { transform: rotate(180deg); }
.footer__more {
  width: 100%; overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height 0.38s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.3s var(--ease);
}
.footer.is-open .footer__more { max-height: 420px; opacity: 1; }
.footer__inner-pad { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 16px; }

.socials { display: flex; gap: 10px; }
.socials a {
  width: 36px; height: 36px; border-radius: var(--r); background: var(--bg-3);
  border: 1px solid var(--line-2); display: grid; place-items: center;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.socials a:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--bg-2); }
.socials svg { width: 18px; height: 18px; fill: var(--ink-dim); transition: fill 0.2s; }
.socials a:hover svg { fill: var(--accent); }

.footer__links {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; align-items: center;
  font-size: 14px;
}
.footer__links a { color: var(--ink-dim); border-bottom: 1px dotted var(--line-2); transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }
.age-badge {
  font-family: var(--font-display); font-size: 12px; color: var(--ink-dim);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 7px; letter-spacing: 0;
}
.footer__legal {
  font-size: 12px; color: var(--ink-mute); line-height: 1.7; max-width: 760px;
}

/* =====================================================================
   ТОСТ «СКОПИРОВАНО»
   ===================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px);
  z-index: 150; background: var(--bg-3); color: var(--ink);
  border: 2px solid var(--earth); border-radius: var(--r);
  padding: 12px 22px; font-family: var(--font-display); font-size: 15px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-fail { border-color: var(--fire); }

/* =====================================================================
   АДАПТИВ
   ===================================================================== */
@media (max-width: 620px) {
  .join__steps { gap: 10px; }
  .age-badge { font-size: 11px; }
}

/* короткий экран (ландшафт телефона): лого мельче, отступы плотнее */
@media (max-height: 620px) {
  .hero { min-height: calc(100svh - 64px); }
  .hero__logo { width: auto; max-height: 26vh; }
  .hero__center { gap: clamp(10px, 2vh, 18px); }
}

/* =====================================================================
   PREFERS-REDUCED-MOTION
   ===================================================================== */
@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;
  }
}
