/* =========================================================
   Narzędziownia - design system
   Paleta: atramentowa zieleń + mosiądz + chłodny papier
   ========================================================= */

:root {
  --paper: #f3f5f0;
  --surface: #fcfdfa;
  --surface-2: #e9ede5;
  --ink: #16201c;
  --muted: #4f5d55;
  --line: #d4dbd0;
  --line-strong: #b7c2b8;
  --petrol: #123f38;
  --petrol-deep: #0a2823;
  --brass: #b26a2b;
  --brass-ink: #8a4a12;
  --brass-soft: #f3e6d4;
  --green-soft: #e4efe6;
  --red-soft: #f7e4e1;
  --tip-line: #9db8a6;
  --warn-line: #c98d86;
  --wash-a: rgba(178, 106, 43, .055);
  --wash-b: rgba(18, 63, 56, .05);

  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --header-h: 76px;
  --sidebar-w: 300px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1512;
    --surface: #141d18;
    --surface-2: #1b2821;
    --ink: #edf1ea;
    --muted: #a9b8ae;
    --line: #28362e;
    --line-strong: #3a4c42;
    --petrol: #10352e;
    --petrol-deep: #081c18;
    --brass: #d69a5a;
    --brass-ink: #ecb782;
    --brass-soft: #2a2015;
    --green-soft: #12251b;
    --red-soft: #2a1414;
    --tip-line: #3f5f4a;
    --warn-line: #6a3a35;
    --wash-a: rgba(214, 154, 90, .06);
    --wash-b: rgba(70, 140, 120, .07);
  }
}

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

html { font-size: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(58rem 38rem at 102% -8%, var(--wash-a), transparent 62%),
    radial-gradient(48rem 32rem at -12% 104%, var(--wash-b), transparent 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0;
}

p { text-wrap: pretty; }

a { color: var(--brass-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
.brand, .sidebar-link, .cat-lead, .cat-list a, .related a, .search-item { text-decoration: none; }

img { max-width: 100%; }

::selection { background: #e6c39b; color: #16201c; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; font-family: var(--font-mono); font-size: .8rem;
  border: 1px solid var(--ink);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.app-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 100;
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(243, 245, 240, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark) {
  .app-header { background: rgba(14, 21, 18, .93); }
}

.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink); flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--petrol); flex: 0 0 auto; }
@media (prefers-color-scheme: dark) { .brand-mark { color: #9fc4b3; } }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.24rem; letter-spacing: -.03em; }
.brand-sub {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-top: 4px;
}

.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 2px;
  cursor: pointer;
}
.menu-toggle:hover { background: var(--surface-2); }

.header-search { position: relative; margin-left: auto; width: min(420px, 38vw); }
.header-search input {
  width: 100%; height: 42px;
  padding: 0 42px 0 40px;
  font-family: var(--font-body); font-size: .98rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 2px;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.header-search input::placeholder { color: var(--muted); opacity: .9; }
.header-search input:focus {
  outline: none; border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(178, 106, 43, .16);
}
.header-search input::-webkit-search-cancel-button { cursor: pointer; }

.search-icon {
  position: absolute; left: 14px; top: 12px;
  color: var(--muted); pointer-events: none;
}
.search-kbd {
  position: absolute; right: 11px; top: 11px;
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--muted); background: var(--paper);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 1px 6px; pointer-events: none;
}

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 120;
  background: var(--surface); border: 1px solid var(--ink);
  max-height: min(64vh, 520px); overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-item {
  display: block; padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item.is-selected { background: var(--surface-2); text-decoration: none; }
.search-item strong {
  display: block; font-family: var(--font-body); font-weight: 600;
  font-size: .96rem; line-height: 1.35; color: var(--ink);
}
.search-item span {
  display: block; margin-top: 3px;
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .04em; color: var(--muted);
}
.search-empty {
  padding: 16px 14px; font-size: .95rem; color: var(--muted);
}

/* ---------- shell / sidebar ---------- */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 90;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.sidebar-inner { padding: 26px 18px 32px 24px; }

.sidebar-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--ink);
}
.sidebar-title {
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase;
}
.sidebar-count { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); }

.nav-group { margin-top: 22px; }
.nav-head {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px; padding-left: 10px;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.sidebar-link {
  position: relative; display: block;
  padding: 6px 10px;
  font-family: var(--font-body); font-size: .95rem; line-height: 1.38;
  color: var(--ink); border-radius: 2px;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
}
.sidebar-link:hover { background: var(--surface-2); text-decoration: none; }
.sidebar-link[aria-current="page"] {
  color: var(--brass-ink); font-weight: 600; background: var(--brass-soft);
}
.sidebar-link[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: .74em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--brass);
}

