@font-face { font-family: 'Geist'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/geist-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/geist-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/geist-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/geist-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/geist-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/geist-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/geist-mono-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/geist-mono-latin-600-normal.woff2') format('woff2'); }

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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #0f0f0f;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-code: #0d0d0d;
  --bg-sidebar: #0e0e0e;
  --border: #222222;
  --border-hover: #333333;
  --border-subtle: #191919;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #848484;
  --accent: #5b8cff;
  --accent-hover: #7ba0ff;
  --accent-dim: rgba(91, 140, 255, 0.12);
  --accent-glow: rgba(91, 140, 255, 0.06);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168, 85, 247, 0.12);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.12);
  --teal: #06b6d4;
  --teal-dim: rgba(6, 182, 212, 0.12);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(91, 140, 255, 0.08);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}


a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

/* ─── Background depth: faint top wash + fine grain ─── */
body:has(.hero)::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 480px;
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.045) 0%, rgba(91, 140, 255, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9998;
}

/* ─── Header ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 200;
  transition: background var(--transition-base);
}

.site-header .logo {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 2px;
}

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

.site-header nav { display: flex; gap: 4px; }
.site-header nav a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.site-header nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.site-header nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.search-box {
  position: relative;
  width: 220px;
}

.search-box input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-base);
}

.search-box input::placeholder { color: var(--text-dim); text-overflow: ellipsis; }
.search-box input:focus {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.08);
}

.search-box::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--text-dim);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Keyboard shortcut hint */
.search-box .kbd-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  line-height: 1.4;
}

/* ─── Sidebar ─── */
.layout {
  display: flex;
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 10;
}

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

.sidebar-section-title {
  padding: 8px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--transition-fast);
}

.sidebar-section-title:hover { color: var(--text-muted); }

.sidebar-section-title::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--text-dim);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.sidebar-section.collapsed .sidebar-section-title::after {
  transform: rotate(-90deg);
}

.sidebar-section .sidebar-links {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 1;
}

.sidebar-section.collapsed .sidebar-links {
  max-height: 0;
  opacity: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-link .tool-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.sidebar-link:hover .tool-icon {
  border-color: var(--border-hover);
  color: var(--text-muted);
}

.sidebar-link.active .tool-icon {
  background: var(--accent-dim);
  border-color: rgba(91, 140, 255, 0.3);
  color: var(--accent);
}

.sidebar-link .tool-icon svg { width: 12px; height: 12px; }

/* Learned checkmark */
.sidebar-link .learned-mark {
  margin-left: auto;
  width: 14px;
  height: 14px;
  color: var(--green);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.sidebar-link .learned-mark.show { opacity: 1; }

/* ─── Main content ─── */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  max-width: 860px;
  padding: 56px 48px 96px;
  position: relative;
  z-index: 1;
}

/* ─── Index page hero ─── */
.hero {
  margin-bottom: 72px;
  padding-top: 16px;
  position: relative;
}

.hero h1 {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  line-height: 1.04;
  color: var(--text);
}

.hero h1 .hero-accent { color: var(--accent); }

.hero p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 580px;
  line-height: 1.65;
}

.hero p { text-wrap: pretty; }
.hero p em { color: var(--text); font-style: normal; font-weight: 500; }

.main-content:has(.hero) { max-width: 1040px; }


/* ─── Tag filter buttons ─── */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
  padding: 12px 0;
}

