/* Фаза 1: база — сброс, типографика design.md, кнопки-пилюли, чипы, фокус, reduced motion. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + var(--safe-top) + 8px); }
body {
  margin: 0; min-height: 100dvh; background: var(--paper); color: var(--text);
  font: 400 var(--fs-body)/1.53 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 600; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--pill); color: var(--pill-text); }
.skip:focus { top: calc(12px + var(--safe-top)); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--s5)); margin-inline: auto; padding-inline: max(var(--s5), var(--safe-left)) max(var(--s5), var(--safe-right)); }
.display { font-size: var(--fs-display); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.heading { font-size: var(--fs-heading); line-height: 1.09; font-weight: 600; letter-spacing: -.02em; }
.card-title { font-size: var(--fs-card); line-height: 1.15; font-weight: 600; color: var(--ink); letter-spacing: -.015em; }
.lead { font-size: var(--fs-lead); line-height: 1.42; color: var(--text); }
.body-text { font-size: var(--fs-body); line-height: 1.53; }
.eyebrow { font-size: var(--fs-eyebrow); font-weight: 600; line-height: 1.43; color: var(--blue); margin-bottom: var(--s3); }
.meta { font-size: var(--fs-meta); color: var(--muted); }

/* Пилюли: заливка только Wallet Black (ink) или Oat (design.md: оранжевым и синим не заливаем) */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  font-size: var(--fs-label); font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pill:active { transform: scale(.97); }
.pill--ink { background: var(--pill); color: var(--pill-text); }
.pill--ink:hover { background: var(--pill-hover); }
.pill--oat { background: var(--oat); color: var(--ink); }
.pill--oat:hover { background: var(--oat-hover); }
.pill--lg { min-height: 48px; padding: 0 24px 0 22px; font-size: 16px; }
.pill--block { display: flex; width: 100%; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 12px; color: var(--ink); transition: background-color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--oat); }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 18px; height: 18px; }

/* Иконка темы: в светлой показываем луну (переключить в тёмную), в тёмной — солнце */
.ic--light { display: none; }
[data-theme="dark"] .ic--light { display: block; }
[data-theme="dark"] .ic--dark { display: none; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .ic--light { display: block; }
  [data-theme="auto"] .ic--dark { display: none; }
}

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--oat); color: var(--ink); font-size: var(--fs-label); font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip--coin .ic { color: var(--gold); }

.badge {
  position: absolute; top: 6px; right: 6px; min-width: 9px; height: 9px; padding: 0 4px; border-radius: 9px;
  background: var(--orange); box-shadow: 0 0 0 2px var(--paper); font-size: 10px; line-height: 9px; color: #fff; font-weight: 700;
}
.badge:not(:empty) { height: 16px; line-height: 16px; min-width: 16px; top: 2px; right: 2px; text-align: center; }

.bar { height: 8px; border-radius: 8px; background: var(--oat); overflow: hidden; }
.bar__fill { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--mint); transition: width var(--t-med) var(--ease); }

.loader { display: grid; place-items: center; min-height: 40vh; }
.loader__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--butter); animation: pulse 1s var(--ease) infinite alternate; }
@keyframes pulse { from { transform: scale(.7); opacity: .5; } to { transform: scale(1.15); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Фаза 24: утки-маскоты на экранах загрузки, «нет доступа» и техработ */
.loader__duck { width: 112px; height: 112px; animation: duck-bob 1.4s ease-in-out infinite alternate; }
.duck-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 24px; }
.duck-state__img { width: 160px; height: 160px; object-fit: contain; animation: duck-bob 2s ease-in-out infinite alternate; }
@keyframes duck-bob { to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .loader__duck, .duck-state__img { animation: none; } }
