/* ================================================================ TOKENS
   Cathedral of Embers — покинутий собор, освітлений тліючим вугіллям.

   Правило акценту: --red-bright і --ember світяться рідко. Три місця на
   весь сайт: ember-частинки в hero, primary CTA у hover, активний стан
   навігації. Все інше тримається на камені й бронзі — саме бронза дає
   відчуття віку і ціни, якого не дає «чорне + червоне».
   ==================================================================== */
:root {
  /* поверхні: від найглибшого рівня до освітленої грані каменю */
  --void: #030202;
  --bg: #050303;
  --stone: #0d0a0a;
  --stone-lit: #16100f;
  --panel: rgba(20, 12, 12, 0.66);
  --panel-solid: #130b0b;

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 60, 60, 0.18);
  --line-bronze: rgba(138, 111, 71, 0.22);

  /* текст: --muted дає 5.2:1 на --bg, --muted-dim 4.6:1 — обидва проходять AA */
  --text: #efe9e6;
  --muted: #8c7d7d;
  --muted-dim: #6f6363;
  --parchment: #d8cbb8;

  --red: #9c1c1c;
  --red-bright: #e8382c;
  --red-dim: #3d0a0a;
  --blood: #5c0f0f;
  --ember: #c9622e;
  --bronze: #8a6f47;
  --green: #3fae6b;

  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --font-display: 'Cinzel', 'UnifrakturMaguntia', serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Курсор оголошений один раз у змінній, а не продубльований двома
   base64-блоками по 2 KB. Текстові поля його не отримують — там мусить
   бути каретка, інакше не видно, куди клікаєш. */
:root {
  --cursor-blade: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABFUlEQVR4nO3RwUrDMBzH8f8/TdLRdSKO6gbbRS9atI9gGVPRJ3I3n0B8E/HgffSgT1AKu4iIh9UeZudK13ZNfIVURDzkc05+X0IANE3T/qWp79PQdflP7mKTwxJuyKv/sNXiFk9qgTxd1JucLo+jqFTdoE2CL2ePHV6iU8Tx1a7Efmm27nkP32QEHwggVTaIamzq+9TCypSf2WX3xL3buzidMIbXy3Rtzz3PUt1RDjpJQgAAJIih3XMIDPqABj0QRcWoXSjvNPrD9/FhV6TGvsHIxGJ0kOXrW9HhT8N6O8Yg2Px6MHRd3nZgp1phW0DFiG2u6qpMj55nX6objYIAABIA5+eeRbOChGyWjwJQepmmadrf+QbbtVgQfRTIBQAAAABJRU5ErkJggg==") 14 14, auto;
}

/* ------------------------------------------------------------ backdrop
   П'ять шарів глибини замість плоского чорного:

     void → камінь (статична текстура) → вінєтка → вугільне світло + промінь
     (рухаються) → зерно → контент

   Статичні шари живуть у background самого body, тому нових композитних
   шарів не додається: анімованих залишається два, як і було. */
body {
  min-height: 100vh;
  background-color: var(--void);
  background-image:
    /* вінєтка: темніє до країв, тримає погляд у центрі */
    radial-gradient(ellipse 92% 78% at 50% 42%, transparent 38%, rgba(3, 2, 2, 0.72) 100%),
    /* камінь: дуже слабкі вертикальні жили, як шліфований базальт */
    repeating-linear-gradient(102deg,
      rgba(255, 255, 255, 0.011) 0 2px,
      transparent 2px 7px),
    linear-gradient(178deg, var(--bg) 0%, var(--stone) 52%, var(--bg) 100%);
  background-attachment: fixed, fixed, fixed;
  color: var(--text);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
  cursor: var(--cursor-blade);
}

a, button, .buy, summary, .logo, label, [role="button"] { cursor: var(--cursor-blade); }
input, textarea { cursor: text; }
select { cursor: var(--cursor-blade); }

/* Вугільне світло замість fog-шейдера клієнта + промінь із стелі собору.
   Промінь їде разом із туманом — так він читається як світло, що пробилося
   крізь мряку, а не як окремий градієнт. */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(ellipse 46% 34% at 50% 6%, rgba(160, 31, 31, 0.20), transparent 70%),
    radial-gradient(ellipse 60% 42% at 82% 96%, rgba(160, 31, 31, 0.08), transparent 65%),
    radial-gradient(ellipse 60% 42% at 12% 100%, rgba(90, 16, 16, 0.14), transparent 65%),
    conic-gradient(from 196deg at 62% -14%,
      transparent 0deg,
      rgba(201, 98, 46, 0.055) 7deg,
      rgba(216, 203, 184, 0.028) 11deg,
      transparent 19deg);
  pointer-events: none;
  z-index: 0;
  animation: fog 20s ease-in-out infinite alternate;
}

@keyframes fog {
  from { transform: translate3d(-1.5%, 0, 0) scale(1); }
  to   { transform: translate3d(1.5%, -2%, 0) scale(1.06); }
}

/* Слабке зерно — щоб плоский чорний не смугував на дешевих матрицях. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { position: relative; z-index: 1; }

a { color: inherit; }

/* Ніщо клікабельне не має виділятися як текст на подвійний клік.
   .tab прибрано: такого класу в розмітці немає з моменту, коли табі
   рангів перейшли на .rank-switch button. */