.tag-filter {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-filter:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.tag-filter.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.tag-filter .filter-count {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.9;
}

/* ─── Category sections ─── */
.category-section {
  margin-bottom: 64px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.category-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.category-header .count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.category-header .progress-indicator {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-header .progress-bar {
  width: 60px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.category-header .progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Tool cards ─── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.tool-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(91, 140, 255, 0.4);
  box-shadow: var(--shadow-md);
}

.tool-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

/* Learned indicator on card */
.tool-card .learned-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tool-card .learned-badge.show { opacity: 1; }

.tool-card .learned-badge svg {
  width: 10px;
  height: 10px;
  color: var(--green);
}

/* ─── Tags ─── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.tag-windows { background: var(--blue-dim); color: #6aa8fb; border-color: rgba(59, 130, 246, 0.2); }
.tag-linux { background: var(--green-dim); color: var(--green); border-color: rgba(34, 197, 94, 0.2); }
.tag-ad { background: var(--purple-dim); color: #c084fc; border-color: rgba(168, 85, 247, 0.2); }
.tag-web { background: var(--orange-dim); color: var(--orange); border-color: rgba(249, 115, 22, 0.2); }
.tag-cpts { background: rgba(255,255,255,0.07); color: #e5e5e5; border-color: rgba(255,255,255,0.16); }

/* ─── Tool detail page ─── */
.tool-header { margin-bottom: 40px; }

.tool-header .breadcrumb {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-header .breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.tool-header .breadcrumb a:hover { color: var(--text); }
.tool-header .breadcrumb .sep { color: var(--text-dim); }

.tool-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.tool-header .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.tool-header .meta {
  display: flex;
  gap: 10px 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Mark as learned toggle */
.learned-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.learned-toggle:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.learned-toggle.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.learned-toggle svg {
  width: 14px;
  height: 14px;
}

/* ─── Content sections ─── */
.content-section {
  margin-bottom: 48px;
}

.content-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Sticky section headers */
.content-section h2.sticky-header {
  position: sticky;
  top: 56px;
  background: var(--bg);
  z-index: 5;
  padding-top: 8px;
}

.content-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--text);
}

.content-section p {
  margin-bottom: 12px;
  color: var(--text);
}

.content-section ul, .content-section ol {
  margin-bottom: 12px;
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 6px;
  color: var(--text);
}

.content-section li strong { color: var(--text); }

/* ─── Signal / Warning / Tip boxes ─── */
.signal-box, .warning-box, .tip-box, .info-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  position: relative;
}

.signal-box {
  background: var(--accent-dim);
  border-color: var(--accent);
  border-top: 1px solid rgba(91, 140, 255, 0.15);
  border-right: 1px solid rgba(91, 140, 255, 0.15);
  border-bottom: 1px solid rgba(91, 140, 255, 0.15);
}

.signal-box .signal-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signal-box .signal-title::before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.signal-box ul { padding-left: 18px; }
.signal-box li { font-size: 14px; margin-bottom: 4px; }

.warning-box {
  background: var(--red-dim);
  border-color: var(--red);
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  border-right: 1px solid rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.warning-box .warning-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-box .warning-title::before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--red);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.tip-box {
  background: var(--green-dim);
  border-color: var(--green);
  border-top: 1px solid rgba(34, 197, 94, 0.15);
  border-right: 1px solid rgba(34, 197, 94, 0.15);
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
}

.tip-box .tip-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tip-box .tip-title::before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--green);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.info-box {
  background: var(--blue-dim);
  border-color: var(--blue);
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  border-right: 1px solid rgba(59, 130, 246, 0.15);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.info-box .info-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin-bottom: 8px;
}

/* ─── Code blocks ─── */
.code-block {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  overflow: hidden;
}

.code-block .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

.code-block .code-lang {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.code-block .copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.code-block .copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.code-block .copy-btn.copied {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.code-block pre .comment { color: #8b949e; font-style: italic; }
.code-block pre .flag { color: #79c0ff; }
.code-block pre .string { color: #a5d6ff; }
.code-block pre .prompt { color: var(--accent); user-select: none; }
.code-block pre .output { color: var(--text-dim); }
.code-block pre .highlight { color: var(--green); font-weight: 500; }

.info-table td, .info-table th { overflow-wrap: anywhere; }

code {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: #c9d1d9;
}

/* ─── Tables ─── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}

.info-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.info-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.info-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ─── Related tools section ─── */
.related-tools {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-tools h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-base);
  color: var(--text);
}

.related-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
  color: var(--text);
}

.related-card .related-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  flex-shrink: 0;
}

.related-card:hover .related-icon {
  border-color: var(--accent);
  color: var(--accent);
}

.related-card .related-name {
  font-size: 14px;
  font-weight: 600;
}

.related-card .related-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ─── Flow diagram ─── */
.flow-step {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
  position: relative;
}

.flow-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -4px;
  width: 1px;
  background: var(--border);
}

.flow-step:last-child::before { display: none; }

.flow-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: var(--mono);
  border: 1px solid rgba(91, 140, 255, 0.25);
}

.flow-content {
  padding: 4px 0 20px;
  flex: 1;
}

.flow-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.flow-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0;
}

.flow-content .flow-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ─── On this page (right sidebar on tool pages) ─── */
.page-nav {
  position: fixed;
  top: 56px;
  right: 0;
  width: 200px;
  padding: 24px 16px;
  font-size: 13px;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}

