/* ============================================
   BOSONICA — Editorial / Atom Theme
   Burgundy · Cream · Charcoal · No theme toggle
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=News+Cycle:wght@400;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Core palette */
  --burgundy:        #9b1e3f;
  --burgundy-dark:   #7a1832;
  --burgundy-light:  #b8344e;
  --burgundy-bg:     rgba(155, 30, 63, 0.08);

  --cream:           #fbe6d5;
  --cream-light:     #fdf2e6;
  --cream-soft:      #f5ebe0;
  --cream-deep:      #f0d9c0;

  --charcoal:        #3d3a37;
  --charcoal-light:  #4f4c48;
  --charcoal-deep:   #2c2a28;

  --text:            #2a2622;       /* near-black on cream */
  --text-secondary:  #5c5852;
  --text-tertiary:   #8a857e;
  --text-on-dark:    #f0e6dc;       /* cream on charcoal */
  --text-on-dark-2:  #a8a098;
  --text-on-dark-3:  #6e6862;

  --border:          #d8c8b8;       /* on cream */
  --border-2:        #c0b0a0;
  --border-dark:     #4f4c48;       /* on charcoal */
  --border-dark-2:   #5a564f;

  --bg:              #fbe6d5;       /* cream */
  --bg-elevated:     #fdf2e6;       /* slightly lighter */
  --bg-soft:         #f5ebe0;
  --bg-deep:         #f0d9c0;
  --surface-hover:   rgba(155, 30, 63, 0.06);

  --shadow-sm: 0 1px 3px rgba(60, 40, 30, 0.08);
  --shadow-md: 0 4px 12px rgba(60, 40, 30, 0.1);
  --shadow-lg: 0 8px 28px rgba(60, 40, 30, 0.14);

  /* Typography */
  --font-display: 'Crimson Text', Georgia, serif;
  --font-ui:      'News Cycle', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm: 3px;
  --radius:    5px;
  --radius-lg: 8px;

  --topband-h:     150px;
  --sidebar-w:     250px;
  --max-w:         1280px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--burgundy-light); }

a { color: var(--burgundy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Tags ── */
.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15em 0.55em;
  border-radius: var(--radius-sm);
  border: 1px solid;
  white-space: nowrap;
}
.tag-coral  { color: #a3422d; border-color: #a3422d; background: rgba(163,66,45,0.07); }
.tag-sage   { color: #4f7c50; border-color: #4f7c50; background: rgba(79,124,80,0.07); }
.tag-amber  { color: #936a1c; border-color: #936a1c; background: rgba(147,106,28,0.07); }
.tag-rose   { color: #8b3a5a; border-color: #8b3a5a; background: rgba(139,58,90,0.07); }
.tag-accent { color: var(--burgundy); border-color: var(--burgundy); background: var(--burgundy-bg); }

.read-time {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 0.5em 1.1em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  text-decoration: none;
  border: 1px solid var(--border-2);
  background: var(--bg-elevated);
  color: var(--text);
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--bg-deep); border-color: var(--burgundy-light); text-decoration: none; }
.btn-accent {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--cream);
}
.btn-accent:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); }

/* ============================================
   APP SHELL — fixed top band + independent panes
   ============================================
   Grid rows: [top band] [body]
   Grid cols: [sidebar]  [section-header / content]
   The whole shell is 100vh and never scrolls;
   only .nav-pane and .content-pane scroll.
   ============================================ */
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topband-h) 1fr;
  grid-template-areas:
    "brand    section-header"
    "sidebar  content";
  overflow: hidden;
}

/* ── Brand block (top-left) ── */
.brand-block {
  grid-area: brand;
  background: var(--burgundy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--cream);
  text-decoration: none;
  padding: 1rem;
  overflow: hidden;
}
.brand-block:hover { text-decoration: none; }

.brand-logo {
  /* strict 1:1 box */
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}
.brand-logo svg { width: 100%; height: 100%; display: block; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
  line-height: 1;
}

/* ── Section header band (top-right) ── */
.section-header-band {
  grid-area: section-header;
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 2rem;
  overflow: hidden;
  gap: 0.4rem;
}

.section-header-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.1;
  letter-spacing: 0.005em;
}

.section-header-path {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-on-dark-2);
  letter-spacing: 0.02em;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-header-path .sep { color: var(--text-on-dark-3); margin: 0 0.3rem; }

.section-header-path .crumb {
  cursor: pointer;
  transition: color 0.12s;
}
.section-header-path .crumb:hover {
  color: var(--cream);
  text-decoration: underline;
}
.section-header-path .crumb:last-child {
  color: var(--cream);
}

