/* =========================================================================
   BloxFruitScripts — main.css
   База, токены, типографика, шапка, hero, секции, подвал, адаптив.
   Концепция: глубокий тёмный океан + пиратское золото. Радиус 6px.
   ========================================================================= */

/* ---------- Токены ---------- */
:root {
  /* Палитра (по брифу) */
  --bg-base:      #070A12;
  --bg-card:      #0D1320;
  --bg-code:      #050810;
  --accent:       #F59E0B;
  --accent-dim:   #78350F;
  --text-primary: #FFFBEB;
  --text-muted:   #8A93A3;   /* осветлён с #6B7280 до контраста WCAG AA (≥4.5:1) на тёмном фоне */
  --border:       #1E2D45;

  /* Производные оттенки */
  --bg-elev:      #111B2E;
  --accent-soft:  #FBBF24;   /* закатный янтарь — для градиентов */
  --accent-deep:  #B45309;
  --ok:           #34D399;   /* «работает» */
  --border-soft:  #16223A;
  --gold-gradient: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 55%, var(--accent-deep) 100%);

  /* Шрифты */
  --font-display: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

  /* Радиусы и тени */
  --radius:    6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --shadow:    0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 6px 22px rgba(245, 158, 11, 0.22);

  /* Раскладка */
  --container:  1100px;
  --container-narrow: 800px;
  --header-h:   64px;
}

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

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

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip (а не hidden) — иначе body становится scroll-контейнером и ломает
     position: sticky у .site-header (пустой отступ над шапкой под админ-баром WP) */
  overflow-x: clip;
}

img { max-width: 100%; height: auto; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.25rem; letter-spacing: 0.015em; }

p { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-soft); text-decoration: underline; }

strong { font-weight: 700; color: var(--text-primary); }

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

/* ---------- Доступность ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #000;
  padding: 10px 16px;
  font-weight: 700;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Контейнеры ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: var(--container-narrow); }

.main { display: block; }

.section-title {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.12em; bottom: 0.12em;
  width: 5px;
  border-radius: 3px;
  background: var(--gold-gradient);
}

.section-lead {
  max-width: 72ch;
  margin: -0.4rem 0 1.6rem;
  font-size: 1.06rem;
  line-height: 1.65;
  color: #C9D1DD;
}

/* Промо-баннер после hero */
.home-banner {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 0;
}
.home-banner img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Лонгрид */
.longread { padding: clamp(1.5rem, 4vw, 2.5rem) 0 0; }
.longread .prose { margin-block: 0 2.4rem; }
.longread .prose:first-child h2 { margin-top: 0; }

/* =========================================================================
   ШАПКА
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Залогиненный админ: шапка не уезжает под админ-бар WordPress при скролле */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

.nav {
  max-width: var(--container);
  margin-inline: auto;
  height: var(--header-h);
  padding-inline: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo:hover { color: var(--text-primary); text-decoration: none; }
.nav-logo__mark { font-size: 1.15rem; filter: drop-shadow(0 1px 4px rgba(245,158,11,.4)); }
.nav-logo__accent { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-links a:hover {
  background: var(--bg-card);
  color: var(--accent);
  text-decoration: none;
}

/* Бургер */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-burger.is-active .nav-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-active .nav-burger__bar:nth-child(2) { opacity: 0; }
.nav-burger.is-active .nav-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6.5rem) 20px clamp(4rem, 8vw, 6rem);
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(245, 158, 11, 0.16), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(30, 45, 69, 0.5), transparent 70%),
    linear-gradient(180deg, #0B1730 0%, var(--bg-base) 78%);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-inline: auto;
}
.hero__eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 12px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.18);
}
.hero__title {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 8vw, 5rem);
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.hero__subtitle {
  max-width: 620px;
  margin: 0 auto 1.75rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.6;
  color: #D8DEE9;
}
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-bottom: 2rem;
}
.fact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.fact__check {
  color: var(--accent);
  font-weight: 900;
}
.hero__cta { font-size: 1.05rem; }

