:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-card: #21262d;
  --border-default: #30363d;
  --border-muted: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-blue: #58a6ff;
  --accent-blue-emphasis: #1f6feb;
  --accent-green: #3fb950;
  --accent-purple: #bc8cff;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-cyan: #39d2c0;
  --link-color: #58a6ff;
  --sidebar-width: 280px;
  --header-height: 60px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 3px 6px rgba(0,0,0,.4);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated cloud / code background ── */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation .cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .06;
  animation: floatCloud 25s ease-in-out infinite alternate;
}

.bg-animation .cloud:nth-child(1) { width: 500px; height: 300px; background: var(--accent-blue); top: 10%; left: -5%; animation-duration: 30s; }
.bg-animation .cloud:nth-child(2) { width: 400px; height: 250px; background: var(--accent-purple); top: 50%; right: -5%; animation-duration: 22s; animation-delay: -5s; }
.bg-animation .cloud:nth-child(3) { width: 350px; height: 200px; background: var(--accent-cyan); bottom: 10%; left: 30%; animation-duration: 28s; animation-delay: -10s; }

@keyframes floatCloud {
  0% { transform: translateY(0) translateX(0) scale(1); }
  50% { transform: translateY(-30px) translateX(20px) scale(1.1); }
  100% { transform: translateY(10px) translateX(-15px) scale(0.95); }
}

/* ── Code rain effect ── */
.code-rain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .03;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-green);
  overflow: hidden;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(13,17,23,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.header-logo svg { width: 32px; height: 32px; fill: var(--text-primary); }

.header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: block;
  object-fit: contain;
}

.header-logo .logo-text {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.header-logo .logo-text .muted { color: var(--text-secondary); font-weight: 400; }

/* ── Star on GitHub button ── */
.star-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}

.star-btn:hover {
  border-color: var(--accent-orange);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.star-btn svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.star-btn .star-emoji { font-size: 13px; line-height: 1; }

/* ── Search button (opens the search modal, see assets/js/search.js) ── */
.search-btn {
  display: inline-flex;
  align-items: center;
  align-self: stretch; /* match the Star button's height */
  gap: 8px;
  padding: 5px 6px 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}

.search-btn:hover {
  border-color: var(--accent-blue);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-btn svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.search-btn .search-label { min-width: 72px; text-align: left; }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 5px;
  border: 1px solid var(--border-default);
  border-bottom-color: var(--text-muted);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  box-shadow: inset 0 -1px 0 var(--border-default);
}

/* ── Search modal ── */
.search-modal {
  width: min(640px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  margin: clamp(40px, 10vh, 110px) auto 0;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(1,4,9,.75);
  overflow: hidden;
}

.search-modal::backdrop { background: rgba(1,4,9,.6); backdrop-filter: blur(2px); }
.search-modal[open] { animation: sm-in .15s ease-out; }

@keyframes sm-in {
  from { opacity: 0; transform: translateY(-6px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.sm-inner { display: flex; flex-direction: column; max-height: inherit; }

.sm-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
}

.sm-icon { display: flex; color: var(--text-muted); }
.sm-icon svg { width: 16px; height: 16px; fill: currentColor; }

.sm-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: var(--text-primary);
}

.sm-input::placeholder { color: var(--text-muted); }
.sm-input::-webkit-search-cancel-button { display: none; }

.sm-close {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 2px 7px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.sm-close:hover { background: var(--bg-card); color: var(--text-primary); }

.sm-status {
  margin: 0;
  padding: 10px 16px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.sm-results {
  list-style: none;
  margin: 0;
  padding: 6px 8px 8px;
  overflow-y: auto;
  flex: 1;
}

.sm-hit + .sm-hit { margin-top: 2px; }

.sm-hit a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  color: var(--text-primary);
  transition: background .15s, border-color .15s;
}

.sm-hit a:hover { text-decoration: none; background: var(--bg-tertiary); }

.sm-hit.active a {
  background: rgba(88,166,255,.12);
  border-left-color: var(--accent-blue);
}

.sm-crumb { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 1px; }
.sm-title { display: block; font-weight: 600; font-size: 14px; line-height: 1.4; }

.sm-snippet {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sm-results mark {
  background: rgba(210,153,34,.3);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.sm-foot {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 16px;
  border-top: 1px solid var(--border-default);
  font-size: 12px;
  color: var(--text-secondary);
}

.sm-foot kbd { margin-right: 3px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: color .15s, background .15s;
}

.header-nav a:hover, .header-nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
}

/* ── Layout ── */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-default);
  padding: 20px 0;
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
  transition: transform .3s ease;
}

.sidebar-section { margin-bottom: 8px; }

.sidebar-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-left: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.sidebar-link.active {
  color: var(--text-primary);
  border-left-color: var(--accent-blue);
  background: rgba(88,166,255,.08);
}

.sidebar-link .badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 48px 80px;
}

/* ── Typography ── */
h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 12px;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--accent-blue);
}

