:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-2: #3fb950;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max-width: 1200px;
  --article-width: 720px;
  --article-accent: #58a6ff;
  --article-glow: rgba(88, 166, 255, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-main {
  flex: 1;
  padding-block: 2rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  display: block;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* Hero */
.hero {
  padding-block: 2rem 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

.lead {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-visual {
  text-align: center;
}

.hero-visual img {
  filter: drop-shadow(var(--shadow));
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0d1117;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding-block: 2rem;
}

.section-title {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-with-media {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card-with-media:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-media-link {
  display: block;
  line-height: 0;
  overflow: hidden;
}

.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-elevated);
}

.card-body {
  padding: 1.15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-featured.card-with-media {
  display: grid;
  grid-template-columns: minmax(200px, 42%) 1fr;
}

.card-featured .card-cover {
  aspect-ratio: auto;
  min-height: 220px;
  height: 100%;
}

@media (max-width: 700px) {
  .card-featured.card-with-media {
    grid-template-columns: 1fr;
  }
}

.card-title {
  margin: 0.5rem 0 0.35rem;
  line-height: 1.3;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-title a {
  color: var(--text);
  background: linear-gradient(to right, var(--text), var(--text)) no-repeat 0 100%;
  background-size: 0 2px;
  transition: color 0.2s, background-size 0.25s;
}

.card-title a:hover {
  color: var(--card-accent, var(--accent));
  background-image: linear-gradient(to right, var(--card-accent, var(--accent)), var(--card-accent, var(--accent)));
  background-size: 100% 2px;
}

.card--windows { --card-accent: #0078d4; }
.card--linux { --card-accent: #3fb950; }
.card--self-hosted { --card-accent: #58a6ff; }
.card--news { --card-accent: #a371f7; }

.card-media-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 17, 23, 0.85) 0%, transparent 55%);
  pointer-events: none;
}

.card-media-link {
  position: relative;
}

.card-meta .card-cta {
  margin-left: auto;
  color: var(--card-accent, var(--accent));
  font-weight: 600;
  font-size: 0.82rem;
}

.card-meta-dot {
  opacity: 0.5;
}

.card-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 600;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.85rem;
}

.card-featured {
  border-color: var(--accent);
}

/* Featured guide carousel (home) */
.featured-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.featured-carousel-header .section-title {
  margin: 0;
}

.featured-carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.carousel-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.carousel-btn:hover {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
}

.carousel-btn:active {
  transform: scale(0.96);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.featured-carousel-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.featured-carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  max-width: 42rem;
  margin-inline: auto;
}

.featured-carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.featured-carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0;
}

.featured-carousel-slide .card-featured.card-with-media {
  grid-template-columns: minmax(7.5rem, 32%) 1fr;
  min-height: unset;
}

.featured-carousel-slide .card-featured {
  margin: 0;
  min-height: unset;
}

.featured-carousel-slide .card-featured .card-cover {
  min-height: unset;
  height: auto;
  max-height: 8.5rem;
  aspect-ratio: 16 / 9;
}

.featured-carousel-slide .card-body {
  padding: 0.85rem 1rem;
}

.featured-carousel-slide .card-title {
  font-size: 1.05rem;
  margin: 0.35rem 0 0.2rem;
}

.featured-carousel-slide .card-excerpt {
  -webkit-line-clamp: 2;
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.featured-carousel-slide .card-meta {
  padding-top: 0.5rem;
  font-size: 0.8rem;
}

.featured-carousel-slide .card-meta .card-cta {
  display: none;
}

.featured-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot:hover {
  background: var(--text-muted);
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .featured-carousel-viewport {
    max-width: 100%;
  }

  .featured-carousel-slide .card-featured.card-with-media {
    grid-template-columns: minmax(6.5rem, 38%) 1fr;
  }

  .featured-carousel-slide .card-featured .card-cover {
    max-height: 5.5rem;
  }
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.category-card-visual {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.category-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.category-card-body {
  padding: 1.15rem 1.25rem 1.25rem;
}

.category-card h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.category-count {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Category page hero */
.category-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.category-hero-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.category-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 17, 23, 0.95) 0%, rgba(13, 17, 23, 0.35) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem 1.75rem;
}

.category-hero-overlay h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.category-hero-overlay .lead {
  margin: 0;
  max-width: 52ch;
}

.category-hero-count {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--accent-2);
  font-weight: 600;
}

.breadcrumb-invert a,
.breadcrumb-invert {
  color: rgba(230, 237, 243, 0.85);
}

.breadcrumb-invert a:hover {
  color: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
}

/* Layout */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.layout-main {
  min-width: 0;
}

.sidebar-sticky {
  position: sticky;
  top: 5rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-horizontal {
  display: block;
}

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(48, 54, 61, 0.6);
  z-index: 110;
}

.reading-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--article-accent), var(--accent-2));
  box-shadow: 0 0 12px var(--article-glow);
  transition: width 0.1s linear;
}

/* Article page — editorial layout */
.article-shell {
  --article-accent: #58a6ff;
  --article-glow: rgba(88, 166, 255, 0.35);
}

.article-page {
  max-width: none;
}

.article-layout .layout-main {
  max-width: 880px;
}

.breadcrumb-sep {
  margin: 0 0.35rem;
  opacity: 0.45;
}

.breadcrumb-current {
  color: var(--text);
}

.article-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}

.article-hero-media {
  position: relative;
  min-height: 280px;
}

.article-hero-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.article-hero-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, var(--article-glow) 100%);
  pointer-events: none;
}

