/* ============================================================
   AngielskiProsto - design system
   Paleta: teal (zaufanie edukacyjne) + bursztyn (motywacja)
           + krem (papier podręcznika)
   Typografia: Merriweather (display, książkowy serif)
               + Work Sans (body, przyjazny grotesk)
   ============================================================ */

:root {
  --bg: #f7f5f0;
  --bg-soft: #efede6;
  --bg-card: #fffdf9;
  --teal-mist: #dcece9;
  --teal-mist-soft: #e9f2f0;
  --ink: #1c2424;
  --ink-soft: #33403f;
  --muted: #5d6b69;
  --accent: #0f6b63;
  --accent-strong: #0b5750;
  --accent-soft: rgba(15, 107, 99, 0.09);
  --accent-line: rgba(15, 107, 99, 0.25);
  --gold: #92400e;
  --gold-bright: #b45309;
  --gold-soft: rgba(180, 83, 9, 0.1);
  --gold-line: rgba(180, 83, 9, 0.3);
  --border: #e4e0d6;
  --ok: #1e6b4e;
  --ok-bg: rgba(30, 107, 78, 0.09);
  --warn: #9a4a12;
  --warn-bg: rgba(217, 119, 6, 0.11);
  --bad: #8c2f39;
  --bad-bg: rgba(140, 47, 57, 0.08);
  --header-h: 62px;
  --sidebar-w: 280px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(28, 36, 36, 0.05), 0 4px 18px rgba(28, 36, 36, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(28, 36, 36, 0.06), 0 12px 30px rgba(15, 107, 99, 0.14);
  --font-display: "Merriweather", Georgia, serif;
  --font-body: "Work Sans", system-ui, sans-serif;
  --transition: all 0.2s ease-out;
  --body-grad-1: radial-gradient(600px 400px at 92% -60px, rgba(220, 236, 233, 0.85), transparent 70%);
  --body-grad-2: radial-gradient(700px 500px at -10% 110%, rgba(180, 83, 9, 0.1), transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1515;
    --bg-soft: #131c1b;
    --bg-card: #16201f;
    --teal-mist: #1c2e2c;
    --teal-mist-soft: #182522;
    --ink: #e2e8e7;
    --ink-soft: #c3cdcb;
    --muted: #8fa09d;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --accent-line: rgba(45, 212, 191, 0.3);
    --gold: #f59e0b;
    --gold-bright: #fbbf24;
    --gold-soft: rgba(245, 158, 11, 0.12);
    --gold-line: rgba(245, 158, 11, 0.3);
    --border: #243330;
    --ok: #5fae8b;
    --ok-bg: rgba(95, 174, 139, 0.12);
    --warn: #e8a35c;
    --warn-bg: rgba(232, 163, 92, 0.12);
    --bad: #e07a86;
    --bad-bg: rgba(224, 122, 134, 0.12);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 30px rgba(45, 212, 191, 0.13);
    --body-grad-1: radial-gradient(600px 400px at 92% -60px, rgba(28, 46, 44, 0.9), transparent 70%);
    --body-grad-2: radial-gradient(700px 500px at -10% 110%, rgba(245, 158, 11, 0.05), transparent 70%);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--body-grad-1), var(--body-grad-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.24; text-wrap: balance; margin: 0 0 0.6em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

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

/* ---------- Header ---------- */
.app-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 200;
  background: var(--bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  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, var(--accent-line), transparent);
  opacity: 0.6; pointer-events: none;
}
.header-inner {
  max-width: 1500px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 22px; padding: 0 22px;
}
.mark {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; flex-shrink: 0;
}
.mark:hover { text-decoration: none; }
.mark-bubble { fill: var(--accent); flex-shrink: 0; }
.mark em { font-style: normal; color: var(--accent); }
.header-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
#search-input {
  width: 100%; padding: 9px 16px 9px 38px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
  transition: var(--transition);
  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='%235d6b69' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center;
}
#search-input:focus { outline: none; border-color: var(--accent); background-color: var(--bg-card); box-shadow: inset 0 0 0 1px var(--accent); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 250;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover); overflow: hidden; max-height: 420px; overflow-y: auto;
}
.sr-item { display: block; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--accent-soft); text-decoration: none; }
.sr-item .sr-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.sr-item:hover .sr-title { color: var(--accent); }
.sr-item .sr-meta { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sr-empty { padding: 14px 16px; color: var(--muted); font-size: 0.92rem; }

.burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; margin-left: auto; flex-shrink: 0;
  background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.burger span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: var(--transition); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */
.page-wrap { display: flex; max-width: 1500px; margin: 0 auto; padding-top: var(--header-h); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; width: var(--sidebar-w);
  padding: 20px 14px 28px; overflow-y: auto; z-index: 150;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 18px; }
.side-group-title {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold);
  padding: 0 10px; margin: 0 0 6px;
}
.side-links { display: flex; flex-direction: column; gap: 1px; }
.sidebar-link {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 0.9rem; line-height: 1.35; color: var(--ink-soft);
  padding: 5px 10px; border-radius: 8px; transition: var(--transition);
}
.sidebar-link .sl-ic { font-size: 0.82rem; flex-shrink: 0; }
.sidebar-link:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-note {
  margin-top: 22px; padding: 12px 14px; font-size: 0.8rem; line-height: 1.5; color: var(--muted);
  background: var(--teal-mist-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; gap: 8px; align-items: flex-start;
}
.sn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); padding: 30px 42px 60px; }