h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
}

p { margin-bottom: 16px; color: var(--text-secondary); }
p strong { color: var(--text-primary); }

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0 0 16px 24px; color: var(--text-secondary); }
li { margin-bottom: 6px; }
li::marker { color: var(--text-muted); }

/* ── Subtitle / lead ── */
.lead {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* ── Cards grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}

.card-icon.blue { background: rgba(88,166,255,.15); color: var(--accent-blue); }
.card-icon.green { background: rgba(63,185,80,.15); color: var(--accent-green); }
.card-icon.purple { background: rgba(188,140,255,.15); color: var(--accent-purple); }
.card-icon.orange { background: rgba(210,153,34,.15); color: var(--accent-orange); }
.card-icon.cyan { background: rgba(57,210,192,.15); color: var(--accent-cyan); }
.card-icon.red { background: rgba(248,81,73,.15); color: var(--accent-red); }

.card h3 {
  font-size: 16px;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

.card .card-weight {
  margin-top: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ── Info / Tip / Warning boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 3px solid;
  font-size: 14px;
}

.callout p { margin-bottom: 8px; color: inherit; }
.callout p:last-child { margin-bottom: 0; }

.callout-title {
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout.info {
  background: rgba(88,166,255,.08);
  border-color: var(--accent-blue);
  color: var(--text-secondary);
}
.callout.info .callout-title { color: var(--accent-blue); }

.callout.tip {
  background: rgba(63,185,80,.08);
  border-color: var(--accent-green);
  color: var(--text-secondary);
}
.callout.tip .callout-title { color: var(--accent-green); }

.callout.warning {
  background: rgba(210,153,34,.08);
  border-color: var(--accent-orange);
  color: var(--text-secondary);
}
.callout.warning .callout-title { color: var(--accent-orange); }

.callout.danger {
  background: rgba(248,81,73,.08);
  border-color: var(--accent-red);
  color: var(--text-secondary);
}
.callout.danger .callout-title { color: var(--accent-red); }

/* ── Code blocks ── */
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

pre code { background: none; padding: 0; }

/* ── Table of Contents (in-page) ── */
.page-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}

.page-toc h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.page-toc ul { list-style: none; margin: 0; padding: 0; }

.page-toc li { margin-bottom: 4px; }

.page-toc a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all .15s;
}

.page-toc a:hover {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
}

.page-toc ul ul { margin-left: 16px; }

/* ── Progress bar for exam weights ── */
.weight-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.weight-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.weight-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

.weight-bar-label {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 55px;
  text-align: right;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .sep { color: var(--text-muted); }

/* ── Page navigation (prev / next) ── */
.page-nav {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-default);
}

.page-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s;
}

.page-nav a:hover { border-color: var(--accent-blue); }

.page-nav .nav-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.page-nav .nav-title {
  font-size: 15px;
  color: var(--accent-blue);
  font-weight: 500;
}

.page-nav .next { text-align: right; margin-left: auto; }

/* ── Disclaimer banner ── */
.disclaimer {
  background: rgba(210,153,34,.06);
  border: 1px solid rgba(210,153,34,.2);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin: 24px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.disclaimer strong { color: var(--accent-orange); }

/* ── Tags ── */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  margin-right: 4px;
}

.tag.blue { background: rgba(88,166,255,.15); color: var(--accent-blue); }
.tag.green { background: rgba(63,185,80,.15); color: var(--accent-green); }
.tag.purple { background: rgba(188,140,255,.15); color: var(--accent-purple); }
.tag.orange { background: rgba(210,153,34,.15); color: var(--accent-orange); }

/* ── Hero section ── */
.hero {
  text-align: center;
  padding: 48px 0 40px;
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(88,166,255,.35));
}

.hero h1 {
  font-size: 40px;
  border: none;
  padding: 0;
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead { max-width: 640px; margin: 0 auto 24px; }

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Exam stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-blue);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 4px;
}

/* ── Checklist ── */
.checklist { list-style: none; margin-left: 0; padding: 0; }

.checklist li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  border-bottom: 1px solid var(--border-muted);
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-default);
  border-radius: 3px;
  background: var(--bg-secondary);
}

