@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Outfit:wght@100..900&display=swap');

:root {
  --primary: #1b494d;             /* Calming Sea Teal */
  --primary-hover: #14383c;
  --primary-light: #e4f1f2;
  --primary-dark: #0e2a2e;
  --bg: #faf6f0;                  /* Soft Warm Sand/Cream */
  --bg-body: #fdfbf7;             /* Comforting Soft Linen */
  --bg-card: #ffffff;
  --bg-sidebar: #fdfbf7;
  --bg-sidebar-hover: #f5eedc;    /* Richer Warm cream */
  --bg-code: #f3ede2;
  --border: #eadecf;              /* Soft Warm Linen Border */
  --border-light: #f5eedc;
  --text: #2a3233;                /* Gentle Soft Charcoal */
  --text-secondary: #4d5859;
  --text-muted: #7c8b8c;
  --text-header: #172c2e;         /* Rich Teal-Charcoal */
  --shadow-sm: 0 2px 6px rgba(42,50,51,0.04);
  --shadow-md: 0 8px 24px rgba(42,50,51,0.07);
  --shadow-lg: 0 16px 40px rgba(42,50,51,0.1);
  --radius: 8px;                  /* Softer rounded corners */
  --radius-lg: 14px;
  --radius-xl: 20px;
  --sidebar-width: 280px;
  --toc-width: 240px;
  --max-content: 760px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-reading: 'Lora', Georgia, serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --accent-gold: #d4a373;         /* Gorgeous Sunset Gold */
  --accent-gold-hover: #c69162;
  --accent-gold-light: #fef8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121516;                /* Soothing Dark Onyx */
    --bg-body: #16191b;           /* Cozy Forest Obsidian */
    --bg-card: #1d2224;           /* Warm Dark Slate Card */
    --bg-sidebar: #16191b;
    --bg-sidebar-hover: #262e31;
    --bg-code: #252b2e;
    --border: #2a3133;
    --border-light: #1e2426;
    --text: #e2e6e7;
    --text-secondary: #a0a9ac;
    --text-muted: #6f7a7d;
    --text-header: #ffffff;
    --primary: #5bc0be;           /* Soft Bright Cyan-Teal */
    --primary-hover: #3a9e9d;
    --primary-light: #1b2e2f;
    --primary-dark: #0b1a1b;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
    --accent-gold: #e9c46a;       /* Soft glowing gold */
    --accent-gold-hover: #dfb248;
    --accent-gold-light: #242219;
  }
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); text-decoration: none; }

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

/* ─── Header & Progress Bar ──────────────────────────────────────── */
.header {
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
}

.brand-area { display: flex; align-items: center; gap: 12px; }
.brand-logo img { width: 30px; height: 32px; border-radius: var(--radius); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 800; font-size: 15px; color: var(--text-header); letter-spacing: -0.2px; }
.brand-tagline { font-size: 10.5px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 6px;
  margin-left: auto;
}
.nav-links li a {
  display: block;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}
.nav-links li a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.lang-selector { margin-left: 12px; }
.lang-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.lang-dropdown:focus { border-color: var(--primary); }

/* Sticky Header Scroll Progress Bar */
.scroll-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: hidden;
  z-index: 101;
}
.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-gold));
  transition: none;
}

/* ─── Page Layout ─────────────────────────────────────────────────── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  position: relative;
}

/* ─── Left Sidebar ────────────────────────────────────────────────── */
.sidebar-left {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand { display: none; }

.sidebar-nav { width: 100%; }
.sidebar-top-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-top-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.sidebar-top-links li a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--primary);
}
.sidebar-top-links li a i { font-size: 14px; width: 16px; text-align: center; }

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

/* Hierarchical Sidebar details tree */
.sidebar-section {
  margin-bottom: 8px;
}
.sidebar-section summary {
  list-style: none;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.sidebar-section summary:hover { background: var(--border-light); }
.sidebar-section summary::-webkit-details-marker { display: none; }
.sidebar-section summary i { font-size: 13px; margin-right: 8px; width: 14px; text-align: center; color: var(--text-secondary); }
.section-count {
  margin-left: auto;
  font-size: 10px;
  background: var(--border-light);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-muted);
}

