/* Музыкант — сброс, типографика и базовые элементы. Экраны — в app.css. */

/* ---------- сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1;
}

::selection { background: var(--gold-dim); color: var(--ink); }

/* ---------- типографика ---------- */
.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.04;
  text-wrap: balance;
}

/* слово-марка «Музыкант» */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.display { font-size: clamp(44px, 7.2vw, 104px); line-height: 0.98; letter-spacing: -0.015em; }
h1, .h1 { font-size: clamp(38px, 5.2vw, 72px); }
h2, .h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; }
h3, .h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.15; }

/* курсив антиквы — для акцентов внутри заголовков и названий нот */
.italic, em.display-em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}

.lead {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 36em;
  text-wrap: pretty;
}

p { text-wrap: pretty; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.5; }

/* ярлык-подпись (SPEC 6.2) */
.label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label--ink2 { color: var(--ink-2); }
.label--gold { color: var(--gold); }

/* цифры в таблицах, счётчиках и клавишах */
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- ссылки ---------- */
a { color: inherit; }

.link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 calc(100% - 1px);
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: color var(--t-fast) var(--ease), background-size var(--t) var(--ease);
}
.link:hover { color: var(--gold-bright); }
.link--quiet { color: var(--ink-2); background-image: linear-gradient(var(--line-strong), var(--line-strong)); }
.link--quiet:hover { color: var(--ink); }

/* ---------- кнопки ---------- */
.btn {
  --btn-h: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .4; pointer-events: none; }

/* главная: слоновая кость на тёплом чёрном */
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--gold-bright); }

/* второстепенная: тонкий контур */
.btn--secondary { border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover { border-color: var(--ink-2); background: rgba(243, 238, 230, .04); }

/* тихая: только текст, для «Пропустить», «Сначала» */
.btn--quiet { padding: 0 14px; color: var(--ink-2); font-weight: 500; }
.btn--quiet:hover { color: var(--ink); }

.btn--small { --btn-h: 40px; padding: 0 18px; font-size: 14px; }

/* круглая кнопка-иконка (назад, настройки) */
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-icon:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- чип фильтра ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed='true'], .chip[aria-selected='true'], .chip.is-active {
  border-color: var(--gold-dim);
  background: rgba(201, 166, 107, .08);
  color: var(--gold-bright);
}

/* ---------- клавиша (подсказка «1»–«8», Esc, Пробел) ---------- */
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- тонкая линия прогресса ---------- */
.progress {
  --value: 0;               /* 0…1, задаётся из JS: el.style.setProperty('--value', p) */
  position: relative;
  height: 1px;
  width: 100%;
  background: var(--line);
  overflow: visible;
}
.progress::before {
  content: '';
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--value));
  background: var(--gold);
  transition: transform var(--t) var(--ease);
}
/* бегущая точка на конце — показывает, что процесс жив */
.progress--live::after {
  content: '';
  position: absolute;
  top: -1.5px;
  left: calc(var(--value) * 100%);
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--gold-bright);
  transition: left var(--t) var(--ease);
}
/* неопределённый процесс */
.progress--indeterminate::before {
  transform: none;
  width: 24%;
  animation: progress-slide 1.6s var(--ease) infinite;
}
@keyframes progress-slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(420%); }
}

/* ---------- разделитель ---------- */
.rule { height: 1px; border: 0; background: var(--line); margin: 0; }

/* ---------- фокус с клавиатуры ---------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-s);
}
.btn:focus-visible, .chip:focus-visible, .btn-icon:focus-visible { border-radius: 999px; }
.link:focus-visible { box-shadow: none; outline: 1.5px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

/* скрыто визуально, доступно читалке */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- глиф руки (стили для SVG из js/ui/glyph.js) ---------- */
.hand-glyph { display: block; overflow: visible; flex: none; max-width: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