/* ── Navigate sidebar (bottom-left) ── */
.nav-pane {
  grid-area: sidebar;
  background: var(--charcoal);
  color: var(--text-on-dark);
  padding: 1.25rem 0 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--border-dark);
}

.nav-section-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-on-dark);
  padding: 0 1.25rem 0.75rem;
  display: block;
}

/* ── Expandable tree nav ── */
.navtree { padding: 0 0.5rem; }

.navtree-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-on-dark);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
  user-select: none;
  line-height: 1.3;
}
.navtree-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--cream);
  text-decoration: none;
}
.navtree-item.active {
  color: var(--burgundy-light);
  background: rgba(184,52,78,0.12);
}

.navtree-arrow {
  width: 18px;
  padding: 0.15rem 0;
  margin: -0.15rem 0;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-on-dark-2);
  text-align: center;
  transition: transform 0.12s;
  border-radius: var(--radius-sm);
}
.navtree-arrow:not(.spacer) { cursor: pointer; }
.navtree-arrow:not(.spacer):hover {
  color: var(--cream);
  background: rgba(255,255,255,0.1);
}
.navtree-arrow.spacer { visibility: hidden; }

.navtree-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navtree-item--section {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
}
.navtree-item--folder { font-weight: 700; }
.navtree-item--note {
  font-family: var(--font-display);
  color: var(--text-on-dark-2);
}
.navtree-item--note:hover { color: var(--cream); }

.navtree-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.22s ease;
}
.navtree-children.open { max-height: 4000px; }

/* ── Content pane (bottom-right) ── */
.content-pane {
  grid-area: content;
  padding: 2.5rem 3rem 3rem;
  min-width: 0;
  background: var(--bg);
  overflow-y: auto;
}

/* ============================================
   HERO (homepage)
   ============================================ */
.hero {
  padding: 0.5rem 0 3rem;
  max-width: 720px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 720px;
}
.hero-tagline strong { font-weight: 700; color: var(--text); }

/* ============================================
   FEATURED PANEL (latest)
   ============================================ */
.featured-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
}

.featured-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.featured-label::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--burgundy);
}

.featured-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.featured-excerpt {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 560px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-tertiary);
}

/* ============================================
   SECTION HEADER & TILES
   ============================================ */
.pane-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pane-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.pane-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.15s;
}
.section-tile:hover {
  background: var(--bg-deep);
  border-color: var(--burgundy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.section-tile__icon {
  width: 40px; height: 40px;
  background: var(--burgundy);
  color: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.section-tile__body { min-width: 0; }
.section-tile__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.section-tile__meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
}

/* ============================================
   FILE LIST
   ============================================ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  animation: fadeIn 0.3s ease both;
  animation-delay: var(--delay, 0s);
}
.file-row:hover {
  border-color: var(--burgundy-light);
  background: var(--bg-deep);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.file-row__icon {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--burgundy-bg);
  color: var(--burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-row__body { min-width: 0; }
.file-row__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.file-row__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.file-row__tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}
.file-row__meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.2rem;
  flex-shrink: 0;
}
.file-row__type { padding-top: 0.2rem; }


/* ============================================
   FILTER CHIPS
   ============================================ */
.view-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 1.25rem;
}
.filter-chip {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 0.3em 0.9em;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.filter-chip:hover { color: var(--text); border-color: var(--burgundy-light); }
.filter-chip.active {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--cream);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  gap: 0.5rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}
.empty-state__icon { font-size: 2rem; opacity: 0.4; }

/* ============================================
   FOLDER VIEW (rendered in main area by JS)
   ============================================ */
.folder-view__hd {
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.folder-view__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.folder-view__icon { color: var(--burgundy); opacity: 0.7; }
.folder-view__subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

/* Clickable path elements inside the main block */
.folder-view__subtitle .crumb,
.article-eyebrow .crumb {
  cursor: pointer;
  transition: color 0.12s;
}
.folder-view__subtitle .crumb:hover,
.article-eyebrow .crumb:hover {
  color: var(--burgundy);
  text-decoration: underline;
}
.article-eyebrow .sep { color: var(--text-tertiary); }

.folder-view__group-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 1.5rem 0 0.75rem;
}

.folder-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}
.folder-card:hover {
  border-color: var(--burgundy-light);
  background: var(--bg-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.folder-card__icon {
  width: 38px; height: 38px;
  background: var(--burgundy-bg);
  color: var(--burgundy);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.folder-card__body { min-width: 0; flex: 1; }
.folder-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-card__meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
}

/* ── File-tree view in main area (cream re-skin of the navtree) ── */
.maintree {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.6rem;
}
.maintree .navtree-item { color: var(--text); font-size: 0.95rem; }
.maintree .navtree-item:hover {
  background: var(--surface-hover);
  color: var(--burgundy);
}
.maintree .navtree-item.active {
  color: var(--burgundy);
  background: var(--burgundy-bg);
}
.maintree .navtree-arrow { color: var(--text-tertiary); }
.maintree .navtree-arrow:hover { color: var(--burgundy); }
.maintree .navtree-item--note { color: var(--text-secondary); }
.maintree .navtree-item--note:hover { color: var(--burgundy); }

/* Back button in article view */
.main-back {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--burgundy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: gap 0.15s;
}
.main-back:hover { gap: 0.45rem; text-decoration: none; color: var(--burgundy-dark); }

/* ============================================
   TICKER
   ============================================ */
.ticker-wrap {
  background: var(--charcoal);
  color: var(--text-on-dark);
  padding: 0.5rem 0;
  overflow: hidden;
}
.ticker-inner { display: flex; align-items: center; }
.ticker-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--burgundy);
  padding: 0.3em 0.85em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-items {
  display: flex;
  animation: ticker-scroll 32s linear infinite;
  white-space: nowrap;
}
.ticker-item {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--text-on-dark);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ticker-item::before { content: '◆'; color: var(--burgundy-light); font-size: 0.55rem; }
@keyframes ticker-scroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ============================================
   ARTICLE PAGE
   ============================================ */
.article-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 4rem;
}
.article-back {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--burgundy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 2rem;
  transition: gap 0.15s;
}
.article-back:hover { gap: 0.45rem; text-decoration: none; }

