/* GeekBot web — тёмный «студийный» design-system. Без сборки, чистый CSS. */

:root {
  color-scheme: dark;          /* нативные тёмные контролы/скроллбары */
  /* поверхности */
  --bg:        #0a0a0c;
  --bg-2:      #0e0e12;
  --surface:   #141419;
  --surface-2: #1b1b22;
  --line:      #26262f;
  --line-2:    #34343f;

  /* текст */
  --text:      #f4f4f6;
  --text-dim:  #a0a0ac;
  --text-mute: #6b6b78;

  /* акценты */
  --acid:      #cdff4a;   /* основной — кислотный лайм */
  --acid-dim:  #9bc92e;
  --violet:    #9b7bff;   /* вторичный для градиентов */
  --cyan:      #4ad6ff;
  --danger:    #ff5a6e;

  --glow:      0 0 0 1px rgba(205,255,74,.25), 0 8px 40px -8px rgba(205,255,74,.25);
  --radius:    16px;
  --radius-sm: 10px;

  --font:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease:  cubic-bezier(.22, 1, .36, 1);
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* фон-свечение вынесено в фикс-слой: не репейнтится при скролле (быстрее, плавнее) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(155,123,255,.10), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(205,255,74,.07), transparent 55%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--acid); color: #000; }

/* ─── типографика ─────────────────────────────────────────── */
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--acid-dim);
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.muted { color: var(--text-dim); }

/* ─── каркас ──────────────────────────────────────────────── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }

nav.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,10,12,.7);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }
.topbar .spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--acid));
  display: grid; place-items: center; font-weight: 700; color: #000; font-size: 14px;
}

/* ─── кнопки ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .15s var(--ease), border-color .2s, background .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-mute); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--acid); color: #08090a; border-color: transparent; font-weight: 700;
}
.btn-primary:hover { box-shadow: var(--glow); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 26px; font-size: 16px; }

/* ─── карточки ────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

/* сетка инструментов */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tool {
  position: relative; display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .2s var(--ease), border-color .2s, background .2s;
  overflow: hidden;
}
.tool::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(400px 200px at 80% -20%, rgba(205,255,74,.12), transparent 70%);
  transition: opacity .3s; pointer-events: none;
}
.tool:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tool:hover::after { opacity: 1; }
.tool.locked { opacity: .62; }
.tool.disabled { pointer-events: none; }
.tool .ico { font-size: 26px; }
.tool .ttl { font-weight: 700; margin-top: 14px; letter-spacing: -.01em; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; margin-top: 12px;
}
.tag.free { color: var(--acid); background: rgba(205,255,74,.10); }
.tag.pro  { color: var(--violet); background: rgba(155,123,255,.12); }

/* ─── upload zone ─────────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  background: var(--bg-2);
  padding: 56px 24px; text-align: center;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--text-mute); }
.dropzone.drag { border-color: var(--acid); background: rgba(205,255,74,.05); transform: scale(1.005); }
.dropzone .big { font-size: 1.15rem; font-weight: 700; }
.dropzone .hint { color: var(--text-mute); font-size: 13px; margin-top: 6px; }
.dz-ico { font-size: 34px; opacity: .85; }

/* волна */
#waveform { margin-top: 22px; border-radius: var(--radius-sm); overflow: hidden; min-height: 96px; }

/* ─── результат BPM/Key ───────────────────────────────────── */
.result {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-align: center; position: relative; overflow: hidden;
}
.stat .label { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); }
.stat .value {
  font-family: var(--mono); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.1; margin-top: 6px;
  font-feature-settings: "tnum" 1;
  background: linear-gradient(135deg, var(--text), var(--acid));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat .unit { font-size: 1rem; color: var(--text-mute); font-weight: 600; margin-left: 4px; -webkit-text-fill-color: var(--text-mute); }

/* ─── состояния ───────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.15); border-top-color: var(--acid);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: rgba(255,90,110,.10); border: 1px solid rgba(255,90,110,.3); color: #ffb3bc;
  font-size: 14px;
}

/* ─── анимации появления ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* ─── login / landing ─────────────────────────────────────── */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card .card { padding: 34px; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface-2); font-weight: 600; margin-top: 12px;
  transition: border-color .2s, transform .15s var(--ease);
}
.provider:hover { border-color: var(--text-mute); transform: translateY(-1px); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-mute); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.hero { text-align: center; padding: 90px 0 40px; }
.hero p.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 560px; margin: 18px auto 0; }
.hero .cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .result { grid-template-columns: 1fr; }
}

/* ── личный кабинет ─────────────────────────────────────────── */
.account-wrap { max-width: 680px; margin: 0 auto; }
.account-wrap .card { margin-top: 16px; }

.banner { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-top: 16px; border: 1px solid var(--line-2); }
.banner.ok  { background: rgba(205,255,74,.08); border-color: var(--acid-dim); color: var(--text); }
.banner.err { background: rgba(255,90,90,.08); border-color: var(--danger); color: var(--text); }

.profile-card { display: flex; align-items: center; gap: 18px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line-2); }
.avatar-lg.letter { display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-weight: 700; font-size: 26px; color: var(--acid); }
.profile-name { font-size: 1.25rem; font-weight: 700; }
.profile-providers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text-dim); font-family: var(--mono); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 1.05rem; }