.sidebar-foot {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .7rem; line-height: 1.9; color: var(--muted);
}
.sidebar-foot p { margin: 0; }
.sidebar-foot a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); }
.sidebar-foot a:hover { color: var(--brass-ink); }

.sidebar-overlay { display: none; }

/* ---------- main ---------- */

.main-content {
  margin-left: var(--sidebar-w);
  padding: calc(var(--header-h) + 44px) clamp(22px, 4vw, 64px) 0;
  min-height: 100vh;
}
.main-content:focus { outline: none; }
#view { max-width: 1120px; margin: 0 auto; }

/* ---------- hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(430px, 54vh, 560px);
  background: var(--petrol-deep);
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg,
    rgba(7, 32, 27, .97) 0%,
    rgba(7, 32, 27, .91) 36%,
    rgba(7, 32, 27, .62) 68%,
    rgba(7, 32, 27, .34) 100%);
}
.hero-inner {
  padding: clamp(28px, 4.4vw, 56px);
  max-width: 720px;
  color: #eef3ec;
}
.hero-label {
  font-family: var(--font-mono); font-size: .75rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: #e0b184; margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(3rem, 7vw, 5.1rem);
  line-height: .93; letter-spacing: -.035em;
  font-weight: 700; color: #f8faf4;
}
.hero-lede {
  font-size: 1.18rem; line-height: 1.58;
  color: #dfe7dd; max-width: 46ch;
  margin: 22px 0 30px;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: #e2a464; color: #10322c;
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase;
  border-radius: 2px;
  transition: transform .18s var(--ease-out), background-color .18s var(--ease-out);
}
.hero-cta:hover { background: #efb87e; text-decoration: none; transform: translateY(-1px); }
.hero-cta:active { transform: scale(.98); }
.hero-cta .arrow { color: #10322c; opacity: .8; }
.hero-cta:hover .arrow { transform: translateX(4px); opacity: 1; }

/* ---------- home: intro + catalog ---------- */

.home-intro {
  display: flex; justify-content: space-between; align-items: baseline; gap: 32px;
  margin: 42px 0 6px; padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.home-intro p { margin: 0; max-width: 62ch; font-size: 1rem; line-height: 1.6; color: var(--muted); }
.home-intro span {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}

.catalog { padding-bottom: 8px; }
.cat-block { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.cat-block:first-child { border-top: 0; padding-top: 14px; }

.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.cat-head h2 { font-size: 1.6rem; letter-spacing: -.025em; }
.cat-count { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); white-space: nowrap; }

.cat-lead { display: block; padding: 2px 0 22px; max-width: 780px; color: var(--ink); }
.cat-lead:hover { text-decoration: none; }
.cat-lead .lead-title {
  font-family: var(--font-display); font-size: 1.32rem; font-weight: 600;
  line-height: 1.25; letter-spacing: -.02em;
  transition: color .15s var(--ease-out);
}
.cat-lead p { margin: 8px 0 0; font-size: 1rem; line-height: 1.6; color: var(--muted); max-width: 66ch; }
.cat-lead:hover .lead-title { color: var(--brass-ink); }

.cat-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px;
  list-style: none; margin: 0; padding: 0;
}
.cat-list li { border-top: 1px solid var(--line); }
.cat-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 0; color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.35;
}
.cat-list a:hover { color: var(--brass-ink); text-decoration: none; }

.arrow {
  font-family: var(--font-mono); font-size: .95rem; color: var(--brass);
  opacity: .5; transform: translateX(0);
  transition: transform .2s var(--ease-out), opacity .2s var(--ease-out);
}
a:hover .arrow { transform: translateX(4px); opacity: 1; }

/* ---------- article ---------- */

.article { max-width: 790px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .04em; color: var(--muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); }
.breadcrumb a:hover { color: var(--brass-ink); }
.breadcrumb .sep { color: var(--line-strong); }

.article h1 {
  font-size: clamp(2.05rem, 4vw, 2.95rem);
  letter-spacing: -.03em; margin-bottom: 18px;
}
.article-lede {
  font-size: 1.17rem; line-height: 1.62;
  color: #3d4b43; max-width: 64ch; margin: 0 0 22px;
}
@media (prefers-color-scheme: dark) { .article-lede { color: #c6d2c9; } }

.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--font-mono); font-size: .69rem;
  color: var(--muted);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
  padding: 11px 0; margin-bottom: 30px;
}
.article-meta span + span::before { content: "·"; margin-right: 18px; color: var(--line-strong); }

