/* ===== Balkonkraftwerk Kompendium — Editorial Theme ===== */
/* Design: Editorial/Solar-Technical, Font: Newsreader + Plus Jakarta Sans */
/* Palette: Solar Amber #D4642A + Warm Cream #F9F8F4 */
/* Signature: Newspaper-authority typography with warm solar tones */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; }

:root {
  --bg: #F9F8F4;
  --surface: #FFFFFF;
  --surface-alt: #F2F0EA;
  --border: #E4E0D8;
  --border-strong: #D1CCC2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);

  --text: #1C1B18;
  --text-secondary: #5E5B53;
  --text-tertiary: #706C64;

  --accent: #BF5520;
  --accent-hover: #B8541F;
  --accent-subtle: #FDF3EC;
  --accent-text: #FFFFFF;

  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1440px;
  --content-width: 720px;

  --font-heading: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-3xl: clamp(2.25rem, 1.5rem + 3vw, 3.25rem);
  --text-display: clamp(2.75rem, 1.5rem + 4.5vw, 4.5rem);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* Icon size utilities */
.w-3 { width: 0.75rem; } .h-3 { height: 0.75rem; }
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; } .h-6 { height: 1.5rem; }

/* ========================================
   LAYOUT
   ======================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow { max-width: var(--content-width); }

.section { padding: clamp(3rem, 5vw, 5rem) 0; }
.section--alt { background: var(--surface-alt); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text) !important;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.logo .logo-icon { color: var(--accent); width: 20px; height: 20px; }
.logo strong { font-weight: 600; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--surface-alt); }
.nav-link--active { color: var(--text); font-weight: 600; }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown .dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  padding-top: calc(0.5rem + 0.75rem);
  min-width: 560px;
  z-index: 200;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-sm);
  transition: background 0.15s;
  font-weight: 500;
}

.dropdown-item:hover { background: var(--surface-alt); color: var(--text); }
.dropdown-item .dropdown-icon { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: var(--surface);
  z-index: 99;
  padding: 1.5rem;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

.mobile-menu.is-open { display: block; }

.mobile-menu-section { margin-bottom: 1.5rem; }

.mobile-menu-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.mobile-menu-link {
  display: block;
  padding: 0.625rem 0.75rem;
  color: var(--text);
  font-weight: 500;
  font-size: var(--text-base);
  border-radius: var(--radius);
  transition: background 0.15s;
}

.mobile-menu-link:hover { background: var(--surface-alt); color: var(--text); }

/* ========================================
   HERO
   ======================================== */
.hero {
  padding: clamp(3rem, 6vw, 6rem) 0 clamp(2rem, 4vw, 4rem);
  text-align: center;
}

.hero-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hero-label svg { width: 16px; height: 16px; }

.hero h1 {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
  text-wrap: balance;
}

.hero h1 em,
.highlight { font-style: normal; color: var(--accent); }

.hero .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

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

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* ========================================
   SECTION HEADERS
   ======================================== */
.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.section-desc {
  color: var(--text-secondary);
  font-size: var(--text-base);
  max-width: 520px;
  line-height: 1.6;
}

.section-header { margin-bottom: 2.5rem; }
.section-header--center { text-align: center; }
.section-header--center .section-desc { margin: 0.5rem auto 0; }

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs { padding: 1rem 0; font-size: var(--text-xs); }

.breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--text-tertiary); transition: color 0.15s; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .separator { color: var(--border-strong); font-size: 0.7rem; }
.breadcrumbs .current { color: var(--text-secondary); font-weight: 500; }

/* ========================================
   CLUSTER GRID
   ======================================== */
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.cluster-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  color: var(--text);
}

.cluster-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
  color: var(--text);
}

.cluster-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cluster-card-icon svg { width: 20px; height: 20px; }

.cluster-card-body h3 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.cluster-card-body p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cluster-card-count {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 0.375rem;
}

/* ========================================
   ARTICLE CARDS
   ======================================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  color: var(--text);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--text);
}

.article-card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.article-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.article-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Article list */
.article-list { display: flex; flex-direction: column; }

.article-list-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}

.article-list-item:first-child { padding-top: 0; }
.article-list-item:last-child { border-bottom: none; }
.article-list-item:hover { color: var(--text); }
.article-list-item:hover h3 { color: var(--accent); }

.article-list-number {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text-tertiary);
  min-width: 2.5rem;
  line-height: 1.3;
}

.article-list-body h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  transition: color 0.15s;
}

.article-list-body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   ARTICLE LAYOUT
   ======================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

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

/* Article Header */
.article-header { margin-bottom: 2.5rem; }

.article-cluster-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: inline-block;
}

.article-cluster-label a { color: var(--accent); }

.article-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.article-byline { margin-bottom: 1rem; }

.article-byline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
}

