/* ============================================================
   Spatial Workflow — Global Styles
   Marine Blue palette: indigo · crystal blue · turquoise · white foam
   ============================================================ */

/* ── Custom Properties ──────────────────────────────────────────────────── */
:root {
  --color-primary:       #1a3a6b;   /* marine indigo */
  --color-primary-dark:  #112952;
  --color-primary-light: #2a5298;
  --color-accent:        #0ea5e9;   /* crystal blue */
  --color-accent-dark:   #0284c7;
  --color-teal:          #14b8a6;   /* turquoise */
  --color-teal-dark:     #0d9488;
  --color-foam:          #f0f9ff;   /* white foam */
  --color-surface:       #ffffff;
  --color-surface-2:     #f8fafc;
  --color-code-bg:       #e8f4fd;
  --color-code-border:   #bae6fd;
  --color-text:          #1e293b;
  --color-text-muted:    #64748b;
  --color-text-light:    #94a3b8;
  --color-border:        #e2e8f0;
  --color-border-strong: #cbd5e1;

  /* Type-specific accents */
  --color-foundation:    #6366f1;   /* indigo */
  --color-task:          #0ea5e9;   /* sky blue */
  --color-troubleshoot:  #f59e0b;   /* amber */

  /* Spacing */
  --header-h: 64px;
  --max-w:    1400px;
  --gutter:   clamp(1rem, 4vw, 2.5rem);
  --radius:   0.6rem;
  --radius-lg: 1rem;

  /* Font */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Transitions */
  --t: 160ms ease;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; display: block; }

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--color-primary); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol { list-style: none; }

/* Re-enable list style inside article prose */
.article ul  { list-style: disc; padding-left: 1.5rem; }
.article ol  { list-style: decimal; padding-left: 1.5rem; }
.article li  { margin-bottom: 0.3rem; }
.article li > ul, .article li > ol { margin-top: 0.3rem; }

/* ── Typography ─────────────────────────────────────────────────────────── */
.article h1, .article h2, .article h3, .article h4, .article h5 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0;
  /* Ensure gradient shows through any child inline elements */
  display: inline-block;
  width: 100%;
}
.article h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--color-primary);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-code-border);
}
.article h3 { font-size: 1.2rem; color: var(--color-primary-light); }
.article h4 { font-size: 1rem; color: var(--color-text); font-weight: 600; }

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

.article strong { color: var(--color-primary); }

/* Heading anchor links — small # symbol after heading text */
.article .anchor-icon {
  display: inline-block;
  margin-left: 0.4em;
  font-size: 0.7em;
  font-weight: 400;
  color: var(--color-text-light);
  opacity: 0;
  text-decoration: none;
  vertical-align: middle;
  transition: opacity var(--t);
}
.article h1:hover .anchor-icon,
.article h2:hover .anchor-icon,
.article h3:hover .anchor-icon,
.article h4:hover .anchor-icon { opacity: 1; }
/* The wrapping anchor itself should be invisible / not underlined */
.article h1 a.header-anchor,
.article h2 a.header-anchor,
.article h3 a.header-anchor,
.article h4 a.header-anchor {
  color: inherit;
  text-decoration: none;
}

/* ── Inline code ────────────────────────────────────────────────────────── */
.article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-code-border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

/* ── Code blocks ────────────────────────────────────────────────────────── */
.article pre {
  position: relative;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-code-border);
}

.article pre code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--color-code-bg);
  color: var(--color-text);
  border: none;
  border-radius: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.65;
}