.page-nav .nav-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.page-nav a {
  display: block;
  padding: 5px 0;
  color: var(--text-dim);
  font-size: 12px;
  border-left: 2px solid var(--border);
  padding-left: 12px;
  transition: all var(--transition-fast);
}

.page-nav a:hover {
  color: var(--text-muted);
  border-left-color: var(--border-hover);
}

.page-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.has-page-nav .main-content { margin-right: 200px; }

/* ─── Command Palette (Ctrl+K) ─── */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cmd-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cmd-palette {
  width: 520px;
  max-height: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(91, 140, 255, 0.06);
  overflow: hidden;
  transform: scale(0.96) translateY(-8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette-overlay.open .cmd-palette {
  transform: scale(1) translateY(0);
}

.cmd-palette-input {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.cmd-palette-input .search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.cmd-palette-input input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
}

.cmd-palette-input input::placeholder { color: var(--text-dim); }

.cmd-palette-input .cmd-esc {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.cmd-palette-results {
  overflow-y: auto;
  max-height: 340px;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.cmd-palette-group {
  padding: 4px 0;
}

.cmd-palette-group-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 4px 12px 6px;
}

.cmd-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-muted);
  text-decoration: none;
}

.cmd-result:hover, .cmd-result.selected {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.cmd-result .cmd-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cmd-result .cmd-icon svg { width: 14px; height: 14px; }

.cmd-result .cmd-name {
  font-size: 14px;
  font-weight: 500;
}

.cmd-result .cmd-category {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
}

.cmd-result .cmd-enter {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-dim);
  padding: 1px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cmd-result:hover .cmd-enter, .cmd-result.selected .cmd-enter { opacity: 1; }

.cmd-palette-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
}

.cmd-palette-footer kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ─── Feature cards for index page ─── */
.features-section {
  margin-top: 24px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.features-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-base);
  color: var(--text);
}

.feature-card:hover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.04);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.feature-card .feature-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--accent-dim);
  border: 1px solid rgba(91, 140, 255, 0.2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  color: var(--accent);
}

.feature-card .feature-icon svg { width: 18px; height: 18px; }