.sidebar-section-links {
  list-style: none;
  padding-left: 12px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section-links li a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all 0.12s;
}
.sidebar-section-links li a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--primary);
}

/* ─── Right TOC Sidebar ───────────────────────────────────────────── */
.sidebar-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
  padding: 24px;
}
.toc-sticky { position: sticky; top: 0; }
.toc-header {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc-nav .toc-list {
  list-style: none;
  padding: 0;
}
.toc-nav .toc-list li {
  margin: 0;
  padding: 0;
}
.toc-nav .toc-list a {
  display: block;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.45;
}
.toc-nav .toc-list a:hover {
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}
.toc-nav .toc-lvl-2 a { padding-left: 8px; }
.toc-nav .toc-lvl-3 a { padding-left: 20px; font-size: 12px; color: var(--text-muted); }

/* ─── Breadcrumbs ─────────────────────────────────────────────────── */
.breadcrumbs {
  padding: 16px 32px 0;
  font-size: 12.5px;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 4px;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--text-muted);
  margin-right: 4px;
}
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item:last-child a { color: var(--text-muted); pointer-events: none; }

/* ─── Homepage Redesign ───────────────────────────────────────────── */

/* Hero Sanctuary Area */
.hero-sanctuary {
  padding: 64px 32px 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.hero-sanctuary h1 {
  font-family: var(--font);
  font-size: 38px;
  font-weight: 800;
  color: var(--text-header);
  margin-bottom: 16px;
  letter-spacing: -0.7px;
  line-height: 1.25;
}
.hero-sanctuary p {
  font-family: var(--font-reading);
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.65;
}
.hero-stats {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 12.5px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.hero-stats b {
  color: var(--primary);
  font-weight: 700;
}

/* Digital Safety & Warm Support Cards Section */
.sanctuary-support-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 32px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.sanctuary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.sanctuary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.sanctuary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--primary);
}
.sanctuary-card.safety-card::before {
  background: var(--accent-gold);
}
.sanctuary-card h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sanctuary-card h3 i {
  font-size: 16px;
}
.sanctuary-card.safety-card h3 i {
  color: var(--accent-gold);
}
.sanctuary-card.comfort-card h3 i {
  color: var(--primary);
}
.sanctuary-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.sanctuary-card p:last-child {
  margin-bottom: 0;
}
.sanctuary-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sanctuary-tips-list li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.sanctuary-tips-list li i {
  color: var(--primary);
  font-size: 12px;
  margin-top: 3px;
}
.sanctuary-card.safety-card .sanctuary-tips-list li i {
  color: var(--accent-gold);
}

/* Core Principle / Foundation of Inquiry Card */
.core-principle-section {
  padding: 0 32px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.core-principle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-sidebar-hover) 100%);
  position: relative;
  overflow: hidden;
}
.core-principle-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(212,163,115,0.06) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.core-principle-card .principle-label {
  font-family: var(--font);
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}
.core-principle-card .principle-title {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 12px;
}
.core-principle-card .principle-body {
  font-family: var(--font-reading);
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.core-principle-card .principle-body br {
  margin-bottom: 8px;
}

/* Search bar styling */
.search-container { padding: 0 32px 32px; max-width: 620px; margin: 0 auto; }
.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 16px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.search-icon { color: var(--text-muted); font-size: 15px; }
.search-input {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 12px;
  font-size: 14.5px;
  outline: none;
  color: var(--text);
  font-family: var(--font);
}
.search-input::placeholder { color: var(--text-muted); }

/* ─── Homepage Link-list Cards ────────────────────────────────────── */
.home-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  padding: 0 32px 32px;
}

.home-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
}
.home-section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.home-section-wide { grid-column: 1 / -1; }