/* PrismJS token colour overrides (marine blue) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7c8fa5; }
.token.punctuation { color: var(--color-text-muted); }
.token.property, .token.tag, .token.boolean, .token.number { color: #0369a1; }
.token.selector, .token.attr-name, .token.string { color: #0d9488; }
.token.operator, .token.entity, .token.url { color: var(--color-primary); }
.token.atrule, .token.attr-value, .token.keyword { color: var(--color-primary); font-weight: 600; }
.token.function, .token.class-name { color: #7c3aed; }
.token.regex, .token.important, .token.variable { color: #d97706; }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t), background var(--t);
  z-index: 2;
}
.article pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--color-accent-dark); }
.copy-btn.copied { background: var(--color-teal); }

/* ── Mermaid diagrams ───────────────────────────────────────────────────── */
.mermaid {
  background: var(--color-foam);
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

/* ── Checkboxes ─────────────────────────────────────────────────────────── */
.article input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--color-teal);
  cursor: pointer;
  margin-right: 0.5em;
  vertical-align: middle;
}
.article li:has(input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.5rem;
}
.checkbox-checked { text-decoration: line-through; color: var(--color-text-muted); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin: 1.25rem 0; border-radius: var(--radius); }
.article .data-table,
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 400px;
}
.article table th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 1rem;
}
.article table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.article table tr:nth-child(even) td { background: var(--color-foam); }
.article table tr:hover td { background: var(--color-code-bg); }

/* ── Blockquotes ────────────────────────────────────────────────────────── */
.article blockquote {
  border-left: 4px solid var(--color-accent);
  background: var(--color-foam);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text-muted);
}

/* ── FAQ Accordions ─────────────────────────────────────────────────────── */
.faq-section details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.faq-section summary {
  padding: 0.9rem 1.1rem;
  background: var(--color-foam);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--t);
}
.faq-section summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--color-accent);
  transition: transform var(--t);
}
.faq-section details[open] > summary::after { transform: rotate(45deg); }
.faq-section summary:hover { background: var(--color-code-bg); }
.faq-section details > *:not(summary) { padding: 0.75rem 1.1rem 1rem; }

/* ── Sticky Header ──────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-primary);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(26, 58, 107, 0.3);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo img { border-radius: 50%; width: 38px; height: 38px; }
.logo-text {
  font-size: 1.1rem;
  color: var(--color-foam);
  letter-spacing: -0.02em;
}
.logo-text strong { color: var(--color-teal); font-weight: 800; }

.header-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}
.nav-link.active { background: rgba(255,255,255,0.2); color: var(--color-teal); }
.nav-icon { font-size: 1rem; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px; height: 20px;
  background: none; border: none;
  cursor: pointer; padding: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--t);
}
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.mobile-nav {
  background: var(--color-primary-dark);
  padding: 0.75rem var(--gutter);
}
.mobile-nav ul { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  font-weight: 500;
  transition: background var(--t);
  text-decoration: none;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  margin-top: auto;
  padding-top: 2.5rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-brand img { opacity: 0.9; }
.footer-brand span { font-weight: 700; color: #fff; font-size: 1rem; }
.footer-tagline { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.4; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}
.footer-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-teal);
  margin-bottom: 0.75rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  transition: color var(--t);
  text-decoration: none;
}
.footer-col a:hover { color: var(--color-accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  padding: 1rem var(--gutter);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.content-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem var(--gutter) 4rem;
  width: 100%;
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumbs {
  margin-bottom: 1.5rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  list-style: none;
}
.breadcrumbs li:not(:last-child)::after { content: '›'; margin-left: 0.5rem; }
.breadcrumbs a { color: var(--color-accent-dark); }
.breadcrumbs a:hover { color: var(--color-primary); }

/* ── Content type badge ─────────────────────────────────────────────────── */
.content-meta { margin-bottom: 1.5rem; }
.type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.type-badge--foundation { background: #ede9fe; color: #5b21b6; }
.type-badge--task       { background: #e0f2fe; color: #0369a1; }
.type-badge--troubleshooting { background: #fef3c7; color: #92400e; }

/* ── Two-column article layout ──────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

.article-main { min-width: 0; /* prevent grid blowout */ }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
}
.sidebar-block--nav { background: var(--color-foam); }

.sidebar-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-link {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text);
  border-radius: 4px;
  line-height: 1.4;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.sidebar-link:hover { background: var(--color-code-bg); color: var(--color-primary); text-decoration: none; }

.sidebar-all-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-decoration: none;
}
.sidebar-all-link:hover { color: var(--color-primary); text-decoration: underline; }