.toc {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 18px 22px; margin: 0 0 34px; border-radius: 2px;
}
.toc-title {
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 10px; padding: 4px 0;
  font-family: var(--font-display); font-size: .95rem;
  line-height: 1.35; color: var(--ink);
}
.toc a::before {
  content: counter(toc) "."; flex: 0 0 auto;
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--brass); padding-top: 3px;
}
.toc a:hover { color: var(--brass-ink); text-decoration: none; }

.article-body { font-size: 1.125rem; line-height: 1.72; }
.article-body > p:first-child::first-letter {
  float: left;
  font-family: var(--font-display); font-weight: 600;
  font-size: 3.3em; line-height: .8;
  padding: 8px 12px 0 0; color: var(--brass);
}
.article-body h2 {
  font-size: 1.55rem; letter-spacing: -.02em;
  margin: 2.1em 0 .55em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.article-body h2::before {
  content: ""; display: block; width: 34px; height: 2px;
  background: var(--brass); margin-bottom: 14px;
}
.article-body h3 { font-size: 1.2rem; margin: 1.6em 0 .35em; }
.article-body p { margin: 0 0 1.05em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.25em; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--brass); }
.article-body strong { font-weight: 600; }
.article-body a { text-decoration: underline; text-decoration-color: rgba(138, 74, 18, .35); }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 2px solid var(--brass);
  font-style: italic; color: var(--muted);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--surface-2); padding: 1px 5px; border-radius: 2px;
}

