:root {
  --bg: #13131F;
  --text: #EFEADC;
  --accent: #4ADE80;

  --raised: color-mix(in srgb, var(--text) 4%, var(--bg));
  --raised-2: color-mix(in srgb, var(--text) 8%, var(--bg));
  --line: color-mix(in srgb, var(--text) 11%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 22%, transparent);
  --muted: color-mix(in srgb, var(--text) 64%, var(--bg));
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t: 320ms;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --head-h: 108px;
  --wide: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 64px); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
input { caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
kbd { font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600; transition: top var(--t-fast); }
.skip:focus { top: 10px; }

/* Ambient background */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60vw 45vh at 85% -10%, color-mix(in srgb, #6366f1 14%, transparent), transparent 70%),
              radial-gradient(40vw 35vh at -5% 105%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}

/* Header (aligned to --wide + --gutter) */
.head {
  position: sticky; top: 0; z-index: 30; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.head-row { max-width: var(--wide); margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; flex: none; }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.brand b { color: var(--accent); font-weight: 800; }

/* Global search in top-right */
.global-search { position: relative; width: clamp(210px, 28vw, 340px); }
.global-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; transition: stroke var(--t-fast); pointer-events: none; }
.global-search input {
  width: 100%; height: 38px; padding: 0 36px 0 36px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); font: inherit; font-size: 0.9rem;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.global-search input::placeholder { color: var(--muted); }
.global-search input:focus { border-color: var(--accent); background: var(--raised-2); outline: 2px solid var(--accent); outline-offset: 2px; }
.global-search:focus-within svg { stroke: var(--accent); }
.global-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.tabs-shell { position: relative; max-width: var(--wide); margin: 0 auto; display: flex; align-items: center; }
.tabs-shell::before,
.tabs-shell::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 56px; z-index: 2; pointer-events: none;
  opacity: 0; transition: opacity var(--t-fast);
}
.tabs-shell::before { left: 0; background: linear-gradient(to right, var(--bg) 35%, transparent); }
.tabs-shell::after { right: 0; background: linear-gradient(to left, var(--bg) 35%, transparent); }
.tabs-shell.can-left::before { opacity: 1; }
.tabs-shell.can-right::after { opacity: 1; }

.tabs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--bg) 92%, var(--text));
  color: var(--text); display: grid; place-items: center; padding: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease);
}
.tabs-arrow svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tabs-arrow:hover { color: var(--accent); border-color: var(--accent); background: var(--raised-2); }
.tabs-arrow:active { transform: translateY(-50%) scale(0.92); }
.tabs-prev { left: 0; }
.tabs-next { right: 0; }

.tabs { position: relative; flex: 1; min-width: 0; height: 46px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--muted); font-size: 0.9rem; font-weight: 500; transition: color var(--t-fast); }
.tab:first-of-type { padding-left: 0; }
.tab:last-of-type { padding-right: 36px; }
.tab svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); }
.tab-bm { margin-left: auto; }
.tab-bm.active svg { fill: currentColor; }
.tab-badge { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 999px; line-height: 1.3; }
.tabs-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); border-radius: 2px 2px 0 0; transform: translateX(0); transition: transform var(--t) var(--ease), width var(--t) var(--ease), opacity var(--t-fast); opacity: 0; }