.article-header { margin-bottom: 2.25rem; }

.article-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.article-eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--burgundy);
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

.article-excerpt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--burgundy);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-tertiary);
}
.article-meta strong { color: var(--text); font-weight: 500; font-family: var(--font-ui); }
.article-meta__sep { color: var(--border-2); }

.article-body { font-size: 1.05rem; line-height: 1.85; color: var(--text); font-family: var(--font-display); }
.article-body p { margin-bottom: 1.5rem; }

.article-body h2.article-h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}
.article-body h3.article-h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}
.article-body h4.article-h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin: 1.75rem 0 0.6rem;
}

blockquote.pull-quote {
  margin: 1.75rem 0;
  padding: 1.1rem 1.5rem;
  border-left: 3px solid var(--burgundy);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.7;
}

hr.article-rule { border: none; border-top: 1px solid var(--border); margin: 2.25rem 0; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--burgundy);
}

.code-block {
  margin: 1.5rem 0;
  background: var(--charcoal);
  border: 1px solid var(--charcoal-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-dark-2);
  background: var(--charcoal-deep);
  border-bottom: 1px solid var(--charcoal-light);
  padding: 0.45em 1em;
  display: block;
}
.code-block pre { margin: 0; padding: 1.1rem 1rem; overflow-x: auto; }
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--cream);
  background: none;
  border: none;
  padding: 0;
}

.article-figure {
  margin: 2rem 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-figure img { width: 100%; height: auto; display: block; }
.article-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-tertiary);
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--border);
}
.fig-label { color: var(--burgundy); font-weight: 500; margin-right: 0.25rem; }

.table-wrap {
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.article-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.88rem; }
.article-table thead { background: var(--bg-deep); }
.article-table th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.article-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.article-table tbody tr:last-child td { border-bottom: none; }
.article-table tbody tr:hover td { background: var(--bg-deep); }

.equation-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.75rem 0;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--burgundy);
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow-x: auto;
}
.equation-body { flex: 1; text-align: center; font-size: 1.05rem; color: var(--text); }
.equation-num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  margin-left: 1.25rem;
}

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

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 1.75rem 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--burgundy);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.12s;
}
.footer-links a:hover { color: var(--burgundy); text-decoration: none; }

/* ============================================
   ANIMATIONS & RESPONSIVE
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease both; }

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topband-h) auto 1fr;
    grid-template-areas:
      "brand"
      "section-header"
      "content";
    height: 100vh;
  }
  .brand-block {
    flex-direction: row;
    gap: 0.75rem;
    --topband-h: 80px;
    height: 80px;
  }
  .brand-logo { width: 44px; height: 44px; }
  .brand-name { font-size: 1.4rem; }
  .section-header-title { font-size: 1.4rem; }
  .nav-pane { display: none; }
  .content-pane { padding: 1.5rem; }
}
