/* =========================================================================
   Brookhaven — main.css
   Дизайн-токены, шрифты, базовая типографика, раскладка, шапка/подвал.
   Эстетика: вечерний пригород, розово-фиолетовый закат.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Шрифты (самохостинг). Manrope — дисплей, Inter — текст, Roboto Mono — код.
   Каждое семейство: cyrillic + cyrillic-ext + latin + latin-ext.
   ---------------------------------------------------------------------- */

/* Manrope (variable 200–800) */
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('../fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('../fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Inter (variable 100–900) */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Roboto Mono (500) */
@font-face {
  font-family: 'Roboto Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/robotomono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Roboto Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/robotomono-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Roboto Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/robotomono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/robotomono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------------------
   Дизайн-токены
   ---------------------------------------------------------------------- */
:root {
  --bg-base:      #0F0A0D;
  --bg-card:      #1A1018;
  --bg-code:      #0A0608;
  --accent:       #F472B6;
  --accent-dim:   #831843;
  --accent-alt:   #A78BFA;
  --text-primary: #FDF2F8;
  --text-muted:   #9CA3AF;
  --border:       #2D1A26;

  /* производные */
  --bg-elevated:    #231420;
  --accent-soft:    rgba(244, 114, 182, 0.12);
  --accent-glow:    rgba(244, 114, 182, 0.28);
  --alt-soft:       rgba(167, 139, 250, 0.12);
  --alt-glow:       rgba(167, 139, 250, 0.26);
  --gradient-accent: linear-gradient(135deg, #F472B6 0%, #A78BFA 100%);
  --gradient-text:   linear-gradient(120deg, #FBCFE8 0%, #F472B6 45%, #A78BFA 100%);

  --font-display: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Roboto Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;

  --container:   1120px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-pill: 99px;

  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-pop:  0 14px 40px rgba(0, 0, 0, 0.45);
  --transition:  0.2s ease;
  --header-h:    64px;
}

/* -------------------------------------------------------------------------
   Сброс
   ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(1100px 600px at 50% -8%, rgba(244, 114, 182, 0.16), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.12), transparent 55%),
    linear-gradient(180deg, #160d14 0%, var(--bg-base) 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* -------------------------------------------------------------------------
   Типографика
   ---------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 700; }

p { color: var(--text-primary); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fbcfe8; }

strong, b { font-weight: 700; }
code, kbd, samp { font-family: var(--font-mono); font-weight: 500; }

::selection { background: var(--accent); color: #1a0a12; }

/* Доступность: видимый фокус */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Утилиты */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #1a0a12; font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius);
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; color: #1a0a12; }

/* -------------------------------------------------------------------------
   Раскладка
   ---------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.site-main { display: block; padding-bottom: 64px; }

.section { padding-block: 44px; }
.section--tight { padding-block: 28px; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.section__head h2 { margin: 0; }
.section__link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.section__link:hover { text-decoration: underline; }

/* Заголовок секции с иконкой (template-parts/section-header.php) */
.section-header { margin-bottom: 24px; }
.section-header__icon {
  font-size: 1.6rem;
  line-height: 1;
  display: inline-block;
  margin-bottom: 8px;
}
.section-header__title { margin: 0 0 6px; }
.section-header__desc { color: var(--text-muted); max-width: 70ch; }

/* -------------------------------------------------------------------------
   Шапка
   ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 10, 13, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.nav-logo:hover { color: var(--text-primary); }
.nav-logo b {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1;
  width: 42px;
  height: 42px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.nav-burger:hover { border-color: var(--accent); }

/* -------------------------------------------------------------------------
   Хлебные крошки
   ---------------------------------------------------------------------- */
.breadcrumb {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px 20px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .breadcrumb_last { color: var(--text-primary); font-weight: 600; }

/* -------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */
.hero {
  padding-block: clamp(40px, 8vw, 76px);
  text-align: center;
}
.hero__inner { max-width: 760px; margin-inline: auto; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.hero__title {
  margin: 0 0 18px;
  font-size: clamp(1.85rem, 6vw, 3.6rem);
}
.hero__title .accent {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
}
.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Шаги (гайды)
   ---------------------------------------------------------------------- */
.steps {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.step__num {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  color: #1a0a12;
  background: var(--gradient-accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.step__body { min-width: 0; }
.step__title { margin: 2px 0 4px; font-size: 1.1rem; }
.step__text { color: var(--text-muted); }
.step__text a { font-weight: 600; }

/* -------------------------------------------------------------------------
   Текстовые блоки (.prose)
   ---------------------------------------------------------------------- */
.prose { max-width: 75ch; }
.prose > * + * { margin-top: 1rem; }
.prose p { color: var(--text-primary); }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.4em; color: var(--text-primary); }
.prose li + li { margin-top: 0.4rem; }
.prose a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text-primary); }

.lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 70ch;
}

/* -------------------------------------------------------------------------
   Рекламный слот (пустой до вставки кода — место не занимает)
   ---------------------------------------------------------------------- */
.ad-slot { margin-block: 28px; text-align: center; }
.ad-slot:empty { display: none; }

/* -------------------------------------------------------------------------
   Подвал
   ---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(10, 6, 8, 0.6);
  margin-top: 40px;
  padding-block: 40px 28px;
}
.footer-grid {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 28px 40px;
}
.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.footer-grid > div > a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 3px 0;
}
.footer-grid > div > a:hover { color: var(--accent); }
.footer-disclaimer {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 42ch;
  justify-self: end;
}
.footer-bottom {
  max-width: var(--container);
  margin: 28px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--accent); }

/* -------------------------------------------------------------------------
   Адаптив
   ---------------------------------------------------------------------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-disclaimer { grid-column: 1 / -1; justify-self: start; max-width: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    background: rgba(15, 10, 13, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-pop);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .step { padding: 16px; }
  .hero__title { font-size: clamp(1.5rem, 6.4vw, 2.2rem); }
  /* CTA-кнопки на узких экранах — на всю ширину, чтобы не выходить за край */
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