main { position: relative; z-index: 1; flex: 1; outline: none; padding: 0 var(--gutter) 72px; }
.view-in { animation: viewIn 420ms var(--ease) both; }
.view-out { animation: viewOut 140ms ease-in both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes viewOut { to { opacity: 0; transform: translateY(-6px); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line-strong); background: transparent; padding: 9px 16px; border-radius: 10px; font-weight: 500; font-size: 0.9rem; transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast); }
.btn:hover { background: var(--raised-2); }
.btn:active { transform: scale(0.96); }
.btn.cta { background: var(--accent); color: var(--bg); border-color: var(--accent); padding: 14px 26px; font-size: 1rem; font-weight: 600; }
.btn.cta:hover { background: color-mix(in srgb, var(--accent) 88%, white); transform: translateY(-2px); }
.btn.cta svg { width: 18px; height: 18px; transition: transform var(--t) var(--ease); }
.btn.cta:hover svg { transform: translateY(3px); }
.btn.danger { background: #f87171; border-color: #f87171; color: #1b0f0f; }

/* Home */
.hero { position: relative; max-width: var(--wide); margin: 0 auto; padding: clamp(56px, 11vh, 112px) 0 clamp(48px, 8vh, 80px); }
.hero > :not(.hero-grid) { position: relative; z-index: 1; }
.hero-grid {
  position: absolute; inset: 0 calc(50% - 50vw); z-index: 0; pointer-events: none; opacity: 0.055;
  background-image: linear-gradient(var(--text) 1px, transparent 1px), linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 85% at 50% 45%, #000 30%, transparent 85%);
}
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 7.2vw, 5.4rem); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 24px; max-width: 14ch; text-wrap: balance; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; }
.hero h1 .w > span { display: inline-block; transform: translateY(105%); animation: rise 800ms var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 80ms); }
@keyframes rise { to { transform: none; } }
.hero p { max-width: 54ch; color: var(--muted); font-size: 1.125rem; margin: 0 0 32px; opacity: 0; animation: fade 700ms 420ms var(--ease) forwards; }
.hero .actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; opacity: 0; animation: fade 700ms 520ms var(--ease) forwards; }
.hero .stat { color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.hero .stat strong { color: var(--text); font-weight: 600; }
.hero .stat-link { transition: color var(--t-fast); }
.hero .stat-link svg { width: 15px; height: 15px; stroke: var(--accent); fill: var(--accent); stroke-width: 1.9; }
.hero .stat-link:hover, .hero .stat-link:hover strong { color: var(--accent); }
@keyframes fade { to { opacity: 1; } }

.topics-head { max-width: var(--wide); margin: 0 auto 8px; font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.rows { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 56px; }
.row { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 4px; border-bottom: 1px solid var(--line); transition: padding var(--t) var(--ease); }
.row::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: calc(var(--p, 0) * 1%); background: var(--accent); transition: width 900ms var(--ease); }
.row .row-ico { width: 20px; height: 20px; flex: none; stroke: var(--muted); fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--t-fast); }
.row .nm { flex: 1; font-family: var(--display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; transition: color var(--t-fast); }
.row .meta { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; text-align: right; display: inline-flex; align-items: center; gap: 12px; }
.row .meta-bm { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-family: var(--mono); font-size: 0.78rem; }
.row .meta-bm svg { width: 13px; height: 13px; stroke: currentColor; fill: currentColor; stroke-width: 2; }
.row .arr { width: 18px; height: 18px; flex: none; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t) var(--ease), stroke var(--t-fast); }
.row:hover { padding-left: 12px; }
.row:hover .nm { color: var(--accent); }
.row:hover .row-ico, .row:hover .arr { stroke: var(--accent); }
.row:hover .arr { transform: translateX(4px); }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease), transform 600ms var(--ease), padding var(--t) var(--ease); transition-delay: var(--d, 0ms), var(--d, 0ms), 0ms; }
.reveal.in { opacity: 1; transform: none; }
.foot { max-width: var(--wide); margin: 64px auto 0; color: var(--muted); font-size: 0.85rem; }