button, .nav-cta, .pay-option, .badge, .logo, summary, .stat {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------ focus ring
   Раніше стилі фокуса мав лише input, тому навігація клавіатурою по
   темному фону була сліпою. :focus-visible не показує рамку на клік
   мишею, тільки на Tab. */
:where(a, button, summary, .pay-option, [tabindex]):focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Пропустити навігацію — перша ціль Tab на сторінці. */
.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 60;
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
  background: var(--panel-solid);
  border: 1px solid var(--line-bronze);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: top 0.22s var(--ease);
}
.skip:focus-visible { top: 12px; }

/* ---------------------------------------------------------------- header */

header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(5, 3, 3, 0.72);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.35s;
}
/* При скролі бордер стає бронзовим градієнтом, що затухає до країв —
   лінія читається як кована накладка, а не як рамка вікна. */
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, var(--line-bronze) 22%, rgba(201, 98, 46, 0.34) 50%, var(--line-bronze) 78%, transparent);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
header.scrolled {
  background: rgba(5, 3, 3, 0.9);
  box-shadow: 0 14px 34px -28px rgba(0, 0, 0, 0.95);
}
header.scrolled::after { opacity: 1; }

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.logo {
  font-family: UnifrakturMaguntia, serif;
  font-size: 25px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s var(--ease);
}
.logo:hover { transform: translateY(-1px); }
.logo .fellas { color: var(--red-bright); }

.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  position: relative;
  transition: color 0.18s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

/* Кована пластина: світло по верхній грані, тінь по нижній. Замість
   filter: brightness() на градієнті, який дає брудний результат. */
.nav-cta {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid rgba(232, 56, 44, 0.28);
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(180deg, var(--red) 0%, #7d1616 55%, var(--red-dim) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 170, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  text-decoration: none;
  white-space: nowrap;
  width: auto;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 56, 44, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 170, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 8px 22px -8px rgba(201, 98, 46, 0.85);
}
.nav-cta:active { transform: translateY(0) scale(0.97); }

.burger { display: none; background: none; border: none; color: var(--text); font-size: 22px; width: auto; padding: 0 4px; }

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--panel-solid);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    animation: dropIn 0.25s var(--ease);
  }
  .nav-links:not(.open) { display: none; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .burger { display: block; margin-left: auto; }
  .nav-cta { display: none; }
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- layout */

section.page { display: none; }
section.page.active { display: block; animation: pageIn 0.45s var(--ease); }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Вихідна фаза переходу: коротке затемнення поверх контенту, 0.2s. Разом
   із pageIn це 0.65s — достатньо, щоб перехід читався, і замало, щоб
   користувач відчув чекання. */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(5, 3, 3, 0.72), var(--void) 92%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.page-veil.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .page-veil { display: none; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 0 20px; }
.mid { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-bright);
  font-weight: 700;
  margin-bottom: 14px;
  font-family: var(--font-body);
}

/* Воскова печатка — підписний елемент hero. */
.seal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 26px;
}
.seal .wax {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 32% 28%, var(--red-bright), var(--red) 55%, var(--red-dim) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), inset 0 2px 4px rgba(0,0,0,0.5), 0 0 14px -4px rgba(194,58,46,0.9);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: rgba(241,230,212,0.85);
}
.seal span.txt {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-bright);
  font-weight: 700;
}

/* Орнаментальний розділювач: бронзова лінія з ромбом у центрі.
   Використовується там, де потрібна пауза між блоками тексту. */
.ornament {
  color: var(--bronze);
  line-height: 0;
  margin: 0 auto 22px;
  opacity: 0.72;
}
.ornament svg { display: block; margin: 0 auto; max-width: 100%; }