.table-wrap {
  overflow-x: auto; margin: 0 0 1.4em;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.article-body table, .table-wrap table {
  width: 100%; border-collapse: collapse;
  font-size: .96rem; line-height: 1.5;
}
.article-body th, .table-wrap th {
  text-align: left; vertical-align: bottom;
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
}
.article-body td, .table-wrap td {
  padding: 10px 14px 10px 0; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.article-body tr:last-child td, .table-wrap tr:last-child td { border-bottom: 0; }
.article-body tbody tr:hover, .table-wrap tbody tr:hover { background: var(--surface-2); }

/* boxes - always set color, never inherit dark-mode ink on a light pastel */
.info-box, .tip-box, .warning-box, .key-takeaways {
  padding: 16px 20px; margin: 0 0 1.4em;
  font-size: 1rem; line-height: 1.62;
  color: var(--ink);
  border: 1px solid; border-radius: 2px;
}
.info-box { background: var(--brass-soft); border-color: var(--brass); }
.tip-box { background: var(--green-soft); border-color: var(--tip-line); }
.warning-box { background: var(--red-soft); border-color: var(--warn-line); }
.key-takeaways { background: var(--surface-2); border-color: var(--line-strong); }
.info-box p:last-child, .tip-box p:last-child, .warning-box p:last-child { margin-bottom: 0; }
.info-box strong, .tip-box strong, .warning-box strong { color: var(--ink); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  padding: 16px 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 600; line-height: 1.35;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: 0 0 auto;
  font-family: var(--font-mono); font-size: 1.15rem;
  color: var(--brass);
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 18px; padding-right: 38px; font-size: 1rem; line-height: 1.65; }
.faq-item[open] summary { color: var(--brass-ink); }

/* glossary */
.glossary { margin: 0 0 1.5em; }
.glossary dt {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.06rem; margin-top: 1.15em;
}
.glossary dt::after { content: ""; display: block; width: 24px; height: 1px; background: var(--brass); margin-top: 7px; }
.glossary dd { margin: .5em 0 0; }

/* related + footer of article */
.related { margin-top: 56px; border-top: 1px solid var(--ink); padding-top: 22px; }
.related h2 {
  font-family: var(--font-mono); font-size: .67rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.related ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px;
}
.related a {
  display: block; padding: 10px 0; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-size: .98rem;
  line-height: 1.35; color: var(--ink);
}
.related a:hover { color: var(--brass-ink); text-decoration: none; }

.article-foot {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .7rem;
  line-height: 1.8; color: var(--muted);
}
.article-foot a { color: var(--brass-ink); }

/* ---------- site footer ---------- */

.site-footer {
  max-width: 1120px; margin: 74px auto 0;
  border-top: 1px solid var(--ink);
  padding: 32px 0 56px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px;
}
.footer-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.footer-brand p { margin: 8px 0 0; max-width: 42ch; font-size: .93rem; line-height: 1.6; color: var(--muted); }
.footer-links {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-family: var(--font-mono); font-size: .72rem;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--brass-ink); }
.footer-note {
  grid-column: 1 / -1; margin: 8px 0 0;
  border-top: 1px solid var(--line); padding-top: 16px;
  font-family: var(--font-mono); font-size: .64rem;
  line-height: 1.75; color: var(--muted);
}

/* ---------- cookie bar ---------- */

#vd-cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px; padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
  background: #101a16; color: #eef2ea;
  border-top: 1px solid #2a3a32;
  font-family: var(--font-body); font-size: .9rem; line-height: 1.45;
}
#vd-cookie-bar[hidden] { display: none; }
#vd-cookie-bar a { color: #f0c089; text-decoration: underline; }
.vd-cb-t { max-width: 68ch; }
.vd-cb-ok, .vd-cb-no {
  border-radius: 2px; padding: 9px 16px; cursor: pointer;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em;
}
.vd-cb-ok { background: #e2a464; color: #10322c; border: 1px solid #e2a464; }
.vd-cb-ok:hover { background: #efb87e; }
.vd-cb-no { background: transparent; color: #d5ded5; border: 1px solid #56665c; }
.vd-cb-no:hover { border-color: #8b9c90; }

/* ---------- motion ---------- */

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes heroIn {
  from { transform: scale(1.05); opacity: .55; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes heroTextIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.article, .home-intro, .catalog { animation: viewIn .32s var(--ease-out); }
.hero-media img { animation: heroIn 1.2s var(--ease-out); }
.hero-label { animation: heroTextIn .6s var(--ease-out) both; }
.hero h1 { animation: heroTextIn .7s var(--ease-out) .06s both; }
.hero-lede { animation: heroTextIn .7s var(--ease-out) .12s both; }
.hero-cta { animation: heroTextIn .7s var(--ease-out) .18s both; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  :root { --sidebar-w: 272px; }
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .app-header { gap: 12px; padding: 0 16px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 1.06rem; }
  .brand-sub { display: none; }

  .sidebar {
    width: min(326px, 87vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .34s var(--ease-drawer), visibility 0s linear .34s;
    will-change: transform;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .34s var(--ease-drawer), visibility 0s; }
  .sidebar-overlay {
    display: block; position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: rgba(6, 20, 15, .46); z-index: 85;
  }
  .sidebar-overlay[hidden] { display: none; }

  .main-content { margin-left: 0; padding-top: calc(var(--header-h) + 26px); }
  .header-search { flex: 1 1 auto; width: auto; max-width: none; }
  .search-kbd { display: none; }

  .hero { min-height: 440px; }
  .hero::before {
    background: linear-gradient(180deg, rgba(7, 32, 27, .78) 0%, rgba(7, 32, 27, .95) 78%);
  }
  .hero-inner { padding: 26px; max-width: 100%; }
  .hero h1 { font-size: clamp(2.6rem, 11vw, 3.6rem); }
  .hero-lede { font-size: 1.05rem; margin: 18px 0 24px; }

  .cat-list { grid-template-columns: 1fr; }
  .article-body { font-size: 1.08rem; }
  .related ul { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; gap: 24px; margin-top: 56px; }
}

@media (max-width: 600px) {
  :root { --header-h: 112px; }
  body { font-size: 1.07rem; }
  .app-header {
    flex-wrap: wrap; align-content: center;
    row-gap: 8px; padding: 8px 14px;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: .66rem; }
  .header-search { order: 3; flex: 1 1 100%; width: 100%; margin-left: 0; }
  .header-search input { height: 42px; font-size: .9rem; padding-left: 36px; padding-right: 34px; }
  .search-icon { left: 12px; top: 12px; }

  .hero { min-height: 420px; }
  .hero-inner { padding: 22px; }
  .hero-label { font-size: .72rem; letter-spacing: .14em; }
  .hero-cta { font-size: .74rem; padding: 14px 20px; min-height: 48px; }

  .home-intro { flex-direction: column; gap: 8px; margin-top: 32px; }
  .cat-head h2 { font-size: 1.42rem; }
  .cat-lead .lead-title { font-size: 1.18rem; }

  .article h1 { font-size: 2rem; }
  .article-lede { font-size: 1.1rem; }
  .article-meta { font-size: .75rem; gap: 4px 10px; }
  .article-meta span + span::before { margin-right: 10px; }
  .article-body { font-size: 1.08rem; line-height: 1.7; }
  .article-body > p:first-child::first-letter { font-size: 2.9em; }
  .article-body h2 { font-size: 1.34rem; }
  .toc { padding: 14px 16px; }
  .related a { font-size: .94rem; }

  #vd-cookie-bar { font-size: .82rem; line-height: 1.45; text-align: left; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .vd-cb-t { max-width: none; flex: 1 1 100%; }
  .vd-cb-ok, .vd-cb-no { flex: 1 1 0; min-height: 44px; padding: 8px 10px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-media img { animation: none; }
}

@media print {
  .app-header, .sidebar, .sidebar-overlay, #vd-cookie-bar, .related, .site-footer { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