/* ---------- Hero (home) ---------- */
.home-hero {
  position: relative;
  border-radius: var(--radius);
  padding: 46px 48px 40px;
  background:
    radial-gradient(520px 300px at 88% 8%, rgba(220, 236, 233, 0.9), transparent 70%),
    linear-gradient(135deg, var(--bg-card), var(--teal-mist-soft));
  border: 1px solid var(--border);
  overflow: hidden;
}
.home-hero .hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gold);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.home-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); margin-bottom: 14px; }
.home-hero h1 .hl { color: var(--accent); font-style: italic; }
.home-hero .hero-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 620px; margin-bottom: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(15, 107, 99, 0.3); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 8px 24px rgba(15, 107, 99, 0.38); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); border-width: 1.5px; }
.btn-ghost:hover { background: var(--accent-soft); }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 26px; margin-top: 30px; padding-top: 22px;
  border-top: 1px solid var(--border);
}
.hs-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.hs-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.hero-art { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); width: 250px; }
.hero-art::before {
  content: ''; position: absolute; inset: 10% 14%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(8px); pointer-events: none;
}

/* Signature: speech bubble z maszyną do pisania */
.speech-bubble {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-card-hover);
}
.speech-bubble::after {
  content: ''; position: absolute; left: 34px; bottom: -13px;
  width: 20px; height: 20px;
  background: var(--bg-card);
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  border-radius: 0 0 6px 0;
}
.sb-label {
  display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.sb-text {
  min-height: 3.2em;
  font-family: var(--font-display); font-size: 1.12rem; font-style: italic;
  line-height: 1.55; color: var(--ink);
}
.sb-caret {
  display: inline-block; width: 2px; height: 1.05em;
  background: var(--accent); vertical-align: -0.15em; margin-left: 2px;
  animation: caretBlink 0.9s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.sb-chip {
  position: absolute;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid var(--gold-line);
  box-shadow: var(--shadow-card);
  animation: chipFloat 5s ease-in-out infinite;
}
.sb-chip.c1 { top: -14px; left: -18px; animation-delay: 0.4s; }
.sb-chip.c2 { bottom: 30px; right: -20px; animation-delay: 1.6s; }
.sb-chip.c3 { top: 40%; right: -28px; animation-delay: 2.8s; }
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- Home sections ---------- */
.home-section { margin-top: 46px; }
.home-section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.home-section-head h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.home-section-head .sec-count { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.home-section-head::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.home-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--gold-bright));
  opacity: 0; transition: opacity 0.2s ease-out;
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); text-decoration: none; }
.home-card:hover::before { opacity: 1; }
.hc-icon {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.25rem;
  background: var(--accent-soft); border-radius: 11px;
}
.hc-title { font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; line-height: 1.4; color: var(--ink); }
.home-card:hover .hc-title { color: var(--accent); }
.hc-excerpt { font-size: 0.85rem; line-height: 1.55; color: var(--muted); margin: 0; flex: 1; }
.hc-arrow { position: absolute; right: 14px; top: 16px; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: var(--transition); }
.home-card:hover .hc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- Article page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .crumb-sep { opacity: 0.5; }
.article-head { margin-bottom: 26px; }
.article-tag {
  display: inline-block; font-family: var(--font-body); font-size: 0.76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--gold);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.article-head h1 { margin-bottom: 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.85rem; color: var(--muted); }
.article-meta .am-icon { margin-right: 4px; }

.toc {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 0 0 30px;
}
.toc summary {
  cursor: pointer; font-weight: 700; color: var(--ink); font-size: 0.98rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: '▸'; color: var(--accent); transition: transform 0.2s ease-out; }
