/* ============================================================
   AI - design system
   Grafit + elektryczny błękit + neon cyjan
   Typografia: Unbounded (display) + Hanken Grotesk (body)
   WCAG 2.1 AA: body 17px, kontrast >= 4.5:1
   ============================================================ */

:root {
  /* Light (domyślne) */
  --bg: #f4f7fa;
  --bg-alt: #e9eef4;
  --surface: #ffffff;
  --text: #17222e;
  --muted: #55626f;
  --accent: #1a63c9;
  --accent-strong: #124a9e;
  --accent-soft: #dbe7f7;
  --cyan: #0e7490;
  --cyan-soft: #dcf3f7;
  --border: #d7dfe8;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 1px 2px rgba(15, 30, 50, 0.06), 0 4px 16px rgba(15, 30, 50, 0.06);
  --shadow-hover: 0 6px 24px rgba(26, 99, 201, 0.14), 0 1px 3px rgba(15, 30, 50, 0.08);
  --code-bg: #0f1720;
  --code-text: #cfe6ff;
  --radius: 14px;
  --radius-sm: 8px;
  --header-height: 60px;
  --sidebar-w: 288px;
  --transition: 0.2s ease-out;
  --font-display: "Unbounded", "Hanken Grotesk", sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1016;
    --bg-alt: #10161e;
    --surface: #121a24;
    --text: #dbe4ee;
    --muted: #93a3b5;
    --accent: #4d9fff;
    --accent-strong: #7db8ff;
    --accent-soft: #16233a;
    --cyan: #38e1ff;
    --cyan-soft: #0e2a33;
    --border: #1e2a38;
    --header-bg: rgba(11, 16, 22, 0.92);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 6px 24px rgba(77, 159, 255, 0.18), 0 1px 3px rgba(0, 0, 0, 0.4);
    --code-bg: #0a0f16;
    --code-text: #bfe0ff;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at -10% -5%, rgba(26, 99, 201, 0.09), transparent 60%),
    radial-gradient(800px 480px at 110% 105%, rgba(14, 116, 144, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(77, 159, 255, 0.35), transparent);
  pointer-events: none;
}
.header-inner {
  max-width: 1400px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
}
.menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 10px; cursor: pointer;
}
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 22px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a63c9, #0e7490);
  border-radius: 10px; color: #fff; box-shadow: 0 2px 10px rgba(26, 99, 201, 0.35);
}
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.01em;
}
.brand-name em { font-style: normal; color: var(--accent); }