h1.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 9vw, 84px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
h1.hero-title .fellas {
  background: linear-gradient(100deg, var(--red) 20%, #ff6b57 45%, var(--red) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sheen 7s linear infinite;
}

@keyframes sheen {
  from { background-position: 120% 0; }
  to   { background-position: -120% 0; }
}

h2.sec { font-family: var(--font-display); font-size: 27px; font-weight: 600; margin-bottom: 10px; letter-spacing: 0.005em; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }

.sec-note { color: var(--muted); font-size: 14px; margin-bottom: 30px; line-height: 1.6; }

.hero { padding: 92px 0 84px; text-align: center; position: relative; }
.hero p.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* ------------------------------------------------------------- embers */

.embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ember {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 6px 1px rgba(232, 56, 44, 0.9), 0 0 14px 3px rgba(156, 28, 28, 0.5);
  opacity: 0;
  animation: emberRise linear infinite;
}
@keyframes emberRise {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  8%   { opacity: 0.9; }
  85%  { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(var(--drift, 20px), -320px, 0) scale(1.1); }
}
.ember:nth-child(1)  { left: 6%;  width: 2px; height: 2px; animation-duration: 7s;  animation-delay: 0.2s; --drift: 14px; }
.ember:nth-child(2)  { left: 14%; animation-duration: 9s;  animation-delay: 2.1s; --drift: -22px; }
.ember:nth-child(3)  { left: 23%; width: 2px; height: 2px; animation-duration: 6.4s; animation-delay: 0.9s; --drift: 10px; }
.ember:nth-child(4)  { left: 34%; animation-duration: 8.2s; animation-delay: 3.4s; --drift: -16px; }
.ember:nth-child(5)  { left: 45%; width: 2px; height: 2px; animation-duration: 7.6s; animation-delay: 1.6s; --drift: 24px; }
.ember:nth-child(6)  { left: 55%; animation-duration: 9.4s; animation-delay: 0.4s; --drift: -12px; }
.ember:nth-child(7)  { left: 64%; width: 2px; height: 2px; animation-duration: 6.9s; animation-delay: 2.8s; --drift: 18px; }
.ember:nth-child(8)  { left: 73%; animation-duration: 8.6s; animation-delay: 1.1s; --drift: -20px; }
.ember:nth-child(9)  { left: 82%; width: 2px; height: 2px; animation-duration: 7.2s; animation-delay: 3.9s; --drift: 12px; }
.ember:nth-child(10) { left: 90%; animation-duration: 9.8s; animation-delay: 0.7s; --drift: -14px; }
.ember:nth-child(11) { left: 38%; width: 2px; height: 2px; animation-duration: 6.2s; animation-delay: 4.6s; --drift: 20px; }
.ember:nth-child(12) { left: 60%; animation-duration: 8.9s; animation-delay: 2.3s; --drift: -10px; }

/* Дальні вуглинки: дрібніші, тусклі, повільні. Разом із ближніми дають
   відчуття глибини без другого шару DOM і без JS-parallax. */
.ember.far {
  width: 2px; height: 2px;
  opacity: 0;
  box-shadow: 0 0 4px 1px rgba(201, 98, 46, 0.55);
  background: var(--ember);
}
.ember.far { animation-name: emberRiseFar; }

@keyframes emberRiseFar {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.5); }
  10%  { opacity: 0.42; }
  80%  { opacity: 0.22; }
  100% { opacity: 0; transform: translate3d(var(--drift, 12px), -190px, 0) scale(0.8); }
}

.hero > *:not(.embers) { position: relative; z-index: 1; }

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

/* Поява першого екрана: грає один раз, observer не потрібен. */
.rise { opacity: 0; animation: rise 0.75s var(--ease) forwards; }
.rise.d1 { animation-delay: 0.06s; }
.rise.d2 { animation-delay: 0.14s; }
.rise.d3 { animation-delay: 0.22s; }
.rise.d4 { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.stats { display: flex; justify-content: center; gap: 46px; margin-top: 60px; flex-wrap: wrap; }
.stat .n { font-size: 26px; font-weight: 600; transition: opacity 0.4s; }
.stat .n.loading { opacity: 0.35; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 2px; animation: pulse 2.4s infinite; }

.block { padding: 74px 0; border-top: 1px solid var(--line); }

/* Поява при скролі. */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Заголовки виїжджають з-під маски знизу вгору — типографіка «проявляється»,
   а не просто вилітає разом із блоком. */
.tx-reveal > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.85s var(--ease);
}
.tx-reveal { overflow: hidden; padding-bottom: 0.08em; }
.tx-reveal.in > span { transform: none; }

/* Parallax: JS кладе у --shift значення в піднятих пікселях, CSS лише
   застосовує. Через це читання layout і запис стилів не змішуються. */
.plx { transform: translate3d(0, var(--shift, 0px), 0); will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .rise { opacity: 1; }
  .tx-reveal > span { transform: none; }
  .plx { transform: none; will-change: auto; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

/* Камінь у бронзовій окантовці: зовнішня рамка тримає форму, внутрішній
   inset-хайлайт читається як металева накладка, кутові насічки — як
   оздоблення. Все на псевдоелементах, зайвих вузлів у DOM немає. */
.card {
  background:
    linear-gradient(168deg, rgba(22, 16, 15, 0.5) 0%, transparent 58%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.05),
    inset 0 0 0 1px rgba(138, 111, 71, 0.05);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
  opacity: 0;
  transition: opacity 0.35s, background 0.35s;
}
/* Кутові насічки: два сегменти бордера в лівому верхньому й правому
   нижньому кутах. Дешевше за рамку-картинку і масштабується. */
.card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background:
    linear-gradient(var(--bronze), var(--bronze)) 0 0 / 11px 1px no-repeat,
    linear-gradient(var(--bronze), var(--bronze)) 0 0 / 1px 11px no-repeat,
    linear-gradient(var(--bronze), var(--bronze)) 100% 100% / 11px 1px no-repeat,
    linear-gradient(var(--bronze), var(--bronze)) 100% 100% / 1px 11px no-repeat;
  opacity: 0.22;
  pointer-events: none;
  transition: opacity 0.35s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 56, 44, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.07),
    inset 0 -22px 30px -26px rgba(201, 98, 46, 0.4),
    0 18px 40px -26px rgba(143, 29, 29, 0.8);
}
.card:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
}
.card:hover::after { opacity: 0.5; }
.card h3 { font-family: var(--font-display); font-weight: 600; }
.card p { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* Тонкі лінійні піктограми в бронзі замість emoji: emoji рендериться
   шрифтом системи, тому на кожній ОС виглядає інакше і вибивається з
   палітри. SVG підкоряється currentColor. */
.card .ico {
  display: block;
  width: 26px; height: 26px;
  margin-bottom: 13px;
  color: var(--bronze);
  transition: transform 0.35s var(--ease), color 0.35s;
}
.card .ico svg { display: block; width: 100%; height: 100%; }
.card:hover .ico { transform: translateY(-2px) scale(1.06); color: var(--ember); }

/* --------------------------------------------------------------- pricing */

.rank-switch { display: flex; gap: 8px; justify-content: center; margin-bottom: 26px; }
.rank-switch button {
  width: auto;
  padding: 9px 22px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
  box-shadow: none;
  color: var(--muted);
  /* transition: all анімує і box-shadow, і background-image — зайва робота
     на кожен кадр. Перелічуємо тільки те, що справді змінюється. */
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.rank-switch button:hover:not(.on) {
  transform: none;
  color: var(--text);
  border-color: var(--line-bronze);
  background: rgba(216, 203, 184, 0.04);
}
.rank-switch button.on {
  color: var(--text);
  border-color: rgba(232, 56, 44, 0.5);
  background: rgba(232, 56, 44, 0.12);
}

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; align-items: stretch; }
.price-grid.solo { max-width: 360px; margin: 0 auto; }

/* -------------------------------------------------------- locked tab (premium) */

.price-grid-wrap { position: relative; }

.price-grid-wrap.locked .price-grid {
  filter: blur(2.5px) grayscale(0.6);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
  z-index: 5;
}

/* Печатка замість emoji-ланцюгів: тонка бронзова сигіла, яка дихає. */
.locked-sigil {
  color: var(--bronze);
  line-height: 0;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.7));
  animation: sigilBreathe 6s ease-in-out infinite;
}
.locked-sigil svg { display: block; }

