/* ==========================================================================
   Cubicle: «cobalt trust» поверх клона.
   Синий — самый любимый цвет (YouGov, 10 стран) и главный цвет крипто/финтеха.
   Курс — меньше «сгенерированного» блеска, больше редакционной структуры:
     Accred (accred.sh) — вертикальные линии-колонны, моно-метки с номерами
       «01 / …», двухстрочный заголовок со второй строкой в акценте;
     Delver (delvermining.tech) — мягкая аврора, зерно, стеклянные панели,
       подсветка за курсором.
   Все цвета — только через токены.
   ========================================================================== */

:root {
  /* бумага и поверхности: карточки полупрозрачные — под ними живёт фон */
  --paper: #eef2fb;
  --paper-2: #ffffffd9;
  /* панели почти плотные: линии фона и аврора видны в зазорах, а не сквозь текст */
  --card: #ffffffeb;
  --card-solid: #ffffff;
  --bar: #eef2fbc2;
  --well: #0b1a4d08;
  --well-2: #0b1a4d0f;
  --track: #0b1a4d12;
  --line: #0b1a4d17;
  --frame: #0b1a4d26;
  --scroll: #b6c1d6;
  --chrome: #7a869c;
  --grain: #0b122008;

  /* текст */
  --ink: #0b1220;
  --muted: #5a6478;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* основной акцент — кобальт */
  --brand: #2f5bff;
  --fill: #2f5bff;
  --fill-lit: #2148e6;
  --on-fill: #ffffff;
  --lime: #2f5bff;
  --head: #1f47e8;
  --head-lit: #3a66ff;

  /* тёмная карточка-герой и плашка сверху */
  --panel: #0a1533;
  --on-panel: #f4f6fb;
  --notice: #0a1533;
  --on-notice: #f4f6fb;

  /* подсказки / баннер «Minted a desk?» */
  --tip: #eef3ffcc;
  --tip-line: #cdd9ff;
  --on-tip: #1f47e8;
  --wash: linear-gradient(120deg, #e6edff 0%, #edf4ff 38%, transparent 72%);

  /* семантика */
  --alert: #e5484d;
  --gold: #a16207;
  --phos: #2f6bff;
  --phos-dim: #9db7f5;

  /* тени с синим подтоном */
  --rest: 0 0 0 1px #0b1a4d14, 0 1px 2px #0b1a4d08, 0 2px 4px #0b1a4d0a;
  --lift: 0 6px 12px -2px #0b1a4d0f, 0 12px 24px -4px #0b1a4d17;
  --pop: 0 6px 12px -2px #0b1a4d0f, 0 12px 24px -4px #0b1a4d17;

  /* фон: небо сверху, мягкая аврора, вертикальные линии, зерно */
  --sky: #dce5ff;
  --aura-1: #2f5bff24;
  --aura-2: #19c3ff1f;
  --aura-3: #2f5bff17;
  --grid: #0b1a4d14;
  --grid-hi: #2f5bff66;
  --noise-o: .035;
  /* стекло: блик сверху карточки и подсветка за курсором */
  --glass-hi: #ffffffa6;
  --spot: #2f5bff;
  --spot-max: 10%;

  /* свои токены для анимаций */
  --glow: #2f5bff;
  --glow-2: #19c3ff;
  --shine: #a9bfff;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

html[data-theme="dark"] {
  --paper: #050913;
  --paper-2: #0c1222d9;
  --card: #0c1426eb;
  --card-solid: #0c1222;
  --bar: #050913b8;
  --well: #ffffff08;
  --well-2: #ffffff0f;
  --track: #ffffff12;
  --line: #ffffff14;
  --frame: #ffffff24;
  --scroll: #26314f;
  --chrome: #6b7690;
  --grain: #ffffff06;

  --ink: #eef2fb;
  --muted: #8d97ab;

  --brand: #5b84ff;
  --fill: #2f5bff;
  --fill-lit: #4a72ff;
  --on-fill: #ffffff;
  --lime: #5b84ff;
  --head: #86a5ff;
  --head-lit: #a8bfff;

  --panel: #0d1838;
  --on-panel: #eef2fb;
  --notice: #04070f;
  --on-notice: #eef2fb;

  --tip: #2f5bff17;
  --tip-line: #2f5bff40;
  --on-tip: #a8bfff;
  --wash: linear-gradient(120deg, #2f5bff26 0%, #2f5bff0d 38%, transparent 72%);

  --alert: #f2555a;
  --gold: #e3b341;
  --phos: #60a5fa;
  --phos-dim: #2b4a7a;

  --rest: 0 0 0 1px #ffffff12, 0 1px 2px #0000004d;
  --lift: 0 18px 40px -18px #000000cc;
  --pop: 0 16px 40px #00000099;

  --sky: #0b1838;
  --aura-1: #2f5bff42;
  --aura-2: #19c3ff21;
  --aura-3: #3a66ff2b;
  --grid: #ffffff10;
  --grid-hi: #7d9bff80;
  --noise-o: .05;
  --glass-hi: #ffffff12;
  --spot: #5b84ff;
  --spot-max: 16%;
}

html[data-theme="dark"] { color-scheme: dark; }

/* ---------- фон страницы, под всем контентом ---------- */
html {
  background-color: var(--paper);
  /* верх страницы чуть светлее и синее, книзу уходит в базовый тон */
  background-image: radial-gradient(120% 70% at 60% 0%, var(--sky), transparent 70%);
  background-attachment: fixed;
}
body.bg-paper { background-color: transparent; }
/* мягкая аврора (Delver), медленно плывёт */
body::before {
  content: "";
  position: fixed; inset: -25%;
  z-index: -2; pointer-events: none;
  /* бокс на 150% вьюпорта: 55%/10% ≈ верх-центр за героем, 90%/45% — правый край, 28%/86% — низ слева */
  background:
    radial-gradient(34% 30% at 55% 10%, var(--aura-1), transparent 70%),
    radial-gradient(30% 34% at 90% 45%, var(--aura-2), transparent 70%),
    radial-gradient(40% 32% at 28% 86%, var(--aura-3), transparent 72%);
  animation: brand-aurora 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes brand-aurora {
  0%   { transform: translate3d(-5%, -3%, 0) scale(1); }
  50%  { transform: translate3d(4%, 4%, 0) scale(1.1); }
  100% { transform: translate3d(-3%, 5%, 0) scale(1.04); }
}
/* вертикальные линии-колонны (Accred) вместо клеток */
html::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: calc(100% / 8) 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
/* по линиям изредка сверху вниз проходит световой импульс */
html::after {
  content: "";
  position: fixed; left: 0; right: 0; top: -45vh; height: 45vh;
  z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-hi) 1px, transparent 1px);
  background-size: calc(100% / 8) 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 75%, transparent);
  animation: brand-scan 12s cubic-bezier(.45, .05, .55, .95) infinite;
}
@keyframes brand-scan { 0% { transform: translateY(0); } 70%, 100% { transform: translateY(150vh); } }
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  opacity: var(--noise-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- стекло: блик сверху у всех карточек, мягче углы ---------- */
.bg-card { background-image: linear-gradient(180deg, var(--glass-hi), transparent 42%); }
.rounded-\[6px\] { border-radius: 10px; }
.rounded-\[7px\], .rounded-\[8px\] { border-radius: 12px; }
/* в тёмной теме у карточек светлая верхняя кромка — «свет сверху» */
html[data-theme="dark"] .bg-card.border { border-top-color: #ffffff21; }
/* сайдбар — матовое стекло */
aside.rail {
  background-color: color-mix(in oklab, var(--card-solid) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
/* на мобилке сайдбар — выезжающее меню поверх текста: почти непрозрачное */
@media (max-width: 1023px) {
  aside.rail { background-color: color-mix(in oklab, var(--card-solid) 94%, transparent); }
}
/* на десктопе сайдбар парит отдельной панелью с отступами (Delver) */
@media (min-width: 1024px) {
  aside.rail {
    margin: 12px 0 12px 12px;
    top: calc(var(--strip-h) + 12px);
    height: calc(100vh - var(--strip-h) - 24px);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 var(--glass-hi), 0 30px 70px -40px #000000b3;
  }
}
/* выпадашки и модалки должны оставаться плотными */
[role="dialog"], [role="menu"], [role="listbox"], .absolute.bg-card, .fixed.bg-card:not(.rail) {
  background-color: var(--card-solid);
}

/* ---------- моноширинный для меток: номера секций «01 / …» (Accred) ---------- */
main { counter-reset: brand-sec; }
main h3.uppercase.text-\[10px\] { font-family: var(--mono); letter-spacing: .1em; }
main h3.uppercase.text-\[10px\]::before {
  counter-increment: brand-sec;
  content: counter(brand-sec, decimal-leading-zero) " / ";
  color: var(--brand);
}
.rail-head { font-family: var(--mono); letter-spacing: .12em; }

/* ---------- герой: вертикальные линии, мягкое свечение, двухстрочный заголовок ---------- */
.bg-panel { isolation: isolate; }
section.bg-panel {
  border-radius: 16px;
  background-image:
    radial-gradient(70% 90% at 75% 40%, transparent 0%, var(--panel) 78%),
    linear-gradient(to right, #ffffff14 1px, transparent 1px);
  background-size: auto, 48px 100%;
  box-shadow: inset 0 1px 0 #ffffff1a, 0 0 0 1px #ffffff0d, 0 30px 70px -40px #000000d9;
}
section.bg-panel::before {
  content: "";
  position: absolute; inset: -40%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 78% 30%, color-mix(in oklab, var(--glow) 50%, transparent) 0%, transparent 70%),
    radial-gradient(30% 40% at 18% 90%, color-mix(in oklab, var(--glow-2) 22%, transparent) 0%, transparent 70%);
  filter: blur(28px);
  opacity: .45;
  animation: brand-drift 16s var(--ease-out) infinite alternate;
}
@keyframes brand-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-4%, 3%, 0) scale(1.06); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.02); }
}

/* заголовок: крупнее, две строки, вторая — в акценте; строки выезжают из-под маски */
section.bg-panel h1 {
  font-size: clamp(1.9rem, 1.15rem + 2.3vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: .6rem;
}
section.bg-panel h1 .brand-l1, section.bg-panel h1 .brand-l2 {
  display: block;
  animation: brand-line .95s var(--ease-out) both;
}
section.bg-panel h1 .brand-l2 { color: var(--shine); animation-delay: .14s; }
@keyframes brand-line {
  from { clip-path: inset(0 -0.1em 100% -0.1em); transform: translateY(.45em); }
  to   { clip-path: inset(-0.25em -0.1em -0.3em -0.1em); transform: none; }
}

/* остальное в герое всплывает лесенкой */
section.bg-panel .z-\[1\] > :not(h1) { animation: brand-rise .75s var(--ease-out) both; }
section.bg-panel .z-\[1\] > :nth-child(3) { animation-delay: .22s; }
section.bg-panel .z-\[1\] > :nth-child(4) { animation-delay: .3s; }
section.bg-panel .z-\[1\] > :nth-child(5) { animation-delay: .38s; }
@keyframes brand-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* метка героя — моно, с мигающим курсором терминала */
section.bg-panel .z-\[1\] > p:first-child { font-family: var(--mono); letter-spacing: .08em; }
section.bg-panel .z-\[1\] > p:first-child::after {
  content: "";
  display: inline-block;
  width: .55em; height: 1.05em; margin-left: .45em;
  vertical-align: -0.2em;
  background: currentColor; opacity: .85;
  animation: brand-caret 1.1s steps(1) infinite;
}
@keyframes brand-caret { 50% { opacity: 0; } }
section.bg-panel dt { font-family: var(--mono); letter-spacing: .06em; }

/* ---------- заголовки «пишутся» слева направо (маска) ---------- */
@property --ink { syntax: "<percentage>"; inherits: false; initial-value: 125%; }
main :where(h1, h2, h3):not(.uppercase) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--ink) - 25%), transparent var(--ink));
  mask-image: linear-gradient(90deg, #000 calc(var(--ink) - 25%), transparent var(--ink));
  animation: brand-ink 1.1s var(--ease-out) both;
}
section.bg-panel h1 { -webkit-mask-image: none; mask-image: none; animation: none; }
main :where(h1):not(.uppercase) { letter-spacing: -0.035em; }
@keyframes brand-ink { from { --ink: 0%; } to { --ink: 125%; } }
/* в доках заголовки дописываются по мере прокрутки */
@supports (animation-timeline: view()) {
  main article :is(h2, h3):not(.uppercase) {
    animation: brand-ink linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
}

/* ---------- текстовые ссылки: подчёркивание вырастает слева ---------- */
main a:not([class*="border"]):not([class*="bg-"]):not([class*="rounded"]):not(.brand-card):not(.brand-live a) {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .35s var(--ease-out), color .18s;
}
main a:not([class*="border"]):not([class*="bg-"]):not([class*="rounded"]):not(.brand-card):not(.brand-live a):hover { background-size: 100% 1px; }

/* ---------- лаунчер: живая лента запусков занимает пустую колонку справа ---------- */
/* до 1024 — просто под сводкой; 1024–1499 — под сводкой в правой колонке; от 1500 — третьей колонкой */
@media (min-width: 1024px) {
  main .flex.max-w-\[940px\]:has(> .brand-live) {
    display: grid;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas: "form sum" "form live";
    align-items: start;
  }
  main .flex.max-w-\[940px\]:has(> .brand-live) > :first-child { grid-area: form; }
  main .flex.max-w-\[940px\]:has(> .brand-live) > :nth-child(2) { grid-area: sum; }
  .brand-live { grid-area: live; position: sticky; top: calc(var(--strip-h) + 76px); }
}
@media (min-width: 1500px) {
  main:has(.brand-live) { max-width: 94rem; }
  main .flex.max-w-\[940px\]:has(> .brand-live) {
    grid-template-columns: minmax(0, 1fr) 300px 300px;
    grid-template-rows: auto;
    grid-template-areas: "form sum live";
  }
}
.brand-live-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 14px;
  background-color: var(--card);
}
html[data-theme="dark"] .brand-live-card { border-top-color: #ffffff21; }
.brand-live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.brand-live-title { margin: 0; color: var(--muted); font-weight: 500; }
.brand-live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand);
}
.brand-live-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
  animation: brand-caret 1.4s steps(1) infinite;
}
.brand-live-list { list-style: none; margin: 0; padding: 0; }
.brand-live-row + .brand-live-row { border-top: 1px solid var(--line); }
.brand-live-row a {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin: 0 -8px; padding: 9px 8px;
  border-radius: 8px;
  color: var(--ink); text-decoration: none;
  transition: background-color .18s var(--ease-out);
}
.brand-live-row a:hover { background-color: var(--well-2); }
.brand-live-ava {
  position: relative;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 999px; overflow: hidden;
  background: color-mix(in oklab, var(--brand) 18%, var(--well-2));
}
.brand-live-ava::before { content: attr(data-l); font: 600 12px/1 var(--mono); color: var(--brand); }
.brand-live-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brand-live-mid { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.brand-live-mid b, .brand-live-right b { font-size: 13px; font-weight: 600; line-height: 1.1; }
.brand-live-mid b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-live-mid small, .brand-live-right small {
  font: 11px/1.15 var(--mono); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-live-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
/* новая монета въезжает сверху и коротко подсвечивается */
.brand-live-row.is-new { animation: brand-live-in .6s var(--ease-out) both; }
.brand-live-row.is-new a { animation: brand-live-flash 1.8s ease-out both; }
@keyframes brand-live-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes brand-live-flash { from { background-color: color-mix(in oklab, var(--brand) 22%, transparent); } to { background-color: transparent; } }
.brand-live-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font: 500 11px/1 var(--mono); letter-spacing: .03em;
  color: var(--muted); text-decoration: none;
}
.brand-live-foot span:last-child { color: var(--brand); transition: transform .2s var(--ease-out); }
.brand-live-foot:hover span:last-child { transform: translateX(3px); }

/* ---------- лого: живая «C» (theme/logo-anim.svg, вставляет motion.js) ----------
   на ховере плитка наклоняется за курсором и подсвечивается, по ней проходит блик,
   три детали буквы расходятся и на выходе пружинисто собираются обратно */
/* свечение — на подложке, а не filter на самом svg: filter + 3D-наклон дают зубчатый растр */
.rail-brand > span:first-child {
  position: relative; width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  box-shadow: 0 6px 18px -6px #2f5bff00;
  transition: box-shadow .45s var(--ease-out);
}
.rail-brand:hover > span:first-child { box-shadow: 0 10px 26px -4px #2f5bffa6; }
.rail-brand > span:first-child > img { width: 30px; height: 30px; border-radius: 7px; }
.rail-brand > span:first-child:has(> .brand-logo) > img { opacity: 0; }
/* svg вдвое больше бокса и ужат scale(.5): при 3D-наклоне и увеличении растр остаётся чётким */
.brand-logo {
  position: absolute; left: -50%; top: -50%;
  width: 200%; height: 200%;
  overflow: visible;
  transform: perspective(440px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(.5);
  transition: transform .7s var(--ease-spring);
}
.rail-brand:hover .brand-logo {
  transform: perspective(440px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(.58);
  transition: transform .22s var(--ease-out);
}
.brand-logo .bl-hot { opacity: 0; transition: opacity .5s var(--ease-out); }
.rail-brand:hover .brand-logo .bl-hot { opacity: 1; }
.brand-logo .bl-shine { transform: translateX(0); }
.rail-brand:hover .brand-logo .bl-shine { transform: translateX(2300px); transition: transform 1.1s var(--ease-out) .05s; }
.brand-logo .bl-cres, .brand-logo .bl-top, .brand-logo .bl-bot {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .75s var(--ease-spring);
}
.rail-brand:hover .brand-logo .bl-cres { transform: translate(-110px, 0) rotate(-10deg); }
.rail-brand:hover .brand-logo .bl-top { transform: translate(90px, -70px) rotate(7deg); }
.rail-brand:hover .brand-logo .bl-bot { transform: translate(90px, 70px) rotate(-7deg); }
.rail-brand:hover .brand-logo .bl-top, .rail-brand:hover .brand-logo .bl-bot { transition-delay: .04s; }
/* название: буквы расходятся и уходят в кобальт (дешифровка — в motion.js) */
.rail-brand .rail-text { transition: letter-spacing .45s var(--ease-out), color .2s; }
.rail-brand:hover .rail-text { letter-spacing: .2em; color: var(--brand); }

/* ---------- меню: иконка чуть подаётся вперёд на ховере ---------- */
.rail-item svg { transition: transform .25s var(--ease-out); }
.rail-item:not([aria-current="page"]):hover svg { transform: translateX(2px) rotate(-6deg); }

/* ---------- кнопки: блик и мягкий подъём (только свои классы: чужие кнопки
   бывают спозиционированы через transform, их трогать нельзя) ---------- */
.gloss, .brand-cta {
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background-color .18s, color .18s, border-color .18s;
}
.gloss:hover, .brand-cta:hover { transform: translateY(-1px); }
.gloss:active, .brand-cta:active { transform: translateY(0) scale(.98); }
.brand-cta {
  background: var(--fill) !important;
  color: var(--on-fill) !important;
  border-color: transparent !important;
  box-shadow: 0 6px 18px -8px color-mix(in oklab, var(--fill) 70%, transparent), inset 0 1px 0 #ffffff33;
  position: relative; overflow: hidden;
}
.brand-cta:hover { background: var(--fill-lit) !important; }
.brand-cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, #ffffff40 50%, transparent 65%);
  transform: translateX(-120%);
  animation: brand-shine 8s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes brand-shine { 0%, 82% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- карточки и панели: подсветка за курсором, подъём без «неонового» свечения ---------- */
@property --spot-o { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.brand-card, .brand-glow {
  background-image:
    radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklab, var(--spot) var(--spot-o), transparent), transparent 65%),
    linear-gradient(180deg, var(--glass-hi), transparent 42%);
  transition: --spot-o .45s var(--ease-out), transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s;
}
.brand-card:hover, .brand-glow:hover { --spot-o: var(--spot-max); }
.brand-card:hover {
  will-change: transform;
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--brand) 40%, transparent);
  box-shadow: var(--lift);
}
.brand-glow:hover { border-color: color-mix(in oklab, var(--brand) 24%, transparent); }

/* ---------- появление при скролле ---------- */
.brand-reveal { opacity: 0; transform: translateY(14px); }
.brand-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

/* ---------- живая точка «New update» ---------- */
.brand-pulse { position: relative; }
.brand-pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 999px;
  border: 1px solid currentColor; opacity: 0;
  animation: brand-ping 2.4s var(--ease-out) infinite;
}
@keyframes brand-ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- графики: прорисовка линии ---------- */
.brand-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.brand-draw.is-in { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease-out); }

