/* Pożegnanie - design system
   Paleta: głęboka zieleń (spokój, powaga) + mosiądz (pamięć, ciepło) + kamienny off-white.
   Typografia: Cormorant Garamond (display, humanistyczny serif) + Outfit (tekst). */

:root {
  --bg: #edefe8;
  --surface: #f4f6ef;
  --surface-2: #fbfcf8;
  --ink: #16211c;
  --ink-soft: #33413a;
  --muted: #59655d;
  --border: #d5dbd1;
  --border-strong: #bcc5ba;
  --pine: #1d3a30;
  --pine-deep: #12251e;
  --brass: #a9803f;
  --brass-ink: #7c5a23;
  --brass-soft: #f0e6d2;
  --red-soft: #f7e6e3;
  --red-ink: #8c2f22;
  --cream: #f7f5ee;
  --header-h: 68px;
  --sidebar-w: 288px;
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --hero-img: url('/assets/hero.webp');
  --shadow-pop: 0 14px 34px rgba(18, 37, 30, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1714;
    --surface: #15201b;
    --surface-2: #1a2620;
    --ink: #e9ede6;
    --ink-soft: #ccd5cc;
    --muted: #a7b3a9;
    --border: #26332c;
    --border-strong: #35443b;
    --pine: #16302a;
    --pine-deep: #0b1411;
    --brass: #c79a58;
    --brass-ink: #d9b177;
    --brass-soft: #2a2416;
    --red-soft: #2c1915;
    --red-ink: #e5a599;
    --cream: #eef1e9;
    --shadow-pop: 0 18px 40px rgba(0, 0, 0, 0.55);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  font-size: 1.09rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 460px at 100% 0%, rgba(169, 128, 63, 0.07), transparent 62%),
    radial-gradient(900px 420px at 0% 100%, rgba(29, 58, 48, 0.06), transparent 60%);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

a { color: var(--brass-ink); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--pine);
  color: var(--cream);
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 10px; }

/* ---------- Header ---------- */

.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  background: rgba(237, 239, 232, 0.94);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@media (prefers-color-scheme: dark) {
  .app-header { background: rgba(15, 23, 20, 0.94); }
}

.app-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(169, 128, 63, 0.45) 18%, rgba(169, 128, 63, 0.1) 60%, transparent);
  pointer-events: none;
}

.header-inner {
  max-width: 1340px;
  margin: 0 auto;
  height: 100%;
  padding: 0 clamp(16px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; color: var(--brass-ink); flex: none; }
.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.36rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.015em;
}
.brand-tag {
  display: block;
  margin-top: 3px;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.search {
  position: relative;
  margin-left: auto;
  width: min(420px, 46%);
}
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: var(--brass-ink);
  box-shadow: 0 0 0 3px rgba(169, 128, 63, 0.18);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 62vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  z-index: 70;
}
.search-results[hidden] { display: none; }
.search-item {
  display: block;
  padding: 9px 11px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item:focus-visible { background: var(--brass-soft); }
.search-item small {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-empty { padding: 12px; font-size: 0.86rem; color: var(--muted); }

.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  padding: 10px 9px;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.22s var(--ease-out), opacity 0.18s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  max-width: 1340px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 16px 36px 22px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.sidebar-section { margin-bottom: 18px; }
.sidebar-section-title {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-ink);
}
.sidebar-link {
  position: relative;
  display: block;
  padding: 6px 0 6px 15px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.16s ease;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0; top: 13px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s var(--ease-out);
}
.sidebar-link:hover { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .sidebar-link:hover::before { opacity: 0.45; transform: scale(1); }
}
.sidebar-link.active {
  color: var(--brass-ink);
  font-weight: 500;
}
.sidebar-link.active::before { opacity: 1; transform: scale(1); }

.sidebar-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.sidebar-foot p { margin: 0 0 6px; }
.sidebar-foot a { color: var(--brass-ink); text-decoration: none; }
.sidebar-foot a:hover { text-decoration: underline; }

.content { min-width: 0; }

.overlay {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(10, 18, 15, 0.45);
  z-index: 44;
}
.overlay[hidden] { display: none; }
body.menu-open { overflow: hidden; }

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 470px;
  overflow: hidden;
  background: var(--pine-deep);
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: -3%;
  z-index: -2;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center 58%;
  animation: drift 30s ease-in-out infinite alternate;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(96deg, rgba(12, 28, 22, 0.95) 0%, rgba(12, 28, 22, 0.88) 42%, rgba(12, 28, 22, 0.52) 78%, rgba(12, 28, 22, 0.38) 100%),
    linear-gradient(0deg, rgba(12, 28, 22, 0.55) 0%, transparent 45%);
}
@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