/* Compact single-row Topic & search header (left: icon + title, right: count + % + bar + reset) */
.topic-head {
  max-width: var(--wide); margin: 0 auto; padding: 26px 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topic-title-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.topic-head h2 {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display); font-weight: 800; font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.025em; line-height: 1.1; margin: 0;
}
.topic-head h2 svg { width: 26px; height: 26px; flex: none; stroke: var(--accent); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.filter-status { color: var(--muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; }

.progress { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.prog-meta { display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; font-size: 0.86rem; color: var(--muted); }
.prog-pct { font-family: var(--mono); font-weight: 600; font-size: 0.92rem; color: var(--accent); }
.progress .bar { width: 110px; height: 5px; border-radius: 99px; background: var(--raised-2); overflow: hidden; flex: none; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 700ms var(--ease); }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color var(--t-fast); }
.link-btn:hover { color: var(--text); }

.tag-active { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px 2px 11px; font-size: 0.78rem; font-family: var(--mono); transition: background var(--t-fast); }
.tag-active:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.tag-active svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }

.filter-pills { display: inline-flex; align-items: center; gap: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.pill { border: 0; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 500; padding: 3px 11px; border-radius: 999px; transition: color var(--t-fast), background var(--t-fast); }
.pill:hover { color: var(--text); }
.pill.active { background: var(--accent-soft); color: var(--accent); }

.cat-topic-link { display: inline-flex; align-items: center; gap: 8px; }
.cat-topic-link svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cat-topic-link:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

/* Category groups */
.cat-group { max-width: var(--wide); margin: 0 auto 32px; }
.cat-group:last-of-type { margin-bottom: 0; }
.cat-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 24px 0 8px; padding: 0 2px;
}
.cat-group:first-of-type .cat-head { margin-top: 6px; }
.cat-head h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.08rem;
  letter-spacing: -0.015em; color: var(--accent); margin: 0;
}
.cat-head .cat-cnt { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.qlist { max-width: var(--wide); margin: 0 auto; border-top: 1px solid var(--line); }
.q { border-bottom: 1px solid var(--line); animation: qin 560ms var(--ease) both; animation-delay: var(--d, 0ms); transition: opacity 260ms var(--ease); }
@keyframes qin { from { opacity: 0; transform: translateY(12px); } }
.q.leaving { opacity: 0; }
.q-head { display: flex; align-items: flex-start; gap: 6px; }
.q-toggle { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 14px; background: none; border: 0; padding: 18px 4px 18px 2px; text-align: left; border-radius: 8px; }
.bm-btn { flex: none; margin-top: 14px; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease); }
.bm-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: fill var(--t-fast), stroke var(--t-fast); }
.bm-btn:hover { color: var(--text); background: var(--raised-2); }
.bm-btn.active { color: var(--accent); }
.bm-btn.active svg { fill: var(--accent); stroke: var(--accent); }
.bm-btn.celebrate { animation: ping 420ms var(--ease); }
.q-toggle:focus-visible { outline-offset: -2px; }
.q-n { flex: none; width: 2.4ch; padding-top: 0.2em; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color var(--t-fast); }
.q-title { flex: 1; font-size: 1.04rem; font-weight: 500; line-height: 1.5; transition: color var(--t-fast); }
.q-title code { font-family: var(--mono); font-size: 0.9em; }
.q-topic-pill { flex: none; font-family: var(--mono); font-size: 0.72rem; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; margin-top: 3px; }
.chev { flex: none; width: 20px; height: 20px; margin-top: 3px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t) var(--ease), stroke var(--t-fast); }
.q-toggle:hover .q-title, .q.open .q-title { color: var(--accent); }
.q-toggle:hover .chev { stroke: var(--text); }
.q.open .chev { transform: rotate(180deg); stroke: var(--accent); }
.q.open .q-n { color: var(--accent); }
.q.done .q-title { color: var(--muted); }
.q.done.open .q-title, .q.done .q-toggle:hover .q-title { color: var(--accent); }
@keyframes pop { 40% { transform: scale(1.4) rotate(14deg); } }

.q-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--t) var(--ease), opacity var(--t) var(--ease); }
.q.open .q-body { grid-template-rows: 1fr; opacity: 1; }
.q-body > div { overflow: hidden; min-height: 0; }
.q-inner { padding: 0 4px 24px 38px; }
.answer { max-width: 72ch; }
.answer p { margin: 0 0 12px; color: color-mix(in srgb, var(--text) 92%, var(--bg)); }
.answer code { font-family: var(--mono); background: var(--raised-2); padding: 1px 6px; border-radius: 5px; font-size: 0.86em; color: var(--accent); }

