/* ===================================================================
   Finratio · Фирменный слой (подключается ПОСЛЕДНИМ на каждой странице)

   Фирменные цвета: тёплая бумага, лесной зелёный, золото из логотипа,
   почти чёрный текст. Гарнитура Geologica, табличные цифры.

   Почему отдельный файл, а не правка старых стилей: шапку и цвета
   исторически задавали пять разных файлов (style.css, module*.css,
   стили внутри страниц). Этот слой идёт последним и задаёт их
   окончательно; селекторы с `html body` перебивают старые правила
   без !important.
   =================================================================== */

/* ---------- Токены ---------- */
:root {
  --paper:    #f4f1ea;          /* фон страниц */
  --card:     #ffffff;          /* карточки на бумаге */
  --cream:    #ece8de;          /* подложки */
  --line:     #e0dacb;          /* разделители */
  --ink:      #0c0c10;
  --ink-2:    #34343a;          /* второстепенный текст */
  --ink-3:    #65625b;          /* подписи (≈5:1 на бумаге) */

  --gold:       #c8a84b;        /* фирменное золото: заливки, кнопки */
  --gold-ink:   #7a5a10;        /* золото для текста на светлом */
  --gold-light: #f3e7c4;        /* мягкая золотая подложка */
  --gold-lt:    #e8d080;        /* золото на тёмном */
  --gold-dim:   rgba(200,168,75,.14);
  --accent:     #e8c547;

  --forest:    #19392a;         /* фирменный зелёный */
  --forest-md: #1f4a35;
  --forest-dk: #0f2419;
  --sage:      #4a7c59;
  --mint:      #e1ece4;         /* светлая зелёная подложка */
  --rust:      #b84a2e;
  --mist:      #a9bdb0;         /* светлый текст на зелёном */
  --muted:     #c9c5bc;

  --font-display: 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ui:      var(--font-display);
  --font-text:    var(--font-display);
  --font-label:   var(--font-display);
  --font-code:    'JetBrains Mono', ui-monospace, Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --z-header: 200; --z-menu: 210; --z-toast: 400;
  --header-h: 64px;
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
}