.article-hero-panel {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}

.article-hero-panel::before {
  content: "";
  width: 4px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--article-accent), transparent);
}

.article-hero-panel-inner {
  padding: 1.75rem 1.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
}

.article-category-pill {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--article-accent);
  background: color-mix(in srgb, var(--article-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--article-accent) 35%, transparent);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.article-title {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 0%, #c9d1d9 55%, var(--article-accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.article-deck {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
  font-family: var(--font-serif);
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.byline-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.byline-chip--tags {
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-pill {
  color: var(--article-accent);
  font-weight: 500;
}

.byline-icon {
  font-size: 0.85em;
  line-height: 1;
}

.article-content-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.75rem;
  align-items: start;
}

.article-toc-wrap {
  position: sticky;
  top: 5.5rem;
}

.article-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem;
  font-size: 0.86rem;
  border-top: 3px solid var(--article-accent);
}

.article-toc-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--article-accent);
  margin: 0 0 0.85rem;
  font-weight: 700;
}

.article-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.article-toc-list li {
  margin-bottom: 0.15rem;
  counter-increment: toc;
}

.article-toc-list a {
  display: block;
  padding: 0.45rem 0.5rem 0.45rem 1.75rem;
  color: var(--text-muted);
  border-radius: 6px;
  position: relative;
  line-height: 1.35;
  transition: color 0.15s, background 0.15s;
}

.article-toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0.35rem;
  top: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--article-accent);
  opacity: 0.7;
}

.article-toc-list a:hover,
.article-toc-list a.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--article-accent) 12%, transparent);
}

.article-toc-list a.is-active {
  font-weight: 600;
}

@media (max-width: 900px) {
  .article-hero {
    grid-template-columns: 1fr;
  }

  .article-hero-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .article-hero-panel::before {
    width: auto;
    height: 4px;
  }

  .article-content-grid {
    grid-template-columns: 1fr;
  }

  .article-toc-wrap {
    position: static;
    order: -1;
  }
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.page-header h1,
.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  line-height: 1.25;
  margin: 0.5rem 0;
}

