/* ============================================================
   VECTOR FEED — MODERN MONOCHROME THEME
   Font: Quicksand 400–700
   Palette: #000, #111, #333, #666, #999, #ddd, #f5f5f5, #fff
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: #111;
  background: #fff;
  line-height: 1.7;
  padding-top: 140px;
}

img { max-width: 100%; height: auto; }
a { color: #000; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.6; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
li { margin-bottom: 0.35rem; }
p { margin-bottom: 1.25rem; }
strong { font-weight: 700; }
em { font-style: italic; }
code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 0.875em; background: #f5f5f5; padding: 0.15em 0.4em; border-radius: 3px; color: #000; }
pre { background: #f5f5f5; padding: 1.25rem; border-radius: 6px; overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid #e0e0e0; }
pre code { background: none; padding: 0; border-radius: 0; font-size: 0.85rem; line-height: 1.6; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
th, td { border: 1px solid #ddd; padding: 0.65rem 0.85rem; text-align: left; font-weight: 400; }
th { background: #000; color: #fff; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.8rem; }
tr:nth-child(even) td { background: #fafafa; }
blockquote { border-left: 3px solid #000; padding: 0.75rem 1.25rem; margin: 0 0 1.25rem 0; background: #f9f9f9; font-style: italic; color: #333; }
hr { border: none; border-top: 1px solid #e0e0e0; margin: 2.5rem 0; }

/* --- HEADINGS — ALL CAPS --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.2rem; letter-spacing: 0.08em; border-bottom: 2px solid #000; padding-bottom: 0.6rem; margin-top: 0; }
h2 { font-size: 1.5rem; letter-spacing: 0.06em; padding-bottom: 0.4rem; border-bottom: 1px solid #ddd; }
h3 { font-size: 1.15rem; letter-spacing: 0.05em; color: #333; }
h4 { font-size: 1rem; letter-spacing: 0.05em; color: #555; text-transform: none; font-weight: 600; }
h5 { font-size: 0.9rem; letter-spacing: 0.04em; color: #666; text-transform: none; font-weight: 600; }

/* Figure captions (diagram titles) — ALL CAPS */
figure { margin: 1.5rem 0; text-align: center; }
figure img { border: 1px solid #e0e0e0; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
figcaption { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: #666; margin-top: 0.5rem; font-weight: 500; }

/* --- DIAGRAMS: FULL WIDTH, LANDSCAPE ORIENTED --- */
.content-inner img[src*="diagrams/"] {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 1.5rem auto;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Right after h3, the text paragraphs + diagram form a 2-column grid.
   The pattern: h3 → p (text) → p (text) → p (diagram) → h3 (next use case)
   We wrap everything between h3s via display: flow-root and float the img. */
.content-inner p:has(> img[src*="diagrams/"]) {
  margin: 0.75rem 0 1.5rem;
}

.content-inner img[src*="diagrams/"] {
  display: block;
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
  margin: 1.5rem auto;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* --- HEADER --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #000; height: 140px;
  border-bottom: 1px solid #222;
}

.header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}

.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-header { height: 120px; width: auto; display: block; }

/* --- PAGE BRAND BAR (sits at top of <main class="content">) --- */
.page-brand {
  display: flex; align-items: center; gap: 18px;
  justify-content: flex-end;
  padding: 28px 0 22px;
  margin: 0 0 6px;
  border-bottom: 1px solid #e0e0e0;
}
.page-brand-icon { height: 54px; width: auto; display: block; flex-shrink: 0; }
.page-brand-text {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 2.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  line-height: 1;
  white-space: nowrap;
}
.brand-icon { height: 42px; width: auto; display: block; flex-shrink: 0; }
.brand-text {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.65rem;
  letter-spacing: 0.08em;
  color: #fff;
  margin-left: 14px;
  line-height: 1;
  white-space: nowrap;
}

.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav .nav-link {
  color: #fff; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: opacity 0.2s ease; white-space: nowrap;
}
.header-nav .nav-link:hover { opacity: 0.55; }
.header-nav .nav-link-intro {
  color: #f6c453; border: 1px solid rgba(246, 196, 83, 0.5);
  padding: 0.3rem 0.65rem; border-radius: 3px;
  background: rgba(246, 196, 83, 0.08);
}
.header-nav .nav-link-intro:hover { opacity: 1; background: rgba(246, 196, 83, 0.2); border-color: #f6c453; }

.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 0.25rem; }

/* --- LAYOUT --- */
.layout {
  max-width: 1400px; margin: 0 auto;
  display: flex; min-height: calc(100vh - 80px - 180px);
}

/* --- SIDEBAR --- */
.sidebar {
  width: 280px; flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
  padding: 2rem 1.5rem;
  background: #fafafa;
  position: sticky; top: 140px; height: calc(100vh - 140px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-label {
  display: block; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #999; margin-bottom: 0.6rem;
}

.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin: 0; }
.sidebar-link {
  display: block; padding: 0.3rem 0; font-size: 0.85rem; font-weight: 500;
  color: #333; transition: color 0.2s ease, padding-left 0.2s ease;
  border-bottom: 1px solid transparent;
}
.sidebar-link:hover { color: #000; padding-left: 4px; opacity: 1; }

/* --- MAIN CONTENT --- */
.content { flex: 1; min-width: 0; padding: 2.5rem 3rem 3rem; }

.content-inner { max-width: 820px; }
.content-inner .page-title { margin-top: 0; margin-bottom: 1.5rem; }

.content-inner h2 { margin-top: 2.5rem; }
.content-inner h3 { margin-top: 2rem; }

/* --- FOOTER --- */
.site-footer {
  background: #fff; border-top: 1px solid #e0e0e0;
  padding: 2.5rem 2rem; text-align: center;
}

.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.logo-footer { height: 96px; width: auto; display: block; margin-bottom: 0.25rem; }
.footer-links { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.footer-text { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; color: #666; text-transform: uppercase; }
.footer-link { color: #000; font-weight: 600; }
.footer-divider { color: #ddd; font-size: 0.8rem; }
.footer-copy { font-size: 0.65rem; color: #999; letter-spacing: 0.05em; margin-top: 0.25rem; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .sidebar { width: 240px; padding: 1.5rem 1.25rem; }
  .content { padding: 2rem; }
}

@media (max-width: 768px) {
  body { padding-top: 100px; }
  .site-header { height: 100px; }
  .header-inner { padding: 0 1.25rem; }
  .logo-header { height: 72px; }
  .header-nav { display: none; }
  .menu-toggle { display: block; }

  .site-header.menu-open .header-nav {
    display: flex; flex-direction: column;
    position: absolute; top: 100px; left: 0; right: 0;
    background: #000; padding: 1rem 1.25rem; gap: 0.75rem;
    border-bottom: 1px solid #222;
  }

  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; position: static; height: auto;
    border-right: none; border-bottom: 1px solid #e0e0e0;
    padding: 1rem 1.25rem; display: none;
  }
  .sidebar.open { display: block; }

  .content { padding: 1.5rem 1.25rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1rem; }
  .site-footer { padding: 1.5rem 1.25rem; }
  .footer-links { flex-direction: column; gap: 0.35rem; }
  .footer-divider { display: none; }
}

/* --- SCROLLBAR --- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #999; }

/* --- SELECTION --- */
::selection { background: #000; color: #fff; }
::-moz-selection { background: #000; color: #fff; }

/* --- ANCHOR SMOOTH SCROLL --- */
html { scroll-behavior: smooth; }

/* --- MISC UTILITY --- */
.content-inner .subtitle { font-size: 0.9rem; color: #666; font-weight: 500; letter-spacing: 0.04em; margin-top: -0.5rem; margin-bottom: 1.5rem; }