.search-wrap { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search-input {
  width: 100%; padding: 10px 16px 10px 38px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355626f' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26, 99, 201, 0.18); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: none; z-index: 120;
}
.search-results.open { display: block; }
.search-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-soft); text-decoration: none; }
.si-title { font-weight: 600; font-size: 0.92rem; }
.si-section { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.search-empty { padding: 14px 16px; color: var(--muted); font-size: 0.9rem; }

.header-tagline {
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1400px; margin: 0 auto; padding: 0 22px;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 34px;
  padding-top: calc(var(--header-height) + 26px);
  min-height: calc(100vh - 160px);
}

.sidebar {
  position: sticky; top: calc(var(--header-height) + 26px);
  height: calc(100vh - var(--header-height) - 52px);
  overflow-y: auto; padding: 8px 14px 30px 0;
  scrollbar-width: thin;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); padding: 0 10px; margin-bottom: 5px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.9rem; line-height: 1.35; color: var(--text);
  padding: 6px 10px; border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.sidebar-link:hover { background: var(--accent-soft); text-decoration: none; transform: translateX(2px); }
.sidebar-link.active { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.s-icon { font-size: 0.85rem; flex-shrink: 0; opacity: 0.85; }
.sidebar-overlay { display: none; }

/* ---------- Main ---------- */
.main-content { min-width: 0; padding-bottom: 60px; }

/* ---------- Hero ---------- */
.home-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(700px 340px at 85% -20%, rgba(77, 159, 255, 0.28), transparent 60%),
    radial-gradient(520px 300px at 8% 115%, rgba(56, 225, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #0b1016 0%, #101a26 55%, #0e2233 100%);
  background-size: 100% 100%, 100% 100%, cover;
  color: #eaf2fb;
  padding: 46px 42px 40px;
  box-shadow: var(--shadow);
}
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(77, 159, 255, 0.22) 1px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: 0.5; pointer-events: none;
  -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
  mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero-eyebrow {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #38e1ff;
  border: 1px solid rgba(56, 225, 255, 0.4); border-radius: 999px; padding: 5px 14px; margin-bottom: 18px;
}
.home-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.18; margin-bottom: 14px;
  text-wrap: balance;
}
.home-hero h1 .accent-word { color: #4d9fff; }
.hero-sub { font-size: 1.02rem; line-height: 1.65; color: #b9c9db; max-width: 640px; margin-bottom: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, #2f7df6, #1a63c9); color: #fff;
  box-shadow: 0 4px 18px rgba(47, 125, 246, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 26px rgba(47, 125, 246, 0.55); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06); color: #eaf2fb;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 8px; }
.hero-stat { display: flex; flex-direction: column; }
.hs-num {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem;
  color: #fff; line-height: 1.1;
}
.hs-label { font-size: 0.78rem; color: #93a3b5; max-width: 170px; }

/* Terminal signature */
.terminal {
  position: relative; z-index: 2;
  margin-top: 28px; max-width: 560px;
  background: rgba(6, 10, 16, 0.82);
  border: 1px solid rgba(77, 159, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(56, 225, 255, 0.06);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(77, 159, 255, 0.18);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-title { margin-left: 8px; font-size: 0.72rem; color: #7d93ab; font-weight: 600; }
.term-body { padding: 14px 16px 16px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.88rem; line-height: 1.7; }
.t-line { white-space: nowrap; overflow: hidden; width: 0; color: #bfe0ff; }
.t-line .t-prompt { color: #38e1ff; font-weight: 700; }
.t1 { animation: typing 1.4s steps(30, end) 0.3s forwards; }
.t2 { animation: typing 1.6s steps(38, end) 1.9s forwards; color: #9db8d4; }
.t3 { width: auto; color: #38e1ff; animation: none; opacity: 0; animation: blinkCursor 1s steps(1) 3.6s infinite; }
.t3::before { content: "▊"; }
@keyframes typing { to { width: 100%; } }
@keyframes blinkCursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Home sections & cards ---------- */
.home-section { margin-top: 46px; }
.home-section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; line-height: 1.3; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 12px; text-wrap: balance;
}
.sec-count {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 8px; padding: 2px 7px;
  flex-shrink: 0; font-family: var(--font-body);
}
.sec-desc { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
}
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 20px 16px; color: var(--text);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.home-card::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 0 0 4px 4px; opacity: 0; transition: opacity var(--transition);
}
.home-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(26, 99, 201, 0.35); text-decoration: none; }
.home-card:hover::before { opacity: 1; }
.hc-icon { font-size: 1.5rem; line-height: 1; }
.home-card h3 { font-size: 0.95rem; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.home-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.55; flex-grow: 1; }
.hc-more {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 5px;
}
.hc-more .arrow { transition: transform var(--transition); }
.home-card:hover .hc-more .arrow { transform: translateX(4px); }

/* ---------- Article ---------- */
.article-header { margin-bottom: 26px; padding-top: 8px; }
.breadcrumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--accent-strong); }
.breadcrumbs .sep { margin: 0 7px; color: var(--muted); }
.article-header h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  line-height: 1.25; margin-bottom: 12px; text-wrap: balance;
}
.article-excerpt { font-size: 1.05rem; color: var(--muted); line-height: 1.6; max-width: 760px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 700; font-size: 0.75rem; padding: 4px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.article-body { max-width: 820px; }
.article-body > * + * { margin-top: 1.05em; }
.article-body h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.18rem; line-height: 1.35; margin-top: 1.8em; padding-top: 0.3em;
  text-wrap: balance; scroll-margin-top: calc(var(--header-height) + 20px);
}
.article-body h2::before {
  content: ""; display: inline-block; width: 22px; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 4px; margin-right: 10px; vertical-align: middle;
}
.article-body h3 { font-size: 1.02rem; font-weight: 700; margin-top: 1.5em; text-wrap: balance; }
.article-body p { line-height: 1.72; }
.article-body ul, .article-body ol { padding-left: 1.35em; line-height: 1.72; }
.article-body li { margin: 0.35em 0; }
.article-body strong { font-weight: 700; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { text-decoration-thickness: 2px; }

.article-toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 1.6em;
}
.article-toc summary {
  cursor: pointer; font-weight: 700; font-size: 0.92rem; color: var(--accent-strong);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::before { content: "☰"; font-size: 0.85rem; }
.article-toc ol { margin-top: 10px; padding-left: 1.3em; font-size: 0.9rem; line-height: 1.65; }
.article-toc a { color: var(--text); }
.article-toc a:hover { color: var(--accent-strong); }

/* Info box */
.info-box {
  background: var(--accent-soft); border: 1px solid rgba(26, 99, 201, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 15px 18px; font-size: 0.95rem; line-height: 1.6;
}
.info-box strong { display: block; margin-bottom: 4px; color: var(--accent-strong); }
.info-box.warn { background: #fdf3e3; border-color: rgba(180, 120, 20, 0.3); border-left-color: #c98a1b; color: #4a3a15; }
.info-box.warn strong { color: #8a5d0e; }
@media (prefers-color-scheme: dark) {
  .info-box.warn { background: #2a2210; border-color: rgba(201, 138, 27, 0.35); color: #e8d9b0; }
  .info-box.warn strong { color: #e6b455; }
}

/* Tables */
.table-responsive { overflow-x: auto; margin: 1.4em 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface); }
caption { text-align: left; font-weight: 700; font-size: 0.9rem; padding: 12px 14px; background: var(--bg-alt); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); font-weight: 700; font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-alt); }
.error-table th { background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; }
.error-table td:first-child { font-weight: 700; color: var(--accent-strong); white-space: nowrap; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 20px; margin: 14px 0; background: var(--surface);
}
.faq-item h3 { font-size: 1rem; font-weight: 700; margin-top: 0; display: flex; gap: 10px; align-items: baseline; }
.faq-item h3::before { content: "Q:"; color: var(--accent); font-family: var(--font-display); font-size: 0.85rem; flex-shrink: 0; }
.faq-item p { margin-top: 0.6em; }

/* Glossary */
.glossary dt {
  font-weight: 700; margin-top: 1.1em; color: var(--accent-strong);
  display: flex; gap: 8px; align-items: baseline;
}
.glossary dt::before { content: "◆"; font-size: 0.7rem; color: var(--accent); }
.glossary dd { margin: 0.2em 0 0 1.1em; line-height: 1.65; }

/* Prompt / code blocks */
.prompt-box, pre {
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid rgba(77, 159, 255, 0.25); border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem; line-height: 1.65;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.prompt-box::before { content: "PROMPT"; display: block; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.14em; color: #38e1ff; margin-bottom: 8px; }
pre code { font-family: inherit; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em; background: var(--accent-soft); color: var(--accent-strong);
  padding: 2px 6px; border-radius: 5px;
}
pre code { background: none; color: inherit; padding: 0; }

blockquote {
  border-left: 3px solid var(--cyan); background: var(--cyan-soft);
  padding: 12px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text); font-style: italic;
}

/* Prev / next */
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 2.6em; padding-top: 1.6em; border-top: 1px solid var(--border);
}
.article-nav a {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; color: var(--text); transition: var(--transition);
}
.article-nav a:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); text-decoration: none; transform: translateY(-2px); }
.article-nav .an-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.article-nav .an-title { font-weight: 600; font-size: 0.92rem; line-height: 1.4; }
.article-nav .next { text-align: right; }
.article-nav span { display: block; }

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 34px 22px 44px;
}
.footer-inner { max-width: 1400px; margin: 0 auto; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }
.footer-inner strong { color: var(--text); }
.footer-note { margin-top: 10px; font-size: 0.8rem; max-width: 860px; }
.footer-copy { margin-top: 14px; font-size: 0.8rem; }

/* ---------- FadeUp page transition ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-content > * { animation: fadeUp 0.26s ease-out; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding-top: calc(var(--header-height) + 18px); }
  .menu-btn { display: flex; }
  .header-tagline { display: none; }
  .sidebar {
    position: fixed; top: var(--header-height); left: 0; bottom: 0; z-index: 90;
    width: min(320px, 86vw); background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 18px 40px;
    transform: translateX(-105%); transition: transform 0.25s ease-out;
    height: auto;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3); }
  .sidebar-overlay.show {
    display: block; position: fixed; inset: var(--header-height) 0 0 0; z-index: 80;
    background: rgba(8, 12, 18, 0.55); backdrop-filter: blur(2px);
  }
  .home-hero { padding: 34px 26px 30px; }
  .hero-stats { gap: 18px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .layout { padding: calc(var(--header-height) + 14px) 16px 0; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .search-wrap { max-width: none; }
  .brand-name { font-size: 0.92rem; }
  .home-hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 0.95rem; }
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { text-align: left; }
  .home-section h2 { font-size: 1.08rem; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
