/* TraderLab landing: мобільна версія базова, далі розширення. Палітра і геометрія як у порталі:
   квадратні кути 6–8 px, без pill-кнопок, без inline-стилів (CSP style-src 'self'). */

:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --surface: #0e131b;
  --panel: #111821;
  --raised: #171f2b;
  --hover: #1d2736;
  --line: #1c2633;
  --line-strong: #2a3649;
  --text: #e6ebf2;
  --muted: #8794a8;
  --faint: #6b7a90;
  --accent: #3ddc97;
  --accent-ink: #04170e;
  --accent-soft: #123128;
  --blue: #6ea8ff;
  --warn: #f0b429;
  --warn-soft: #2e2611;
  --danger: #ff6170;
  --r: 6px;
  --r-lg: 8px;
  --max: 1120px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 10; padding: 10px 14px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--raised); color: var(--text); font-weight: 600; font-size: 15px;
  text-align: center; cursor: pointer; transition: background .2s, border-color .2s;
}
.btn:hover { background: var(--hover); border-color: #3a4a62; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #6ee9b8; border-color: #6ee9b8; }
.btn { position: relative; overflow: hidden; }
.btn.primary { box-shadow: 0 0 0 0 rgba(61, 220, 151, .45); animation: ring 2.8s ease-out infinite; }
.btn.primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn.primary:hover::after { left: 120%; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 16px; }

/* ---------- шапка ---------- */

.site-head { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: rgba(10, 13, 18, .92); backdrop-filter: blur(8px); }
.head-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand span { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.head-nav { display: none; gap: 22px; margin-left: auto; }
.head-nav a { color: var(--muted); font-size: 14px; }
.head-nav a:hover { color: var(--text); text-decoration: none; }
.head-cta { display: flex; gap: 8px; margin-left: auto; }
.head-cta .btn { min-height: 38px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
@media (max-width: 599px) {
  .brand span { display: none; }
  .head-cta .btn.ghost { padding: 0 8px; }
}

/* ---------- герой ---------- */

.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 80%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 60% at 30% 40%, rgba(61, 220, 151, .18), transparent 70%),
              radial-gradient(40% 50% at 80% 30%, rgba(240, 180, 41, .14), transparent 70%);
  animation: glow 9s ease-in-out infinite alternate;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: 40px; padding: 40px 0 56px; }
.sparks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); z-index: 0; pointer-events: none; opacity: .5; }
.orb-a { width: 320px; height: 320px; left: -120px; top: 60px; background: rgba(61, 220, 151, .25); animation: drift 14s ease-in-out infinite alternate; }
.orb-b { width: 260px; height: 260px; right: -80px; bottom: 40px; background: rgba(240, 180, 41, .18); animation: drift 18s ease-in-out infinite alternate-reverse; }

