/* BuyTokens · витрина — палитра и фон взяты с /check (плоская тёмно-серая тема + синий акцент).
   Скролл-механика: reveal через clip-path, параллакс, рейл прогресса, лента. */

:root {
  --bg: #1B1B1C;
  --panel: #232325;
  --panel-2: #2a2a2d;
  --line: #333336;
  --line-2: #414145;
  --txt: #dcdce0;
  --dim: #9a9aa1;
  --dim-2: #6e6e75;
  --acc: #4c8dff;
  --acc-h: #6ba0ff;
  --ok: #3fb979;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .21, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(76, 141, 255, .28); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- фон: полосатые круги как на /check ---------- */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 7px, rgba(255, 255, 255, 0) 7px 15px);
  border: 1px solid rgba(255, 255, 255, .05);
}
.o1 { width: 460px; height: 460px; top: -160px; left: -120px; animation: orb-a 52s ease-in-out infinite alternate; }
.o2 { width: 320px; height: 320px; bottom: -100px; right: 6%; animation: orb-b 41s ease-in-out infinite alternate; }
.o3 { width: 190px; height: 190px; top: 36%; right: -70px; animation: orb-a 33s ease-in-out infinite alternate-reverse; }
.o4 { width: 120px; height: 120px; top: 62%; left: 4%; animation: orb-b 27s ease-in-out infinite alternate-reverse; }
@keyframes orb-a { to { transform: translate(80px, 60px) rotate(45deg); } }
@keyframes orb-b { to { transform: translate(-70px, -50px) rotate(-40deg); } }

main, .top, .rail, .foot { position: relative; z-index: 1; }