.hero-inner {
  width: 100%;
  max-width: 760px;
  padding: clamp(34px, 5.4vw, 68px) clamp(22px, 4.6vw, 56px);
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: #d8c6a2;
}
.hero-brand svg { width: 30px; height: 30px; flex: none; }
.hero-brand span {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.05rem, 3.9vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: #f8f5ec;
}
.hero-lead {
  max-width: 48ch;
  margin: 0 0 30px;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  font-weight: 400;
  line-height: 1.62;
  color: #e6ebe3;
  text-shadow: 0 1px 2px rgba(8, 20, 15, 0.45);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #17211c;
  background: #c9a468;
  border: 1px solid #c9a468;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s var(--ease-out), transform 0.16s var(--ease-out), border-color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #d8b57c; border-color: #d8b57c; transform: translateY(-1px); }
}
.btn:active { transform: scale(0.985); }

/* ---------- Home body ---------- */

.home-body {
  padding: 0 clamp(20px, 4.4vw, 56px) 20px;
  animation: fadeUp 0.4s var(--ease-out) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Signature: pierwsze 24 godziny */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-strong);
}
.step {
  padding: 20px 22px 26px 0;
  border-right: 1px solid var(--border);
}
.step:last-child { border-right: 0; padding-right: 0; }
.step-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brass-ink);
}
.step h3 {
  margin: 6px 0 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.002em;
}
.step p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.home-section { padding: 48px 0 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.section-count {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-desc {
  max-width: 66ch;
  margin: 0 0 18px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--muted);
}

.rows { display: flex; flex-direction: column; }
.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px 2px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.rows .article-row:first-child { border-top: 1px solid var(--border); }
.row-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.004em;
  transition: color 0.16s ease;
}
.row-excerpt {
  display: block;
  max-width: 74ch;
  margin-top: 3px;
  font-size: 0.91rem;
  line-height: 1.5;
  color: var(--muted);
}
.row-arrow {
  width: 19px; height: 19px;
  color: var(--brass-ink);
  opacity: 0.5;
  transition: transform 0.2s var(--ease-out), opacity 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .article-row:hover .row-title { color: var(--brass-ink); }
  .article-row:hover .row-arrow { transform: translateX(4px); opacity: 1; }
}
.article-row:active .row-title { color: var(--brass-ink); }

.home-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--border-strong);
}
.home-close p {
  margin: 0;
  max-width: 62ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}
.home-close a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--brass-ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ---------- Article ---------- */

.article-wrap {
  max-width: 820px;
  padding: 30px clamp(20px, 4.4vw, 56px) 40px;
  animation: fadeUp 0.35s var(--ease-out) both;
}
.breadcrumb {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brass-ink); text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

.article-wrap h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.85rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.012em;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-ink);
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

.toc {
  margin: 26px 0 32px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.toc-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol { margin: 0; padding-left: 1.15rem; }
.toc li { margin: 4px 0; }
.toc a { font-size: 0.93rem; color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--brass-ink); text-decoration: underline; }

.content h2 {
  margin: 2.1em 0 0.5em;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.008em;
}
.content h2:first-child { margin-top: 0; }
.content h3 {
  margin: 1.6em 0 0.35em;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
}
.content p { margin: 0 0 1.05em; line-height: 1.75; color: var(--ink-soft); }
.content strong { color: var(--ink); font-weight: 600; }
.content ul, .content ol { margin: 0 0 1.2em; padding-left: 1.25em; }
.content li { margin: 0.42em 0; line-height: 1.7; color: var(--ink-soft); }
.content a { color: var(--brass-ink); text-underline-offset: 2px; }
.content a:hover { text-decoration-thickness: 2px; }
.content img { display: block; max-width: 100%; height: auto; margin: 1.6em 0; }
.content blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
  border-left: 1px solid var(--brass);
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
}
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.info-box, .warning-box, .tip-box {
  margin: 1.6em 0;
  padding: 17px 20px;
  color: var(--ink);
  border: 1px solid var(--border);
  background: var(--brass-soft);
}
.warning-box { background: var(--red-soft); }
.tip-box { background: var(--surface); }
.info-box p:last-child, .warning-box p:last-child, .tip-box p:last-child { margin-bottom: 0; }
.info-box h3, .warning-box h3, .tip-box h3 { margin-top: 0; font-size: 1rem; }

.table-responsive { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--border); }
table.error-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 0.92rem; }
table.error-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}
table.error-table td {
  padding: 11px 14px;
  vertical-align: top;
  line-height: 1.6;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
}
table.error-table tr:last-child td { border-bottom: 0; }