.feature-card .feature-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-card .feature-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Full-width layout for feature pages ─── */
.full-layout {
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  padding: 32px;
  position: relative;
  z-index: 1;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .page-nav { display: none; }
  .has-page-nav .main-content { margin-right: 0; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0 !important; padding: 24px 16px 60px; max-width: 100vw; overflow-x: hidden; }
  .tool-grid { grid-template-columns: 1fr; }
  .site-header nav { gap: 2px; }
  .site-header nav a { font-size: 12px; padding: 4px 8px; }
  .search-box { width: 160px; }
  .hero { margin-bottom: 48px; padding-top: 0; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .category-section { margin-bottom: 48px; }
  .hero-links { gap: 6px; }
  .hero-link { padding: 6px 14px; font-size: 12px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .full-layout { padding: 16px; }
  .cmd-palette { width: calc(100vw - 32px); margin: 0 16px; }
  .tag-filters { gap: 4px; }
  .content-section { overflow-x: hidden; }
  .content-section p, .content-section li { overflow-wrap: break-word; word-break: break-word; }
  .tool-header { overflow-x: hidden; }
  .tool-header h1 { font-size: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .info-table { display: block; overflow-x: auto; }
}

@media (max-width: 768px) {
  body [class$="-hero"] h1 { font-size: 30px; }
}

@media (max-width: 480px) {
  .site-header { padding: 0 12px; }
  .site-header nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex-shrink: 1; min-width: 0; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; font-size: 11px; padding: 3px 6px; }
  .site-header .logo { flex-shrink: 0; }
  .site-header nav { margin: 0 8px; }
  .search-box { width: 104px; flex-shrink: 0; }
  .search-box input { font-size: 12px; padding-right: 8px; }
  .search-box .kbd-hint { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .logo span { display: none; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ─── Selection ─── */
::selection {
  background: rgba(91, 140, 255, 0.25);
  color: var(--text);
}

/* ─── Scroll progress bar ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 9999;
  transition: none;
  pointer-events: none;
}


/* ─── Cheatsheet mode ─── */
.cheatsheet-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}
.cheatsheet-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cheatsheet-toggle.active {
  border-color: var(--accent);
  color: var(--bg);
  background: var(--accent);
}
body.cheatsheet-mode .content-section > p,
body.cheatsheet-mode .content-section > ul:not(.cheatsheet-keep),
body.cheatsheet-mode .content-section > ol:not(.cheatsheet-keep),
body.cheatsheet-mode .signal-box,
body.cheatsheet-mode .warning-box,
body.cheatsheet-mode .tip-box,
body.cheatsheet-mode .info-box,
body.cheatsheet-mode .info-table {
  display: none;
}
body.cheatsheet-mode .content-section h3 {
  margin-bottom: 8px;
}


/* ─── Hero quick-links ─── */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all var(--transition-base);
}

.hero-link:hover {
  color: var(--accent);
  border-color: rgba(91, 140, 255, 0.4);
  background: var(--accent-dim);
}

.hero-link.hero-link-primary {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.hero-link.hero-link-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
}

/* ─── Learned toast ─── */
.learned-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.learned-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.learned-toast-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}
.learned-toast-dismiss {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* ─── Tool page: at a glance ─── */
.glance {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin: -8px 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.glance-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 24px;
  border-right: 1px solid var(--border);
}

.glance-item:last-child { border-right: none; }

.glance-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.glance-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.verify-note {
  max-width: 640px;
  margin: 0 0 48px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.verify-note strong { color: var(--text); font-weight: 500; }
body.cheatsheet-mode .verify-note { display: none; }

a.glance-link { transition: background var(--transition-base); }
a.glance-link .glance-value { color: var(--accent); }
a.glance-link:hover { background: var(--accent-dim); }

/* ─── Tool page: connections ─── */
.connections {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.connections h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.conn-lead {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.conn-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.conn-cols.single { grid-template-columns: 1fr; max-width: 420px; }

.conn-cols h3 {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.conn-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition-base), background var(--transition-base);
}

.conn-card:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.4);
  background: var(--bg-card-hover);
}

.conn-name { font-size: 14px; font-weight: 600; }
.conn-why { font-size: 12px; color: var(--text-dim); text-align: right; }

/* ─── Tool page: previous / next ─── */
.tool-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition-base), background var(--transition-base);
}

.pager-link.next { text-align: right; align-items: flex-end; grid-column: 2; }
.pager-link.prev { grid-column: 1; }

.pager-link:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.4);
  background: var(--bg-card-hover);
}