.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line); min-height: 30px; }
.acct-row:first-of-type { border-top: none; }

.avatar-link { display: inline-flex; }
.avatar-img { object-fit: cover; padding: 0; }

/* ── встроенный YouTube-плеер ────────────────────────────────── */
.yt-embed { margin-top: 20px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; }
.yt-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── история сэмплов ─────────────────────────────────────────── */
.hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.hist-item { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .12s var(--ease); }
.hist-item:hover { border-color: var(--text-mute); transform: translateX(2px); }
.hist-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { flex-shrink: 0; color: var(--text-mute); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   ПОЛИРОВКА: доступность, состояния, инпуты, анимации, перф
   ═══════════════════════════════════════════════════════════════ */

img, svg, video, audio { max-width: 100%; }
html { scroll-behavior: smooth; }

/* ── клавиатурный фокус (видимое кольцо только при навигации с клавы) ── */
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .tool:focus-visible, .provider:focus-visible,
.hist-item:focus-visible, .avatar-link:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* ── тонкий тематический скроллбар ── */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ── поля ввода: единый фокус + плавность (работает и поверх инлайн-стилей) ── */
input, select, textarea { transition: border-color .18s var(--ease), box-shadow .18s var(--ease); outline: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--acid) !important;
  box-shadow: 0 0 0 3px rgba(205,255,74,.16);
}
input::placeholder { color: var(--text-mute); }

/* кастомная стрелка у select (фон-цветом, чтобы не конфликтовать с background-color полей) */
select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b78' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  padding-right: 36px !important; cursor: pointer;
}

/* ── кнопки: пресс, disabled, насыщенный primary ── */
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: saturate(.6); }
.btn-primary { background: linear-gradient(135deg, #d6ff63, var(--acid)); }
.btn-primary:focus-visible { outline-offset: 4px; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; }

/* ── провайдеры/строки: пресс ── */
.provider:active { transform: translateY(0) scale(.99); }
.hist-item:active { transform: translateX(2px) scale(.995); }

/* ── dropzone: отклик и подпрыгивание иконки при drag ── */
.dropzone:active { transform: scale(.996); }
.dropzone.drag .dz-ico { animation: dz-bob .6s var(--ease) infinite alternate; }
@keyframes dz-bob { to { transform: translateY(-6px); } }

/* ── back-link (← Все тулзы) ── */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-mute);
  font-size: 13px; transition: color .2s, transform .2s var(--ease); }
.back-link:hover { color: var(--text-dim); transform: translateX(-3px); }

/* ── audio плеер: вписать в тему ── */
audio { height: 42px; border-radius: 999px; }
audio::-webkit-media-controls-panel { background: var(--surface-2); }

/* ── успех-вариант toast ── */
.toast.ok { background: rgba(205,255,74,.08); border-color: var(--acid-dim); color: var(--acid); }

/* ── микро-анимации появления (только если пользователь не против движения) ── */
@media (prefers-reduced-motion: no-preference) {
  main { animation: pg-fade .4s var(--ease); }
  @keyframes pg-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  /* плавный каскад карточек инструментов */
  .tools .tool { animation: rise .5s var(--ease) backwards; }
  .tools .tool:nth-child(1){animation-delay:.03s}
  .tools .tool:nth-child(2){animation-delay:.07s}
  .tools .tool:nth-child(3){animation-delay:.11s}
  .tools .tool:nth-child(4){animation-delay:.15s}
  .tools .tool:nth-child(5){animation-delay:.19s}
  .tools .tool:nth-child(6){animation-delay:.23s}
  .tools .tool:nth-child(7){animation-delay:.27s}
  .tools .tool:nth-child(8){animation-delay:.31s}
  .tools .tool:nth-child(9){animation-delay:.35s}
  .tools .tool:nth-child(n+10){animation-delay:.39s}
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* живой пульс брендового индикатора */
  .brand .dot { animation: dot-pulse 2.6s ease-in-out infinite; }
  @keyframes dot-pulse {
    0%,100% { box-shadow: 0 0 10px var(--acid); }
    50%     { box-shadow: 0 0 20px var(--acid), 0 0 6px var(--acid); }
  }

  /* история: мягкое появление новых записей */
  .hist-item { animation: hist-in .35s var(--ease) backwards; }
  @keyframes hist-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* ── уважаем prefers-reduced-motion: гасим всё движение ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ── фильтры Find Sample (чипы) ───────────────────────────────── */
.filter-group { margin-top: 18px; }
.filter-group:first-child { margin-top: 0; }
.filter-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 10px; }
.filter-hint { text-transform: none; letter-spacing: 0; color: var(--text-mute); opacity: .8; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text-dim); font-size: 13px; font-weight: 600;
  transition: background .15s var(--ease), color .15s, border-color .15s, transform .12s var(--ease); }
.chip:hover { border-color: var(--text-mute); color: var(--text); }
.chip:active { transform: scale(.95); }
.chip.active { background: var(--acid); color: #08090a; border-color: transparent; }
.kw-input { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); color: var(--text); font-size: 14px; font-family: var(--mono); }