/* Плаваючі монети навколо героя */
.float { position: absolute; z-index: 1; pointer-events: none; animation: bob 6s ease-in-out infinite; }
.float .tk { width: 46px; height: 46px; font-size: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border: 1px solid var(--line-strong); }
.f1 { right: 6%; top: 8%; animation-delay: -1s; }
.f2 { left: 4%; bottom: 14%; animation-delay: -3s; }
.f3 { right: 18%; bottom: 6%; animation-delay: -4.5s; }
.float .tk.c-ETH { background: #1c2a45; color: #8fb0ff; }
.float .tk.c-USDT { background: #123128; color: var(--accent); }

/* Градієнтний акцент у заголовку */
.grad {
  background: linear-gradient(90deg, #3ddc97, #ffd166, #ff8a5b, #3ddc97);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 6s linear infinite;
}

/* Бігучий рядок */
.ticker { position: relative; overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); }
.ticker-track { display: flex; gap: 40px; width: max-content; padding: 14px 0; animation: ticker 38s linear infinite; }
.ticker-track span { display: inline-flex; align-items: center; gap: 40px; white-space: nowrap; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.ticker-track span::after { content: '◆'; color: var(--accent); font-size: 10px; }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* Поява блоків при прокрутці */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Малювання графіка */
.mock-chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s .4s cubic-bezier(.4, 0, .2, 1) forwards; }
.mock { transform: perspective(900px) rotateX(calc(var(--py, 0) * -4deg)) rotateY(calc(var(--px, 0) * 6deg)); transition: transform .3s ease; will-change: transform; }
.mock-chg { animation: pulse 2.4s ease-in-out infinite; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { margin-bottom: 18px; }
.lead { color: var(--muted); font-size: 17px; max-width: 560px; }
.hero-actions { display: grid; gap: 10px; margin-top: 28px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.trust li::before { content: '✓'; margin-right: 6px; color: var(--accent); font-weight: 700; }

.hero-visual { display: grid; gap: 10px; }
.mock { padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--panel); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.mock-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mock-head strong { display: block; font-size: 15px; }
.mock-head small { display: block; color: var(--faint); font-size: 12px; }
.mock-chg { margin-left: auto; padding: 3px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.mock-chart { display: block; width: 100%; height: auto; border-radius: var(--r); background: #0b1017; }
.mock-chart .grid-line { fill: none; stroke: #1a2330; stroke-width: 1; }
.mock-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.mock-order { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.mock-row { display: flex; justify-content: space-between; }
.mock-row span { color: var(--muted); }
.hero-visual figcaption { color: var(--faint); font-size: 12px; text-align: center; }

.tk { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); background: var(--raised); color: var(--muted); font-size: 15px; font-weight: 700; }
.tk.c-BTC { background: #3b2a14; color: #f7a23b; }

/* ---------- цифри ---------- */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line); overflow: hidden; }
.stats > div { display: grid; gap: 2px; padding: 20px; background: var(--panel); }
.stats strong { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: 14px; }

/* ---------- секції ---------- */

.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section h2 { margin-bottom: 12px; }
.section-lead { color: var(--muted); max-width: 640px; margin-bottom: 28px; }

.steps { display: grid; gap: 14px; margin-top: 28px; counter-reset: none; }
.steps li { position: relative; padding: 22px 22px 22px 72px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: 15px; }
.step-no { position: absolute; left: 22px; top: 22px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.cards { display: grid; gap: 14px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(61, 220, 151, .5); box-shadow: 0 16px 40px rgba(61, 220, 151, .08); }
.card:hover .icon { transform: scale(1.12) rotate(-4deg); }
.icon { transition: transform .3s ease; }
.steps li { transition: border-color .3s ease, transform .3s ease; }
.steps li:hover { border-color: rgba(240, 180, 41, .45); transform: translateY(-3px); }
.stats strong { background: linear-gradient(90deg, var(--text), #fff, var(--text)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.faq summary { transition: color .2s ease; }
.faq details[open] { border-color: rgba(61, 220, 151, .35); }
.closing { position: relative; overflow: hidden; }
.closing::before { content: ''; position: absolute; inset: -40% -20%; background: conic-gradient(from 0deg, transparent, rgba(61, 220, 151, .12), transparent 30%); animation: spin 14s linear infinite; pointer-events: none; }
.closing > * { position: relative; }
.card h3 { margin: 14px 0 6px; }
.card p { color: var(--muted); font-size: 15px; }
.icon { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.split-cols { display: grid; gap: 14px; margin-top: 24px; }
.col { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.col h3 { margin-bottom: 14px; }
.checks li, .crosses li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; }
.checks li:last-child, .crosses li:last-child { border-bottom: 0; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.crosses li::before { content: '—'; position: absolute; left: 0; color: var(--faint); font-weight: 700; }
.crosses li { color: var(--muted); }

.faq { display: grid; gap: 10px; margin-top: 24px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.faq summary { min-height: 52px; display: flex; align-items: center; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; margin-left: auto; padding-left: 12px; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary:hover { color: var(--accent); }
.faq details p { padding: 0 18px 18px; color: var(--muted); font-size: 15px; }

.closing { margin: 24px auto 56px; padding: 40px 24px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--panel), var(--surface)); text-align: center; }
.closing h2 { margin-bottom: 10px; }
.closing p { color: var(--muted); margin-bottom: 22px; }

/* ---------- футер ---------- */

.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 40px; }
.brand-sm { font-weight: 700; margin-bottom: 12px; }
.legal { color: var(--faint); font-size: 13px; line-height: 1.6; max-width: 880px; margin-bottom: 10px; }

/* ---------- широкі екрани ---------- */

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-actions { grid-auto-flow: column; justify-content: start; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 40px; }
}

@media (min-width: 900px) {
  .head-nav { display: flex; }
  .hero h1 { font-size: 46px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { padding: 72px 22px 22px; }
  .step-no { top: 22px; left: 22px; }
  .section h2 { font-size: 30px; }
}

/* ---------- нові блоки ---------- */

.kicker { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.fine { color: var(--faint); font-size: 13px; margin-top: 14px; }
.step-note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); color: var(--faint) !important; font-size: 13px !important; }
.mock-tabs { display: flex; gap: 6px; margin-top: 12px; }
.mock-tabs span { padding: 3px 8px; border-radius: 4px; background: var(--raised); color: var(--muted); font-size: 12px; }
.mock-tabs span.on { background: var(--accent-soft); color: var(--accent); }
.head-nav a { white-space: nowrap; }

/* Пари */
.pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pair-grid li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); transition: border-color .25s ease, transform .25s ease; }
.pair-grid li:hover { border-color: rgba(61, 220, 151, .5); transform: translateY(-2px); }
.pair-grid b { font-size: 15px; }
.pair-grid span { color: var(--muted); font-size: 13px; text-align: right; }
.pair-grid + .fine { margin-top: 16px; }

/* Комісії */
.fee-grid { display: grid; gap: 12px; margin-top: 24px; }
.fee-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.fee-big { display: block; color: var(--accent); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.fee-card h3 { margin: 6px 0 6px; }
.fee-card p { color: var(--muted); font-size: 15px; }
.example { margin-top: 16px; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.example h3 { margin-bottom: 14px; }
.calc { display: grid; }
.calc li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.calc li span { color: var(--muted); }
.calc li.sum { border-bottom: 0; padding-top: 14px; font-size: 17px; }
.calc li.sum b { color: var(--accent); }

/* Безпека */
.sec-grid { display: grid; gap: 12px; margin-top: 24px; }
.sec { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.sec h3 { margin-bottom: 6px; }
.sec p { color: var(--muted); font-size: 15px; }

/* Для кого */
.who-grid { display: grid; gap: 12px; margin-top: 24px; }
.who { padding: 22px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-lg) var(--r-lg) 0; background: var(--panel); }
.who h3 { margin-bottom: 6px; }
.who p { color: var(--muted); font-size: 15px; }

/* Словник */
.glossary { display: grid; gap: 1px; margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line); overflow: hidden; }
.glossary > div { display: grid; gap: 4px; padding: 16px 18px; background: var(--panel); }
.glossary dt { font-weight: 600; color: var(--text); }
.glossary dd { margin: 0; color: var(--muted); font-size: 15px; }

/* Підвал */
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px; }
.foot-nav a { color: var(--muted); font-size: 14px; }
.foot-nav a:hover { color: var(--text); }

@media (min-width: 640px) {
  .pair-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fee-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .pair-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .who-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- ключові кадри ---------- */

@keyframes glow { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }
@keyframes drift { to { transform: translate3d(60px, -40px, 0); } }
@keyframes bob { 50% { transform: translate3d(0, -14px, 0); } }
@keyframes gradShift { to { background-position: 250% 0; } }
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); } 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .4); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(61, 220, 151, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- широкі екрани для героя ---------- */

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; padding: 72px 0 88px; }
  .f1 { right: 4%; top: 14%; }
  .f2 { left: 2%; bottom: 10%; }
  .f3 { right: 10%; bottom: 8%; }
}
@media (max-width: 899px) {
  .f2 { display: none; }
}
@media (max-width: 599px) {
  .f3 { display: none; }
  .float .tk { width: 38px; height: 38px; font-size: 17px; }
}

/* ---------- зменшена анімація ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .mock-chart .line { stroke-dashoffset: 0; }
  .sparks { display: none; }
  .grad { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
}