.pager-dir {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pager-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.pager-cat { font-size: 12px; color: var(--text-muted); }

body.cheatsheet-mode .glance,
body.cheatsheet-mode .connections { display: none; }

@media (max-width: 768px) {
  .glance { width: 100%; }
  .glance-item { flex: 1 1 50%; padding: 10px 16px; border-bottom: 1px solid var(--border); }
  .glance-item:nth-child(even) { border-right: none; }
  .conn-cols { grid-template-columns: 1fr; gap: 24px; }
  .tool-pager { grid-template-columns: 1fr; }
  .pager-link.next, .pager-link.prev { grid-column: 1; }
}

/* ─── Accessibility ─── */
p a, li a, td a, .verify-note a, .conn-lead a {
  text-decoration: underline;
  text-decoration-color: rgba(91, 140, 255, 0.45);
  text-underline-offset: 3px;
}
p a:hover, li a:hover, td a:hover, .verify-note a:hover, .conn-lead a:hover { text-decoration-color: currentColor; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}
.skip-link:focus { transform: none; color: var(--bg); }
[role="main"]:focus { outline: none; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Keyboard nav focus ring ─── */
.tool-card.kb-focus, .feature-card.kb-focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Footer ─── */
.site-footer {
  position: relative;
  z-index: 1;
  margin-left: 0;
  padding: 64px 48px 32px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}
body:has(.sidebar) .site-footer { margin-left: 260px; }
body:not(:has(.sidebar)) .footer-inner,
body:not(:has(.sidebar)) .footer-bottom { margin-inline: auto; max-width: 960px; }
body:has(.hero) .footer-inner,
body:has(.hero) .footer-bottom { max-width: 944px; }

.footer-inner {
  max-width: 860px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.footer-logo span { color: var(--text-muted); font-weight: 400; }
.footer-logo:hover { color: var(--text); }

.footer-brand p {
  margin-top: 10px;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.footer-col .footer-heading {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

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

.site-footer a { transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 860px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  body:has(.sidebar) .site-footer { margin-left: 0; }
  .site-footer { padding: 40px 16px 24px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}


/* ─── Index lists: rows, not cards ─── */
.tool-grid { display: block; }
.tool-card {
  display: grid;
  grid-template-columns: minmax(150px, 190px) 1fr auto;
  align-items: baseline;
  gap: 4px 24px;
  padding: 13px 12px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.tool-card:first-child { border-top: 0; }
.category-header { margin-bottom: 0; }
.tool-card:hover { background: rgba(255, 255, 255, 0.03); box-shadow: none; border-color: var(--border); }
.tool-card h3 { font-size: 15px; font-weight: 600; margin: 0; display: block; transition: color var(--transition-fast); }
.tool-card:hover h3 { color: var(--accent); }
.tool-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin: 0; max-width: 62ch; }
.tool-card .tags { margin: 0; flex-wrap: nowrap; justify-content: flex-end; }
.tool-card .learned-badge { top: 50%; left: -26px; right: auto; transform: translateY(-50%); }

.feature-grid { display: block; }
.feature-card {
  display: grid;
  grid-template-columns: 18px 170px 1fr;
  align-items: center;
  gap: 0 16px;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.feature-card:first-child { border-top: 1px solid var(--border); }
.feature-card:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border); box-shadow: none; }
.feature-card .feature-icon { width: 18px; height: 18px; margin: 0; border: 0; background: none; border-radius: 0; color: var(--text-muted); }
.feature-card .feature-icon svg { width: 18px; height: 18px; }
.feature-card .feature-name { margin: 0; font-size: 15px; transition: color var(--transition-fast); }
.feature-card .feature-desc { font-size: 13.5px; line-height: 1.5; }
.feature-card:hover .feature-icon, .feature-card:hover .feature-name { color: var(--accent); }

.hero-progress { margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.hero-progress b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ─── Sidebar and page-nav without heavy colored edges ─── */
.sidebar-link { border-left: 0; }
.sidebar-link.active { border-left: 0; background: var(--accent-dim); color: var(--text); }
.sidebar-link .tool-icon { width: 16px; height: 16px; border: 0; background: none; border-radius: 0; }
.sidebar-link .tool-icon svg { width: 15px; height: 15px; }
.sidebar-link.active .tool-icon { background: none; border: 0; color: var(--accent); }
.page-nav a { border-left-width: 1px; }

/* ─── Type and browser surfaces ─── */
h1, h2, h3 { text-wrap: balance; }
.content-section p, .content-section li { max-width: 72ch; }
.tool-header .subtitle { max-width: 68ch; }
input, textarea, select { caret-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
table { font-variant-numeric: tabular-nums; }
.category-header .count, .tag-filter .filter-count, .cheatsheet-toggle { font-family: var(--font); }

@media (max-width: 768px) {
  .tool-card { grid-template-columns: 1fr; gap: 6px; }
  .tool-card .tags { justify-content: flex-start; }
  .tool-card .learned-badge { left: auto; right: 8px; top: 16px; transform: none; }
  .feature-card { grid-template-columns: 18px 1fr; }
  .feature-card .feature-desc { grid-column: 2; }
}


/* ─── Learning structure: prerequisites and check yourself ─── */
.prereq {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 32px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 72ch;
}
.prereq-row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.prereq-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); padding-top: 1px; }
.prereq-value { font-size: 14px; color: var(--text); line-height: 1.55; }

.qa { max-width: 72ch; border-bottom: 1px solid var(--border); }
.qa:first-of-type { border-top: 1px solid var(--border); }
.qa summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 28px 14px 0;
  font-weight: 500;
  position: relative;
  line-height: 1.5;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
}
.qa[open] summary::after { transform: rotate(-135deg); top: 25px; }
.qa summary:hover { color: var(--accent); }
.qa .qa-answer { padding: 0 0 16px; color: var(--text-muted); line-height: 1.65; }
.qa .qa-answer code { color: var(--text); }

body.cheatsheet-mode .prereq,
body.cheatsheet-mode #check { display: none; }

@media (max-width: 768px) {
  .prereq-row { grid-template-columns: 1fr; gap: 2px; }
}

/* keep state and flag names in the first column on one line */
.info-table td:first-child code, .info-table th:first-child { white-space: nowrap; overflow-wrap: normal; }
.info-table td:first-child { padding-right: 24px; }