/* ---------- верхняя плашка прогресса ---------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: 100%; height: 2px;
  background: var(--acc);
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform;
}

/* ---------- шапка ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(rgba(27, 27, 28, .92), rgba(27, 27, 28, 0));
  pointer-events: none;
  transition: transform .38s var(--ease), opacity .38s ease;
}
.top.hide { transform: translateY(-118%); opacity: 0; }
.top > * { pointer-events: auto; }
.logo { font-weight: 700; letter-spacing: .01em; font-size: 16px; display: flex; align-items: center; gap: 9px; color: var(--txt); }
.logo .dim { color: var(--dim-2); font-weight: 500; }
.logo-mark {
  width: 12px; height: 12px; display: inline-block; background: var(--acc);
  clip-path: polygon(0 50%, 25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%);
}
.pill {
  display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; background: var(--panel);
  transition: border-color .15s, color .15s;
}
.pill:hover { border-color: var(--line-2); color: var(--txt); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- герой ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 8vw;
}
.hero .kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--dim-2);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(36px, 6.4vw, 84px);
  line-height: 1.04; font-weight: 700; letter-spacing: -.02em;
  max-width: 11em; color: var(--txt);
}
.hero h1 .grad { color: #f0f1f3; }
.hero .sub {
  margin-top: 20px; color: var(--dim); font-size: clamp(14px, 1.4vw, 17px);
}
.cue {
  position: absolute; left: 8vw; bottom: 40px;
  display: flex; align-items: center; gap: 12px;
  color: var(--dim-2); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
}
.cue .bar { width: 1px; height: 56px; background: linear-gradient(var(--line-2), transparent); }

/* ---------- панель работы ---------- */
.panel {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(28px, 5vw, 84px);
  align-items: center;
  padding: clamp(72px, 10vh, 140px) 8vw;
  border-top: 1px solid var(--line);
}
.panel.rev { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.panel.rev .frame-wrap { order: 2; }
.panel.rev .meta { order: 1; }

.ghost {
  position: absolute; z-index: 0;
  top: clamp(28px, 6vh, 72px);
  font: 700 clamp(120px, 19vw, 300px)/1 var(--mono);
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(154, 154, 161, .20);
  user-select: none; pointer-events: none;
  will-change: transform;
}
.panel:not(.rev) .ghost { right: 7vw; }
.panel.rev .ghost { left: 4vw; }

.frame-wrap { position: relative; z-index: 1; }
.frame {
  position: relative; display: block; overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: clip-path 1.05s var(--ease), border-color .2s;
}
.frame:hover { border-color: var(--line-2); }
.panel.live .frame { clip-path: inset(0 0 0 0); }
.js .frame { clip-path: inset(12% 9% 12% 9%); }
.par { position: relative; will-change: transform; }
.frame img {
  width: 100%; height: auto; display: block;
  transition: transform 1.35s var(--ease);
}
.js .frame img { transform: scale(1.14); }
.panel.live .frame img { transform: scale(1); }

.meta { position: relative; z-index: 1; }
.meta .idx {
  font: 600 12px/1.4 var(--mono); letter-spacing: .12em;
  color: var(--dim-2); margin-bottom: 14px;
}
.meta .idx b { color: var(--acc); }
.meta h2 {
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.1; font-weight: 700; letter-spacing: -.015em;
  margin-bottom: 16px; color: var(--txt);
}
.meta .note { color: var(--dim); font-size: clamp(14px, 1.3vw, 16px); max-width: 44ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags span {
  font-size: 11.5px; letter-spacing: .03em;
  color: var(--dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 9px;
}
.meta > * { transition: opacity .7s ease-out, transform .7s var(--ease); }
.js .meta > * { opacity: 0; transform: translateY(26px); }
.meta .idx { transition-delay: .05s; }
.meta h2 { transition-delay: .13s; }
.meta .note { transition-delay: .21s; }
.meta .tags { transition-delay: .29s; }
.panel.live .meta > * { opacity: 1; transform: none; }

/* ---------- лента (автомат) ---------- */
.panel.wide { display: block; padding: clamp(76px, 11vh, 130px) 8vw clamp(48px, 7vh, 92px); }
.panel.wide .meta { max-width: 640px; margin-bottom: clamp(24px, 4vh, 40px); }
.strip {
  position: relative; z-index: 1;
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5vw, #000 calc(100% - 1.5vw), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 1.5vw, #000 calc(100% - 1.5vw), transparent);
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 min(66vw, 480px); scroll-snap-align: center; }
.shot .ph {
  position: relative; display: block; overflow: hidden;
  border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line);
  transition: opacity .8s ease-out, transform .8s var(--ease), border-color .2s;
}
.shot:hover .ph { border-color: var(--line-2); }
.js .shot .ph { opacity: 0; transform: translateY(34px); }
.panel.live .shot .ph { opacity: 1; transform: none; }
.panel.live .shot:nth-child(2) .ph { transition-delay: .1s; }
.panel.live .shot:nth-child(3) .ph { transition-delay: .2s; }
.panel.live .shot:nth-child(4) .ph { transition-delay: .3s; }
.shot img { width: 100%; height: auto; }
.shot .cap { margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.strip-nav { display: flex; gap: 8px; margin-top: clamp(12px, 2vh, 18px); }
.strip-nav button {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--txt); font-size: 16px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.strip-nav button:hover { border-color: var(--line-2); background: #232930; }

/* ---------- кейс с кодом ---------- */
.panel.split .code {
  position: relative; z-index: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  font: 13px/1.7 var(--mono);
  color: #c6c6cb;
  transition: opacity .8s ease-out .15s, transform .8s var(--ease) .15s, border-color .2s;
}
.panel.split .code:hover { border-color: var(--line-2); }
.js .panel.split .code { opacity: 0; transform: translateY(30px); }
.panel.live.split .code { opacity: 1; transform: none; }
.code .ch {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--dim-2);
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.code .ch .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.code pre { white-space: pre-wrap; }
.code .hl { color: var(--acc-h); }
.code .m { color: var(--dim-2); }

/* ---------- призыв ---------- */
.cta {
  min-height: 64vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 18px;
  padding: 90px 8vw;
  border-top: 1px solid var(--line);
}
.cta h2 { font-size: clamp(26px, 3.4vw, 42px); font-weight: 700; letter-spacing: -.015em; }
.cta p { color: var(--dim); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--acc); border: 1px solid var(--acc); color: #fff;
  border-radius: 8px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn svg { width: 16px; height: 16px; }

.foot {
  padding: 22px 8vw 34px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--dim-2); font-size: 12.5px;
}

/* ---------- рейл навигации ---------- */
.rail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 70; display: none;
  flex-direction: column; gap: 14px;
}
@media (min-width: 1100px) { .rail { display: flex; } }
.rail button {
  position: relative;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; width: 100%;
  background: none; border: 0; cursor: pointer;
  color: var(--dim-2); font: 600 11px/1 var(--mono); letter-spacing: .1em;
  padding: 2px 0;
}
.rail button .tick { width: 18px; height: 1.5px; background: var(--line-2); transition: width .3s var(--ease), background .3s ease; }
.rail button .lbl { opacity: 0; transform: translateX(6px); transition: opacity .25s ease, transform .25s ease; white-space: nowrap; }
.rail button:hover .lbl { opacity: 1; transform: none; }
.rail button.on .tick { width: 34px; background: var(--acc); }
.rail button.on { color: var(--txt); }
.rail button.on .lbl { opacity: 1; transform: none; }

/* ---------- лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 21, .95);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; border: 1px solid var(--line); }
.lightbox .lb-x {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.lightbox .lb-x:hover { border-color: var(--line-2); }

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .panel, .panel.rev { display: block; padding-top: 64px; padding-bottom: 64px; }
  .panel.rev .frame-wrap { order: 0; }
  .panel.rev .meta { order: 0; }
  .meta { margin-top: 26px; }
  .ghost { font-size: 90px; }
  .hero { padding: 0 6vw; }
  .cue { left: 6vw; }
  .panel, .panel.wide, .panel.split { padding-left: 6vw; padding-right: 6vw; }
  .shot { flex-basis: 84vw; }
  .top { padding: 12px 16px; }
}

/* ---------- доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .frame, .frame { clip-path: none; }
  .js .frame img, .frame img { transform: none; }
  .js .meta > *, .meta > * { opacity: 1; transform: none; }
  .js .shot .ph, .shot .ph, .js .panel.split .code, .panel.split .code { opacity: 1; transform: none; }
}