.toc[open] summary::before { transform: rotate(90deg); }
.toc ol { margin: 12px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.toc a { color: var(--ink-soft); font-size: 0.92rem; }
.toc a:hover { color: var(--accent); }

.content-article { max-width: 780px; }
.content-article h2 {
  margin-top: 1.8em; padding-top: 0.4em; scroll-margin-top: calc(var(--header-h) + 18px);
}
.content-article h2::before { content: ''; display: block; width: 44px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--gold-bright)); margin-bottom: 10px; }
.content-article h3 { margin-top: 1.4em; scroll-margin-top: calc(var(--header-h) + 18px); }
.content-article p { color: var(--ink-soft); }
.content-article ul, .content-article ol { color: var(--ink-soft); padding-left: 1.4em; margin-bottom: 1em; }
.content-article li { margin-bottom: 0.4em; }
.content-article strong { color: var(--ink); }
.content-article a { text-decoration: underline; text-underline-offset: 3px; }
.content-article a:hover { text-decoration-thickness: 2px; }

/* Przykłady angielskie - styl "podręcznik" */
.content-article .eng {
  font-style: italic; font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px; padding: 1px 5px;
}
.content-article .eng::before { content: '“'; }
.content-article .eng::after { content: '”'; }

/* Tables */
.table-responsive { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: var(--bg-card); }
caption { text-align: left; padding: 10px 14px; font-weight: 700; color: var(--ink); font-size: 0.95rem; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 700; color: var(--ink); background: var(--accent-soft); font-size: 0.88rem; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--teal-mist-soft); }
td:first-child { font-weight: 600; color: var(--ink); }
.compare-table td.best { background: var(--ok-bg); font-weight: 600; color: var(--ok); }

/* Callout boxes */
.info-box, .tip-box, .warning-box {
  border-radius: var(--radius-sm); padding: 16px 18px 16px 52px; margin: 1.4em 0;
  position: relative; font-size: 0.96rem; line-height: 1.65; color: var(--ink-soft);
}
.info-box::before, .tip-box::before, .warning-box::before {
  content: ''; position: absolute; left: 18px; top: 18px; width: 20px; height: 20px;
  background-size: contain; background-repeat: no-repeat;
}
.info-box { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.info-box::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6b63' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E"); }
.tip-box { background: var(--gold-soft); border: 1px solid var(--gold-line); }
.tip-box::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12.7c.8.6 1.3 1.5 1.4 2.5h5.2c.1-1 .6-1.9 1.4-2.5A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.warning-box { background: var(--warn-bg); border: 1px solid rgba(217, 119, 6, 0.35); }
.warning-box::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a4a12' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 12px; background: var(--bg-card); }
.faq-item h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; margin: 0 0 8px; color: var(--ink); }
.faq-item h3::before { content: 'Q: '; color: var(--accent); }
.faq-item p { margin: 0; font-size: 0.95rem; }

/* Glossary */
.glossary dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 22px; margin: 0; }
.glossary dt { font-weight: 700; color: var(--accent); font-size: 0.95rem; padding: 8px 0; }
.glossary dd { margin: 0; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; color: var(--ink-soft); }

/* Prev / next */
.prevnext { display: flex; gap: 14px; margin-top: 44px; }
.pn-card {
  flex: 1; display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px; transition: var(--transition);
}
.pn-card:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }
.pn-card .pn-dir { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); font-family: var(--font-body); font-weight: 700; }
.pn-card .pn-title { font-weight: 700; color: var(--ink); font-size: 0.95rem; margin-top: 3px; }
.pn-card.next { text-align: right; }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border); background: var(--bg); margin-left: var(--sidebar-w); }
.footer-inner {
  max-width: 1500px; margin: 0 auto; padding: 26px 42px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px;
  font-size: 0.85rem; color: var(--muted);
}
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.footer-brand em { font-style: normal; color: var(--accent); }
.footer-note { margin-left: auto; }

/* ---------- Motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-enter { animation: fadeUp 0.28s ease-out both; }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.reveal.on { opacity: 1; transform: translateY(0); }

@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; }
  .reveal { opacity: 1; transform: none; }
  .sb-caret { animation: none; opacity: 0; }
  .sb-chip { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-art { width: 200px; right: 20px; }
  .home-hero { padding-right: 210px; }
}
@media (max-width: 900px) {
  .burger { display: flex; }
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.25s ease-out, visibility 0.25s;
    visibility: hidden;
    box-shadow: 4px 0 30px rgba(14, 21, 21, 0.18);
  }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .main { margin-left: 0; padding: 24px 18px 50px; }
  .app-footer { margin-left: 0; }
  .footer-inner { padding: 22px 18px; }
  .overlay { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(14, 21, 21, 0.5); z-index: 140; }
  .home-hero { padding: 34px 26px 30px; }
  .hero-art { display: none; }
  .hero-stats { gap: 18px; }
}
@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .mark { font-size: 1.18rem; }
  .header-search { max-width: none; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .prevnext { flex-direction: column; }
  .home-section-head { flex-wrap: wrap; gap: 6px; }
  .glossary dl { grid-template-columns: 1fr; gap: 0; }
  .glossary dt { padding-bottom: 2px; }
  .glossary dd { padding-top: 2px; }
}