/* ---------- плавная смена темы ---------- */
html.brand-theming, html.brand-theming * {
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out), border-color .35s var(--ease-out) !important;
}

/* ---------- выделение и фокус в цвет бренда ---------- */
::selection { background: color-mix(in oklab, var(--brand) 22%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- три зашитых в Tailwind зелёных класса -> токены подсказок ---------- */
.border-\[\#d9f99d\] { border-color: var(--tip-line) !important; }
.bg-\[\#f7fee7\] { background-color: var(--tip) !important; }
.text-\[\#3f6212\] { color: var(--on-tip) !important; }

/* ---------- вход подгруженных карточек (то, что пришло с API, а не из HTML) ---------- */
.brand-pop { animation: brand-pop .5s var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes brand-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- куб в герое: еле заметно парит ---------- */
.brand-float { animation: brand-float 6s ease-in-out infinite; }
@keyframes brand-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- активный пункт меню в цвет бренда ---------- */
.rail-item { transition: background-color .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.rail-item[aria-current="page"] {
  background: linear-gradient(90deg, color-mix(in oklab, var(--brand) 16%, transparent), color-mix(in oklab, var(--brand) 4%, transparent)) !important;
  color: var(--brand) !important;
  box-shadow: inset 2px 0 0 var(--brand);
}
.rail-item[aria-current="page"] svg { color: var(--brand); }

/* ---------- пре-лонч: плашку не закрыть, подсказка вместо кошелька ---------- */
.brand-notice.brand-preview button { display: none; }
.brand-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-solid);
  box-shadow: var(--pop);
  color: var(--muted);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .35s var(--ease-out);
}
.brand-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.brand-toast b { color: var(--ink); font-weight: 600; }
.brand-toast a { color: var(--brand); font: 500 12px/1 var(--mono); text-decoration: none; }
.brand-toast a:hover { text-decoration: underline; }

/* ---------- иконка X в шапке ---------- */
.brand-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 4px;
  color: var(--muted);
  transition: background-color .18s var(--ease-out), color .18s var(--ease-out), transform .18s var(--ease-out);
}
.brand-x:hover { background: var(--well-2); color: var(--ink); }
.brand-x:active { transform: scale(.94); }

/* ---------- мобилка: у оригинала поиск сжимается в 22px и наезжает на «Sort» ---------- */
@media (max-width: 639px) {
  main .flex.shrink-0.items-center.gap-1\.5 > span.text-\[11px\].text-muted { display: none; }
  main .rounded-full.border.border-line.bg-paper-2:has(> input[placeholder="Search"]) { min-width: 36px; justify-content: center; }
  /* в свёрнутом поле от «Search» торчит обрезанная буква — прячем, пока поле не в фокусе */
  main input[placeholder="Search"]:not(:focus)::placeholder { color: transparent; }
}

/* ---------- вордмарк в сайдбаре: CUBICLE капсом с трекингом, как было у OTC ---------- */
.rail-brand span { text-transform: uppercase; }

/* ---------- меньше движения — по просьбе системы ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before, html::after, section.bg-panel::before, .brand-cta::after, .brand-pulse::after { animation: none; }
  html::after { display: none; }
  section.bg-panel h1 .brand-l1, section.bg-panel h1 .brand-l2, section.bg-panel .z-\[1\] > *, section.bg-panel .z-\[1\] > p:first-child::after { animation: none; }
  main :where(h1, h2, h3):not(.uppercase) { animation: none; -webkit-mask-image: none; mask-image: none; }
  .brand-reveal, .brand-reveal.is-in { opacity: 1; transform: none; transition: none; }
  .brand-pop, .brand-float, .brand-live-dot::before, .brand-live-row.is-new, .brand-live-row.is-new a { animation: none; }
  .brand-card:hover, .gloss:hover, .brand-cta:hover, .gloss:active, .brand-cta:active, .brand-x:active, .rail-item:hover svg { transform: none; }
  .brand-logo, .rail-brand:hover .brand-logo { transform: scale(.5); }
  .rail-brand:hover .brand-logo .bl-cres, .rail-brand:hover .brand-logo .bl-top, .rail-brand:hover .brand-logo .bl-bot, .rail-brand:hover .brand-logo .bl-shine { transform: none; }
  .brand-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  html.brand-theming, html.brand-theming * { transition: none !important; }
}

/* ---------- ссылки монеты в лаунчере (theme/links.js): Telegram и Website под полем X ---------- */
.brand-links { display: grid; gap: 12px; margin-top: 12px; }
.brand-links.hidden { display: none; }
.brand-link-field.is-bad input { color: var(--alert, #ff6b6b); }
