/* ── Self-Hosted Fonts ────────────────────────────────────────────── */
/* Step 1: Self-hosted (no third-party Google Fonts CDN) */
/* Step 2: WOFF2 only */
/* Step 3: Latin subset only */
/* Step 5: font-display: swap with metric overrides for CLS prevention */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
  size-adjust: 100%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
  size-adjust: 100%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  --color-bg: #070B14; /* Extremely deep, premium slate */
  --color-surface: #0E1524; 
  --color-surface-hover: #162032;
  --color-primary: #E85D00; /* Brand Orange */
  --color-primary-glow: rgba(232, 93, 0, 0.12);
  --color-text: #F8FAFC;
  --color-text-muted: #8B9BB4;
  --color-border: rgba(255, 255, 255, 0.05);
  --color-border-strong: rgba(255, 255, 255, 0.12);
  --color-warning: #EF4444; /* Alert Red */
  
  --font-display: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1.25rem;
  --spacing-md: 2.5rem;
  --spacing-lg: 5rem;
  --spacing-xl: 8rem;
}

/* Custom Selection & Scrollbar */
::selection {
  background: var(--color-primary);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-hover);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  
  /* Premium dot-matrix background */
  background-image: radial-gradient(var(--color-border-strong) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}

/* Top ambient glow */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50vh;
  background: radial-gradient(circle at 50% -20%, var(--color-primary-glow), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

h1 { 
  font-size: 2.5rem; 
  letter-spacing: -0.03em; 
  margin-top: 0.5rem; 
  position: relative;
  display: flex;
  align-items: center;
}

/* Terminal prompt before h1 */
h1::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 50%;
  margin-right: 16px;
  box-shadow: 0 0 8px rgba(232, 93, 0, 0.4);
  flex-shrink: 0;
}

h2 { 
  font-size: 1.35rem; 
  margin-top: var(--spacing-lg); 
  border-bottom: 1px solid var(--color-border); 
  padding-bottom: 1rem; 
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
}

h3 { 
  font-size: 1.1rem; 
  margin-top: var(--spacing-md); 
  color: var(--color-primary); 
  letter-spacing: 0.05em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
}

.main-content a {
  border-bottom: 1px solid rgba(232, 93, 0, 0.3);
}

.main-content a:hover {
  color: #fff;
  border-bottom-color: var(--color-primary);
  text-shadow: 0 0 8px var(--color-primary-glow);
}

p { 
  margin-top: 0; 
  margin-bottom: 1.75rem; 
  color: var(--color-text-muted); 
  font-size: 1.05rem;
  font-weight: 400;
}

strong {
  color: #fff;
  font-weight: 500;
}

/* Premium Code Tag Styling */
code {
  font-family: var(--font-display);
  background: rgba(0,0,0,0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  word-break: break-all;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--spacing-lg);
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* Header — reduced backdrop-filter to smaller element */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
  margin-bottom: var(--spacing-lg);
  background: rgba(7, 11, 20, 0.92);
  position: sticky;
  top: 0;
  z-index: 100;
  border-top: 3px solid var(--color-primary); /* Bold top accent */
}

.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo span {
  color: var(--color-primary);
}

/* Sidebar Navigation - Dossier Style */
.sidebar-nav {
  position: sticky;
  top: 110px;
  height: max-content;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--color-border);
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
  margin-left: -1px; /* Overlap the ul border */
  border-bottom: none;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--color-text);
  border-left-color: var(--color-primary);
  background: linear-gradient(90deg, rgba(232, 93, 0, 0.05) 0%, transparent 100%);
}

