/* ═══════════════════════════════════════════════════
   SYSTEM APPROACH — Indigo Ink Editorial Design
   Palette: #1B0A3C · #3D1E7C · #7B68EE · #E8E0F0
   Fonts: Cormorant Garamond (display) + Manrope (body)
         + Space Mono (code/labels)
═══════════════════════════════════════════════════ */

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

:root {
  --ink-deep:    #0D0520;
  --ink-dark:    #1B0A3C;
  --ink-mid:     #2E1260;
  --ink-purple:  #3D1E7C;
  --ink-violet:  #5A3A9E;
  --ink-accent:  #7B68EE;
  --ink-bright:  #9D8FF5;
  --ink-light:   #E8E0F0;
  --ink-pale:    #F2EEF8;
  --ink-white:   #FAFAFA;

  --gold:        #C9A84C;
  --gold-light:  #E8C96A;

  --sidebar-w:   260px;
  --content-max: 900px;

  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-body:    'Manrope', sans-serif;
  --ff-mono:    'Space Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--ink-deep);
  color: var(--ink-light);
  font-family: var(--ff-body);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink-dark); }
::-webkit-scrollbar-thumb { background: var(--ink-violet); border-radius: 3px; }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink-dark);
  border-right: 1px solid rgba(123,104,238,0.2);
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  z-index: 100;
  transition: transform 0.4s var(--ease-out-expo);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid rgba(123,104,238,0.15);
  margin-bottom: 1.5rem;
}

.logo-chip {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--ink-accent), var(--ink-purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-light);
  line-height: 1.2;
}

.nav-list {
  list-style: none;
  flex: 1;
  padding: 0 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(232,224,240,0.55);
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 0.15rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink-light);
  background: rgba(123,104,238,0.15);
}

.nav-link.active {
  color: var(--ink-bright);
  background: rgba(123,104,238,0.2);
  border-left: 2px solid var(--ink-accent);
}

.nav-num {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1.5rem;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.3);
  border-top: 1px solid rgba(123,104,238,0.1);
  margin-top: auto;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  background: var(--ink-purple);
  border: none;
  border-radius: 8px;
  width: 40px; height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--ink-light);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 5rem 4rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(61,30,124,0.4) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(123,104,238,0.15) 0%, transparent 60%),
    var(--ink-deep);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(123,104,238,0.04) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(123,104,238,0.04) 80px);
  pointer-events: none;
}

.hero::after {
  content: 'SYSTEM';
  position: absolute;
  right: -2rem;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  font-family: var(--ff-display);
  font-size: 12rem;
  font-weight: 700;
  color: rgba(123,104,238,0.04);
  letter-spacing: 0.3em;
  pointer-events: none;
  white-space: nowrap;
}

.hero-tag {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--ink-white);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.35s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--ink-bright);
}

.hero-sub {
  max-width: 580px;
  font-size: 1rem;
  color: rgba(232,224,240,0.65);
  line-height: 1.75;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.65s forwards;
}

.chip {
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(123,104,238,0.4);
  border-radius: 100px;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--ink-bright);
  background: rgba(123,104,238,0.08);
}

.hero-scroll-hint {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.3);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.8s forwards;
}

/* ══════════════════════════════════════════
   CONTENT SECTIONS
══════════════════════════════════════════ */
.content-section {
  padding: 5rem 5rem 4rem;
  border-top: 1px solid rgba(123,104,238,0.1);
  max-width: calc(var(--content-max) + 10rem);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.section-num {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--ink-accent);
  opacity: 0.6;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--ink-white);
  line-height: 1.1;
}

/* ── PROSE ── */
.prose {
  max-width: var(--content-max);
  margin-bottom: 2.5rem;
}

.prose p {
  font-size: 0.975rem;
  color: rgba(232,224,240,0.8);
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.prose h3 {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink-light);
  margin: 2rem 0 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--ink-accent);
}

.prose strong { color: var(--ink-bright); font-weight: 600; }
.prose em { color: var(--gold-light); font-style: italic; }