.hero__wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  z-index: 1;
  line-height: 0;
}
.hero__wave svg { width: 100%; height: 60px; display: block; }
.hero__wave path { fill: var(--bg-base); }

/* =========================================================================
   СЕКЦИИ
   ========================================================================= */
.scripts { padding: clamp(2.5rem, 6vw, 4rem) 0; }

.how-to {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  background:
    linear-gradient(180deg, transparent, rgba(13, 19, 32, 0.6) 50%, transparent),
    var(--bg-base);
  border-block: 1px solid var(--border-soft);
}

/* Шаги «Как использовать» */
.steps {
  list-style: none;
  counter-reset: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #000;
  background: var(--gold-gradient);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-gold);
}
.step__title { margin: 0.1rem 0 0.4rem; font-size: 1.1rem; }
.step__body p { margin: 0; font-size: 0.98rem; color: #C4CCD8; }

.link-arrow {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 700;
  font-family: var(--font-body);
}
.link-arrow:hover { text-decoration: none; }

/* =========================================================================
   СТРАНИЦЫ (page-*)
   ========================================================================= */
.page { padding-block: 0.75rem clamp(3rem, 7vw, 5rem); }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .breadcrumb_last { color: var(--text-primary); font-weight: 700; }

.page-head { margin-bottom: 2rem; }
.page-title { margin-bottom: 0.6rem; }
.page-lead {
  font-size: 1.12rem;
  line-height: 1.65;
  color: #D8DEE9;
  max-width: 64ch;
}

/* Текстовые блоки */
.prose { margin-block: 2.5rem; }
.prose h2 { margin-top: 2rem; }
.prose p { color: #D2D9E4; max-width: 72ch; }
.prose a { font-weight: 700; }
.prose ol.reasons,
.prose ol {
  padding-left: 0;
  list-style: none;
  counter-reset: r;
  max-width: 72ch;
}
.prose ol.reasons li {
  counter-increment: r;
  position: relative;
  padding: 12px 12px 12px 48px;
  margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #D2D9E4;
}
.prose ol.reasons li::before {
  content: counter(r);
  position: absolute;
  left: 12px; top: 12px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #000;
  background: var(--gold-gradient);
  border-radius: var(--radius-sm);
}

/* =========================================================================
   404
   ========================================================================= */
.error-404 { text-align: center; }
.error-404__inner { max-width: 600px; margin-inline: auto; padding-block: 2rem; }
.error-404__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1;
  margin: 0;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-404__links { margin-block: 1.5rem; }
.error-404__nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 0;
  margin: 1.5rem 0 0;
}

/* =========================================================================
   ПОДВАЛ
   ========================================================================= */
.site-footer {
  position: relative;
  margin-top: 3rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.footer-wave { position: absolute; top: -1px; left: 0; right: 0; line-height: 0; transform: translateY(-100%); }
.footer-wave svg { width: 100%; height: 36px; display: block; }
.footer-wave path { fill: var(--bg-card); }

.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 3rem 20px 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.6fr;
  gap: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.footer-logo:hover { color: var(--text-primary); text-decoration: none; }
.footer-tagline { color: var(--text-muted); font-size: 0.92rem; margin: 0; max-width: 30ch; }
.footer-heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-size: 0.95rem;
  margin: 0 0 4px;
}
.footer-col a {
  color: #B6C0CE;
  font-size: 0.95rem;
  text-decoration: none;
}
.footer-col a:hover { color: var(--accent); }
.footer-disclaimer p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin: 0 0 8px; }
.footer-copy { font-size: 0.82rem !important; }

/* =========================================================================
   АДАПТИВ
   ========================================================================= */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand, .footer-disclaimer { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav-burger { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 20px;
    background: rgba(7, 10, 18, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;             /* убрать из tab-order и дерева доступности, когда закрыто */
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