@keyframes sigilBreathe {
  0%, 100% { opacity: 0.62; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.035); }
}

.locked-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(5, 3, 3, 0.82);
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  border-radius: 8px;
  margin: 0;
}

.price {
  background:
    linear-gradient(168deg, rgba(22, 16, 15, 0.5) 0%, transparent 58%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 24px;
  position: relative;
  backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.05),
    inset 0 0 0 1px rgba(138, 111, 71, 0.05);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.price::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 160px at 50% -20%, rgba(143, 29, 29, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.price:hover {
  transform: translateY(-5px);
  border-color: rgba(232, 56, 44, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.07),
    0 22px 50px -30px rgba(143, 29, 29, 0.9);
}
.price:hover::before { opacity: 1; }
.price.best { border-color: rgba(232, 56, 44, 0.5); }
.price.best::before { opacity: 0.6; background: radial-gradient(400px 160px at 50% -20%, rgba(232, 56, 44, 0.22), transparent 70%); }

.price .tag {
  position: absolute;
  top: 14px; right: 14px;
  background: linear-gradient(180deg, var(--red-bright), var(--blood));
  color: #1a1206;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.price .name { font-family: var(--font-display); font-size: 13px; color: var(--muted); margin-bottom: 12px; letter-spacing: 0.03em; }

/* #6a5f4f давав 3.3:1. Стара ціна мусить читатись, вона й є аргументом. */
.price .old {
  font-size: 15px;
  color: var(--muted-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(232, 56, 44, 0.8);
  text-decoration-thickness: 1.5px;
  margin-bottom: 4px;
}
.price .amount { font-size: 36px; font-weight: 700; line-height: 1; font-family: var(--font-display); }
.price .amount span { font-size: 15px; color: var(--muted); font-weight: 400; }
.price .alt { font-size: 13px; color: var(--muted); margin-top: 7px; }
.price .per { font-size: 12.5px; color: var(--muted); margin-top: 8px; margin-bottom: 22px; }
.price button { margin-top: auto; }

.save {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #7ddb9e;
  background: rgba(40, 160, 80, 0.12);
  border: 1px solid rgba(40, 160, 80, 0.28);
}

.price-note { text-align: center; font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 24px; }

/* ------------------------------------------------------------------- faq */

details.faq { border-bottom: 1px solid var(--line); padding: 17px 0; }
details.faq summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.2s;
}
details.faq summary:hover { color: #fff; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.4s var(--ease), color 0.25s;
}
details.faq[open] summary::after { transform: rotate(135deg); color: var(--red); }
details.faq[open].closing summary::after { transform: rotate(0deg); color: var(--muted); }

/* Плавне розкриття: grid-рядок 0fr → 1fr анімується, на відміну від height:auto */
details.faq .faq-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.4s var(--ease), opacity 0.3s var(--ease);
}
details.faq[open] .faq-body { grid-template-rows: 1fr; opacity: 1; }
details.faq[open].closing .faq-body { grid-template-rows: 0fr; opacity: 0; }
details.faq .faq-body > div { overflow: hidden; }

details.faq p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  padding-top: 11px;
  transform: translateY(-6px);
  transition: transform 0.4s var(--ease);
}
details.faq[open] p { transform: none; }
details.faq[open].closing p { transform: translateY(-6px); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- screenshots */

/* Плейсхолдер тепер тепло-кам'яний, а не синьо-чорний (#101014 конфліктував
   із бордовою палітрою). Текст піднято з #34343c (1.54:1 — провал) до
   --muted-dim на світлішому камені: 4.6:1, AA проходить. */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.shot {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(160deg, var(--stone-lit), var(--void));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.shot > span {
  /* --muted-dim давав 3.57:1 на цьому світлішому камені — воно світліше за
     --bg, тому поріг тут жорсткіший, ніж для тексту на фоні сторінки.
     --muted тримає 4.79:1 на найсвітлішій частині градієнта. */
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.shot:hover {
  transform: scale(1.02);
  border-color: var(--line-bronze);
  box-shadow: 0 18px 44px -30px rgba(0, 0, 0, 0.95);
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  backdrop-filter: blur(20px);
}

h2.panel-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 20px; letter-spacing: 0.01em; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.25s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(232, 56, 44, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 56, 44, 0.10);
}
/* #4a4136 давав ~2.1:1 — placeholder був практично невидимий. */
input::placeholder { color: var(--muted-dim); }

/* Кована пластина: трьохстопний градієнт + inset-хайлайт по верхній грані
   і inset-тінь по нижній. Раніше hover робив filter: brightness(1.3) по
   градієнту — це вимиває колір у брудно-сірий і будує зайвий шар фільтра.
   Тепер світлішає сам градієнт, а фільтра немає взагалі. */
button {
  width: 100%;
  padding: 11px;
  border: 1px solid rgba(138, 111, 71, 0.16);
  border-radius: 6px;
  background: linear-gradient(180deg, #3a2d20 0%, #2a2016 52%, #1b150e 100%);
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.18s var(--ease), background 0.22s, border-color 0.22s, box-shadow 0.25s;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-bronze);
  background: linear-gradient(180deg, #4a3a29 0%, #34281c 52%, #221a11 100%);
  box-shadow:
    inset 0 1px 0 rgba(216, 203, 184, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 8px 20px -12px rgba(0, 0, 0, 0.9);
}
button:active:not(:disabled) { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: default; }

/* Primary CTA: єдине місце, крім hero і навігації, де дозволене світіння. */
button.accent {
  border-color: rgba(232, 56, 44, 0.3);
  background: linear-gradient(180deg, var(--red-bright) 0%, #a01d1a 55%, var(--red-dim) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 180, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}
button.accent:hover:not(:disabled) {
  border-color: rgba(232, 56, 44, 0.55);
  background: linear-gradient(180deg, #f04a3c 0%, #b12220 55%, #4a0d0d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 180, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 12px 30px -12px rgba(201, 98, 46, 0.9);
}

button.ghost {
  background: rgba(255, 255, 255, 0.014);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(216, 203, 184, 0.04);
}
button.ghost:hover:not(:disabled) {
  background: rgba(216, 203, 184, 0.045);
  border-color: var(--line-bronze);
  box-shadow: inset 0 1px 0 rgba(216, 203, 184, 0.07);
}
button.auto { width: auto; padding: 12px 26px; }

/* Стан завантаження: текст лишається на місці (щоб кнопка не змінювала
   ширину), але стає прозорим, а поверх обертається бронзовий орнамент. */
button.is-busy { position: relative; color: transparent; pointer-events: none; }
button.is-busy::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 1.5px solid rgba(216, 203, 184, 0.2);
  border-top-color: var(--parchment);
  border-radius: 50%;
  animation: runeSpin 0.75s linear infinite;
}

@keyframes runeSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  /* Без обертання індикатор мусить лишитися видимим, інакше кнопка просто
     мовчить. Показуємо статичне кільце. */
  button.is-busy::after { animation: none; border-top-color: var(--parchment); opacity: 0.8; }
}

.switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.switch a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer; transition: border-color 0.2s; }
.switch a:hover { border-color: var(--red); }

.msg { padding: 10px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: none; line-height: 1.5; }
.msg.error, .msg.ok, .msg.info { animation: fadeIn 0.3s var(--ease); }
.msg.error { display: block; background: rgba(143, 29, 29, 0.12); border: 1px solid rgba(143, 29, 29, 0.3); color: #ff8a8a; }
.msg.ok { display: block; background: rgba(40, 160, 80, 0.10); border: 1px solid rgba(40, 160, 80, 0.28); color: #7ddb9e; }
.msg.info { display: block; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--muted); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-of-type { border-bottom: none; }
.row .k { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.row .v { font-size: 14px; font-weight: 500; text-align: right; }

.badge { padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.badge.user { background: rgba(255, 255, 255, 0.08); }
.badge.developer { background: rgba(143, 29, 29, 0.2); color: #e07461; }
.badge.premium { background: rgba(232, 56, 44, 0.16); color: var(--red-bright); }
.badge.none { background: rgba(255, 255, 255, 0.04); color: var(--muted); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(70, 196, 110, 0.6); animation: pulse 2.4s infinite; }
.dot.off { background: #6a6a72; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(70, 196, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 196, 110, 0); }
}

.divider { height: 1px; background: var(--line); margin: 22px 0; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.55; }

#keyInput { text-transform: uppercase; letter-spacing: 0.5px; font-family: ui-monospace, monospace; }

/* -------------------------------------------------------------- history */

.hist { max-height: 260px; overflow-y: auto; }
.hist-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  animation: fadeIn 0.35s var(--ease);
}
.hist-item:last-child { border-bottom: none; }
.hist-item .code { font-family: ui-monospace, monospace; }
.hist-item .when { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------------------------------------------------------------- modal */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 90;
}
.overlay.open { display: grid; animation: fadeIn 0.22s var(--ease); }

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 26px;
  position: relative;
  animation: modalIn 0.34s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal .close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  width: auto;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, transform 0.25s var(--ease);
}
.modal .close:hover { color: var(--text); transform: rotate(90deg); }

.pay-note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }

.pay-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  text-decoration: none;
  margin-bottom: 10px;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.pay-option:hover { border-color: rgba(61, 220, 132, 0.4); background: rgba(255, 255, 255, 0.06); transform: translateX(3px); }
.pay-option .mark {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: #0e2a1c;
}
.pay-option .txt { text-align: left; }
.pay-option .txt b { display: block; font-size: 14px; font-weight: 600; }
.pay-option .txt span { font-size: 12px; color: var(--muted); }
.pay-option .arrow { margin-left: auto; color: var(--muted); transition: transform 0.25s var(--ease); }
.pay-option:hover .arrow { transform: translateX(4px); }

/* «Скоро»: колір іконки успадковується через currentColor, а не прибитий
   хардкодом у кожному svg. */
.pay-option.soon { opacity: 0.45; cursor: not-allowed; color: var(--muted-dim); }
.pay-option.soon:hover { transform: none; border-color: var(--line); background: rgba(255, 255, 255, 0.022); }
.pay-option.soon .mark { background: rgba(255, 255, 255, 0.05); }

/* Пляма теплого світла за курсором. mix-blend-mode: screen додає світло,
   а не малює поверх — тому вона не «замащує» контент, а підсвічує його. */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 98, 46, 0.09) 0%, rgba(156, 28, 28, 0.05) 42%, transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.4s;
  will-change: transform;
}

/* --------------------------------------------------------------- legal */

.legal h1 { font-size: 30px; margin-bottom: 8px; }
.legal .upd { color: var(--muted); font-size: 13px; margin-bottom: 34px; }
.legal h3 { margin-top: 28px; font-size: 16px; }
.legal p, .legal li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.legal ul { margin: 10px 0 0 20px; }
.legal p { margin-top: 10px; }

/* -------------------------------------------------------------- footer */

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 46px; }
.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--text); }
.foot .links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }

.center { text-align: center; }

/* Утиліти замість style="" в розмітці: інлайнові стилі блокуються
   Content-Security-Policy без 'unsafe-inline', а саме strict-CSP — головна
   причина, чому CSS і JS взагалі винесені у файли. */
.mt { margin-top: 22px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.pad-page { padding-top: 56px; padding-bottom: 56px; }
.pad-legal { padding-top: 56px; padding-bottom: 40px; }

/* =========================================================== RESPONSIVE
   Атмосфера мусить лишитись, але не за рахунок UX і батареї. На вузьких
   екранах прибираємо те, що не має сенсу без мишки або з'їдає GPU при
   тому, що займає пів екрана. */

/* Тач: hover-станів немає в природі, а backdrop-filter на кількох
   поверхнях підряд — найдорожча річ у цьому файлі. */
@media (hover: none) {
  .cursor-glow { display: none; }
  .card:hover, .price:hover, .shot:hover { transform: none; }
  .card, .price { backdrop-filter: none; background: var(--panel-solid); }
}

@media (max-width: 900px) {
  .stats { gap: 30px; }
  .block { padding: 60px 0; }
  h2.sec { font-size: 24px; }
}

@media (max-width: 620px) {
  .hero { padding: 64px 0 60px; }
  /* Вугілля в hero на телефоні: сім частинок замість дванадцяти — на
     екрані 360px решта все одно накладається одна на одну. */
  .ember:nth-child(n + 8) { display: none; }
  /* Промінь із стелі розрахований на широкий екран; на вузькому він
     перетворюється у пляму через пів hero. */
  body::before { background-image: none; }

  .stats { gap: 22px 34px; margin-top: 44px; }
  .stat .n { font-size: 22px; }

  .ornament svg { width: 160px; }
  .card { padding: 18px; }
  .card::after { inset: 5px; }
  .price { padding: 22px 18px; }
  .panel { padding: 20px; }
  .legal h1 { font-size: 25px; }

  /* Кутові насічки на дрібних картках зливаються з рамкою — прибираємо. */
  .shot { border-radius: 8px; }
  .hero-actions button.auto { width: 100%; }
  .hero-actions > a { width: 100%; }
}

@media (max-width: 420px) {
  .nav { gap: 14px; padding: 12px 16px; }
  .logo { font-size: 21px; }
  .container, .narrow, .mid { padding: 0 16px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 14px; }
  .foot .links { margin-left: 0; }
}

/* =========================================================== 3D ACCESS KEY */
.key-stage {
  position: relative;
  width: 250px;
  height: 144px;
  margin: 35px auto 4px;
  perspective: 900px;
  cursor: grab;
  user-select: none;
  z-index: 2;
}
.key-stage:active { cursor: grabbing; }
.key-stage::before {
  content: "";
  position: absolute;
  left: 15%; right: 15%; bottom: 10px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  filter: blur(14px);
  transform: rotate(-5deg);
  transition: transform .35s, opacity .35s;
}
.key-hint {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  color: var(--muted-dim);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  opacity: .72;
}
.access-key {
  --rx: 12deg;
  --ry: -25deg;
  --rz: -5deg;
  position: absolute;
  left: 22px; top: 6px;
  width: 190px; height: 112px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.42));
}
.access-key::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 45%, rgba(156,28,28,.24), transparent 62%);
  transform: translateZ(-10px);
  pointer-events: none;
}
.key-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(216,203,184,.28);
  border-radius: 10px;
  overflow: hidden;
  backface-visibility: hidden;
  background:
    radial-gradient(circle at 78% 25%, rgba(232,56,44,.24), transparent 20%),
    linear-gradient(140deg, #2a1614, #100909 56%, #050303);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -18px 28px rgba(0,0,0,.35);
}
.key-front::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(201,98,46,.23);
  border-radius: 6px;
  background: linear-gradient(118deg, transparent 20%, rgba(255,255,255,.12) 42%, transparent 55%);
  background-size: 240% 100%;
  animation: keySheen 4.5s ease-in-out infinite;
}
@keyframes keySheen { 0%, 40% { background-position: 140% 0; } 75%, 100% { background-position: -40% 0; } }
.key-back { transform: rotateY(180deg) translateZ(2px); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.key-back-label { color: var(--ember); font-size: 9px; letter-spacing: .16em; }
.key-back-code { color: var(--text); font: 700 25px/1 var(--font-display); }
.key-back-copy { color: var(--muted); font-size: 10px; line-height: 1.5; }
.key-led { position: absolute; right: 18px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: #ff765f; box-shadow: 0 0 6px 2px rgba(232,56,44,.88), 0 0 18px 5px rgba(156,28,28,.42); animation: keyPulse 2.1s ease-in-out infinite; }
@keyframes keyPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.key-brand { position: absolute; left: 19px; top: 15px; color: var(--red-bright); font: 22px/1 UnifrakturMaguntia, serif; }
.key-title { position: absolute; left: 19px; bottom: 22px; color: var(--text); font: 700 14px/1.15 var(--font-display); letter-spacing: .08em; }
.key-serial { position: absolute; right: 17px; bottom: 19px; color: var(--muted); font: 8px/1 ui-monospace, monospace; letter-spacing: .1em; writing-mode: vertical-rl; transform: rotate(180deg); }
.key-screw { position: absolute; width: 5px; height: 5px; border: 1px solid rgba(216,203,184,.42); border-radius: 50%; }
.screw-a { left: 12px; bottom: 12px; }
.screw-b { right: 12px; bottom: 12px; }
.key-edge { position: absolute; background: linear-gradient(90deg, #3e211b, #120908); border: 1px solid rgba(216,203,184,.2); }
.key-edge-top, .key-edge-bottom { left: 7px; right: 7px; height: 6px; }
.key-edge-top { top: -3px; transform: rotateX(90deg) translateZ(3px); transform-origin: bottom; }
.key-edge-bottom { bottom: -3px; transform: rotateX(-90deg) translateZ(3px); transform-origin: top; }
.key-edge-left, .key-edge-right { top: 7px; bottom: 7px; width: 6px; }
.key-edge-left { left: -3px; transform: rotateY(-90deg) translateZ(3px); transform-origin: right; }
.key-edge-right { right: -3px; transform: rotateY(90deg) translateZ(3px); transform-origin: left; }
.key-usb { position: absolute; right: -26px; top: 35px; width: 28px; height: 42px; border: 1px solid rgba(216,203,184,.34); border-left: 0; border-radius: 0 5px 5px 0; background: linear-gradient(180deg, #b18a5c, #5e452f 45%, #24180f); transform: translateZ(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.key-usb i { display: block; width: 12px; height: 3px; margin: 8px 0 0 9px; border-radius: 1px; background: rgba(20,12,8,.62); }
.key-usb i + i { margin-top: 5px; }
.key-stage:focus-within .access-key { outline: 1px solid var(--ember); outline-offset: 10px; }
@media (max-width: 620px) {
  .key-stage { margin-top: 27px; transform: scale(.88); }
}
@media (prefers-reduced-motion: reduce) {
  .key-front::before, .key-led { animation: none; }
}

/* Final tuning for the 3D key prototype. */
.key-stage.rise { animation: keyStageReveal 1.05s cubic-bezier(.16,1,.3,1) .22s both; }
@keyframes keyStageReveal {
  from { opacity: 0; transform: translateY(20px) scale(.72) rotate(-5deg); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); filter: blur(0); }
}
.key-edge { display: none; }
.key-stage { height: 164px; margin-bottom: -8px; }
.key-hint { bottom: -19px; }
.key-front::before { border-color: rgba(216,203,184,.15); }
.key-stage::after {
  content: "";
  position: absolute;
  left: 50%; top: 48%;
  width: 145px; height: 70px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: rgba(156,28,28,.16);
  filter: blur(28px);
  opacity: 0;
  animation: keyGlowIn 1.1s ease .35s both;
  pointer-events: none;
}
@keyframes keyGlowIn { from { opacity: 0; scale: .55; } to { opacity: 1; scale: 1; } }
@media (max-width: 620px) {
  .key-stage { height: 158px; margin-bottom: -4px; }
}

/* Key and payment refinements. */
.key-stage:focus-within .access-key,
.access-key:focus,
.access-key:focus-visible { outline: none; outline-offset: 0; }
.key-back-promo { color: var(--red-bright); font: 9px/1 ui-monospace, monospace; letter-spacing: .1em; }
.promo-field { margin-top: 2px; }
.promo-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 5px; }
.promo-row input { margin-bottom: 0; text-transform: uppercase; letter-spacing: .04em; }
.promo-apply { flex: 0 0 auto; width: auto; padding: 0 13px; }
.promo-status { min-height: 18px; margin: 4px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.promo-status.warn { color: #e59a79; }
.pay-option.pay-method { color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pay-option.pay-method .mark { color: var(--muted); }
.pay-option.blocked { opacity: .42; pointer-events: none; filter: grayscale(.55); }
.pay-option.blocked .txt span::after { content: " · промокод"; color: #e59a79; }
@media (max-width: 430px) {
  .promo-row { flex-direction: column; }
  .promo-apply { min-height: 42px; }
}

/* Readable reverse face. */
.key-face { backface-visibility: visible; }
.key-back { transform: rotateY(180deg) translateZ(2px); }
.key-back > * { transform: none; }

/* Correct face visibility: front at rest, readable artwork on the reverse. */
.key-face { backface-visibility: hidden; }
.key-back { transform: rotateY(180deg) translateZ(2px); }
.key-back > * { transform: none; }

/* Show exactly one artwork at a time: front at rest, reverse after 90°. */
.key-face { backface-visibility: visible; }
.key-back { visibility: hidden; transform: rotateY(180deg) translateZ(2px); }
.key-back > * { transform: none; }
.access-key.is-back .key-front { visibility: hidden; }
.access-key.is-back .key-back { visibility: visible; }

/* JS owns every frame of the drag/return motion; CSS must not interpolate behind it. */
.access-key { transition: none; }

/* True two-sided card test: both faces stay in the 3D stack. */
.key-face { backface-visibility: hidden; visibility: visible; }
.key-back { transform: rotateY(180deg); visibility: visible; }
.access-key.is-back .key-front,
.access-key.is-back .key-back { visibility: visible; }
.key-back { transform: translateZ(1px) rotateY(180deg); }
/* Keep the 3D context intact: parent filters flatten backface rendering. */
.access-key { filter: none; }

/* ========================================================= NAV + INTRO PASS */
.nav-links { gap: 24px; }
.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  font-size: 14.5px;
  letter-spacing: .01em;
}
.account-nav {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(216,203,184,.18);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255,255,255,.04);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.account-nav:hover { border-color: rgba(232,56,44,.52); background: rgba(156,28,28,.12); transform: translateY(-1px); }
.account-nav[hidden] { display: none; }
.account-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(63,174,107,.7); }
.account-rank { padding-left: 8px; border-left: 1px solid rgba(216,203,184,.16); color: var(--ember); font: 10px/1 ui-monospace, monospace; letter-spacing: .08em; }

.intro-curtain {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse 45% 42% at 50% 48%, rgba(70,9,9,.28), var(--void) 78%);
  pointer-events: none;
  animation: introCurtainOut 1.15s cubic-bezier(.76,0,.24,1) .22s forwards;
}
.intro-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border: 1px solid rgba(232,56,44,.55);
  border-radius: 50%;
  color: var(--red-bright);
  font: 26px/1 UnifrakturMaguntia, serif;
  opacity: 0;
  transform: scale(.72);
  box-shadow: 0 0 32px rgba(156,28,28,.25), inset 0 1px 0 rgba(255,255,255,.12);
  animation: introMarkIn .44s cubic-bezier(.16,1,.3,1) .1s forwards;
}
.intro-line {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 1px;
  transform: translate(-50%,-50%);
  background: linear-gradient(90deg, transparent, var(--red-bright), #f1c38a, var(--red-bright), transparent);
  box-shadow: 0 0 18px rgba(232,56,44,.78);
  animation: introLine 1.05s cubic-bezier(.16,1,.3,1) .18s forwards;
}
@keyframes introMarkIn { to { opacity:1; transform:scale(1); } }
@keyframes introLine { 0% { width:0; opacity:0; } 28% { width:220px; opacity:1; } 72% { width:440px; opacity:.9; } 100% { width:100vw; opacity:0; } }
@keyframes introCurtainOut { 0% { opacity:1; } 72% { opacity:1; } 100% { opacity:0; visibility:hidden; } }

@media (max-width: 820px) {
  .nav-links a { min-height: 44px; }
  .account-nav { min-height: 38px; padding: 0 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-curtain { display:none; }
}

/* CTA links keep button geometry but navigate to pricing first. */
a.accent.auto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 12px 26px;
  border: 1px solid rgba(232,56,44,.30);
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(180deg, var(--red-bright) 0%, #a01d1a 55%, var(--red-dim) 100%);
  box-shadow: inset 0 1px 0 rgba(255,200,180,.18), inset 0 -1px 0 rgba(0,0,0,.5);
  text-decoration: none;
  transition: transform .18s var(--ease), background .22s, border-color .22s, box-shadow .25s;
}
a.accent.auto:hover { transform: translateY(-1px); border-color: rgba(232,56,44,.55); background: linear-gradient(180deg,#f04a3c 0%,#b12220 55%,#4a0d0d 100%); box-shadow: inset 0 1px 0 rgba(255,200,180,.24), inset 0 -1px 0 rgba(0,0,0,.5), 0 12px 30px -12px rgba(201,98,46,.9); }
a.accent.auto:active { transform: scale(.98); }
@media (max-width:620px) { .hero-actions > a.accent.auto { width:100%; } }