.nav-heading {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.nav-heading:first-child {
  margin-top: 0;
}

/* Content Layout & Animation */
.main-content {
  padding-bottom: var(--spacing-xl);
}

/* Sections start visible (no CLS from opacity:0 → 1 animation) */
.main-content > section {
  margin-bottom: var(--spacing-lg);
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger logic */
.main-content > section:nth-child(1) { animation-delay: 0.05s; }
.main-content > section:nth-child(2) { animation-delay: 0.15s; }
.main-content > section:nth-child(3) { animation-delay: 0.25s; }
.main-content > section:nth-child(4) { animation-delay: 0.35s; }
.main-content > section:nth-child(5) { animation-delay: 0.45s; }
.main-content > section:nth-child(6) { animation-delay: 0.55s; }

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CSS Containment — below-fold sections */
.main-content > section:nth-child(n+3) {
  contain: layout style paint;
}

/* Content-visibility for off-screen sections */
.main-content > section:nth-child(n+5) {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.hero {
  border-left: 4px solid var(--color-primary);
  padding-left: 2rem;
  margin-bottom: var(--spacing-xl);
}

.hero p {
  font-size: 1.15rem;
  max-width: 800px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

/* Elevated Disclaimer Box */
.disclaimer {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-left: 4px solid var(--color-warning);
  padding: 1.5rem 2rem;
  margin-bottom: var(--spacing-lg);
  border-radius: 0 4px 4px 0;
}

.disclaimer p { 
  margin: 0; 
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
}

/* Intelligence Matrix Table Design */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--spacing-md) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

caption {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

th, td {
  padding: 1.25rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

tr:last-child td {
  border-bottom: none;
}

th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.25);
  font-weight: 500;
}

td {
  font-size: 0.95rem;
  color: #fff;
}

td code {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  font-size: 0.9em;
}

tr {
  transition: background 0.2s ease;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Article Images ────────────────────────────────────────────── */
.article-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

.article-image:hover {
  box-shadow: 0 6px 20px rgba(232, 93, 0, 0.15);
}

figure {
  margin: var(--spacing-md) 0;
  padding: 0;
}

figcaption {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.75rem;
  padding-left: 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
  background: rgba(0,0,0,0.3);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links a {
  margin-left: var(--spacing-md);
  color: var(--color-text-muted);
  border-bottom: none;
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* Straight Links Design */
.straight-links {
  margin-top: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.link-row {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.link-title {
  color: var(--color-text-muted);
  width: 180px;
  flex-shrink: 0;
}

.link-row code {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  color: var(--color-text);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* Status Dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 16px;
  flex-shrink: 0;
}

.static-red {
  background-color: var(--color-warning);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.pulse-green {
  background-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.8);
    box-shadow: 0 0 2px rgba(16, 185, 129, 0.2);
  }
}

/* ── Author Byline (below H1) ─────────────────────────────────── */
.article-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: -0.5rem;
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.byline__author {
  color: var(--color-text-muted);
}

.byline__author strong {
  color: var(--color-text);
  font-weight: 500;
}

.byline__sep {
  color: var(--color-border-strong);
  user-select: none;
}

.byline__title {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.article-byline time {
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
}

/* ── Author Bio Box (end of articles) ──────────────────────────── */
.author-bio {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  margin-top: var(--spacing-lg);
}

.author-bio__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), rgba(232, 93, 0, 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.author-bio__body {
  flex: 1;
}

.author-bio__name {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.author-bio__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.author-bio__desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 0;
}

/* ── Article Sources (external citations) ──────────────────────── */
.article-sources {
  margin-top: var(--spacing-lg);
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.article-sources__title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.article-sources ol {
  padding-left: 1.25rem;
  margin: 0;
}

.article-sources li {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.article-sources li:last-child {
  margin-bottom: 0;
}

.article-sources em {
  color: var(--color-text);
  font-style: italic;
}

.article-sources a {
  border-bottom: 1px solid rgba(232, 93, 0, 0.3);
}

/* ── Breadcrumb Navigation ─────────────────────────────────────── */
.breadcrumb-nav {
  margin-bottom: var(--spacing-md);
}

.breadcrumb-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.breadcrumb-nav li {
  color: var(--color-text-muted);
}

.breadcrumb-nav li + li::before {
  content: "›";
  margin-right: 0.5rem;
  color: var(--color-border-strong);
}

.breadcrumb-nav a {
  color: var(--color-text-muted);
  border-bottom: none;
}

.breadcrumb-nav a:hover {
  color: var(--color-primary);
}

.breadcrumb-nav li:last-child {
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .article-byline {
    justify-content: center;
  }
}