.faq-item { padding: 15px 0; border-bottom: 1px solid var(--border); }
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-item h3 { margin: 0 0 5px; font-size: 1.04rem; font-weight: 600; }
.faq-item .faq-a { margin: 0; font-size: 0.98rem; }

dl.glossary { margin: 1.4em 0; }
dl.glossary dt { margin-top: 1.1em; font-weight: 600; color: var(--ink); }
dl.glossary dd { margin: 0.15em 0 0; line-height: 1.7; color: var(--ink-soft); }

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--border-strong);
}
.article-nav a { max-width: 46%; text-decoration: none; }
.article-nav a.next { margin-left: auto; text-align: right; }
.nav-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.article-nav a:hover .nav-title { color: var(--brass-ink); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--pine-deep);
  color: #dfe4db;
  padding: 44px clamp(20px, 4.4vw, 56px);
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.footer-brand svg { width: 26px; height: 26px; color: #c9a468; }
.footer-note { max-width: 68ch; margin: 0 0 18px; font-size: 0.9rem; line-height: 1.65; color: #b9c3b8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 18px; }
.footer-links a { font-size: 0.9rem; color: #dfe4db; text-decoration: none; }
.footer-links a:hover { color: #d8b57c; text-decoration: underline; }
.footer-copy { margin: 0; font-size: 0.8rem; letter-spacing: 0.03em; color: #8fa096; }

/* ---------- Cookie bar ---------- */

.vd-cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(880px, calc(100% - 24px));
  padding: 14px 18px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
}
.vd-cookie-bar[hidden] { display: none; }
.vd-cookie-bar p { margin: 0; }
.vd-cookie-bar a { color: var(--brass-ink); }
.vd-cookie-actions { display: flex; gap: 8px; flex: none; }
.vd-btn {
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  color: #17211c;
  background: #c9a468;
  border: 1px solid #c9a468;
  border-radius: 2px;
  transition: background 0.18s ease, transform 0.14s var(--ease-out);
}
.vd-btn:hover { background: #d8b57c; }
.vd-btn:active { transform: scale(0.98); }
.vd-btn-ghost { color: var(--ink); background: transparent; border-color: var(--border-strong); }
.vd-btn-ghost:hover { background: var(--surface); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  :root { --sidebar-w: 258px; }
  .sidebar { padding-left: 18px; }
  .row-title { font-size: 1.22rem; }
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(322px, 86vw);
    height: auto;
    padding: 20px 18px 40px 22px;
    background: var(--surface-2);
    border-right: 1px solid var(--border-strong);
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease-drawer);
    z-index: 45;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 44px rgba(0, 0, 0, 0.28); }
  .search { width: auto; flex: 1; max-width: none; }
  .hero { min-height: 420px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .step { padding-right: 18px; }
}

@media (max-width: 700px) {
  :root { --hero-img: url('/assets/hero-sm.webp'); }
}

@media (max-width: 600px) {
  body { font-size: 1.06rem; }
  .header-inner { gap: 10px; padding: 0 14px; }
  .brand-tag { display: none; }
  .brand-name { font-size: 1.2rem; }
  .brand-mark { width: 26px; height: 26px; }
  .search input { height: 36px; font-size: 0.86rem; }
  .search input::placeholder { color: transparent; }

  .hero { min-height: 400px; align-items: flex-end; }
  .hero-inner { padding: 30px 20px 34px; }
  .hero h1 { font-size: clamp(1.72rem, 7.4vw, 2.15rem); }
  .hero-lead { font-size: 0.98rem; }
  .hero-brand span { font-size: 1.2rem; letter-spacing: 0.16em; }

  .home-body { padding: 0 18px 20px; }
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0 10px;
    padding: 14px 0;
    border-right: 0;
    border-top: 1px solid var(--border);
  }
  .step:nth-child(2) { border-right: 0; }
  .step-num { grid-row: span 2; padding-top: 2px; }
  .step h3 { margin: 0 0 3px; }
  .step p { grid-column: 2; }

  .home-section { padding-top: 38px; }
  .row-title { font-size: 1.14rem; }
  .row-excerpt { font-size: 0.88rem; }
  .article-row { padding: 14px 0; gap: 12px; }

  .article-wrap { padding: 24px 18px 34px; }
  .content p, .content li { font-size: 1.02rem; }
  .content h2 { font-size: 1.5rem; }
  .toc { padding: 14px 16px; }

  .article-nav a { max-width: 100%; }
  .article-nav a.next { text-align: left; margin-left: 0; }

  .vd-cookie-bar { flex-direction: column; align-items: stretch; gap: 12px; bottom: 10px; padding: 14px; }
  .vd-cookie-actions { justify-content: flex-end; }
}

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