.article-deck {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-list li {
  font-size: 0.8rem;
  color: var(--accent);
}

.related-articles {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.related-header {
  margin-bottom: 1.5rem;
}

.related-header .section-title {
  margin-bottom: 0.35rem;
}

.related-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Prose / markdown */
.prose {
  font-size: 1.05rem;
  line-height: 1.75;
}

.editorial-prose {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.82;
  color: #d0d7de;
}

.editorial-prose .prose-flow {
  counter-reset: section;
}

.editorial-prose .prose-intro {
  margin-bottom: 2rem;
}

.editorial-prose .article-lead {
  font-size: 1.28rem;
  line-height: 1.65;
  color: #e6edf3;
  font-weight: 400;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.35rem 1.25rem 1.15rem;
  border-left: 4px solid var(--article-accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--article-accent) 10%, transparent), transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.editorial-prose .prose-section {
  counter-increment: section;
  margin-bottom: 2.25rem;
  padding: 1.5rem 1.35rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.editorial-prose .prose-section:hover {
  border-color: color-mix(in srgb, var(--article-accent) 40%, var(--border));
}

.editorial-prose .prose-h2 {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.editorial-prose .prose-h2-marker {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin-top: 0.1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--article-accent) 20%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--article-accent) 45%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--article-accent);
}

.editorial-prose .prose-h2-marker::before {
  content: counter(section, decimal-leading-zero);
}

.editorial-prose .prose-h2-text {
  flex: 1;
  padding-top: 0.15rem;
}

.editorial-prose .prose-h2--prereq .prose-h2-marker {
  background: color-mix(in srgb, #d29922 25%, var(--bg-elevated));
  border-color: #d29922;
  color: #e3b341;
}

.editorial-prose .prose-h2--takeaways .prose-h2-marker {
  background: color-mix(in srgb, var(--accent-2) 25%, var(--bg-elevated));
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.editorial-prose .prose-h2--troubleshoot .prose-h2-marker {
  background: color-mix(in srgb, #f85149 20%, var(--bg-elevated));
  border-color: #f85149;
  color: #ff7b72;
}

.editorial-prose .prose-h2--faq .prose-h2-marker,
.editorial-prose .prose-h2--outro .prose-h2-marker {
  background: color-mix(in srgb, var(--article-accent) 22%, var(--bg-elevated));
}

.editorial-prose .prose-h3 {
  font-family: var(--font);
  font-size: 1.08rem;
  font-weight: 600;
  color: #e6edf3;
  margin: 1.75rem 0 0.65rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--article-accent);
}

.prose h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.85rem;
  text-align: left;
}

.prose th {
  background: var(--bg-elevated);
  color: var(--text);
}

.prose tr:nth-child(even) td {
  background: rgba(22, 27, 34, 0.5);
}

.prose h3 {
  margin-top: 1.5rem;
}

.editorial-prose .prose-section .highlight,
.editorial-prose pre {
  margin: 1.25rem 0;
}

.prose pre,
.editorial-prose pre {
  background: #010409;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.editorial-prose .highlight {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.prose .article-figure,
.editorial-prose .article-figure {
  margin: 2rem 0;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prose .article-figure img,
.editorial-prose .article-figure img {
  display: block;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
}

.prose .article-figure figcaption,
.editorial-prose .article-figure figcaption {
  margin: 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-style: normal;
}

.prose p:has(> img:only-child) {
  margin: 2rem 0;
}

.prose p > img:only-child {
  display: block;
  width: 100%;
  margin: 0;
}

.prose blockquote,
.editorial-prose blockquote {
  border-left: 4px solid var(--article-accent, var(--accent));
  margin: 1.5rem 0;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.editorial-prose .prose-h2--takeaways + * ul,
.editorial-prose .prose-section:has(.prose-h2--takeaways) ul {
  list-style: none;
  padding-left: 0;
}

.editorial-prose .prose-section:has(.prose-h2--takeaways) li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
}

.editorial-prose .prose-section:has(.prose-h2--takeaways) li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose :not(pre) > code {
  background: var(--bg-elevated);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.highlight {
  margin: 1rem 0;
}

/* Ads */
.ad-slot {
  margin: 1rem 0;
  text-align: center;
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-slot:empty {
  display: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 2rem;
  background: var(--bg-elevated);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 0.5rem;
}

.hero-logo {
  max-width: min(100%, 360px);
  height: auto;
  filter: drop-shadow(var(--shadow));
}

.footer-links h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 2rem, 520px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow);
  z-index: 200;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
}

.error-page {
  text-align: center;
  padding: 4rem 0;
}

.page-content {
  max-width: var(--article-width);
}

/* Mobile */
@media (max-width: 900px) {
  .hero-grid,
  .layout-with-sidebar,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    flex-direction: column;
  }

  .site-nav.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .sidebar-sticky {
    position: static;
  }
}

/* Tools directory */
.tools-page .page-header {
  margin-bottom: 1.5rem;
}

.tools-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tools-filter-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tools-filter-btn:hover,
.tools-filter-btn.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(88, 166, 255, 0.12);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.tool-logo-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tool-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.tool-logo-fallback {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.tool-logo-fallback[hidden] {
  display: none !important;
}

.tool-card-titles {
  min-width: 0;
}

.tool-name {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.tool-name a {
  color: var(--text);
  text-decoration: none;
}

.tool-name a:hover {
  color: var(--accent);
}

.tool-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.tool-description {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.tool-downloads-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tool-download-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.download-chip {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.download-chip:hover {
  background: rgba(88, 166, 255, 0.22);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.tools-disclaimer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tools-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
}