.sidebar-nav-list { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav-link {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius);
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.sidebar-nav-link:hover { background: var(--color-code-bg); color: var(--color-primary); text-decoration: none; }
.sidebar-nav-link--active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav-link--active:hover { background: var(--color-primary-dark); color: #fff; }

/* ── Prev/Next nav ──────────────────────────────────────────────────────── */
.page-nav { margin-top: 2.5rem; }
.page-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.page-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--color-foam);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--t), background var(--t);
  text-decoration: none;
}
.page-nav-link:hover {
  border-color: var(--color-accent);
  background: var(--color-code-bg);
  text-decoration: none;
}
.page-nav-link--next { text-align: right; }
.page-nav-dir { font-size: 0.78rem; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.page-nav-title { font-size: 0.9rem; font-weight: 600; color: var(--color-primary); }

/* ── Hero section ───────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, #1d5ea8 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero-title-accent { color: var(--color-teal); }
.hero-lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.92;
  margin-bottom: 0.75rem;
  max-width: 600px;
  line-height: 1.6;
}
.hero-sub {
  font-size: 0.95rem;
  opacity: 0.75;
  max-width: 560px;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.hero-logo-img {
  opacity: 0.9;
  filter: drop-shadow(0 4px 24px rgba(14, 165, 233, 0.4));
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn--primary  { background: var(--color-teal); color: #fff; box-shadow: 0 4px 14px rgba(20,184,166,0.4); }
.btn--primary:hover { background: var(--color-teal-dark); color: #fff; }
.btn--secondary { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn--secondary:hover { background: rgba(255,255,255,0.25); color: #fff; }
.btn--tertiary  { background: rgba(245,158,11,0.25); color: #fef3c7; border: 1px solid rgba(245,158,11,0.4); }
.btn--tertiary:hover { background: rgba(245,158,11,0.4); color: #fff; }

/* ── About section ──────────────────────────────────────────────────────── */
.about-section {
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
  background: var(--color-surface-2);
}
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.about-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--t), transform var(--t);
}
.about-card:hover {
  box-shadow: 0 8px 24px rgba(26, 58, 107, 0.1);
  transform: translateY(-3px);
}
.about-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.about-card h3 { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: 0.5rem; }
.about-card p   { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.6; }

/* ── Content sections (home page) ───────────────────────────────────────── */
.content-section {
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
}
.content-section--foundation   { background: var(--color-surface); }
.content-section--task         { background: var(--color-foam); }
.content-section--troubleshooting { background: #fffbeb; }
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.section-icon { font-size: 2rem; flex-shrink: 0; }
.section-desc { color: var(--color-text-muted); font-size: 0.95rem; margin-top: 0.2rem; }
.section-more-link {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-decoration: none;
}
.section-more-link:hover { color: var(--color-primary); text-decoration: underline; }

/* ── Card grid ──────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  list-style: none;
}
.content-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  text-decoration: none;
  height: 100%;
}
.content-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.12);
  transform: translateY(-2px);
  text-decoration: none;
}
.content-card--foundation:hover { border-color: var(--color-foundation); }
.content-card--troubleshooting:hover { border-color: var(--color-troubleshoot); }
.card-icon { font-size: 1.1rem; }
.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  line-height: 1.4;
}
.card-keyword {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: lowercase;
}

/* ── Category header ────────────────────────────────────────────────────── */
.category-header {
  padding: 2rem 0 2.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}
.category-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.category-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.category-header p { font-size: 1rem; color: var(--color-text-muted); max-width: 640px; }

/* ── Page list (category index) ─────────────────────────────────────────── */
.page-list { display: flex; flex-direction: column; gap: 0.5rem; list-style: none; }
.page-list-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color var(--t), background var(--t), transform var(--t);
  text-decoration: none;
}
.page-list-link:hover {
  border-color: var(--color-accent);
  background: var(--color-foam);
  transform: translateX(4px);
  text-decoration: none;
}
.page-list-title { font-weight: 600; color: var(--color-primary); font-size: 0.95rem; flex: 1; }
.page-list-keyword { font-size: 0.78rem; color: var(--color-text-light); flex-shrink: 0; }

/* ── Category pages ─────────────────────────────────────────────────────── */

/* Intro section with text + stats */
.category-intro         { margin-bottom: 3rem; }
.category-intro-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2.5rem;
  align-items: start;
}
.category-intro-text p  { margin-bottom: 1rem; font-size: 0.97rem; line-height: 1.75; color: var(--color-text); }
.category-intro-text p:last-child { margin-bottom: 0; }

