/* ==========================================================================
   Aimerce SEO Guides — Unified Clean Engineering Design System
   Uses local Golos Text, Manrope, Roboto Mono and NBRB fonts.
   ========================================================================== */

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/golos-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/golos-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: 'Golos Text';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/golos-ruble.woff2') format('woff2');
  unicode-range: U+20BD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/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: 400 800;
  font-display: swap;
  src: url('assets/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: 400 800;
  font-display: swap;
  src: url('assets/fonts/manrope-ruble.woff2') format('woff2');
  unicode-range: U+20BD;
}

@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/roboto-mono-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: 400 700;
  font-display: swap;
  src: url('assets/fonts/roboto-mono-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: 'nbrb';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/nbrb.woff2') format('woff2');
  unicode-range: U+0183;
}

:root {
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --bg-subtle: #f4f4f5;
  --surface: #ffffff;

  --ink: #09090b;
  --ink-2: #3f3f46;
  --muted: #71717a;

  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --brand: #18181b;
  --brand-hover: #27272a;
  --brand-soft: #f4f4f5;
  --brand-border: #d4d4d8;

  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --dark-bg: #0c0c0e;
  --dark-border: #27272a;

  --font-display: 'nbrb', 'Manrope', 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'nbrb', 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'nbrb', 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 3px rgba(9, 9, 11, 0.05), 0 12px 28px -18px rgba(9, 9, 11, 0.1);
  --container-max: 1020px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding-left: 20px;
}

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-subtle);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  border-radius: 0;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: 24px;
}

/* ---------- Header ---------- */
.guide-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.guide-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.guide-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
}

.guide-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #ffffff;
  display: grid;
  place-items: center;
}

.guide-brand-mark svg {
  width: 20px;
  height: 20px;
}

.guide-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.guide-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.guide-nav a:hover {
  color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14.5px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.16);
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #a1a1aa;
}

/* ---------- Hero ---------- */
.guide-hero {
  padding: 36px 0 40px;
  background-color: #ffffff;
  background-image:
    radial-gradient(640px 280px at 50% 0%, rgba(9, 9, 11, 0.028), transparent 72%),
    linear-gradient(to right, rgba(9, 9, 11, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9, 9, 11, 0.035) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  border-bottom: 1px solid rgba(9, 9, 11, 0.08);
}

.breadcrumbs {
  margin-bottom: 16px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--border-strong);
}

.breadcrumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.guide-kicker {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-hover);
  margin-bottom: 14px;
}

.guide-hero h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.14;
  font-weight: 700;
  max-width: 24ch;
  margin-bottom: 14px;
}

.guide-lead {
  font-size: 17px;
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 68ch;
  margin-bottom: 20px;
}

.guide-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.guide-meta-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.guide-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Content Sections ---------- */
.guide-section {
  padding: 48px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.guide-section--muted {
  background: var(--bg-muted);
}

.guide-section h2 {
  font-size: clamp(22px, 2.5vw, 29px);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 14px;
}

.guide-section-intro {
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 72ch;
  margin-bottom: 24px;
}

.guide-prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 74ch;
  color: var(--ink-2);
}

.guide-cards-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.guide-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-card h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.guide-card p,
.guide-card li {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.guide-callout {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand);
  font-size: 14.5px;
  color: var(--ink-2);
}

.guide-callout strong {
  color: var(--ink);
}

/* ---------- Comparison Table ---------- */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.compare-table th,
.compare-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.compare-table thead th {
  background: var(--bg-muted);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table tbody td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Code Box ---------- */
.guide-code-box {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  overflow-x: auto;
}

.guide-code-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #94a3b8;
}

.guide-code-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

/* ---------- FAQ ---------- */
.guide-faq {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.guide-faq-item {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-faq-item h3 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
}

.guide-faq-item p {
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ---------- CTA & Related Guides ---------- */
.guide-cta-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, rgba(9, 9, 11, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9, 9, 11, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.guide-cta-copy {
  max-width: 58ch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 140ms ease, transform 140ms ease;
}

.related-card:hover {
  border-color: var(--brand-border);
  transform: translateY(-2px);
}

.related-card span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
}

.related-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
}

.related-card p {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.guide-footer {
  padding: 28px 0;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.guide-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.guide-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.guide-footer-nav a {
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}

.guide-footer-nav a:hover {
  color: var(--brand);
}

@media (max-width: 760px) {
  .container {
    padding-inline: 16px;
  }

  .guide-nav {
    display: none;
  }

  .guide-section {
    padding: 36px 0;
  }

  .guide-cards-2,
  .guide-cards-3 {
    grid-template-columns: 1fr;
  }

  .guide-cta-card {
    padding: 22px 18px;
  }
}