/* Examples (code, text callout, explanation) & Mermaid diagrams */
.code { position: relative; margin: 14px 0 0; max-width: 78ch; }
.code pre { margin: 0 !important; padding: 16px 18px !important; border-radius: 12px !important; border: 1px solid var(--line); background: #0c0c16 !important; font-size: 0.84rem !important; line-height: 1.65 !important; }
.code code[class*="language-"] { font-family: var(--mono) !important; background: none; color: inherit; padding: 0; }
.ex-text {
  margin: 14px 0 0; max-width: 78ch; padding: 13px 16px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--line);
  color: color-mix(in srgb, var(--text) 88%, var(--bg)); font-size: 0.92rem; white-space: pre-line;
}
.ex-note {
  margin: 8px 0 0; max-width: 76ch; color: var(--muted); font-size: 0.85rem; line-height: 1.5;
}
.diagram-box {
  margin: 14px 0 0; max-width: 78ch; padding: 18px 16px; border-radius: 12px;
  background: #0c0c16; border: 1px solid var(--line); overflow-x: auto;
  display: flex; justify-content: center;
}
.diagram-box svg { max-width: 100%; height: auto; }
.diagram-box pre.mermaid-src {
  margin: 0; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); white-space: pre-wrap;
}

.copy { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; background: var(--raised-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 0.75rem; color: var(--muted); transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.copy:hover { color: var(--text); border-color: var(--line-strong); }
.copy:active { transform: scale(0.94); }
.copy svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy .ok { display: none; }
.copy.done { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.copy.done .cp { display: none; }
.copy.done .ok { display: block; animation: pop 420ms var(--ease); }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; max-width: 78ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 999px; padding: 2px 11px; font-size: 0.76rem; font-family: var(--mono); transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 0.9rem; color: var(--muted); transition: color var(--t-fast); }
.check:hover { color: var(--text); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; transition: background var(--t-fast), border-color var(--t-fast); }
.check .box svg { width: 14px; height: 14px; stroke: var(--bg); stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 320ms var(--ease) 60ms; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { stroke-dashoffset: 0; }
.check input:checked ~ .lab { color: var(--accent); }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 3px; }
.check.celebrate .box { animation: ping 420ms var(--ease); }
@keyframes ping { 40% { transform: scale(1.25); } }

.empty { max-width: var(--wide); margin: 56px auto; text-align: center; color: var(--muted); animation: viewIn 320ms var(--ease); }
.empty h3 { font-family: var(--display); font-size: 1.4rem; color: var(--text); margin: 0 0 8px; }
.empty p { margin: 0 0 20px; }

.skel { height: 60px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, transparent 30%, var(--raised) 50%, transparent 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Toasts + dialog */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--raised-2); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem; box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6); animation: toastIn 360ms var(--ease) both; }
.toast.out { animation: toastOut 260ms ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
dialog { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; padding: 24px; max-width: 380px; box-shadow: 0 24px 60px -12px #000; }
dialog::backdrop { background: rgba(8, 8, 14, 0.7); }
dialog[open] { animation: viewIn 300ms var(--ease); }
dialog p { margin: 0; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Footer */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 24px var(--gutter);
  background: color-mix(in srgb, var(--bg) 94%, var(--text));
}
.site-footer-inner {
  max-width: var(--wide); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-meta { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.footer-author strong { color: var(--text); font-weight: 600; }
.footer-dot { color: var(--line-strong); }
.footer-socials { display: inline-flex; align-items: center; gap: 8px; }
.social-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--raised);
  color: var(--muted); font-size: 0.84rem; font-weight: 500;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease);
}
.social-link svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.social-link:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); transform: translateY(-1px); }

@media (max-width: 760px) {
  .rows { grid-template-columns: 1fr; }
  .row .nm { font-size: 1.25rem; }
  .q-inner { padding-left: 2px; }
  .global-search { width: clamp(160px, 48vw, 240px); }
  .global-search kbd { display: none; }
  .global-search input { padding-right: 12px; }
  .progress { margin-left: 0; }
  .toasts { left: 20px; right: 20px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-dot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .hero h1 .w > span, .hero p, .hero .actions { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
}