/* Stat cards */
.category-intro-stats   { display: flex; flex-direction: column; gap: 0.75rem; }
.stat-card {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--color-foam);
  border-left: 4px solid var(--color-border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat-card--foundation  { border-left-color: var(--color-foundation); }
.stat-card--task        { border-left-color: var(--color-task); }
.stat-card--troubleshooting { border-left-color: var(--color-troubleshoot); }
.stat-number { font-size: 1.7rem; font-weight: 800; color: var(--color-primary); line-height: 1; }
.stat-label  { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; }

/* Section headings within category pages */
.category-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.category-section-desc  { font-size: 0.93rem; color: var(--color-text-muted); margin-bottom: 1.25rem; }

.category-featured      { margin-bottom: 3rem; }
.category-all           { margin-bottom: 3rem; }
.category-topics        { margin-bottom: 2.5rem; }
.category-tip           { margin-bottom: 2.5rem; }
.category-next          { padding: 2rem; background: var(--color-foam); border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
.category-next .category-section-title { margin-bottom: 0.5rem; }
.category-next-desc     { font-size: 0.93rem; color: var(--color-text-muted); margin-bottom: 1.25rem; line-height: 1.65; }
.category-next-links    { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Featured cards grid */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  list-style: none;
}
.featured-grid--wide    { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.featured-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  height: 100%;
}
.featured-card:hover {
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(26,58,107,0.1);
  transform: translateY(-3px);
}
.featured-card--foundation:hover  { border-color: var(--color-foundation); }
.featured-card--task:hover         { border-color: var(--color-task); }
.featured-card--troubleshooting:hover { border-color: var(--color-troubleshoot); }
.featured-card-icon  { font-size: 1.4rem; }
.featured-card-title { font-size: 0.95rem; font-weight: 700; color: var(--color-primary); line-height: 1.4; flex: 1; }
.featured-card-keyword { font-size: 0.78rem; color: var(--color-text-muted); }
.featured-card-cta   { font-size: 0.82rem; font-weight: 600; color: var(--color-accent-dark); margin-top: auto; }

/* Page list — icon variant */
.page-list-icon  { font-size: 0.9rem; flex-shrink: 0; }

/* Topic pill tags */
.topic-pills     { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.topic-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-primary);
}
.topic-pill--warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

/* Tip box */
.tip-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--color-troubleshoot);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text);
}
.tip-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }

/* Outline buttons */
.btn--outline-primary {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--t), color var(--t), transform var(--t);
}
.btn--outline-primary:hover { background: var(--color-primary); color: #fff; transform: translateY(-1px); text-decoration: none; }
.btn--outline-warning {
  background: transparent;
  border: 2px solid var(--color-troubleshoot);
  color: #92400e;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--t), color var(--t), transform var(--t);
}
.btn--outline-warning:hover { background: var(--color-troubleshoot); color: #fff; transform: translateY(-1px); text-decoration: none; }

@media (max-width: 768px) {
  .category-intro-grid { grid-template-columns: 1fr; }
  .category-intro-stats { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1; min-width: 130px; }
  .featured-grid { grid-template-columns: 1fr; }
}
.offline-page { text-align: center; padding-top: 4rem; }
.offline-icon { font-size: 4rem; margin-bottom: 1rem; }
.offline-page h1 { color: var(--color-primary); margin-bottom: 0.75rem; font-size: 2rem; }
.offline-page p { color: var(--color-text-muted); margin-bottom: 0.5rem; }

/* ── Article layout (content pages) ────────────────────────────────────── */
.article {
  /* No max-width — fills the main column of the two-column grid */
  min-width: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-graphic { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .page-nav-inner { grid-template-columns: 1fr; }
  /* Collapse sidebar below article on tablet/mobile */
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-block { flex: 1; min-width: 220px; }
}

@media (max-width: 640px) {
  .header-nav { display: none; }
  .hamburger { display: flex; }
  .site-header { height: auto; min-height: var(--header-h); flex-direction: column; align-items: stretch; }
  .section-header { flex-direction: column; }
  .section-more-link { margin-left: 0; }
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
}

@media (min-width: 1200px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

