/* ==========================================================================
   ECUBRAIN.STORE — Automotive Engineering & ECU Portal Stylesheet
   Theme: Dark Graphite, Anthracite, Metallic & Electric Cyan/Blue
   ========================================================================== */

:root {
  --bg-darkest: #070a0e;
  --bg-base: #0b0f15;
  --bg-surface: #101620;
  --bg-card: #141c28;
  --bg-card-hover: #192434;
  --bg-elevated: #1e2a3c;
  
  --border-subtle: #192535;
  --border-card: #223348;
  --border-active: #00f0ff;
  
  --accent-cyan: #00f0ff;
  --accent-blue: #0ea5e9;
  --accent-glow: rgba(0, 240, 255, 0.25);
  --accent-glow-strong: rgba(0, 240, 255, 0.45);
  
  --status-ok: #10b981;
  --status-warn: #f59e0b;
  --status-danger: #ef4444;
  --status-cyan: #06b6d4;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #64748b;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --container-max: 1240px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(14, 165, 233, 0.04) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: min(100% - 32px, var(--container-max));
  margin-inline: auto;
}

/* ==========================================================================
   TOP TELEMETRY BAR
   ========================================================================== */
.topbar {
  background: var(--bg-darkest);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dark);
  padding: 6px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.telemetry-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.protocol-badges {
  display: flex;
  gap: 12px;
}

.protocol-badge {
  color: var(--accent-blue);
  background: rgba(14, 165, 233, 0.08);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ==========================================================================
   STICKY HEADER & NAVIGATION
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 21, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 44px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.search-trigger-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.15);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-card);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-blue);
}

.mobile-menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   HERO / BENCHMARK SECTION
   ========================================================================== */
.hero {
  padding: 56px 0 44px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, #00f0ff, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 28px;
}

.hero-search-box {
  position: relative;
  margin-bottom: 24px;
  max-width: 620px;
}

.hero-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 15px 52px 15px 48px;
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

.hero-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.22);
}

.search-icon-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-cyan);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  font-size: 18px;
  display: none;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-chips-label {
  font-size: 12px;
  color: var(--text-dark);
  font-weight: 600;
}

.chip-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-cyan);
  background: rgba(14, 165, 233, 0.1);
}

/* Hero Terminal / Schematic Widget */
.hero-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.hero-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.widget-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-chip-graphic {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  background: #0d141e;
  border: 2px solid var(--accent-cyan);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
}

.widget-chip-graphic::before, .widget-chip-graphic::after {
  content: "";
  position: absolute;
  background: var(--border-card);
}

/* Pins on top & bottom */
.chip-pins-top, .chip-pins-bottom {
  position: absolute;
  display: flex;
  gap: 8px;
  left: 18px;
}

.chip-pins-top { top: -8px; }
.chip-pins-bottom { bottom: -8px; }

.chip-pin {
  width: 4px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 1px;
}

.chip-core-text {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: 1px;
}

.chip-sub-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
}

.widget-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  font-family: var(--font-mono);
}

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.telemetry-card small {
  display: block;
  font-size: 10px;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.telemetry-card strong {
  font-size: 12px;
  color: var(--accent-blue);
}

/* ==========================================================================
   DYNAMIC SEARCH RESULTS VIEW
   ========================================================================== */
#search-results-panel {
  display: none;
  margin-bottom: 48px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.12);
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ==========================================================================
   FEATURED REAL MATERIAL / FLAGSHIP ARTICLE PREVIEW
   ========================================================================== */
.flagship-banner {
  background: linear-gradient(135deg, #111a26 0%, #152233 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin: 20px 0 60px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.flagship-banner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.flagship-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}

.badge-featured {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.flagship-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
  color: #fff;
}

.flagship-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.flagship-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.flagship-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00f0ff, #0284c7);
  color: #041018;
  font-size: 14px;
  font-weight: 800;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 240, 255, 0.45);
  color: #000;
}

.flagship-preview-img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.flagship-preview-img img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.flagship-banner:hover .flagship-preview-img img {
  transform: scale(1.03);
}

/* ==========================================================================
   SECTION HEADINGS & GRIDS
   ========================================================================== */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 36px;
  gap: 20px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 640px;
}

/* Standard Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tech-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  position: relative;
}

.tech-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  display: grid;
  place-items: center;
  color: var(--accent-cyan);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dark);
}

.card-link {
  color: var(--accent-cyan);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   ARTICLE PAGE / DETAILED VIEW (SM2 PRO ARTICLE)
   ========================================================================== */
.article-container {
  padding: 40px 0 80px;
}

.article-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.article-breadcrumbs {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.article-breadcrumbs a {
  color: var(--accent-cyan);
}

.article-main-title {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 18px;
  color: #fff;
}

.article-author-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* Sticky Table of Contents */
.toc-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.toc-nav a {
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.toc-nav a:hover, .toc-nav a.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

/* Article Content Body */
.article-content {
  font-size: 15px;
  line-height: 1.75;
  color: #cbd5e1;
}

.article-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 44px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

/* Technical Callout Boxes */
.tech-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 24px 0;
}

.tech-box.warning {
  border-left-color: var(--status-warn);
  background: rgba(245, 158, 11, 0.06);
}

.tech-box.danger {
  border-left-color: var(--status-danger);
  background: rgba(239, 68, 68, 0.06);
}

.tech-box-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tech-box.warning .tech-box-title { color: var(--status-warn); }
.tech-box.danger .tech-box-title { color: var(--status-danger); }
.tech-box .tech-box-title { color: var(--accent-cyan); }

/* Figures / Image Cards */
.tech-figure {
  margin: 28px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.tech-figure img {
  width: 100%;
  cursor: zoom-in;
  transition: transform var(--transition-fast);
}

.tech-figure img:hover {
  opacity: 0.96;
}

.tech-figure figcaption {
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.zoom-hint {
  font-size: 10px;
  color: var(--accent-cyan);
}

/* SWD Pinout Interactive Table */
.pinout-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.pinout-table th, .pinout-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.pinout-table th {
  background: var(--bg-darkest);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
}

.pin-num {
  color: var(--accent-cyan);
  font-weight: 800;
}

.pin-volt {
  color: var(--status-warn);
}

/* Software Matrix Table */
.soft-matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 13.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.soft-matrix th, .soft-matrix td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.soft-matrix th {
  background: var(--bg-darkest);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-ok);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-warn);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.no {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Attribution Block */
.source-attribution {
  background: var(--bg-surface);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 40px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.source-attribution-text h4 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
}

.source-attribution-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   IMAGE LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 12, 0.94);
  backdrop-filter: blur(10px);
  padding: 30px;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  border: 1px solid var(--border-card);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  color: #fff;
  font-size: 32px;
  background: none;
  cursor: pointer;
  line-height: 1;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(16, 22, 32, 0.85);
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-card);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: auto;
  background: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 14px;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--text-main);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dark);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-fast);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .flagship-grid {
    grid-template-columns: 1fr;
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links, .search-kbd {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-card);
    padding: 16px;
    gap: 10px;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