.prose ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose ul li {
  font-size: 0.975rem;
  color: rgba(232,224,240,0.8);
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

.prose ul li strong { color: var(--ink-bright); }

.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(201,168,76,0.06);
  border-radius: 0 8px 8px 0;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(232,224,240,0.75);
}

/* ══════════════════════════════════════════
   DIAGRAM CARDS
══════════════════════════════════════════ */
.diagram-card {
  background: rgba(29,14,64,0.6);
  border: 1px solid rgba(123,104,238,0.2);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  max-width: var(--content-max);
  backdrop-filter: blur(8px);
}

.diagram-title {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-accent);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(123,104,238,0.15);
}

.diagram-note {
  font-size: 0.8rem;
  color: rgba(232,224,240,0.45);
  font-style: italic;
  margin-top: 1rem;
  line-height: 1.6;
}

/* ── LAYER DIAGRAM ── */
.layer-diagram {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.layer-app    { background: rgba(123,104,238,0.25); }
.layer-os     { background: rgba(123,104,238,0.20); }
.layer-isa    { background: rgba(123,104,238,0.15); border: 1px solid rgba(201,168,76,0.4); }
.layer-micro  { background: rgba(61,30,124,0.35); }
.layer-logic  { background: rgba(61,30,124,0.28); }
.layer-circuit{ background: rgba(61,30,124,0.20); }

.layer:hover {
  transform: translateX(6px);
  border-color: var(--ink-accent);
  box-shadow: 0 0 20px rgba(123,104,238,0.2);
}

.layer-label {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-light);
}

.layer-examples {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.45);
}

.diagram-tooltip {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(123,104,238,0.1);
  border-radius: 8px;
  font-size: 0.8rem;
  color: rgba(232,224,240,0.65);
  min-height: 2.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(123,104,238,0.15);
}

/* ── VON NEUMANN DIAGRAM ── */
.vonneumann-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.vn-box {
  background: rgba(61,30,124,0.4);
  border: 1px solid rgba(123,104,238,0.35);
  border-radius: 10px;
  padding: 1rem;
  min-width: 140px;
}

.vn-cpu { border-color: var(--ink-accent); }
.vn-mem { border-color: rgba(201,168,76,0.5); }
.vn-io  { border-color: rgba(107,203,119,0.4); }

.vn-title {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-bright);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.vn-inner { display: flex; flex-direction: column; gap: 0.3rem; }

.vn-sub {
  font-size: 0.75rem;
  color: rgba(232,224,240,0.6);
  padding: 0.25rem 0.5rem;
  background: rgba(123,104,238,0.1);
  border-radius: 4px;
}