.home-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-card) 100%);
}
.home-section-header i { font-size: 16px; color: var(--primary); width: 20px; text-align: center; }
.home-section-header h2 { font-size: 14.5px; font-weight: 700; color: var(--text-header); }

.home-section-body { padding: 8px 0; }

.home-section-links {
  list-style: none;
}
.home-section-links li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 20px;
  transition: background 0.15s ease;
}
.home-section-links li:hover { background: var(--bg-sidebar-hover); }
.home-section-links li a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}
.home-section-links li a:hover { color: var(--primary); text-decoration: none; }
.link-count {
  font-size: 11.5px;
  color: var(--text-muted);
}
.link-desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}
.link-date {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.home-recent-list li {
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px;
}
.home-recent-list li a { font-size: 14.5px; font-weight: 600; color: var(--primary); }
.home-recent-list li a:hover { color: var(--primary-hover); }

.home-section-more {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  border-top: 1px solid var(--border-light);
  transition: background 0.15s ease;
}
.home-section-more:hover { background: var(--bg-sidebar-hover); text-decoration: none; }

/* ─── Article Page ─────────────────────────────────────────────────── */
.article-container {
  padding: 32px 48px 48px;
  max-width: var(--max-content);
}

.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-header);
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.article-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.article-info time::before { content: "\f073"; font-family: "Font Awesome 6 Free"; font-weight: 400; margin-right: 5px; }

.article-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}
.tag-badge:hover { background: var(--primary); color: #fff; text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .tag-badge { background: rgba(91,192,190,0.15); }
  .tag-badge:hover { background: var(--primary); }
}

/* ─── TL;DR Box ────────────────────────────────────────────────────── */
.tldr-box {
  background: var(--bg-sidebar-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 32px;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
}
.tldr-title {
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.tldr-content { color: var(--text-secondary); line-height: 1.65; font-family: var(--font-reading); }

/* ─── Article Body ─────────────────────────────────────────────────── */
.com-content-article__body {
  font-family: var(--font-reading);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text);
}
.com-content-article__body h2 {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-header);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.com-content-article__body h3 {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-header);
  margin: 32px 0 12px;
}
.com-content-article__body h4 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-header);
  margin: 24px 0 10px;
}
.com-content-article__body p { margin-bottom: 18px; }
.com-content-article__body ul, .com-content-article__body ol { margin: 0 0 18px 24px; }
.com-content-article__body li { margin-bottom: 6px; }
.com-content-article__body blockquote {
  border-left: 4px solid var(--primary);
  padding: 14px 22px;
  margin: 24px 0;
  background: var(--bg);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.com-content-article__body blockquote p:last-child { margin-bottom: 0; }
.com-content-article__body pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  font-family: var(--font-mono);
  line-height: 1.6;
  margin: 24px 0;
}
.com-content-article__body code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-dark);
}
@media (prefers-color-scheme: dark) {
  .com-content-article__body code { color: var(--primary); }
}
.com-content-article__body pre code { background: none; padding: 0; color: inherit; }
.com-content-article__body img {
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.com-content-article__body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}
.com-content-article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
}
.com-content-article__body th, .com-content-article__body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.com-content-article__body th { background: var(--bg); font-weight: 700; color: var(--text-header); }
.com-content-article__body a { word-break: break-word; text-decoration: underline; text-decoration-color: var(--border); }
.com-content-article__body a:hover { text-decoration-color: var(--primary); }

/* ─── Related Articles ─────────────────────────────────────────────── */
.related-articles {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related-articles h3 { font-size: 16px; font-weight: 700; color: var(--text-header); margin-bottom: 16px; }
.related-articles ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.related-articles ul li a {
  display: block;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s ease;
}
.related-articles ul li a:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-card); text-decoration: none; }

/* ─── Verify/CCO Callout ───────────────────────────────────────────── */
.article-warning {
  margin-top: 40px;
  padding: 18px 22px;
  background: var(--accent-gold-light);
  border: 1px solid var(--border);
  border-left: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}