/* ---------- База ---------- */
html body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}
html body :is(h1, h2, h3) { text-wrap: balance; letter-spacing: -0.02em; }
html body p { text-wrap: pretty; }
.num, .tabular, [data-price], [data-price-old] { font-variant-numeric: tabular-nums lining-nums; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Шапка: сплошная полоса во всю ширину, без «чёлки» ---------- */
html body > header {
  position: fixed; inset: 0 0 auto 0;
  transform: none;               /* старые стили центрировали «чёлку» сдвигом на −50% */
  top: 0; left: 0; right: 0;
  width: auto; max-width: none;
  height: var(--header-h);
  margin: 0;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: rgba(244,241,234,.88);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  z-index: var(--z-header);
  transition: box-shadow 200ms var(--ease-out);
}
html body > header.scrolled {
  transform: none;
  top: 0; width: auto; padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: rgba(244,241,234,.95);
  box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(18,19,22,.06);
  border-radius: 0;
}
html body > header .logo {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 750; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; line-height: 1;
}
html body > header .logo span { color: var(--gold); }
html body > header nav { display: flex; align-items: center; gap: 4px; }
html body > header nav a {
  font-family: var(--font-ui);
  font-size: .94rem; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  color: var(--ink-2); opacity: 1;
  padding: 8px 12px; border-radius: 8px;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
html body > header nav a:hover { color: var(--ink); background: rgba(12,12,16,.05); }
html body > header nav a.active { color: var(--ink); font-weight: 600; }
html body > header nav a.nav-auth,
html body > header nav a.nav-back {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 8px; margin-left: 8px;
}
html body > header nav a.nav-auth:hover,
html body > header nav a.nav-back:hover { border-color: var(--ink-3); background: var(--paper); color: var(--ink); }
html body > header nav a.nav-auth.logged-in { background: var(--gold-light); border-color: transparent; color: var(--gold-ink); }
html body > header nav a.nav-cta {
  /* !important: страницы словаря, оферты и шаблонов красили кнопку в золото своим !important */
  background: var(--ink) !important; color: #fff !important; border-radius: 8px !important;
  padding: 9px 16px; margin-left: 6px; font-weight: 600;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
html body > header nav a.nav-cta:hover { background: #2a2c31 !important; color: #fff !important; }
html body > header nav a:active { transform: scale(0.97); }
html body > header .menu-btn { display: none; }
html body > header .menu-btn span { background: var(--ink); }

/* ---------- Шапка внутренних страниц (словарь, оферта, политика) ---------- */
html body .page-hero {
  margin-top: 0 !important;
  padding: calc(var(--header-h) + clamp(40px, 6vw, 72px)) max(24px, calc((100vw - 1240px) / 2)) clamp(28px, 4vw, 48px);
  background: var(--paper); color: var(--ink); text-align: left;
  border-bottom: 1px solid var(--line);
}
html body .page-hero::before, html body .page-hero::after { display: none; }
html body .page-hero-inner { max-width: 820px; margin: 0; }
html body .page-hero h1 { color: var(--ink); font-size: clamp(2.1rem, 3.8vw, 3.3rem); letter-spacing: -0.035em; line-height: 1.06; }
html body .page-hero p { color: var(--ink-2); margin: 0; max-width: 62ch; }
html body .slabel {
  justify-content: flex-start; color: var(--ink-3) !important;
  font-family: var(--font-ui); font-size: .9rem; font-weight: 500; text-transform: none; letter-spacing: 0;
}
html body .slabel::after { display: none; }
/* бегущая строка терминов под шапкой словаря — декоративная, убрана */
html body .gloss-featured { display: none; }

/* старые декоративные полосы над контентом больше не нужны */
html body > .ticker-wrap { display: none; }
#progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--gold); z-index: calc(var(--z-header) + 1); }

@media (max-width: 900px) {
  html body > header { padding: 0 16px; }
  html body > header .menu-btn {
    display: block; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer;
  }
  html body > header .menu-btn span { display: block; width: 22px; height: 2px; margin: 5px 0; }
  html body > header nav {
    display: none;
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 20px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(18,19,22,.08);
    z-index: var(--z-menu);
  }
  html body > header nav.open { display: flex; }
  html body > header nav a { padding: 12px; min-height: 44px; display: flex; align-items: center; color: var(--ink); font-size: 1rem; }
  html body > header nav a.nav-auth, html body > header nav a.nav-cta, html body > header nav a.nav-back { margin: 6px 0 0; justify-content: center; }
}

/* ---------- Кнопки ---------- */
.btn, .btn-primary, .btn-secondary, .btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font-family: var(--font-ui); font-size: 1rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--accent); }
.btn-primary:hover { background: #2a2c31; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-gold:active { transform: scale(0.97); }

/* ---------- Цена со скидкой ---------- */
.fr-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; font-family: var(--font-display); }
.fr-price-now { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.fr-price-old { font-size: 1.05rem; font-weight: 450; color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.fr-price-off {
  font-size: .85rem; font-weight: 650; color: #fff; background: var(--rust);
  padding: 3px 7px; border-radius: 6px; line-height: 1.2; align-self: center;
}
.fr-price-note { flex-basis: 100%; font-size: .85rem; color: var(--ink-3); font-weight: 450; }
.fr-price.is-large .fr-price-now { font-size: 2.4rem; }

/* ---------- Подвал ---------- */
html body > footer { background: var(--forest-dk); color: #e9eaec; padding: 56px max(24px, calc((100vw - 1240px) / 2)) 32px; }
html body > footer .footer-logo { font-family: var(--font-display); font-weight: 750; letter-spacing: -0.03em; font-size: 1.5rem; color: #fff; }
html body > footer .footer-logo span { color: var(--gold-lt); }
html body > footer .footer-tagline { color: var(--mist); }
html body > footer .fcol .fcol-title {
  font-family: var(--font-ui); text-transform: none; letter-spacing: 0;
  font-size: .9rem; font-weight: 600; color: #fff;
}
html body > footer .fcol a { color: var(--mist); font-size: .92rem; }
html body > footer .fcol a:hover { color: #fff; }
html body > footer .fcopy a { color: var(--gold-lt); }
html body > footer .flegal { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--mist); }
html body > footer .fbadge { display: none; }

/* ---------- Cookie-баннер ---------- */
html body .cookie-banner {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(18,19,22,.14); border-radius: 14px;
}
html body .cookie-banner strong { font-family: var(--font-ui); color: var(--ink); }
html body .cookie-banner .cookie-text { color: var(--ink-2); }
html body .cookie-banner .cookie-text a { color: var(--gold-ink); }
html body .cookie-banner .cookie-btn {
  font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-weight: 600;
  border-radius: 8px; min-height: 44px; text-transform: none;
}
html body .cookie-banner .cookie-btn.accept { background: var(--ink); color: #fff; border-color: var(--ink); }
html body .cookie-banner .cookie-btn.decline { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* «&» больше не подменяем декоративным курсивом — Geologica рисует его нормально */
.amp { font-family: inherit; font-style: normal; }

/* ---------- Появление при прокрутке (assets/fx.js) ---------- */
.fx [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.fx [data-reveal="scale"] { transform: translateY(12px) scale(.97); }
.fx [data-reveal="left"]  { transform: translateX(-24px); }
.fx [data-reveal].is-in, .fx-safe [data-reveal] { opacity: 1; transform: none; }

/* ---------- Кнопки на тёмном ---------- */
.btn-ghost-light {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 600 1rem var(--font-ui); color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.04);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn-ghost-light:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.btn-ghost-light:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* текст только для экранных дикторов */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* иконки из assets/icons.svg: <svg class="ic"><use href="/assets/icons.svg#i-…"/></svg> */
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