/* ── Footer ── */
.site-footer {
  margin-left: var(--sidebar-width);
  padding: 44px 48px 28px;
  border-top: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-secondary); }

/* ── Footer: maintainer / author section ── */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  max-width: 1100px;
  margin: 0 auto 28px;
}

.footer-col { flex: 1 1 200px; min-width: 0; }
.footer-col-author { flex: 2.2 1 320px; }

.footer-col h5 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-col a:hover { color: var(--accent-blue); text-decoration: none; }

.maintainer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-green);
  background: rgba(63,185,80,.12);
  border: 1px solid rgba(63,185,80,.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.author-card { display: flex; gap: 14px; align-items: center; }

.author-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  object-fit: cover;
  flex-shrink: 0;
}

.author-card .ac-name { font-weight: 700; color: var(--text-primary); font-size: 15px; }
.author-card .ac-role { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.author-links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.author-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.author-links a:hover { background: var(--bg-tertiary); color: var(--text-primary); text-decoration: none; }
.author-links a svg, .author-links a img { width: 14px; height: 14px; flex: none; }

.star-cta {
  background: rgba(210,153,34,.08);
  border: 1px solid rgba(210,153,34,.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.star-cta strong { color: var(--accent-orange); }
.star-cta p { margin: 0 0 12px; line-height: 1.55; }

/* Buttons grow to fill their row, so however they wrap the rows end flush.
   Same pairing as the support callout on marcogrimaldi29.com. */
.support-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.support-actions a {
  display: inline-flex;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
}

.support-actions a:hover { text-decoration: none; transform: translateY(-1px); }
.support-actions svg { width: 16px; height: 16px; flex: none; }

.support-actions .support-star { background: var(--bg-tertiary); border-color: var(--border-default); color: var(--text-primary); }
.support-actions .support-star:hover { background: var(--bg-card); border-color: var(--accent-blue); color: var(--text-primary); }

/* LinkedIn's own blue in both themes, lightening on hover. */
.support-actions .support-linkedin { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.support-actions .support-linkedin:hover { background: #1275d1; border-color: #1275d1; color: #fff; }

/* Buy Me a Coffee's own brand colours, so the button reads as theirs; on hover
   the contour turns their near-black, doubled by an inset ring so it still
   shows against the dark callout. */
.support-actions .support-coffee { background: #ffdd00; border-color: #ffdd00; color: #0d0c22; }
.support-actions .support-coffee:hover { border-color: #0d0c22; box-shadow: inset 0 0 0 1px #0d0c22; color: #0d0c22; }

.issue-note {
  background: rgba(88,166,255,.08);
  border: 1px solid rgba(88,166,255,.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.issue-note strong { color: var(--accent-blue); }

/* Inline link inside the banner: undo the footer's block-link styling. */
.issue-note a { display: inline; padding: 0; font-size: inherit; color: var(--accent-blue); font-weight: 600; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-default);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

/* Wide tables scroll horizontally inside their own container instead of
   overflowing the page on narrow / not-full-size viewports. */
.table-wrap {
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table { margin: 0; }

th, td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border-default);
}

th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

td { color: var(--text-secondary); }

tr:hover td { background: rgba(88,166,255,.03); }

/* Footnote under a table (e.g. "* figures change over time") */
.table-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: -4px 0 16px;
}

.skill-section .table-note:last-child { margin-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .site-footer {
    margin-left: 0;
    padding: 32px 20px 24px;
  }

  .footer-col-author { flex-basis: 100%; }

  .footer-bottom { flex-direction: column; }

  /* Keep the Star button on the top bar; move the burger to the far right */
  .menu-toggle { display: block; order: 3; }

  .header-nav { order: 2; }

  .hero h1 { font-size: 28px; }

  .hero-title { gap: 10px; }

  .hero-logo { width: 38px; height: 38px; }

  .card-grid { grid-template-columns: 1fr; }

  .page-nav { flex-direction: column; }

  /* Stacked: let Next stretch full-width like Previous (auto margin is cross-axis here) */
  .page-nav .next { margin-left: 0; text-align: left; }
}

@media (max-width: 900px) {
  /* Touch-first widths: no keyboard hint, and the modal hugs the top */
  .search-btn .search-kbd { display: none; }
}

@media (max-width: 560px) {
  .search-modal { margin-top: 12px; max-height: calc(100vh - 24px); }
  .sm-foot { display: none; }
}

@media (max-width: 480px) {
  .star-btn .star-label { display: none; }

  /* Keep the full wordmark on a phone: the bar gives up padding, gaps and
     button chrome instead, and Search collapses to its icon. */
  .site-header { padding: 0 12px; gap: 6px; }
  .header-logo { gap: 8px; }
  .menu-toggle { padding: 6px 8px; }
  .star-btn { padding: 6px 8px; }
  .search-btn { padding: 6px 8px; }
  .search-btn .search-label { display: none; }
}

/* ── Sidebar overlay on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
}

.sidebar-overlay.show { display: block; }

/* ── Print ── */
@media print {
  .site-header, .sidebar, .bg-animation, .code-rain, .page-nav, .back-to-top, .home-fab { display: none; }
  .main-content { margin-left: 0; padding: 20px; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Resource links ── */
.resource-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.resource-list li {
  padding: 10px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-secondary);
  transition: border-color .15s;
}

.resource-list li:hover {
  border-color: var(--accent-blue);
}

.resource-list a {
  font-weight: 500;
}

.resource-list .resource-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Subsection styling ── */
.skill-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
}

.skill-section h3 {
  margin-top: 0;
  font-size: 18px;
}

/* ── Floating buttons: Home + Back to top ──
   Drawn as Primer icon buttons, the way GitHub draws icon-only controls:
   Octicons, a 6px radius, a hairline border and a resting shadow. Back to top
   is the primary action of the pair, so it takes GitHub's accent-emphasis
   blue; Home is a neutral default button. On hover the colour, border and
   shadow ease together with a 2px lift. */
.back-to-top,
.home-fab {
  position: fixed;
  right: 24px;
  z-index: 90;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: 0 1px 1px rgba(1,4,9,.4), 0 3px 6px rgba(1,4,9,.8);
  cursor: pointer;
  text-decoration: none;
  /* Hidden until the reader scrolls past the fold. visibility only flips to
     hidden once the fade has finished, and keeps the hidden button out of
     the tab order. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition-property: opacity, visibility, transform, background-color, border-color, color, box-shadow;
  transition-duration: .2s;
  transition-timing-function: cubic-bezier(.33,1,.68,1);
}

.back-to-top {
  bottom: 24px;
  border-color: rgba(240,246,252,.1);
  background: var(--accent-blue-emphasis);
  color: #fff;
}

.home-fab { bottom: 72px; }

.back-to-top svg,
.home-fab svg { width: 16px; height: 16px; fill: currentColor; }

.back-to-top.visible,
.home-fab.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Hover-capable pointers only, so a tap on a phone doesn't leave a button
   stuck in its hover state. */
@media (hover: hover) {
  .back-to-top.visible:hover,
  .home-fab.visible:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(1,4,9,.4), 0 8px 16px rgba(1,4,9,.6);
  }

  .back-to-top:hover { background: #388bfd; }

  .home-fab:hover {
    background: var(--border-default);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    text-decoration: none;
  }
}

.back-to-top.visible:active,
.home-fab.visible:active { transform: none; }

.back-to-top:active { background: #1158c7; }
.home-fab:active { background: #282e33; }

.back-to-top:focus-visible,
.home-fab:focus-visible {
  outline: 2px solid var(--accent-blue-emphasis);
  outline-offset: 2px;
}

/* GitHub-style tooltip, built the way Primer's classic .tooltipped is: the
   text comes from the button's aria-label and sits to its left. It appears
   after a short delay on hover and straight away on keyboard focus. */
.back-to-top::after,
.home-fab::after {
  content: attr(aria-label);
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  padding: .5em .75em;
  border-radius: var(--radius);
  background: var(--text-muted);
  color: #fff;
  font: 400 12px/1.5 var(--font-sans);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(4px, -50%);
  transition: opacity .15s ease-out, transform .15s ease-out;
}

@media (hover: hover) {
  .back-to-top:hover::after,
  .home-fab:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
    transition-delay: .4s;
  }
}

.back-to-top:focus-visible::after,
.home-fab:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Phones: pull the stack closer to the edge, in step with the tighter header */
@media (max-width: 480px) {
  .back-to-top, .home-fab { right: 16px; }
  .back-to-top { bottom: 16px; }
  .home-fab { bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Keep the colour and opacity fades, which aren't motion; drop the
     slide-in, the hover lift and the tooltip nudge. */
  .back-to-top,
  .home-fab,
  .back-to-top.visible:hover,
  .home-fab.visible:hover { transform: none; }
  .back-to-top::after,
  .home-fab::after { transform: translate(0, -50%); }
}