.article-byline-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.article-byline-info { display: flex; flex-direction: column; line-height: 1.3; }
.article-byline-name { font-weight: 600; font-size: var(--text-sm); }
.article-byline-role { font-size: var(--text-xs); color: var(--text-tertiary); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.article-meta-divider {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

.article-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 1.25rem;
  text-wrap: pretty;
}

/* TOC sidebar */
.article-sidebar { position: sticky; top: 88px; }

.toc {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.toc-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.toc-list { list-style: none; }
.toc-list li { margin-bottom: 0.25rem; }

.toc-list a {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: block;
  padding: 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: all 0.15s;
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-subtle);
}

.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-list .toc-h3 { padding-left: 1.25rem; }

/* Mobile TOC */
.toc-mobile { display: none; margin-bottom: 2rem; }

.toc-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.toc-mobile-toggle svg {
  width: 18px; height: 18px;
  transition: transform 0.2s;
}

.toc-mobile-toggle.is-open svg { transform: rotate(180deg); }

.toc-mobile .toc-list {
  display: none;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.toc-mobile .toc-list.is-open { display: block; }

/* ========================================
   ARTICLE CONTENT TYPOGRAPHY
   ======================================== */
.content-body { font-size: var(--text-base); line-height: 1.75; }

.content-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  margin: 2.5rem 0 0.875rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  scroll-margin-top: 88px;
}

.content-body h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  margin: 2rem 0 0.625rem;
  line-height: 1.35;
  scroll-margin-top: 88px;
}

.content-body p { margin-bottom: 1.125rem; text-wrap: pretty; }

.content-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 60%);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

.content-body a:hover { text-decoration-color: var(--accent); }

.content-body ul, .content-body ol {
  margin-bottom: 1.125rem;
  padding-left: 1.5rem;
}

.content-body li { margin-bottom: 0.375rem; line-height: 1.65; }
.content-body li::marker { color: var(--accent); }
.content-body strong { color: var(--text); font-weight: 600; }

.content-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.content-body pre {
  background: #1E1E1C;
  color: #D4D0C8;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.content-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.content-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--accent-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.content-body blockquote p { color: var(--text); margin-bottom: 0; }

.content-body table {
  width: 100%;
  margin-bottom: 1.25rem;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.content-body th {
  text-align: left;
  font-weight: 600;
  padding: 0.75rem 1rem;
  background: var(--surface-alt);
  border-bottom: 2px solid var(--border);
}

.content-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.content-body img { border-radius: var(--radius-lg); margin: 1.5rem 0; }
.content-body figure { margin: 1.5rem 0; }

.content-body figcaption {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  text-align: center;
}

/* TL;DR Box */
.tldr-box {
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 80%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.tldr-box-title {
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.tldr-box ul { list-style: none; padding: 0; }

.tldr-box li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.tldr-box li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ========================================
   RELATED ARTICLES
   ======================================== */
.related-articles {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.related-articles .section-title { font-size: var(--text-xl); margin-bottom: 1.5rem; }

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

/* Prev/Next nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.article-nav-link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.article-nav-link--next { text-align: right; }

.article-nav-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.375rem;
}

.article-nav-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.35;
}

/* ========================================
   CLUSTER PAGE
   ======================================== */
.cluster-header {
  padding: clamp(2.5rem, 4vw, 4rem) 0 clamp(2rem, 3vw, 3rem);
}

.cluster-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.cluster-header .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  text-wrap: pretty;
}

.cluster-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ========================================
   GLOSSAR
   ======================================== */
.glossar-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.glossar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.glossar-nav a:hover,
.glossar-nav a.active { background: var(--accent); color: var(--accent-text); }

.glossar-section { margin-bottom: 2.5rem; }

.glossar-letter {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-subtle);
  scroll-margin-top: 88px;
}

.glossar-term { margin-bottom: 1.25rem; }
.glossar-term dt { font-weight: 700; font-size: var(--text-base); margin-bottom: 0.25rem; }
.glossar-term dd { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }
.glossar-link { display: inline-block; margin-top: 0.25rem; font-size: var(--text-xs); font-weight: 600; color: var(--accent); }

/* ========================================
   BUTTONS & BADGES
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--text-tertiary); color: var(--text); }
.btn svg { width: 16px; height: 16px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  letter-spacing: 0.01em;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 3rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  padding: clamp(2.5rem, 4vw, 4rem) 0;
}

.footer-brand { max-width: 280px; }
.footer-brand .logo { margin-bottom: 1rem; }
.footer-brand p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }

.footer-column h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 1rem;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-secondary); font-size: var(--text-sm); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }

.footer-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 80%);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--text-secondary);
}

.footer-disclaimer-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-bottom {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright { font-size: var(--text-xs); color: var(--text-tertiary); }

.footer-bottom-links { display: flex; gap: 1.25rem; list-style: none; }
.footer-bottom-links a { font-size: var(--text-xs); color: var(--text-tertiary); transition: color 0.15s; }
.footer-bottom-links a:hover { color: var(--text-secondary); }

/* ========================================
   PERFORMANCE
   ======================================== */

/* Defer rendering of off-screen content — saves up to 80% render cost */
.site-footer,
.related-articles,
.section--alt {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* ========================================
   UTILITY
   ======================================== */
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

.stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger.visible > * { opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.4s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .toc-mobile { display: block; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: span 2; max-width: none; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: var(--text-2xl); }
  .section { padding: clamp(2rem, 4vw, 3rem) 0; }
  .cluster-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
  .footer-main { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nav-dropdown .dropdown-menu {
    min-width: auto; left: 0; transform: none;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero-stats { gap: 1.5rem; }
}