.vn-bus-area {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.vn-bus-label {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vn-buses { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }

.vn-bus {
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  text-align: center;
}

.bus-addr { background: rgba(123,104,238,0.2); color: var(--ink-bright); }
.bus-data { background: rgba(201,168,76,0.15); color: var(--gold-light); }
.bus-ctrl { background: rgba(107,203,119,0.12); color: #6BCB77; }

.vn-right { display: flex; flex-direction: column; gap: 0.75rem; }

/* ── COMPARISON GRID ── */
.comparison-grid {
  display: flex;
  align-items: stretch;
  gap: 1rem;
}

.compare-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.compare-head {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 0.25rem;
}

.vn-head   { background: rgba(123,104,238,0.25); color: var(--ink-bright); }
.harv-head { background: rgba(201,168,76,0.2);   color: var(--gold-light); }

.compare-item {
  padding: 0.5rem 0.75rem;
  background: rgba(123,104,238,0.07);
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(232,224,240,0.7);
  border: 1px solid rgba(123,104,238,0.1);
}

.compare-vs {
  display: flex;
  align-items: center;
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(123,104,238,0.4);
  padding: 0 0.5rem;
  margin-top: 2.5rem;
}

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: var(--content-max);
}

.info-card {
  background: rgba(29,14,64,0.5);
  border: 1px solid rgba(123,104,238,0.18);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: rgba(123,104,238,0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(123,104,238,0.12);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.info-card h4 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 0.6rem;
}

.info-card p {
  font-size: 0.82rem;
  color: rgba(232,224,240,0.6);
  line-height: 1.7;
}

.info-card p strong { color: var(--ink-bright); }

/* ── CPU DIAGRAM ── */
.cpu-diagram { overflow-x: auto; }

.cpu-outer {
  border: 2px solid var(--ink-accent);
  border-radius: 12px;
  overflow: hidden;
  min-width: 500px;
}

.cpu-title-bar {
  background: var(--ink-accent);
  color: var(--ink-deep);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  text-align: center;
}

.cpu-body {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(27,10,60,0.8);
}

.cpu-col { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }

.cpu-block {
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid rgba(123,104,238,0.25);
}

.cu-block  { background: rgba(123,104,238,0.15); border-color: rgba(123,104,238,0.4); }
.reg-block { background: rgba(201,168,76,0.1);   border-color: rgba(201,168,76,0.3); }
.alu-block { background: rgba(107,203,119,0.1);  border-color: rgba(107,203,119,0.3); }
.fpu-block { background: rgba(255,107,107,0.1);  border-color: rgba(255,107,107,0.3); }

.cpu-block-title {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-bright);
  margin-bottom: 0.5rem;
}

.cpu-block-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cpu-block-items span {
  font-size: 0.72rem;
  color: rgba(232,224,240,0.55);
  padding: 0.2rem 0.4rem;
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.cpu-internal-bus {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--ink-accent);
  background: rgba(123,104,238,0.1);
  padding: 0.5rem 0.3rem;
  border-radius: 4px;
  border: 1px dashed rgba(123,104,238,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cpu-bus-bar {
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 1rem;
  background: rgba(123,104,238,0.12);
  border-top: 1px solid rgba(123,104,238,0.2);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
}

/* ── HW/SW STACK ── */
.hwsw-stack { display: flex; flex-direction: column; gap: 0; }

.hwsw-row {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
}

.hwsw-app { background: rgba(123,104,238,0.12); }
.hwsw-hw  { background: rgba(61,30,124,0.25); }

.hwsw-label {
  writing-mode: vertical-rl;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
}

.hwsw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hwsw-item {
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 0.82rem;
  color: rgba(232,224,240,0.7);
  border-left: 2px solid rgba(123,104,238,0.3);
}

.hwsw-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: linear-gradient(90deg, rgba(201,168,76,0.15), rgba(201,168,76,0.25), rgba(201,168,76,0.15));
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  text-align: center;
}

.hwsw-divider-sub {
  font-size: 0.6rem;
  color: rgba(201,168,76,0.6);
  margin-top: 0.2rem;
}

/* ── CO-DESIGN FLOW ── */
.codesign-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.flow-box {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  min-width: 260px;
  line-height: 1.4;
}

.flow-box small {
  display: block;
  font-size: 0.7rem;
  color: rgba(232,224,240,0.5);
  margin-top: 0.2rem;
}

.flow-spec { background: rgba(123,104,238,0.25); border: 1px solid rgba(123,104,238,0.5); color: var(--ink-light); }
.flow-part { background: rgba(201,168,76,0.15);  border: 1px solid rgba(201,168,76,0.4);  color: var(--gold-light); }
.flow-hw   { background: rgba(107,203,119,0.12); border: 1px solid rgba(107,203,119,0.35); color: #6BCB77; }
.flow-sw   { background: rgba(255,107,107,0.1);  border: 1px solid rgba(255,107,107,0.3);  color: #FF6B6B; }
.flow-hwv  { background: rgba(107,203,119,0.08); border: 1px solid rgba(107,203,119,0.25); color: #6BCB77; }
.flow-swv  { background: rgba(255,107,107,0.07); border: 1px solid rgba(255,107,107,0.2);  color: #FF6B6B; }
.flow-int  { background: rgba(123,104,238,0.2);  border: 1px solid rgba(123,104,238,0.4);  color: var(--ink-bright); }
.flow-val  { background: rgba(123,104,238,0.3);  border: 1px solid var(--ink-accent);       color: var(--ink-light); }

.flow-arrow {
  font-size: 1.2rem;
  color: rgba(123,104,238,0.5);
  padding: 0.2rem 0;
}

.flow-split {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.flow-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── TAXONOMY TREE ── */
.taxonomy-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.tax-root {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink-light);
  padding: 0.6rem 2rem;
  background: rgba(123,104,238,0.25);
  border: 1px solid var(--ink-accent);
  border-radius: 8px;
}

.tax-branches {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tax-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.tax-node {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  min-width: 130px;
  line-height: 1.3;
}

.tax-node small {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 0.2rem;
}

.tax-risc  { background: rgba(123,104,238,0.25); border: 1px solid rgba(123,104,238,0.5); color: var(--ink-bright); }
.tax-cisc  { background: rgba(201,168,76,0.15);  border: 1px solid rgba(201,168,76,0.4);  color: var(--gold-light); }
.tax-vliw  { background: rgba(107,203,119,0.12); border: 1px solid rgba(107,203,119,0.35); color: #6BCB77; }
.tax-super { background: rgba(255,107,107,0.1);  border: 1px solid rgba(255,107,107,0.3);  color: #FF6B6B; }

.tax-children {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}

.tax-children span {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.5);
  padding: 0.2rem 0.6rem;
  background: rgba(123,104,238,0.07);
  border-radius: 4px;
  white-space: nowrap;
}

/* ── PIPELINE DIAGRAM ── */
.pipeline-diagram { display: flex; flex-direction: column; gap: 1.5rem; }

.pipe-stages {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.pipe-stage {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(123,104,238,0.3);
  transition: all 0.3s ease;
}

.pipe-stage:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(123,104,238,0.2); }

.ps-if  { background: rgba(123,104,238,0.30); }
.ps-id  { background: rgba(123,104,238,0.24); }
.ps-ex  { background: rgba(123,104,238,0.18); }
.ps-mem { background: rgba(123,104,238,0.13); }
.ps-wb  { background: rgba(123,104,238,0.08); }

.ps-name {
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-bright);
  margin-bottom: 0.25rem;
}

.ps-full {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}

.ps-desc {
  font-size: 0.65rem;
  color: rgba(232,224,240,0.5);
  line-height: 1.4;
}

.pipe-arrow {
  font-size: 1.2rem;
  color: var(--ink-accent);
  padding: 0 0.25rem;
  flex-shrink: 0;
}

.pipe-timing { }

.pipe-timing-title {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.4);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pipe-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
}

.pipe-cell {
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--ink-deep);
}

.pc-if  { background: rgba(123,104,238,0.8); color: white; }
.pc-id  { background: rgba(123,104,238,0.65); color: white; }
.pc-ex  { background: rgba(123,104,238,0.5); color: white; }
.pc-mem { background: rgba(123,104,238,0.35); color: white; }
.pc-wb  { background: rgba(123,104,238,0.2); color: var(--ink-bright); }
.pc-empty { background: rgba(123,104,238,0.05); }

/* ── MEMORY PYRAMID ── */
.memory-pyramid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.mem-level {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
}

.ml-bar {
  height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.ml-reg    .ml-bar { width: 60px;  background: linear-gradient(90deg, #7B68EE, #9D8FF5); }
.ml-l1     .ml-bar { width: 100px; background: linear-gradient(90deg, #6B5ED4, #8B7EE0); }
.ml-l2     .ml-bar { width: 150px; background: linear-gradient(90deg, #5A4DB8, #7A6DC8); }
.ml-l3     .ml-bar { width: 210px; background: linear-gradient(90deg, #4A3D9C, #6A5DB0); }
.ml-ram    .ml-bar { width: 280px; background: linear-gradient(90deg, #3D1E7C, #5A3A9E); }
.ml-ssd    .ml-bar { width: 360px; background: linear-gradient(90deg, #2E1260, #4A2880); }
.ml-hdd    .ml-bar { width: 440px; background: linear-gradient(90deg, #1B0A3C, #3D1E7C); }

.mem-level:hover .ml-bar { filter: brightness(1.3); }

.ml-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ml-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-light);
  min-width: 160px;
}

.ml-spec {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.5);
  min-width: 160px;
}

.ml-speed {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
}

.pyramid-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(123,104,238,0.15);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: rgba(232,224,240,0.35);
}

/* ── CACHE ADDRESS DIAGRAM ── */
.cache-addr-diagram { display: flex; flex-direction: column; gap: 1rem; }

.addr-bits {
  display: flex;
  gap: 4px;
  height: 50px;
}

.addr-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.addr-field small { font-size: 0.6rem; font-weight: 400; opacity: 0.7; }

.af-tag    { flex: 3; background: rgba(123,104,238,0.3); border: 1px solid rgba(123,104,238,0.5); color: var(--ink-bright); }
.af-index  { flex: 2; background: rgba(201,168,76,0.2);  border: 1px solid rgba(201,168,76,0.4);  color: var(--gold-light); }
.af-offset { flex: 2; background: rgba(107,203,119,0.15); border: 1px solid rgba(107,203,119,0.35); color: #6BCB77; }

.addr-desc { display: flex; flex-direction: column; gap: 0.5rem; }

.addr-desc-item {
  font-size: 0.8rem;
  color: rgba(232,224,240,0.65);
  padding: 0.5rem 0.75rem;
  background: rgba(123,104,238,0.06);
  border-radius: 6px;
  border-left: 2px solid rgba(123,104,238,0.3);
}

.addr-desc-item strong { color: var(--ink-bright); }

.cache-formula {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--gold-light);
  padding: 0.6rem 1rem;
  background: rgba(201,168,76,0.08);
  border-radius: 6px;
  border: 1px solid rgba(201,168,76,0.2);
  text-align: center;
}

/* ── ADDRESSING MODES GRID ── */
.addr-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.addr-mode-card {
  background: rgba(27,10,60,0.6);
  border: 1px solid rgba(123,104,238,0.18);
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.25s ease;
}

.addr-mode-card:hover {
  border-color: rgba(123,104,238,0.45);
  transform: translateY(-2px);
}

.am-name {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}

.am-syntax {
  margin-bottom: 0.5rem;
}

.am-syntax code {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--gold-light);
  background: rgba(201,168,76,0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.am-desc {
  font-size: 0.75rem;
  color: rgba(232,224,240,0.55);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.am-formula {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
  padding: 0.3rem 0.5rem;
  background: rgba(123,104,238,0.1);
  border-radius: 4px;
}

/* ── TOPOLOGY GRID ── */
.topology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.topo-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.topo-name {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-bright);
}

.topo-diagram {
  height: 120px;
  background: rgba(27,10,60,0.5);
  border: 1px solid rgba(123,104,238,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.topo-desc {
  font-size: 0.75rem;
  color: rgba(232,224,240,0.5);
  line-height: 1.5;
}

/* Bus topology */
.topo-bus { flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.topo-bus-line {
  width: 90%;
  height: 3px;
  background: var(--ink-accent);
  border-radius: 2px;
}
.topo-nodes { display: flex; gap: 0.5rem; justify-content: center; }
.topo-node {
  padding: 0.3rem 0.5rem;
  background: rgba(123,104,238,0.25);
  border: 1px solid rgba(123,104,238,0.4);
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: var(--ink-bright);
}

/* ── AXI DIAGRAM ── */
.axi-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.axi-master, .axi-slave {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  min-width: 110px;
}

.axi-master { background: rgba(123,104,238,0.25); border: 1px solid var(--ink-accent); color: var(--ink-bright); }
.axi-slave  { background: rgba(201,168,76,0.15);  border: 1px solid rgba(201,168,76,0.4); color: var(--gold-light); }

.axi-master small, .axi-slave small {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 0.2rem;
}

.axi-channels {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
}

.axi-ch {
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 600;
}

.axi-aw { background: rgba(123,104,238,0.2); color: var(--ink-bright); }
.axi-w  { background: rgba(123,104,238,0.15); color: var(--ink-bright); }
.axi-b  { background: rgba(201,168,76,0.12); color: var(--gold-light); }
.axi-ar { background: rgba(107,203,119,0.1); color: #6BCB77; }
.axi-r  { background: rgba(107,203,119,0.08); color: #6BCB77; }

/* ── SOC DIAGRAM ── */
.soc-diagram { overflow-x: auto; }

.soc-chip {
  border: 2px solid var(--ink-accent);
  border-radius: 16px;
  overflow: hidden;
  min-width: 600px;
  background: rgba(27,10,60,0.7);
}

.soc-title {
  background: linear-gradient(90deg, var(--ink-purple), var(--ink-accent));
  color: white;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  text-align: center;
}

.soc-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }

.soc-row { display: flex; gap: 0.75rem; }

.soc-block {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  border: 1px solid rgba(123,104,238,0.25);
}

.soc-block small {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 0.3rem;
}

.soc-cpu   { background: rgba(123,104,238,0.25); color: var(--ink-bright); border-color: rgba(123,104,238,0.5); }
.soc-gpu   { background: rgba(255,107,107,0.12); color: #FF6B6B; border-color: rgba(255,107,107,0.3); }
.soc-npu   { background: rgba(107,203,119,0.1);  color: #6BCB77; border-color: rgba(107,203,119,0.3); }
.soc-mem   { background: rgba(201,168,76,0.12);  color: var(--gold-light); border-color: rgba(201,168,76,0.3); }
.soc-cache { background: rgba(123,104,238,0.15); color: var(--ink-bright); }
.soc-isp   { background: rgba(255,165,0,0.1);    color: #FFA500; border-color: rgba(255,165,0,0.3); }
.soc-io    { background: rgba(100,149,237,0.12); color: #6495ED; border-color: rgba(100,149,237,0.3); }
.soc-sec   { background: rgba(220,20,60,0.1);    color: #DC143C; border-color: rgba(220,20,60,0.25); }
.soc-pmu   { background: rgba(148,0,211,0.12);   color: #9400D3; border-color: rgba(148,0,211,0.3); }

.soc-interconnect-bar {
  background: rgba(123,104,238,0.2);
  border: 1px solid rgba(123,104,238,0.4);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-bright);
}

/* ── SOC FLOW ── */
.soc-flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }

.soc-flow-step {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(123,104,238,0.15);
  background: rgba(27,10,60,0.4);
  transition: all 0.25s ease;
}

.soc-flow-step:hover {
  border-color: rgba(123,104,238,0.4);
  background: rgba(27,10,60,0.7);
}

.sfs-1 { border-left: 3px solid #7B68EE; }
.sfs-2 { border-left: 3px solid #9D8FF5; }
.sfs-3 { border-left: 3px solid #C9A84C; }
.sfs-4 { border-left: 3px solid #FF6B6B; }
.sfs-5 { border-left: 3px solid #6BCB77; }
.sfs-6 { border-left: 3px solid #6495ED; }
.sfs-7 { border-left: 3px solid #FFA500; }

.sfs-num {
  width: 32px; height: 32px;
  background: rgba(123,104,238,0.2);
  border: 1px solid rgba(123,104,238,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-bright);
  flex-shrink: 0;
}

.sfs-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 0.3rem;
}

.sfs-desc {
  font-size: 0.78rem;
  color: rgba(232,224,240,0.55);
  line-height: 1.6;
}

.soc-flow-arrow {
  text-align: center;
  font-size: 1rem;
  color: rgba(123,104,238,0.4);
  padding: 0.2rem 0;
}

/* ── COMPLEXITY RADAR ── */
.complexity-radar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#radarCanvas {
  max-width: 100%;
  height: auto;
}

.radar-legend {
  display: flex;
  gap: 1.5rem;
}

.rl-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(232,224,240,0.6);
}

.rl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-accent);
}

.rl-dot.rl-old { background: rgba(201,168,76,0.7); }

/* ── MOORE'S CHART ── */
.moores-chart {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 200px;
  padding: 0.5rem;
}

.mc-yaxis {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  width: 60px;
  flex-shrink: 0;
}

.mc-yaxis > span:first-child {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: rgba(232,224,240,0.4);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-bottom: 0.5rem;
}

.mc-yticks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  align-items: flex-end;
}

.mc-yticks span {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: rgba(232,224,240,0.35);
}

.mc-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  border-left: 1px solid rgba(123,104,238,0.2);
  border-bottom: 1px solid rgba(123,104,238,0.2);
  padding: 0 0.5rem;
}

.mc-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.mc-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--ink-bright), var(--ink-purple));
  transition: all 0.3s ease;
  min-height: 4px;
}

.mc-bar:hover { filter: brightness(1.3); }

.mc-bar-label {
  font-family: var(--ff-mono);
  font-size: 0.55rem;
  color: rgba(232,224,240,0.4);
  white-space: nowrap;
}

.mc-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 0 70px;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: rgba(232,224,240,0.35);
}

/* ── TRADEOFF TRIANGLE ── */
.tradeoff-triangle { display: flex; justify-content: center; }
.tradeoff-svg { max-width: 500px; width: 100%; height: auto; }

/* ── COMPONENTS MAP ── */
.components-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.comp-center { display: flex; justify-content: center; }

.comp-node {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  border: 1px solid rgba(123,104,238,0.3);
  transition: all 0.25s ease;
}

.comp-node:hover { transform: scale(1.05); }
.comp-node small { display: block; font-size: 0.65rem; font-weight: 400; opacity: 0.6; margin-top: 0.2rem; }

.comp-cpu     { background: rgba(123,104,238,0.35); border-color: var(--ink-accent); color: var(--ink-bright); font-size: 1rem; padding: 1rem 2rem; }
.comp-mem     { background: rgba(201,168,76,0.15);  border-color: rgba(201,168,76,0.4);  color: var(--gold-light); }
.comp-cache   { background: rgba(123,104,238,0.2);  color: var(--ink-bright); }
.comp-bus     { background: rgba(107,203,119,0.1);  border-color: rgba(107,203,119,0.3); color: #6BCB77; }
.comp-io      { background: rgba(255,107,107,0.1);  border-color: rgba(255,107,107,0.3); color: #FF6B6B; }
.comp-storage { background: rgba(100,149,237,0.12); border-color: rgba(100,149,237,0.3); color: #6495ED; }
.comp-periph  { background: rgba(255,165,0,0.1);    border-color: rgba(255,165,0,0.3);   color: #FFA500; }

.comp-ring {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ── TABLES ── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 2.5rem;
  max-width: var(--content-max);
  border-radius: 12px;
  border: 1px solid rgba(123,104,238,0.2);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.styled-table thead tr {
  background: rgba(61,30,124,0.5);
}

.styled-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-bright);
  border-bottom: 1px solid rgba(123,104,238,0.3);
}

.styled-table td {
  padding: 0.65rem 1rem;
  color: rgba(232,224,240,0.7);
  border-bottom: 1px solid rgba(123,104,238,0.08);
  vertical-align: top;
  line-height: 1.5;
}

.styled-table tbody tr:hover td {
  background: rgba(123,104,238,0.06);
  color: var(--ink-light);
}

.styled-table tbody tr:last-child td { border-bottom: none; }

/* ── FOOTER ── */
.page-footer {
  padding: 4rem 5rem;
  border-top: 1px solid rgba(123,104,238,0.15);
  background: rgba(27,10,60,0.3);
}

.footer-content { max-width: var(--content-max); }

.footer-title {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.footer-sub {
  font-size: 0.82rem;
  color: rgba(232,224,240,0.4);
  margin-bottom: 1rem;
}

.footer-chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-chips span {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-accent);
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(123,104,238,0.3);
  border-radius: 100px;
}

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }
  .hero { padding: 5rem 2rem 3rem; }
  .content-section { padding: 3rem 2rem 2.5rem; }
  .page-footer { padding: 3rem 2rem; }
  .pipe-stages { gap: 2px; }
  .pipe-stage { min-width: 70px; }
  .comparison-grid { flex-direction: column; }
  .compare-vs { transform: rotate(90deg); align-self: center; }
  .flow-split { flex-direction: column; align-items: center; }
  .soc-row { flex-wrap: wrap; }
  .axi-diagram { flex-direction: column; align-items: stretch; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 2.5rem; }
  .section-title { font-size: 1.8rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .addr-modes-grid { grid-template-columns: 1fr; }
  .topology-grid { grid-template-columns: 1fr 1fr; }
  .tax-branches { flex-direction: column; }
  .ml-info { flex-direction: column; gap: 0.25rem; }
}