.article-warning .warning-label { font-weight: 700; color: var(--text-header); display: block; margin-bottom: 6px; font-size: 14px; }
.article-warning .warning-body { color: var(--text-secondary); margin: 0; line-height: 1.6; }

.cc0-callout {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
}
.cc0-callout img { width: 64px; height: auto; flex-shrink: 0; }
.cc0-callout strong { color: var(--text-header); display: block; margin-bottom: 4px; }
.cc0-callout p { color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ─── Tag Page ─────────────────────────────────────────────────────── */
.tag-description { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 24px; font-family: var(--font-reading); }
.tag-page-list { list-style: none; }
.tag-page-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.tag-page-list li a { font-size: 15px; font-weight: 600; color: var(--text); }
.tag-page-list li a:hover { color: var(--primary); }
.tag-page-list .post-date { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }

/* ─── Sister Projects ──────────────────────────────────────────────── */
.sister-projects {
  padding: 36px 32px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
.sister-projects h3 { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 16px; }
.sister-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.sister-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.sister-item:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.sister-item i { font-size: 14px; }

/* ─── Footer ───────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-body);
  padding: 24px 32px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer img { width: 74px; height: 26px; vertical-align: middle; }
.footer-nav { display: flex; list-style: none; gap: 20px; }
.footer-nav a { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.footer-nav a:hover { color: var(--primary); }

/* ─── Back to Top ──────────────────────────────────────────────────── */
.back-to-top-link {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.back-to-top-link.visible { opacity: 1; transform: translateY(0); }
.back-to-top-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ─── Responsive & Adjustments ────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --toc-width: 200px; }
}

@media (max-width: 1024px) {
  .sidebar-toc { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0; }
  .sidebar-left { display: none; }
  .header-inner { padding: 0 16px; }
  .brand-tagline { display: none; }
  .nav-links li a { padding: 8px 10px; font-size: 12.5px; }
  .hero-sanctuary, .sanctuary-support-row, .core-principle-section,
  .search-container, .home-sections, .article-container, .sister-projects,
  .breadcrumbs { padding-left: 20px; padding-right: 20px; }
  .home-sections { grid-template-columns: 1fr; }
  .hero-sanctuary h1 { font-size: 28px; }
  .page-header h1 { font-size: 26px; }
  .article-container { padding: 24px 20px; }
  .article-info { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ─── Archive redesign: field-notes visual system ───────────────────
   The existing Hiccup structure and routes stay unchanged. This layer
   retunes the surface for long-form reading: ink, paper, one signal accent,
   disciplined rules, and quieter containers. */
:root {
  --primary: #b24f35;
  --primary-hover: #893a28;
  --primary-light: #f4e5df;
  --primary-dark: #6f2f22;
  --bg: #eeece6;
  --bg-body: #f7f6f2;
  --bg-card: #fffefa;
  --bg-sidebar: #f1f0eb;
  --bg-sidebar-hover: #e7e5de;
  --bg-code: #e8e6df;
  --border: #d6d3ca;
  --border-light: #e5e2db;
  --text: #273136;
  --text-secondary: #4c585d;
  --text-muted: #778187;
  --text-header: #172126;
  --shadow-sm: 0 1px 2px rgba(23,33,38,.05);
  --shadow-md: 0 12px 30px rgba(23,33,38,.08);
  --shadow-lg: 0 22px 50px rgba(23,33,38,.12);
  --radius: 5px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --font-reading: 'Lora', Georgia, serif;
  --accent-gold: #b24f35;
  --accent-gold-hover: #893a28;
  --accent-gold-light: #f4e5df;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191b;
    --bg-body: #1b2022;
    --bg-card: #22292b;
    --bg-sidebar: #1b2022;
    --bg-sidebar-hover: #2a3235;
    --bg-code: #111517;
    --border: #354044;
    --border-light: #2a3336;
    --text: #e4e7e7;
    --text-secondary: #b3bec1;
    --text-muted: #849195;
    --text-header: #f4f5f3;
    --primary: #e07a5f;
    --primary-hover: #f09578;
    --primary-light: #3a2926;
    --primary-dark: #f0a089;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.28);
    --shadow-md: 0 12px 30px rgba(0,0,0,.32);
    --shadow-lg: 0 22px 50px rgba(0,0,0,.42);
    --accent-gold: #e07a5f;
    --accent-gold-hover: #f09578;
    --accent-gold-light: #3a2926;
  }
}

body {
  background: var(--bg);
  letter-spacing: .005em;
}

.header {
  background: var(--bg-body);
  background: color-mix(in srgb, var(--bg-body) 92%, transparent);
  border-bottom-color: var(--text-header);
  box-shadow: 0 1px 0 var(--border);
}
.header-inner { height: 64px; max-width: 1480px; padding-inline: 28px; }
.brand-area { gap: 13px; }
.brand-logo img { border-radius: 5px; width: 32px; height: 34px; }
.brand-name { font-size: 16px; letter-spacing: -.035em; }
.brand-tagline { color: var(--primary); letter-spacing: .12em; font-size: 9px; }
.nav-links { gap: 2px; }
.nav-links li a { border-radius: 4px; letter-spacing: .03em; text-transform: uppercase; font-size: 11px; }
.nav-links li a:hover { color: var(--text-header); background: var(--primary-light); }
.lang-selector { margin-left: 8px; }
.lang-dropdown { border-radius: 4px; padding: 7px 10px; font-size: 11px; }

.page-wrapper { max-width: 1480px; background: var(--bg-body); }
.sidebar-left { width: 264px; background: var(--bg-sidebar); border-right-color: var(--border); padding: 24px 18px; }
.sidebar-top-links li a { border-radius: 4px; padding: 9px 11px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.sidebar-section { margin-bottom: 5px; }
.sidebar-section summary { border-radius: 4px; padding: 9px 10px; font-size: 10px; letter-spacing: .14em; }
.sidebar-section-links { padding-left: 10px; }
.sidebar-section-links li a { border-radius: 3px; padding: 6px 10px; font-size: 12.5px; }
.section-count { border-radius: 3px; padding: 1px 5px; }
.sidebar-toc { border-left-color: var(--border); padding: 26px 20px; }
.toc-header { color: var(--primary); font-size: 10px; letter-spacing: .16em; }
.toc-nav .toc-list a { border-left-width: 1px; padding-block: 7px; font-size: 12px; }
.toc-nav .toc-list a:hover { border-left-color: var(--primary); }

.hero-sanctuary {
  text-align: left;
  padding: 72px 56px 48px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
}
.hero-sanctuary::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-bottom: 24px;
  background: var(--primary);
}
.hero-sanctuary h1 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 800;
}
.hero-sanctuary p { max-width: 620px; margin: 0 0 24px; font-size: 16px; line-height: 1.75; }
.hero-stats { border-radius: 4px; padding: 8px 12px; box-shadow: none; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.hero-stats b { color: var(--primary); }

.sanctuary-support-row { max-width: none; grid-template-columns: 1.25fr 1fr; gap: 0; padding: 0; }
.sanctuary-card, .core-principle-card, .home-section-card { border-radius: 0; box-shadow: none; }
.sanctuary-card { border-width: 0 1px 1px 0; padding: 30px 34px; }
.sanctuary-card:hover, .home-section-card:hover { transform: none; box-shadow: none; }
.sanctuary-card::before { width: 2px; }
.sanctuary-card h3 { font-size: 14px; letter-spacing: .01em; }
.sanctuary-card p, .sanctuary-tips-list li { font-size: 12.5px; }
.core-principle-section { max-width: none; padding: 0; }
.core-principle-card { border-width: 0 0 1px; padding: 32px 34px; background: var(--bg-sidebar); }
.core-principle-card::after { display: none; }
.core-principle-card .principle-label, .tldr-title { color: var(--primary); font-size: 10px; letter-spacing: .16em; }
.core-principle-card .principle-title { font-size: 22px; letter-spacing: -.025em; }
.core-principle-card .principle-body { max-width: 72ch; font-size: 14px; }

.search-container { max-width: none; padding: 28px 34px; background: var(--bg-body); }
.search-wrapper { max-width: 680px; border-radius: 4px; box-shadow: none; padding-inline: 13px; }
.search-wrapper:focus-within { box-shadow: 0 0 0 3px var(--primary-light); }
.search-input { font-size: 13px; }

.home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; border-top: 1px solid var(--border); }
.home-section-card { border-width: 0 1px 1px 0; min-width: 0; }
.home-section-wide { grid-column: 1 / -1; }
.home-section-header { padding: 17px 22px; background: var(--bg-sidebar); border-bottom-color: var(--border); }
.home-section-header h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; }
.home-section-links li { padding: 9px 22px; }
.home-section-links li:hover { background: var(--bg-sidebar-hover); }
.home-section-links li a { font-size: 13px; }
.home-section-more { border-top-color: var(--border); padding: 12px 22px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

.article-container { max-width: 820px; padding: 52px 60px 72px; }
.page-header { margin-bottom: 38px; }
.page-header h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.article-info { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.tag-badge { border-radius: 3px; padding: 3px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.tldr-box { border-radius: 4px; box-shadow: none; padding: 18px 20px; background: var(--bg-sidebar); }
.com-content-article__body { max-width: 72ch; font-size: 17px; line-height: 1.86; }
.com-content-article__body h2 { font-size: 27px; letter-spacing: -.035em; border-bottom: 0; padding-bottom: 0; margin-top: 52px; }
.com-content-article__body h3 { font-size: 20px; letter-spacing: -.02em; }
.com-content-article__body blockquote { border-left-width: 2px; border-radius: 0; background: var(--bg-sidebar); padding: 18px 22px; }
.com-content-article__body pre, .com-content-article__body img { border-radius: 4px; }
.com-content-article__body a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.related-articles { border-top-color: var(--border); }
.related-articles ul li a { border-radius: 4px; box-shadow: none; }
.article-warning { border-left-width: 2px; border-radius: 0; box-shadow: none; }
.cc0-callout { border-radius: 0; }

.sister-projects { padding: 34px; border-top-color: var(--border); }
.sister-projects h3, .footer { letter-spacing: .08em; }
.sister-item { border-radius: 4px; box-shadow: none; padding: 9px 13px; font-size: 12px; }
.sister-item:hover { transform: none; }
.footer { background: var(--bg-sidebar); padding: 26px 34px; }
.back-to-top-link { border-radius: 4px; width: 40px; height: 40px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ─── Accessibility ────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: first tab stop, visually hidden until focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  font-size: 13px;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* TOC / heading anchors must clear the sticky header when jumped to */
:target { scroll-margin-top: 90px; }
.com-content-article__body [id] { scroll-margin-top: 90px; }

/* Active section in the scroll-spy TOC */
.toc-nav .toc-list a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Below-the-fold sections skip offscreen rendering (paint + layout perf) */
.related-articles, .sister-projects, .footer, .article-warning, .cc0-callout {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 768px) {
  .header-inner { height: 58px; }
  .nav-links { gap: 0; }
  .nav-links li a { padding-inline: 7px; font-size: 10px; }
  .hero-sanctuary { padding: 46px 20px 34px; }
  .hero-sanctuary h1 { font-size: 38px; }
  .hero-sanctuary p { font-size: 15px; }
  .sanctuary-support-row { grid-template-columns: 1fr; }
  .sanctuary-card { border-right: 0; padding: 25px 20px; }
  .core-principle-card { padding: 26px 20px; }
  .home-sections { grid-template-columns: 1fr; }
  .home-section-card { border-right: 0; }
  .search-container { padding: 22px 20px; }
  .article-container { padding: 34px 20px 54px; }
  .com-content-article__body { font-size: 16px; }
  .sister-projects, .footer { padding-inline: 20px; }
}
