Skip to content
LAM
Read Home Blog
Make Projects HTML Tools Games
Touch grass Notes Resume Links
Home Blog HTML Projects
Tools Games Notes Resume Links
Back BE A COMPUTER GOAT Computer-Science
Download Open
Show description 2,367 chars · Computer-Science

BE A COMPUTER GOAT

BE A COMPUTER GOAT































The Complete Path to Mastery

BE A COMPUTER GOAT


From tricking rocks into thinking to teaching machines to learn.
Five phases. Every concept. The full journey from transistor to transformer.



Begin the journey











01

Digital Bedrock




02

The Bridge




03

Great Connection




04

The Architect




05

Enlightened









Phase 01

The "Digital Bedrock"

Hardware & Logic — Before there is code, there is electricity and math. You must understand how we trick rocks into thinking.





Expand All








🔢


Number Systems

Binary, Hex & Two's Complement



▾





Everything a computer does reduces to numbers — but not our familiar base-10 system. Computers speak in binary (base-2), where every value is a sequence of 0s and 1s. Each digit is a bit, eight bits make a byte, and from that tiny alphabet emerges every photo, song, and program you've ever seen.



Why binary? Because a transistor can only be ON or OFF. Two states. One bit. That's the physical constraint everything else is built on.



Hexadecimal (base-16) is the human-friendly shorthand for binary. Instead of writing 11111111, you write FF. It groups four bits into one hex digit, making memory addresses and color codes readable. Every time you see a hex color like #00F0FF, you're staring at three bytes of binary packed into six hex characters.


Two's complement is how computers handle negative numbers. The highest bit becomes the sign bit: flip all the bits and add 1 to negate a number. This elegant trick lets the CPU use the same addition hardware for both positive and negative math — no separate subtraction circuit required.



// Decimal 42 in different bases
Binary: 00101010
Hex: 0x2A
Octal: 052

// Two's complement: -42 in 8-bit binary
Step 1: Start with +42 → 00101010
Step 2: Flip all bits → 11010101
Step 3: Add 1 → 11010110 ← this is -42




Binary (Base-2)
Hexadecimal (Base-16)
Two's Complement
Bits & Bytes
Octal (Base-8)
Signed vs Unsigned












⚡


Boolean Algebra

The mathematical language of circuits



▾





Boolean algebra is the bedrock logic system: every variable is either TRUE (1) or FALSE (0), and every operation produces a TRUE or FALSE result.…

BE A COMPUTER GOAT

96,258 bytes · HTML source
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BE A COMPUTER GOAT</title>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700;800&family=Orbitron:wght@400;500;600;700;800;900&family=Chakra+Petch:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #06080c;
  --bg-card: #0c1018;
  --bg-card-hover: #111827;
  --bg-surface: #0f1520;
  --cyan: #00f0ff;
  --cyan-dim: #00f0ff44;
  --magenta: #ff00aa;
  --magenta-dim: #ff00aa33;
  --green: #00ff88;
  --green-dim: #00ff8833;
  --amber: #ffaa00;
  --amber-dim: #ffaa0033;
  --purple: #aa44ff;
  --purple-dim: #aa44ff33;
  --red: #ff3355;
  --text-primary: #e0e8f0;
  --text-secondary: #8899aa;
  --text-dim: #556677;
  --border: #1a2535;
  --glow-cyan: 0 0 20px #00f0ff44, 0 0 40px #00f0ff22;
  --glow-magenta: 0 0 20px #ff00aa44, 0 0 40px #ff00aa22;
  --glow-green: 0 0 20px #00ff8844, 0 0 40px #00ff8822;
  --glow-amber: 0 0 20px #ffaa0044, 0 0 40px #ffaa0022;
  --glow-purple: 0 0 20px #aa44ff44, 0 0 40px #aa44ff22;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── SCANLINE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.008) 2px,
    rgba(0, 240, 255, 0.008) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── GRID BACKGROUND ── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── HERO SECTION ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
  overflow: hidden;
}

.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: orbFloat 20s ease-in-out infinite;
}
.hero-bg-orb.one {
  width: 600px; height: 600px;
  background: var(--cyan);
  top: -200px; left: -100px;
  animation-delay: 0s;
}
.hero-bg-orb.two {
  width: 500px; height: 500px;
  background: var(--magenta);
  bottom: -150px; right: -100px;
  animation-delay: -7s;
}
.hero-bg-orb.three {
  width: 400px; height: 400px;
  background: var(--purple);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

.hero-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  background: rgba(0, 240, 255, 0.05);
  animation: fadeSlideUp 1s ease-out 0.2s both;
}

.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--cyan) 0%, #ffffff 40%, var(--magenta) 70%, var(--cyan) 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease infinite, fadeSlideUp 1s ease-out 0.4s both;
  margin-bottom: 1.5rem;
  position: relative;
}

.hero-title::after {
  content: 'BE A COMPUTER GOAT';
  position: absolute;
  top: 0; left: 0; right: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.02em;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(0, 240, 255, 0.1);
  filter: blur(1px);
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  text-align: center;
  max-width: 700px;
  line-height: 1.8;
  animation: fadeSlideUp 1s ease-out 0.6s both;
}

.hero-subtitle span { color: var(--cyan); }

.hero-scroll-indicator {
  position: absolute;
  bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeSlideUp 1s ease-out 1s both;
}

.hero-scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--cyan-dim);
  border-bottom: 2px solid var(--cyan-dim);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
  50% { transform: rotate(45deg) translateY(8px); opacity: 1; }
}

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

/* ── NAV / PROGRESS ── */
.phase-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.phase-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.phase-nav-dot::before {
  content: attr(data-label);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.phase-nav-dot:hover::before { opacity: 1; }
.phase-nav-dot:hover { border-color: var(--text-secondary); }

.phase-nav-dot.active {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.phase-nav-dot[data-phase="1"].active { border-color: var(--cyan); background: var(--cyan); box-shadow: var(--glow-cyan); }
.phase-nav-dot[data-phase="2"].active { border-color: var(--green); background: var(--green); box-shadow: var(--glow-green); }
.phase-nav-dot[data-phase="3"].active { border-color: var(--amber); background: var(--amber); box-shadow: var(--glow-amber); }
.phase-nav-dot[data-phase="4"].active { border-color: var(--magenta); background: var(--magenta); box-shadow: var(--glow-magenta); }
.phase-nav-dot[data-phase="5"].active { border-color: var(--purple); background: var(--purple); box-shadow: var(--glow-purple); }

/* ── PROGRESS BAR ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber), var(--magenta), var(--purple));
  z-index: 10000;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(0, 240, 255, 0.3);
}

/* ── MAIN CONTENT ── */
.content { max-width: 1100px; margin: 0 auto; padding: 0 2rem 6rem; }

/* ── PHASE SECTIONS ── */
.phase-section {
  margin-bottom: 6rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.phase-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── PHASE HEADER ── */
.phase-header {
  margin-bottom: 3rem;
  position: relative;
  padding-left: 1.5rem;
}

.phase-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
}

.phase-section[data-phase="1"] .phase-header::before { background: var(--cyan); box-shadow: var(--glow-cyan); }
.phase-section[data-phase="2"] .phase-header::before { background: var(--green); box-shadow: var(--glow-green); }
.phase-section[data-phase="3"] .phase-header::before { background: var(--amber); box-shadow: var(--glow-amber); }
.phase-section[data-phase="4"] .phase-header::before { background: var(--magenta); box-shadow: var(--glow-magenta); }
.phase-section[data-phase="5"] .phase-header::before { background: var(--purple); box-shadow: var(--glow-purple); }

.phase-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.phase-section[data-phase="1"] .phase-number { color: var(--cyan); }
.phase-section[data-phase="2"] .phase-number { color: var(--green); }
.phase-section[data-phase="3"] .phase-number { color: var(--amber); }
.phase-section[data-phase="4"] .phase-number { color: var(--magenta); }
.phase-section[data-phase="5"] .phase-number { color: var(--purple); }

.phase-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.phase-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}

.phase-tagline em {
  font-style: normal;
  color: var(--text-primary);
}

/* ── TOPIC CARDS ── */
.topics-grid {
  display: grid;
  gap: 1.5rem;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.phase-section[data-phase="1"] .topic-card::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.phase-section[data-phase="2"] .topic-card::before { background: linear-gradient(90deg, var(--green), transparent); }
.phase-section[data-phase="3"] .topic-card::before { background: linear-gradient(90deg, var(--amber), transparent); }
.phase-section[data-phase="4"] .topic-card::before { background: linear-gradient(90deg, var(--magenta), transparent); }
.phase-section[data-phase="5"] .topic-card::before { background: linear-gradient(90deg, var(--purple), transparent); }

.topic-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.topic-card:hover::before { opacity: 1; }

.topic-card-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.topic-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.phase-section[data-phase="1"] .topic-icon { background: var(--cyan-dim); }
.phase-section[data-phase="2"] .topic-icon { background: var(--green-dim); }
.phase-section[data-phase="3"] .topic-icon { background: var(--amber-dim); }
.phase-section[data-phase="4"] .topic-icon { background: var(--magenta-dim); }
.phase-section[data-phase="5"] .topic-icon { background: var(--purple-dim); }

.topic-title-area { flex: 1; }

.topic-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
}

.topic-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.topic-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  color: var(--text-dim);
  font-size: 1.2rem;
}

.topic-card.open .topic-toggle { transform: rotate(180deg); }

.topic-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-card.open .topic-content {
  max-height: 2000px;
}

.topic-body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 1.25rem;
}

.topic-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.topic-body p:last-child { margin-bottom: 0; }

.concept-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin: 0.15rem 0.25rem 0.15rem 0;
  border: 1px solid;
}

.phase-section[data-phase="1"] .concept-tag { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(0, 240, 255, 0.05); }
.phase-section[data-phase="2"] .concept-tag { color: var(--green); border-color: var(--green-dim); background: rgba(0, 255, 136, 0.05); }
.phase-section[data-phase="3"] .concept-tag { color: var(--amber); border-color: var(--amber-dim); background: rgba(255, 170, 0, 0.05); }
.phase-section[data-phase="4"] .concept-tag { color: var(--magenta); border-color: var(--magenta-dim); background: rgba(255, 0, 170, 0.05); }
.phase-section[data-phase="5"] .concept-tag { color: var(--purple); border-color: var(--purple-dim); background: rgba(170, 68, 255, 0.05); }

.insight-box {
  background: rgba(0, 240, 255, 0.04);
  border-left: 3px solid;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.phase-section[data-phase="1"] .insight-box { border-left-color: var(--cyan); background: rgba(0, 240, 255, 0.04); }
.phase-section[data-phase="2"] .insight-box { border-left-color: var(--green); background: rgba(0, 255, 136, 0.04); }
.phase-section[data-phase="3"] .insight-box { border-left-color: var(--amber); background: rgba(255, 170, 0, 0.04); }
.phase-section[data-phase="4"] .insight-box { border-left-color: var(--magenta); background: rgba(255, 0, 170, 0.04); }
.phase-section[data-phase="5"] .insight-box { border-left-color: var(--purple); background: rgba(170, 68, 255, 0.04); }

.insight-box strong { color: var(--text-primary); }

/* ── CODE BLOCKS ── */
.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--text-secondary);
}

.code-block .kw { color: var(--magenta); }
.code-block .fn { color: var(--cyan); }
.code-block .str { color: var(--green); }
.code-block .num { color: var(--amber); }
.code-block .cmt { color: var(--text-dim); font-style: italic; }

/* ── PHASE CONNECTOR ── */
.phase-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  position: relative;
}

.connector-line {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, var(--border), transparent);
}

.connector-icon {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.3;
}

/* ── JOURNEY MAP ── */
.journey-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 4rem 0 6rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.journey-step {
  text-align: center;
  padding: 1.25rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.journey-step:hover { background: rgba(255, 255, 255, 0.03); }

.journey-step-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

.journey-step:hover .journey-step-num { opacity: 0.5; }

.journey-step:nth-child(1) .journey-step-num { color: var(--cyan); }
.journey-step:nth-child(2) .journey-step-num { color: var(--green); }
.journey-step:nth-child(3) .journey-step-num { color: var(--amber); }
.journey-step:nth-child(4) .journey-step-num { color: var(--magenta); }
.journey-step:nth-child(5) .journey-step-num { color: var(--purple); }

.journey-step-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 2;
}

.footer-goat {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.footer-quote {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── EXPAND ALL BUTTON ── */
.controls-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.control-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(0, 240, 255, 0.05);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .phase-nav { display: none; }
  .journey-map { grid-template-columns: 1fr; gap: 0.25rem; }
  .journey-step { padding: 0.75rem; }
  .content { padding: 0 1rem 4rem; }
  .topic-card-header { padding: 1rem; }
  .topic-body { padding: 0 1rem 1rem; }
}

/* ── ANIMATION CLASSES ── */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* ── TOPIC CARD ENTER ANIMATION ── */
.phase-section.visible .topic-card {
  animation: cardSlideIn 0.6s ease-out both;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>

<!-- Progress Bar -->
<div class="progress-bar" id="progressBar"></div>

<!-- Phase Navigation -->
<nav class="phase-nav" id="phaseNav">
  <div class="phase-nav-dot" data-phase="1" data-label="Digital Bedrock" onclick="scrollToPhase(1)"></div>
  <div class="phase-nav-dot" data-phase="2" data-label="The Bridge" onclick="scrollToPhase(2)"></div>
  <div class="phase-nav-dot" data-phase="3" data-label="Great Connection" onclick="scrollToPhase(3)"></div>
  <div class="phase-nav-dot" data-phase="4" data-label="The Architect" onclick="scrollToPhase(4)"></div>
  <div class="phase-nav-dot" data-phase="5" data-label="Enlightened" onclick="scrollToPhase(5)"></div>
</nav>

<!-- ════════════════════ HERO ════════════════════ -->
<section class="hero">
  <div class="hero-bg-orb one"></div>
  <div class="hero-bg-orb two"></div>
  <div class="hero-bg-orb three"></div>
  <div class="hero-badge">The Complete Path to Mastery</div>
  <h1 class="hero-title">BE A COMPUTER GOAT</h1>
  <p class="hero-subtitle">
    From <span>tricking rocks into thinking</span> to teaching machines to learn.
    Five phases. Every concept. The full journey from transistor to transformer.
  </p>
  <div class="hero-scroll-indicator">
    <span>Begin the journey</span>
    <div class="scroll-arrow"></div>
  </div>
</section>

<!-- ════════════════════ JOURNEY MAP ════════════════════ -->
<div class="content">
  <div class="journey-map">
    <div class="journey-step" onclick="scrollToPhase(1)">
      <div class="journey-step-num">01</div>
      <div class="journey-step-title">Digital Bedrock</div>
    </div>
    <div class="journey-step" onclick="scrollToPhase(2)">
      <div class="journey-step-num">02</div>
      <div class="journey-step-title">The Bridge</div>
    </div>
    <div class="journey-step" onclick="scrollToPhase(3)">
      <div class="journey-step-num">03</div>
      <div class="journey-step-title">Great Connection</div>
    </div>
    <div class="journey-step" onclick="scrollToPhase(4)">
      <div class="journey-step-num">04</div>
      <div class="journey-step-title">The Architect</div>
    </div>
    <div class="journey-step" onclick="scrollToPhase(5)">
      <div class="journey-step-num">05</div>
      <div class="journey-step-title">Enlightened</div>
    </div>
  </div>

<!-- ════════════════════ PHASE 1 ════════════════════ -->
<section class="phase-section" data-phase="1" id="phase1">
  <div class="phase-header">
    <div class="phase-number">Phase 01</div>
    <h2 class="phase-title">The "Digital Bedrock"</h2>
    <p class="phase-tagline">Hardware &amp; Logic — <em>Before there is code, there is electricity and math. You must understand how we trick rocks into thinking.</em></p>
  </div>

  <div class="controls-bar">
    <button class="control-btn" onclick="toggleAllCards(this.closest('.phase-section'))">Expand All</button>
  </div>

  <div class="topics-grid">

    <!-- 1.1 Number Systems -->
    <div class="topic-card stagger-1" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔢</div>
        <div class="topic-title-area">
          <div class="topic-title">Number Systems</div>
          <div class="topic-subtitle">Binary, Hex & Two's Complement</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>Everything a computer does reduces to numbers — but not our familiar base-10 system. Computers speak in <strong>binary (base-2)</strong>, where every value is a sequence of 0s and 1s. Each digit is a <strong>bit</strong>, eight bits make a <strong>byte</strong>, and from that tiny alphabet emerges every photo, song, and program you've ever seen.</p>

          <div class="insight-box">
            <strong>Why binary?</strong> Because a transistor can only be ON or OFF. Two states. One bit. That's the physical constraint everything else is built on.
          </div>

          <p><strong>Hexadecimal (base-16)</strong> is the human-friendly shorthand for binary. Instead of writing 11111111, you write FF. It groups four bits into one hex digit, making memory addresses and color codes readable. Every time you see a hex color like #00F0FF, you're staring at three bytes of binary packed into six hex characters.</p>

          <p><strong>Two's complement</strong> is how computers handle negative numbers. The highest bit becomes the sign bit: flip all the bits and add 1 to negate a number. This elegant trick lets the CPU use the same addition hardware for both positive and negative math — no separate subtraction circuit required.</p>

          <div class="code-block">
<span class="cmt">// Decimal 42 in different bases</span>
<span class="kw">Binary:</span>    <span class="num">00101010</span>
<span class="kw">Hex:</span>       <span class="num">0x2A</span>
<span class="kw">Octal:</span>     <span class="num">052</span>

<span class="cmt">// Two's complement: -42 in 8-bit binary</span>
<span class="fn">Step 1:</span> Start with +42  → <span class="num">00101010</span>
<span class="fn">Step 2:</span> Flip all bits    → <span class="num">11010101</span>
<span class="fn">Step 3:</span> Add 1            → <span class="num">11010110</span>  ← this is -42
          </div>

          <p>
            <span class="concept-tag">Binary (Base-2)</span>
            <span class="concept-tag">Hexadecimal (Base-16)</span>
            <span class="concept-tag">Two's Complement</span>
            <span class="concept-tag">Bits & Bytes</span>
            <span class="concept-tag">Octal (Base-8)</span>
            <span class="concept-tag">Signed vs Unsigned</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.2 Boolean Algebra -->
    <div class="topic-card stagger-2" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">⚡</div>
        <div class="topic-title-area">
          <div class="topic-title">Boolean Algebra</div>
          <div class="topic-subtitle">The mathematical language of circuits</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>Boolean algebra is the bedrock logic system: every variable is either TRUE (1) or FALSE (0), and every operation produces a TRUE or FALSE result. George Boole formalized this in the 1840s — over a century before transistors existed — giving us the math that would eventually power every digital circuit ever built.</p>

          <p>The fundamental operations are <strong>AND</strong> (both inputs must be true), <strong>OR</strong> (at least one input must be true), and <strong>NOT</strong> (flips the value). From these three, you can construct <strong>XOR</strong> (exclusive or — true when inputs differ), <strong>NAND</strong> (not-and), and <strong>NOR</strong> (not-or). Here's the key insight: <strong>NAND alone is functionally complete</strong> — you can build ANY logic circuit using nothing but NAND gates.</p>

          <div class="insight-box">
            <strong>NAND is universal.</strong> Every gate — AND, OR, NOT, XOR — can be constructed from NAND gates alone. Modern chip fabrication exploits this: billions of NAND-based transistor arrangements running everything from your phone to cloud servers.
          </div>

          <div class="code-block">
<span class="cmt">// Truth tables for core operations</span>
<span class="kw">AND</span>  │ 0·0=<span class="num">0</span>  0·1=<span class="num">0</span>  1·0=<span class="num">0</span>  1·1=<span class="num">1</span>
<span class="kw">OR</span>   │ 0+0=<span class="num">0</span>  0+1=<span class="num">1</span>  1+0=<span class="num">1</span>  1+1=<span class="num">1</span>
<span class="kw">NOT</span>  │ ¬0=<span class="num">1</span>   ¬1=<span class="num">0</span>
<span class="kw">XOR</span>  │ 0⊕0=<span class="num">0</span>  0⊕1=<span class="num">1</span>  1⊕0=<span class="num">1</span>  1⊕1=<span class="num">0</span>
<span class="kw">NAND</span> │ 0↑0=<span class="num">1</span>  0↑1=<span class="num">1</span>  1↑0=<span class="num">1</span>  1↑1=<span class="num">0</span>

<span class="cmt">// De Morgan's Laws (essential for simplification)</span>
<span class="fn">¬(A · B) = ¬A + ¬B</span>
<span class="fn">¬(A + B) = ¬A · ¬B</span>
          </div>

          <p>
            <span class="concept-tag">AND / OR / NOT</span>
            <span class="concept-tag">XOR / NAND / NOR</span>
            <span class="concept-tag">Truth Tables</span>
            <span class="concept-tag">De Morgan's Laws</span>
            <span class="concept-tag">Functional Completeness</span>
            <span class="concept-tag">Karnaugh Maps</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.3 Logic Gates -->
    <div class="topic-card stagger-3" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔧</div>
        <div class="topic-title-area">
          <div class="topic-title">Logic Gates & Combinational Logic</div>
          <div class="topic-subtitle">Adders, Multiplexers & Physical Circuits</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>Logic gates are the physical embodiment of Boolean algebra. A transistor acts as a tiny switch — voltage in, voltage out. Combine transistors and you get gates. Combine gates and you get <strong>combinational circuits</strong>: circuits whose output depends purely on the current inputs, with no memory of the past.</p>

          <p>The <strong>half adder</strong> adds two bits: an XOR gate gives you the sum, an AND gate gives you the carry. Chain half adders into a <strong>full adder</strong> (which handles a carry-in), then cascade those into a <strong>ripple-carry adder</strong> — now your circuit can add multi-bit numbers. This is how CPUs do arithmetic at the hardware level.</p>

          <p><strong>Multiplexers (MUX)</strong> route data: given N inputs and a selector, a MUX passes one input through to the output. <strong>Demultiplexers (DEMUX)</strong> do the reverse — one input, many outputs. <strong>Decoders</strong> convert binary addresses into one-hot signals. These components are the traffic controllers inside every processor.</p>

          <div class="code-block">
<span class="cmt">// Half Adder</span>
<span class="fn">Sum</span>   = A <span class="kw">XOR</span> B
<span class="fn">Carry</span> = A <span class="kw">AND</span> B

<span class="cmt">// Full Adder (adds carry-in)</span>
<span class="fn">Sum</span>   = A <span class="kw">XOR</span> B <span class="kw">XOR</span> Cin
<span class="fn">Cout</span>  = (A <span class="kw">AND</span> B) <span class="kw">OR</span> (Cin <span class="kw">AND</span> (A <span class="kw">XOR</span> B))
          </div>

          <p>
            <span class="concept-tag">Half Adder</span>
            <span class="concept-tag">Full Adder</span>
            <span class="concept-tag">Ripple-Carry Adder</span>
            <span class="concept-tag">Multiplexer (MUX)</span>
            <span class="concept-tag">Decoder</span>
            <span class="concept-tag">Encoder</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.4 Sequential Logic -->
    <div class="topic-card stagger-4" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🧠</div>
        <div class="topic-title-area">
          <div class="topic-title">Sequential Logic</div>
          <div class="topic-subtitle">Flip-Flops, Latches & The Birth of Memory</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>Combinational logic has no memory — it reacts only to the present. <strong>Sequential logic</strong> changes everything: by feeding the output of a gate back into its input, you create a circuit that can <em>remember</em>. This is the birth of state, the dividing line between a calculator and a computer.</p>

          <p>An <strong>SR Latch</strong> (Set-Reset) is the simplest memory element: two cross-coupled NOR or NAND gates that lock into a stable state. The <strong>D Latch</strong> adds a data input and enable signal. The <strong>D Flip-Flop</strong> upgrades further: it captures data only on the rising (or falling) edge of a clock signal, giving you precise, synchronized storage.</p>

          <p>Chain D flip-flops together and you get <strong>registers</strong> — tiny, fast storage inside the CPU. Add counting logic and you get <strong>counters</strong>. Add shift logic and you get <strong>shift registers</strong>. All RAM, all CPU registers, all state machines trace back to this simple feedback loop.</p>

          <div class="insight-box">
            <strong>Clock signal = the heartbeat.</strong> Every flip-flop in the CPU latches its data in sync with the clock. A 4 GHz processor means its flip-flops are capturing data 4 billion times per second.
          </div>

          <p>
            <span class="concept-tag">SR Latch</span>
            <span class="concept-tag">D Latch</span>
            <span class="concept-tag">D Flip-Flop</span>
            <span class="concept-tag">Registers</span>
            <span class="concept-tag">Counters</span>
            <span class="concept-tag">Finite State Machines</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.5 Computer Architecture (ALU) -->
    <div class="topic-card stagger-5" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">⚙️</div>
        <div class="topic-title-area">
          <div class="topic-title">Computer Architecture</div>
          <div class="topic-subtitle">The ALU & Fetch-Decode-Execute Cycle</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The <strong>Arithmetic Logic Unit (ALU)</strong> is the mathematical engine of the CPU. It takes two inputs and an opcode (operation code), then outputs a result plus status flags: zero, carry, overflow, negative. Every computation your computer performs — from adding two integers to comparing strings — ultimately passes through the ALU.</p>

          <p>The <strong>Fetch-Decode-Execute cycle</strong> is the CPU's fundamental rhythm. <strong>Fetch</strong>: the Program Counter (PC) points to the next instruction's address in memory; the CPU reads it. <strong>Decode</strong>: the control unit interprets the opcode and figures out what to do. <strong>Execute</strong>: the ALU or memory unit performs the operation. Then the PC increments and the cycle repeats — billions of times per second.</p>

          <p>Modern CPUs add <strong>pipelining</strong> (overlapping stages so multiple instructions are in-flight simultaneously), <strong>branch prediction</strong> (guessing which way an if-statement will go), and <strong>out-of-order execution</strong> (reordering instructions for efficiency). These optimizations are why a modern chip performs orders of magnitude faster than its raw clock speed would suggest.</p>

          <div class="code-block">
<span class="cmt">// The CPU cycle, simplified</span>
<span class="kw">while</span> (running) {
  instruction = <span class="fn">memory</span>[<span class="fn">PC</span>];      <span class="cmt">// FETCH</span>
  decoded = <span class="fn">decode</span>(instruction);   <span class="cmt">// DECODE</span>
  <span class="fn">execute</span>(decoded);                <span class="cmt">// EXECUTE</span>
  <span class="fn">PC</span>++;                            <span class="cmt">// NEXT</span>
}
          </div>

          <p>
            <span class="concept-tag">ALU</span>
            <span class="concept-tag">Program Counter</span>
            <span class="concept-tag">Control Unit</span>
            <span class="concept-tag">Pipelining</span>
            <span class="concept-tag">Branch Prediction</span>
            <span class="concept-tag">Out-of-Order Execution</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.6 ISA & Assembly -->
    <div class="topic-card stagger-6" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">📜</div>
        <div class="topic-title-area">
          <div class="topic-title">Instruction Set Architecture</div>
          <div class="topic-subtitle">Assembly Language — Talking Directly to the CPU</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The <strong>ISA</strong> is the contract between software and hardware: it defines every instruction the CPU understands, the register set, memory addressing modes, and data types. Two major families dominate: <strong>x86/x64</strong> (complex, variable-length instructions — desktops and servers) and <strong>ARM</strong> (simpler, fixed-length instructions — phones, tablets, Apple Silicon).</p>

          <p><strong>Assembly language</strong> is the lowest level of human-readable code. Each instruction maps almost 1-to-1 to a machine code opcode. You manually move data between registers, call ALU operations, manage the stack, and control program flow. It's tedious, powerful, and deeply instructive — writing assembly forces you to understand exactly what the hardware is doing.</p>

          <div class="insight-box">
            <strong>CISC vs RISC.</strong> x86 is CISC (Complex Instruction Set) — many specialized instructions. ARM is RISC (Reduced Instruction Set) — fewer, simpler instructions that execute in one cycle. Apple's M-series chips proved RISC can match or beat CISC in raw performance while using a fraction of the power.
          </div>

          <div class="code-block">
<span class="cmt">; x86 Assembly — add two numbers</span>
<span class="kw">mov</span>  <span class="fn">eax</span>, <span class="num">5</span>        <span class="cmt">; load 5 into register EAX</span>
<span class="kw">mov</span>  <span class="fn">ebx</span>, <span class="num">3</span>        <span class="cmt">; load 3 into register EBX</span>
<span class="kw">add</span>  <span class="fn">eax</span>, <span class="fn">ebx</span>      <span class="cmt">; EAX = EAX + EBX = 8</span>
          </div>

          <p>
            <span class="concept-tag">x86 / x64</span>
            <span class="concept-tag">ARM</span>
            <span class="concept-tag">CISC vs RISC</span>
            <span class="concept-tag">Opcodes</span>
            <span class="concept-tag">Registers</span>
            <span class="concept-tag">Addressing Modes</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.7 Memory Hierarchy -->
    <div class="topic-card stagger-7" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">📊</div>
        <div class="topic-title-area">
          <div class="topic-title">Memory Hierarchy</div>
          <div class="topic-subtitle">Registers → Cache → RAM → Storage</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The memory hierarchy is a speed-vs-capacity tradeoff that shapes all of computing. At the top: <strong>registers</strong> — a handful of bytes inside the CPU, accessed in a single clock cycle. Below that: <strong>L1 cache</strong> (~64KB per core, ~1ns), <strong>L2 cache</strong> (~256KB–1MB, ~4ns), and <strong>L3 cache</strong> (shared, ~8–64MB, ~10ns). Then <strong>RAM</strong> (gigabytes, ~100ns). Finally, <strong>storage</strong> (SSD/HDD — terabytes, microseconds to milliseconds).</p>

          <p>The CPU wants data NOW. If it's not in L1, there's a <strong>cache miss</strong> and the CPU stalls while waiting for data from a slower level. <strong>Spatial locality</strong> (nearby data gets used soon) and <strong>temporal locality</strong> (recently used data gets used again) are the principles that make caching work. Writing cache-friendly code — accessing memory sequentially rather than randomly — can make programs 10x to 100x faster.</p>

          <div class="code-block">
<span class="cmt">// Approximate access latencies</span>
<span class="fn">Register</span>    →  <span class="num">~0.3 ns</span>    <span class="str">(instant)</span>
<span class="fn">L1 Cache</span>    →  <span class="num">~1 ns</span>      <span class="str">(4 cycles)</span>
<span class="fn">L2 Cache</span>    →  <span class="num">~4 ns</span>      <span class="str">(12 cycles)</span>
<span class="fn">L3 Cache</span>    →  <span class="num">~10 ns</span>     <span class="str">(36 cycles)</span>
<span class="fn">RAM</span>         →  <span class="num">~100 ns</span>    <span class="str">(~350 cycles)</span>
<span class="fn">SSD</span>         →  <span class="num">~100 μs</span>    <span class="str">(~350,000 cycles)</span>
<span class="fn">HDD</span>         →  <span class="num">~10 ms</span>     <span class="str">(~35,000,000 cycles)</span>
          </div>

          <p>
            <span class="concept-tag">Registers</span>
            <span class="concept-tag">L1/L2/L3 Cache</span>
            <span class="concept-tag">Cache Miss</span>
            <span class="concept-tag">RAM (DRAM)</span>
            <span class="concept-tag">Locality Principles</span>
            <span class="concept-tag">Virtual Memory</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 1.8 Microarchitectures -->
    <div class="topic-card stagger-8" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🖥️</div>
        <div class="topic-title-area">
          <div class="topic-title">Microarchitectures</div>
          <div class="topic-subtitle">Bus Lines, Clock Speeds & Hardware Coordination</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>Microarchitecture is HOW a CPU implements its ISA. Two chips can share the same instruction set (x86) but have wildly different internal designs — different pipeline depths, cache sizes, branch predictors, and execution units. Intel's Raptor Lake and AMD's Zen 4 both run x86 code, but their microarchitectures are fundamentally different.</p>

          <p>The <strong>system bus</strong> connects CPU, memory, and I/O devices. It has three channels: the <strong>address bus</strong> (where to read/write), the <strong>data bus</strong> (what to read/write), and the <strong>control bus</strong> (read/write signals, interrupts). The bus width determines how much data can flow per cycle — a 64-bit data bus moves 8 bytes at once.</p>

          <p>The <strong>motherboard</strong> is the central highway: the <strong>chipset</strong> (traditionally Northbridge for high-speed traffic, Southbridge for peripherals — now often unified) coordinates communication between CPU, RAM, GPU, storage, and expansion slots. <strong>PCIe lanes</strong> provide high-bandwidth point-to-point connections for GPUs and NVMe drives. Understanding this topology matters when you're diagnosing bottlenecks or designing systems.</p>

          <p>
            <span class="concept-tag">Bus Architecture</span>
            <span class="concept-tag">Clock Speed & Multipliers</span>
            <span class="concept-tag">Chipset</span>
            <span class="concept-tag">PCIe Lanes</span>
            <span class="concept-tag">Interrupts (IRQs)</span>
            <span class="concept-tag">DMA</span>
          </p>
        </div>
      </div>
    </div>
  </div>
</section>

<div class="phase-connector"><div class="connector-line"></div></div>

<!-- ════════════════════ PHASE 2 ════════════════════ -->
<section class="phase-section" data-phase="2" id="phase2">
  <div class="phase-header">
    <div class="phase-number">Phase 02</div>
    <h2 class="phase-title">The "Bridge"</h2>
    <p class="phase-tagline">Systems Programming — <em>Now you move from hardware to the software that manages it.</em></p>
  </div>

  <div class="controls-bar">
    <button class="control-btn" onclick="toggleAllCards(this.closest('.phase-section'))">Expand All</button>
  </div>

  <div class="topics-grid">

    <!-- 2.1 Compilers & Interpreters -->
    <div class="topic-card stagger-1" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔄</div>
        <div class="topic-title-area">
          <div class="topic-title">Compilers & Interpreters</div>
          <div class="topic-subtitle">From Human Code to Machine Code</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>A <strong>compiler</strong> translates your entire source file into machine code before anything runs. The pipeline: <strong>Lexing</strong> (breaking source into tokens) → <strong>Parsing</strong> (building an Abstract Syntax Tree) → <strong>Semantic Analysis</strong> (type checking, scope resolution) → <strong>Optimization</strong> (dead code elimination, loop unrolling, inlining) → <strong>Code Generation</strong> (emitting machine code or assembly). Languages like C, C++, Rust, and Go are compiled.</p>

          <p>An <strong>interpreter</strong> executes code line-by-line at runtime. No separate compilation step — you write it, you run it. Python, Ruby, and JavaScript (originally) are interpreted. The tradeoff: faster development cycle, slower execution.</p>

          <p><strong>JIT (Just-In-Time) compilation</strong> is the best of both worlds. The Java Virtual Machine and V8 (Chrome's JavaScript engine) start by interpreting code, then identify "hot" paths that run frequently and compile them to native machine code on the fly. This is why modern JavaScript can approach C-level speeds for compute-heavy tasks.</p>

          <div class="insight-box">
            <strong>LLVM changed everything.</strong> LLVM is a compiler infrastructure that provides a universal intermediate representation (IR). Languages like Rust, Swift, and Clang-compiled C/C++ all compile to LLVM IR first, then LLVM's backend optimizes and generates machine code for any target architecture. Write one frontend, get optimized code for x86, ARM, RISC-V, and more.
          </div>

          <p>
            <span class="concept-tag">Lexer / Tokenizer</span>
            <span class="concept-tag">Parser / AST</span>
            <span class="concept-tag">Compiler Optimization</span>
            <span class="concept-tag">JIT Compilation</span>
            <span class="concept-tag">LLVM / IR</span>
            <span class="concept-tag">Linker</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 2.2 OS Fundamentals -->
    <div class="topic-card stagger-2" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🐧</div>
        <div class="topic-title-area">
          <div class="topic-title">Operating System Fundamentals</div>
          <div class="topic-subtitle">Kernels, Processes, Memory & File Systems</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The <strong>kernel</strong> is the innermost layer of the OS — it has absolute control over hardware. It manages <strong>process scheduling</strong> (which program gets CPU time and when), <strong>memory management</strong> (virtual memory, page tables, swapping), <strong>device drivers</strong> (hardware abstraction), and <strong>system calls</strong> (the API that userspace programs use to request kernel services).</p>

          <p><strong>Processes</strong> are isolated instances of running programs, each with its own address space. <strong>Threads</strong> are lightweight execution units within a process, sharing memory but running independently. The scheduler juggles thousands of threads across CPU cores, creating the illusion of parallelism even on a single core through rapid <strong>context switching</strong>.</p>

          <p><strong>Virtual memory</strong> gives every process the illusion of having its own massive, contiguous address space. The OS and hardware (MMU) translate virtual addresses to physical addresses through <strong>page tables</strong>. When RAM fills up, the OS <strong>swaps</strong> least-recently-used pages to disk. The <strong>file system</strong> (ext4, NTFS, APFS) organizes data on storage into hierarchical directories, managing allocation, permissions, and journaling for crash recovery.</p>

          <div class="code-block">
<span class="cmt">// Linux system call to create a child process</span>
<span class="kw">pid_t</span> pid = <span class="fn">fork</span>();
<span class="kw">if</span> (pid == <span class="num">0</span>) {
    <span class="cmt">// Child process</span>
    <span class="fn">execvp</span>(<span class="str">"ls"</span>, args);  <span class="cmt">// Replace process image</span>
} <span class="kw">else</span> {
    <span class="fn">wait</span>(NULL);           <span class="cmt">// Parent waits for child</span>
}
          </div>

          <p>
            <span class="concept-tag">Kernel (Monolithic vs Micro)</span>
            <span class="concept-tag">Process vs Thread</span>
            <span class="concept-tag">Context Switching</span>
            <span class="concept-tag">Virtual Memory</span>
            <span class="concept-tag">System Calls</span>
            <span class="concept-tag">File Systems</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 2.3 C Programming -->
    <div class="topic-card stagger-3" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔩</div>
        <div class="topic-title-area">
          <div class="topic-title">C Programming</div>
          <div class="topic-subtitle">Pointers, Memory Management & The Metal</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>C is the lingua franca of systems programming. Linux, Windows, macOS kernels, database engines, embedded systems, and most programming language runtimes are written in C. It gives you direct access to memory through <strong>pointers</strong> — variables that store memory addresses. Pointer arithmetic lets you navigate raw memory byte by byte.</p>

          <p><strong>Manual memory management</strong> is C's superpower and its trap. <code>malloc()</code> allocates heap memory, <code>free()</code> releases it. Forget to free? <strong>Memory leak.</strong> Free twice? <strong>Undefined behavior.</strong> Use after free? <strong>Security vulnerability.</strong> This discipline is why C programmers deeply understand what the machine is actually doing — there's no garbage collector to save you.</p>

          <p>Understanding C means understanding <strong>the stack</strong> (automatic storage for local variables, function frames), <strong>the heap</strong> (dynamic storage you control), <strong>structs</strong> (custom data layouts with explicit memory alignment), and <strong>function pointers</strong> (callbacks, vtables, polymorphism at the metal level). Modern alternatives like Rust provide memory safety guarantees at compile time, but knowing C means you'll understand what Rust is protecting you from.</p>

          <div class="code-block">
<span class="cmt">// Pointers & dynamic memory</span>
<span class="kw">int</span> *arr = (<span class="kw">int</span> *)<span class="fn">malloc</span>(<span class="num">5</span> * <span class="kw">sizeof</span>(<span class="kw">int</span>));
<span class="kw">for</span> (<span class="kw">int</span> i = <span class="num">0</span>; i < <span class="num">5</span>; i++) {
    *(arr + i) = i * <span class="num">10</span>;  <span class="cmt">// pointer arithmetic</span>
}
<span class="fn">printf</span>(<span class="str">"%d\n"</span>, arr[<span class="num">3</span>]);   <span class="cmt">// prints 30</span>
<span class="fn">free</span>(arr);                <span class="cmt">// YOU must release it</span>
          </div>

          <p>
            <span class="concept-tag">Pointers</span>
            <span class="concept-tag">malloc / free</span>
            <span class="concept-tag">Stack vs Heap</span>
            <span class="concept-tag">Structs & Unions</span>
            <span class="concept-tag">Function Pointers</span>
            <span class="concept-tag">Buffer Overflows</span>
          </p>
        </div>
      </div>
    </div>

    <!-- 2.4 Virtualization -->
    <div class="topic-card stagger-4" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">📦</div>
        <div class="topic-title-area">
          <div class="topic-title">Virtualization & Containers</div>
          <div class="topic-subtitle">VMs, Docker & Running Computers Inside Computers</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Virtual Machines (VMs)</strong> emulate an entire computer — CPU, RAM, storage, network — inside software. A <strong>hypervisor</strong> (Type 1 like ESXi runs on bare metal; Type 2 like VirtualBox runs atop an OS) allocates physical resources to virtual guests. Each VM runs its own full OS, completely isolated. This is how cloud providers carve one massive server into dozens of independently billable instances.</p>

          <p><strong>Containers</strong> (Docker, Podman) take a different approach: instead of virtualizing hardware, they virtualize the OS. Containers share the host kernel but have isolated file systems, process trees, and network stacks via Linux <strong>namespaces</strong> and <strong>cgroups</strong>. A container image packages your application with all its dependencies into a portable, reproducible unit. They boot in seconds (not minutes like VMs) and use a fraction of the resources.</p>

          <p><strong>Docker</strong> popularized containers with a simple workflow: write a <strong>Dockerfile</strong> (build recipe), build an <strong>image</strong> (immutable snapshot), run a <strong>container</strong> (running instance). <strong>Kubernetes</strong> orchestrates containers at scale — scheduling, scaling, load-balancing, and healing thousands of containers across clusters of machines. This is the infrastructure backbone of modern cloud-native applications.</p>

          <div class="code-block">
<span class="cmt"># Simple Dockerfile</span>
<span class="kw">FROM</span> <span class="str">python:3.12-slim</span>
<span class="kw">WORKDIR</span> /app
<span class="kw">COPY</span> requirements.txt .
<span class="kw">RUN</span> <span class="fn">pip install</span> -r requirements.txt
<span class="kw">COPY</span> . .
<span class="kw">CMD</span> [<span class="str">"python"</span>, <span class="str">"app.py"</span>]
          </div>

          <p>
            <span class="concept-tag">Hypervisor (Type 1 / Type 2)</span>
            <span class="concept-tag">Docker</span>
            <span class="concept-tag">Namespaces & Cgroups</span>
            <span class="concept-tag">Container Images</span>
            <span class="concept-tag">Kubernetes (K8s)</span>
            <span class="concept-tag">Infrastructure as Code</span>
          </p>
        </div>
      </div>
    </div>

  </div>
</section>

<div class="phase-connector"><div class="connector-line"></div></div>

<!-- ════════════════════ PHASE 3 ════════════════════ -->
<section class="phase-section" data-phase="3" id="phase3">
  <div class="phase-header">
    <div class="phase-number">Phase 03</div>
    <h2 class="phase-title">The "Great Connection"</h2>
    <p class="phase-tagline">Networking — <em>A computer alone is a calculator. A computer connected is a superpower.</em></p>
  </div>

  <div class="controls-bar">
    <button class="control-btn" onclick="toggleAllCards(this.closest('.phase-section'))">Expand All</button>
  </div>

  <div class="topics-grid">

    <div class="topic-card stagger-1" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🏗️</div>
        <div class="topic-title-area">
          <div class="topic-title">The OSI Model</div>
          <div class="topic-subtitle">All 7 Layers — From Cables to Applications</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The <strong>OSI (Open Systems Interconnection) model</strong> breaks networking into 7 layers, each with a clear responsibility. It's a conceptual framework, but understanding it means you can diagnose any network problem by isolating which layer is failing.</p>

          <div class="code-block">
<span class="fn">Layer 7</span> │ <span class="kw">Application</span>   │ HTTP, FTP, SMTP, DNS
<span class="fn">Layer 6</span> │ <span class="kw">Presentation</span>  │ SSL/TLS, JPEG, ASCII encoding
<span class="fn">Layer 5</span> │ <span class="kw">Session</span>       │ Establish/maintain/terminate connections
<span class="fn">Layer 4</span> │ <span class="kw">Transport</span>     │ TCP (reliable), UDP (fast)
<span class="fn">Layer 3</span> │ <span class="kw">Network</span>       │ IP addressing, routing
<span class="fn">Layer 2</span> │ <span class="kw">Data Link</span>     │ MAC addresses, switches, frames
<span class="fn">Layer 1</span> │ <span class="kw">Physical</span>      │ Cables, signals, voltage, bits on wire
          </div>

          <p>In practice, the <strong>TCP/IP model</strong> (4 layers: Link, Internet, Transport, Application) is what the internet actually runs on. But the OSI model gives you cleaner mental boundaries for understanding encapsulation — how each layer wraps data with its own header as it travels down the stack, then unwraps as it travels back up at the destination.</p>

          <p>
            <span class="concept-tag">Encapsulation</span>
            <span class="concept-tag">PDU (Protocol Data Unit)</span>
            <span class="concept-tag">TCP/IP Model</span>
            <span class="concept-tag">Layer Isolation</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-2" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">📡</div>
        <div class="topic-title-area">
          <div class="topic-title">Protocols Deep Dive</div>
          <div class="topic-subtitle">TCP/IP, UDP, ICMP & DHCP</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>TCP (Transmission Control Protocol)</strong> provides reliable, ordered delivery. It uses a <strong>three-way handshake</strong> (SYN → SYN-ACK → ACK) to establish connections, sequence numbers to order packets, acknowledgments to confirm receipt, and retransmission to handle losses. TCP also implements <strong>flow control</strong> (sliding window) and <strong>congestion control</strong> (slow start, congestion avoidance) to prevent overwhelming the network.</p>

          <p><strong>UDP (User Datagram Protocol)</strong> sacrifices reliability for speed. No handshake, no ordering, no retransmission — just fire and forget. This makes it ideal for video streaming, gaming, VoIP, and DNS queries where speed matters more than perfection. A dropped gaming packet is better than a delayed one.</p>

          <p><strong>IP (Internet Protocol)</strong> handles addressing and routing. IPv4 uses 32-bit addresses (4.3 billion possible — we've run out). IPv6 uses 128-bit addresses (340 undecillion — enough for every atom on Earth). <strong>ICMP</strong> carries error messages and diagnostics (ping and traceroute use ICMP). <strong>DHCP</strong> automatically assigns IP addresses, subnet masks, gateways, and DNS servers to devices joining a network.</p>

          <p>
            <span class="concept-tag">TCP 3-Way Handshake</span>
            <span class="concept-tag">UDP</span>
            <span class="concept-tag">IPv4 / IPv6</span>
            <span class="concept-tag">ICMP</span>
            <span class="concept-tag">DHCP</span>
            <span class="concept-tag">NAT</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-3" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔀</div>
        <div class="topic-title-area">
          <div class="topic-title">Routing & Switching</div>
          <div class="topic-subtitle">How Packets Find Their Way</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Switches</strong> operate at Layer 2. They learn MAC addresses by watching traffic, build a MAC address table, and forward frames only to the correct port. This creates separate collision domains and dramatically improves network efficiency over older hubs (which broadcast everything everywhere). <strong>VLANs</strong> let you create logically separate networks on the same physical switch.</p>

          <p><strong>Routers</strong> operate at Layer 3. They examine destination IP addresses, consult their routing table, and forward packets toward their destination across network boundaries. <strong>Static routes</strong> are manually configured. <strong>Dynamic routing protocols</strong> — OSPF (within an organization), BGP (between organizations/ISPs) — automatically discover and adapt to network topology changes.</p>

          <p><strong>Subnetting</strong> divides a large network into smaller segments. A subnet mask (like 255.255.255.0 or /24 in CIDR notation) determines which portion of an IP address identifies the network vs. the host. Proper subnetting is fundamental to efficient IP allocation, routing, and security isolation.</p>

          <p>
            <span class="concept-tag">MAC Address Table</span>
            <span class="concept-tag">VLANs</span>
            <span class="concept-tag">Routing Tables</span>
            <span class="concept-tag">OSPF / BGP</span>
            <span class="concept-tag">Subnetting / CIDR</span>
            <span class="concept-tag">ARP</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-4" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🌐</div>
        <div class="topic-title-area">
          <div class="topic-title">The Global Internet</div>
          <div class="topic-subtitle">DNS, BGP & The World Wide Web</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>DNS (Domain Name System)</strong> is the phonebook of the internet. When you type "google.com", your browser asks a DNS resolver to translate that domain into an IP address. The query cascades: local cache → recursive resolver → root nameserver → TLD nameserver (.com) → authoritative nameserver → IP address returned. This happens in milliseconds, billions of times per day.</p>

          <p><strong>BGP (Border Gateway Protocol)</strong> is the protocol that holds the internet together. Autonomous Systems (AS) — ISPs, cloud providers, universities — use BGP to announce which IP prefixes they own and exchange routing information with peers. A BGP misconfiguration can take down entire regions of the internet. It's the most critical and least understood protocol on the planet.</p>

          <p><strong>HTTP/HTTPS</strong> is the foundation of the web. HTTP is a request-response protocol: the client sends a request (GET, POST, PUT, DELETE), the server sends a response with a status code (200 OK, 404 Not Found, 500 Server Error) and body. HTTPS wraps HTTP in TLS encryption, ensuring privacy and integrity. HTTP/2 added multiplexing (multiple requests over one connection). HTTP/3 switches from TCP to QUIC (UDP-based) for even faster, more reliable connections.</p>

          <p>
            <span class="concept-tag">DNS Resolution</span>
            <span class="concept-tag">BGP / AS Numbers</span>
            <span class="concept-tag">HTTP/HTTPS</span>
            <span class="concept-tag">HTTP/2 & HTTP/3</span>
            <span class="concept-tag">CDN</span>
            <span class="concept-tag">Load Balancers</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-5" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔐</div>
        <div class="topic-title-area">
          <div class="topic-title">Security Foundations</div>
          <div class="topic-subtitle">Encryption, Certificates & Firewalls</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Symmetric encryption</strong> uses one shared key for both encryption and decryption (AES-256 is the standard). Fast, but the key distribution problem is brutal — how do you securely share the key? <strong>Asymmetric encryption</strong> solves this: a public key (shared openly) encrypts data that only the matching private key can decrypt. RSA and Elliptic Curve Cryptography (ECC) are the workhorses. In practice, you use asymmetric crypto to securely exchange a symmetric session key, then use the faster symmetric cipher for the actual data.</p>

          <p><strong>TLS (Transport Layer Security)</strong> secures web traffic via a handshake: the client and server negotiate a cipher suite, the server presents its certificate (signed by a trusted Certificate Authority), they perform a key exchange, and then all communication is encrypted. <strong>Certificates</strong> create a chain of trust — your browser trusts a root CA, which has signed intermediate CAs, which have signed the server's certificate.</p>

          <p><strong>Firewalls</strong> filter traffic by rules: allow/deny based on source/destination IP, port, and protocol. <strong>Stateful firewalls</strong> track connection states. <strong>WAFs (Web Application Firewalls)</strong> inspect HTTP traffic for attacks. <strong>IDS/IPS</strong> systems detect and prevent intrusions. Defense in depth — multiple overlapping security layers — is the fundamental strategy.</p>

          <p>
            <span class="concept-tag">AES / RSA / ECC</span>
            <span class="concept-tag">TLS Handshake</span>
            <span class="concept-tag">Certificate Authority</span>
            <span class="concept-tag">Firewall Rules</span>
            <span class="concept-tag">Hashing (SHA-256)</span>
            <span class="concept-tag">Zero Trust</span>
          </p>
        </div>
      </div>
    </div>

  </div>
</section>

<div class="phase-connector"><div class="connector-line"></div></div>

<!-- ════════════════════ PHASE 4 ════════════════════ -->
<section class="phase-section" data-phase="4" id="phase4">
  <div class="phase-header">
    <div class="phase-number">Phase 04</div>
    <h2 class="phase-title">The "Architect"</h2>
    <p class="phase-tagline">Full-Stack Engineering — <em>Now you build the applications that live on these networks.</em></p>
  </div>

  <div class="controls-bar">
    <button class="control-btn" onclick="toggleAllCards(this.closest('.phase-section'))">Expand All</button>
  </div>

  <div class="topics-grid">

    <div class="topic-card stagger-1" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🗄️</div>
        <div class="topic-title-area">
          <div class="topic-title">Backend Mastery</div>
          <div class="topic-subtitle">Server-Side Languages & Database Management</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The backend is everything the user doesn't see: the server handling requests, the business logic processing data, and the database storing it. <strong>Python</strong> (Django, FastAPI) offers rapid development and vast ecosystem. <strong>Node.js</strong> (Express, Nest.js) brings JavaScript to the server with event-driven, non-blocking I/O. <strong>Go</strong> delivers compiled speed with built-in concurrency primitives (goroutines and channels). Each has its sweet spot — Python for data-heavy apps, Node for real-time systems, Go for high-performance microservices.</p>

          <p><strong>SQL databases</strong> (PostgreSQL, MySQL) enforce structured schemas, ACID transactions, and powerful query languages. They excel at relational data — users, orders, payments — where consistency is critical. <strong>NoSQL databases</strong> cover everything else: <strong>document stores</strong> (MongoDB — flexible JSON-like docs), <strong>key-value stores</strong> (Redis — blazing fast cache), <strong>wide-column stores</strong> (Cassandra — massive scale), and <strong>graph databases</strong> (Neo4j — relationship-heavy data).</p>

          <p>Understanding <strong>database indexing</strong> (B-trees, hash indexes), <strong>query optimization</strong> (EXPLAIN plans, N+1 query problems), <strong>connection pooling</strong>, <strong>replication</strong> (read replicas), and <strong>sharding</strong> (horizontal partitioning) separates hobbyists from production-ready engineers.</p>

          <p>
            <span class="concept-tag">Python / Node.js / Go</span>
            <span class="concept-tag">PostgreSQL / MySQL</span>
            <span class="concept-tag">MongoDB / Redis</span>
            <span class="concept-tag">ORM vs Raw SQL</span>
            <span class="concept-tag">ACID Transactions</span>
            <span class="concept-tag">Indexing & Query Plans</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-2" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🎨</div>
        <div class="topic-title-area">
          <div class="topic-title">Frontend Mastery</div>
          <div class="topic-subtitle">HTML, CSS, JavaScript & Modern Frameworks</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>HTML</strong> provides semantic structure — headings, paragraphs, lists, forms, media. <strong>CSS</strong> controls visual presentation — layout (Flexbox, CSS Grid), typography, colors, animations, and responsive design (@media queries). <strong>JavaScript</strong> adds interactivity — DOM manipulation, event handling, async operations (Promises, async/await), and dynamic content.</p>

          <p>Modern frontends are built with component frameworks. <strong>React</strong> (Meta) uses a virtual DOM and JSX to build composable UI components with hooks for state management. <strong>Vue</strong> offers a gentler learning curve with its Options and Composition APIs. <strong>Next.js</strong> (built on React) adds server-side rendering (SSR), static site generation (SSG), API routes, and file-based routing — it's become the default for production React apps.</p>

          <p>The frontend ecosystem also includes <strong>TypeScript</strong> (type safety for JavaScript), <strong>Tailwind CSS</strong> (utility-first styling), state management (Zustand, Redux), build tools (Vite, webpack), and testing (Jest, Playwright). Understanding the browser's <strong>critical rendering path</strong> — parsing HTML → building DOM/CSSOM → layout → paint → compositing — is key to building performant UIs.</p>

          <p>
            <span class="concept-tag">HTML5 Semantics</span>
            <span class="concept-tag">CSS Grid / Flexbox</span>
            <span class="concept-tag">React / Vue / Next.js</span>
            <span class="concept-tag">TypeScript</span>
            <span class="concept-tag">Responsive Design</span>
            <span class="concept-tag">Web Performance</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-3" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🔌</div>
        <div class="topic-title-area">
          <div class="topic-title">API Design</div>
          <div class="topic-subtitle">REST, GraphQL & System Communication</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>REST (Representational State Transfer)</strong> is the dominant API paradigm. Resources have URLs (/users/123), actions map to HTTP verbs (GET reads, POST creates, PUT updates, DELETE removes), and responses are typically JSON. Good REST API design uses proper status codes, versioning (/api/v1/), pagination, filtering, and HATEOAS (linking related resources).</p>

          <p><strong>GraphQL</strong> (developed by Meta) solves REST's over-fetching and under-fetching problems. The client specifies exactly which fields it wants in a query, and the server returns precisely that — no more, no less. This is especially powerful for mobile apps with bandwidth constraints and complex UIs that pull from multiple data sources. The tradeoff: more complex server implementation and potential for expensive queries.</p>

          <p>Beyond REST and GraphQL: <strong>gRPC</strong> uses Protocol Buffers for high-performance, strongly-typed RPC calls between microservices. <strong>WebSockets</strong> provide full-duplex, persistent connections for real-time features (chat, live updates, gaming). <strong>Server-Sent Events (SSE)</strong> enable one-way server-to-client streaming. Choosing the right communication pattern depends on the use case — request-response, streaming, or event-driven.</p>

          <p>
            <span class="concept-tag">RESTful Design</span>
            <span class="concept-tag">GraphQL</span>
            <span class="concept-tag">gRPC / Protobuf</span>
            <span class="concept-tag">WebSockets</span>
            <span class="concept-tag">API Authentication</span>
            <span class="concept-tag">Rate Limiting</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-4" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🚀</div>
        <div class="topic-title-area">
          <div class="topic-title">DevOps & Deployment</div>
          <div class="topic-subtitle">SSH, Cloud, CI/CD & The Pipeline</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>SSH (Secure Shell)</strong> is your lifeline to remote servers — encrypted terminal access, file transfers (SCP/SFTP), and tunneling. Key-based authentication (ed25519 keys) eliminates password vulnerabilities. You'll SSH into production servers, debug live issues, and manage infrastructure. <strong>FTP/SFTP</strong> handles bulk file transfers, though modern workflows increasingly favor Git-based deployments.</p>

          <p><strong>Cloud platforms</strong> provide on-demand infrastructure: <strong>AWS</strong> (the giant — EC2, S3, Lambda, RDS), <strong>Google Cloud</strong> (BigQuery, Kubernetes Engine), and <strong>Azure</strong> (Microsoft integration). Key concepts: <strong>compute</strong> (VMs, serverless functions), <strong>storage</strong> (object stores, block storage), <strong>networking</strong> (VPCs, load balancers, CDNs), and <strong>managed services</strong> (databases, message queues, ML endpoints). <strong>Vercel</strong> and <strong>Railway</strong> simplify deployment for web apps — git push and you're live.</p>

          <p><strong>CI/CD (Continuous Integration / Continuous Deployment)</strong> automates the path from code commit to production. Tools like <strong>GitHub Actions</strong>, <strong>GitLab CI</strong>, and <strong>Jenkins</strong> run automated pipelines: lint → test → build → deploy. Every pull request triggers tests. Merging to main triggers deployment. <strong>Infrastructure as Code</strong> (Terraform, Pulumi) defines your cloud resources in version-controlled config files, making environments reproducible and auditable.</p>

          <p>
            <span class="concept-tag">SSH / Key Auth</span>
            <span class="concept-tag">AWS / GCP / Azure</span>
            <span class="concept-tag">GitHub Actions</span>
            <span class="concept-tag">Terraform / IaC</span>
            <span class="concept-tag">Serverless (Lambda)</span>
            <span class="concept-tag">Monitoring / Logging</span>
          </p>
        </div>
      </div>
    </div>

  </div>
</section>

<div class="phase-connector"><div class="connector-line"></div></div>

<!-- ════════════════════ PHASE 5 ════════════════════ -->
<section class="phase-section" data-phase="5" id="phase5">
  <div class="phase-header">
    <div class="phase-number">Phase 05</div>
    <h2 class="phase-title">The "Enlightened"</h2>
    <p class="phase-tagline">AI Research &amp; Consulting — <em>At the top of the mountain, you teach the computer to learn for itself.</em></p>
  </div>

  <div class="controls-bar">
    <button class="control-btn" onclick="toggleAllCards(this.closest('.phase-section'))">Expand All</button>
  </div>

  <div class="topics-grid">

    <div class="topic-card stagger-1" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">📐</div>
        <div class="topic-title-area">
          <div class="topic-title">Advanced Mathematics</div>
          <div class="topic-subtitle">Linear Algebra, Calculus & Probability</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Linear Algebra</strong> is the language of AI. Vectors represent data points, matrices represent transformations, and tensor operations are the computational backbone of every neural network. Key concepts: matrix multiplication (the most important operation in deep learning), eigenvalues/eigenvectors (PCA, dimensionality reduction), dot products (similarity measures), and transpose/inverse operations. When a neural network processes a batch of inputs, it's performing massive matrix multiplications on GPUs optimized specifically for this.</p>

          <p><strong>Multivariable Calculus</strong> powers learning itself. The <strong>gradient</strong> of a function tells you the direction of steepest ascent — flip it and you get <strong>gradient descent</strong>, the algorithm that trains virtually every neural network. <strong>Partial derivatives</strong> measure how the loss changes with respect to each individual weight. The <strong>chain rule</strong> (applied systematically) becomes <strong>backpropagation</strong> — the algorithm that efficiently computes gradients through layers of composed functions.</p>

          <p><strong>Probability & Statistics</strong> underpin everything from Bayesian inference to dropout regularization. <strong>Bayes' theorem</strong> (updating beliefs with evidence), probability distributions (Gaussian, Bernoulli, Softmax), <strong>Maximum Likelihood Estimation</strong> (finding the most probable parameters), and information theory (cross-entropy loss, KL divergence) are essential tools for understanding why models work and when they fail.</p>

          <p>
            <span class="concept-tag">Matrices & Tensors</span>
            <span class="concept-tag">Gradient Descent</span>
            <span class="concept-tag">Chain Rule / Backprop</span>
            <span class="concept-tag">Bayes' Theorem</span>
            <span class="concept-tag">Cross-Entropy Loss</span>
            <span class="concept-tag">Eigenvalues / PCA</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-2" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🤖</div>
        <div class="topic-title-area">
          <div class="topic-title">Machine Learning</div>
          <div class="topic-subtitle">Regressions, Trees & Classical Algorithms</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Supervised learning</strong> trains on labeled data: given inputs X and desired outputs Y, find a function f(X) ≈ Y. <strong>Linear regression</strong> fits a line (or hyperplane) to predict continuous values — house prices, temperatures. <strong>Logistic regression</strong> (despite the name) is a classifier: it uses a sigmoid function to output probabilities for binary decisions — spam/not-spam, click/no-click.</p>

          <p><strong>Decision Trees</strong> split data by asking questions: "Is income > $50K?" → left branch or right. They're intuitive and interpretable but prone to overfitting. <strong>Random Forests</strong> solve this by training many trees on random subsets of data and averaging their predictions (ensemble learning). <strong>Gradient Boosting</strong> (XGBoost, LightGBM) builds trees sequentially, each one correcting the errors of the previous — these dominate tabular data competitions and production ML systems.</p>

          <p><strong>Unsupervised learning</strong> finds structure in unlabeled data. <strong>K-Means clustering</strong> groups similar data points. <strong>PCA</strong> reduces dimensionality while preserving variance. <strong>SVMs (Support Vector Machines)</strong> find optimal decision boundaries. Understanding <strong>bias-variance tradeoff</strong>, <strong>cross-validation</strong>, <strong>feature engineering</strong>, and <strong>regularization</strong> (L1/L2 penalties) is what separates someone who calls model.fit() from someone who understands WHY it works.</p>

          <p>
            <span class="concept-tag">Linear / Logistic Regression</span>
            <span class="concept-tag">Decision Trees / Random Forest</span>
            <span class="concept-tag">XGBoost / LightGBM</span>
            <span class="concept-tag">K-Means / PCA</span>
            <span class="concept-tag">SVM</span>
            <span class="concept-tag">Bias-Variance Tradeoff</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-3" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">🧬</div>
        <div class="topic-title-area">
          <div class="topic-title">Deep Learning</div>
          <div class="topic-subtitle">Neural Networks, Backprop, CNNs & Transformers</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>A <strong>neural network</strong> is layers of neurons (linear transformation + nonlinear activation) stacked together. The input layer receives data, hidden layers learn increasingly abstract representations, and the output layer produces predictions. <strong>Activation functions</strong> (ReLU, GELU, Sigmoid, Tanh) introduce the nonlinearity that lets networks approximate any function — this is the Universal Approximation Theorem in action.</p>

          <p><strong>Backpropagation</strong> is how networks learn. Forward pass: data flows through the network, producing a prediction. The loss function measures how wrong the prediction is. Backward pass: the chain rule computes gradients of the loss with respect to every weight, layer by layer from output to input. <strong>Optimizers</strong> (Adam, SGD with momentum) use these gradients to update weights, nudging the network toward better predictions. Repeat for millions of iterations.</p>

          <p><strong>CNNs (Convolutional Neural Networks)</strong> revolutionized computer vision. Convolutional layers apply learnable filters that detect edges, textures, and patterns. Pooling layers downsample. Stacking these layers builds a hierarchy: edges → shapes → parts → objects. <strong>Transformers</strong> revolutionized everything else. <strong>Self-attention</strong> lets every token in a sequence attend to every other token, capturing long-range dependencies that RNNs couldn't. The "Attention Is All You Need" paper (2017) birthed GPT, BERT, and the entire LLM era. Multi-head attention, positional encoding, and layer normalization are the core building blocks.</p>

          <div class="insight-box">
            <strong>The scaling hypothesis.</strong> Transformers + massive data + massive compute = emergent capabilities. GPT-3 showed that simply scaling up a transformer produces abilities (reasoning, coding, translation) that weren't explicitly trained. This insight — that scale itself creates intelligence — is the driving force behind the current AI revolution.
          </div>

          <p>
            <span class="concept-tag">Forward / Backward Pass</span>
            <span class="concept-tag">Loss Functions</span>
            <span class="concept-tag">Adam Optimizer</span>
            <span class="concept-tag">CNN Architecture</span>
            <span class="concept-tag">Transformer / Self-Attention</span>
            <span class="concept-tag">Transfer Learning</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-4" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">✨</div>
        <div class="topic-title-area">
          <div class="topic-title">Generative AI & LLMOps</div>
          <div class="topic-subtitle">APIs, Agents & The New Stack</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p><strong>Large Language Models (LLMs)</strong> are transformers trained on internet-scale text to predict the next token. They develop world models, reasoning capabilities, and instruction-following through a multi-stage training pipeline: <strong>pre-training</strong> (self-supervised on trillions of tokens), <strong>supervised fine-tuning</strong> (SFT on curated instruction-response pairs), and <strong>RLHF/RLAIF</strong> (reinforcement learning from human or AI feedback to align behavior with human preferences).</p>

          <p>The practical AI stack: <strong>API providers</strong> (Anthropic Claude, OpenAI GPT, Google Gemini) offer hosted inference. <strong>Prompt engineering</strong> — crafting system prompts, few-shot examples, chain-of-thought reasoning — is the interface layer. <strong>RAG (Retrieval-Augmented Generation)</strong> grounds LLMs in factual data by retrieving relevant documents and injecting them into the context. <strong>Function calling / tool use</strong> lets LLMs invoke external APIs, databases, and code execution. <strong>Vector databases</strong> (Pinecone, Weaviate, pgvector) store embeddings for semantic search.</p>

          <p><strong>Agentic AI</strong> is the frontier: autonomous systems that can plan multi-step tasks, use tools, maintain memory, and iterate toward goals. Frameworks like LangChain, CrewAI, and the Anthropic agent loop enable building agents that can research, write code, manage files, and complete complex workflows. <strong>LLMOps</strong> — prompt versioning, evaluation benchmarks, cost tracking, guardrails, observability — is the emerging discipline of running AI systems in production reliably and responsibly.</p>

          <p>
            <span class="concept-tag">Pre-training / SFT / RLHF</span>
            <span class="concept-tag">Prompt Engineering</span>
            <span class="concept-tag">RAG Pipelines</span>
            <span class="concept-tag">Tool Use / Function Calling</span>
            <span class="concept-tag">Vector Databases</span>
            <span class="concept-tag">Agentic AI</span>
          </p>
        </div>
      </div>
    </div>

    <div class="topic-card stagger-5" onclick="toggleCard(this)">
      <div class="topic-card-header">
        <div class="topic-icon">💼</div>
        <div class="topic-title-area">
          <div class="topic-title">AI Consulting</div>
          <div class="topic-subtitle">Bridging Tech, Business & Ethics</div>
        </div>
        <div class="topic-toggle">▾</div>
      </div>
      <div class="topic-content">
        <div class="topic-body">
          <p>The rarest skill in AI isn't building models — it's <strong>translating between technical capability and business value</strong>. An AI consultant evaluates which problems are actually worth solving with AI (many aren't), which approach fits (fine-tuned model vs. prompted API vs. classical ML vs. simple rules), and how to measure ROI. The best consultants can explain a transformer architecture to a CTO and a business case to an ML engineer.</p>

          <p><strong>AI ethics and safety</strong> are non-negotiable at this level. Understanding <strong>bias</strong> (training data reflects historical inequities), <strong>hallucination</strong> (confident fabrication), <strong>alignment</strong> (ensuring AI goals match human intentions), <strong>privacy</strong> (data governance, GDPR/CCPA compliance), and <strong>security</strong> (prompt injection, model extraction, adversarial attacks) is essential. The difference between a demo and a production AI system is often 90% safety engineering.</p>

          <p>The AI consulting playbook: <strong>discovery</strong> (understand the business problem, data landscape, and constraints), <strong>proof of concept</strong> (rapid prototype to demonstrate feasibility), <strong>production architecture</strong> (scalable, monitored, guardrailed deployment), <strong>evaluation</strong> (continuous benchmarking against defined metrics), and <strong>iteration</strong> (model updates, prompt refinement, drift detection). The GOAT doesn't just build — they deliver measurable impact while navigating the hardest ethical questions of our time.</p>

          <div class="insight-box">
            <strong>The GOAT mindset.</strong> You understand the full stack — from transistors to transformers — and you know which layer to optimize for any given problem. You speak hardware AND business. You build AND you ship. You know when AI is the answer and when a SQL query will do. That's the mountain. That's the GOAT.
          </div>

          <p>
            <span class="concept-tag">Problem Scoping</span>
            <span class="concept-tag">ROI Analysis</span>
            <span class="concept-tag">AI Safety & Alignment</span>
            <span class="concept-tag">Bias & Fairness</span>
            <span class="concept-tag">GDPR / CCPA</span>
            <span class="concept-tag">Production AI Systems</span>
          </p>
        </div>
      </div>
    </div>

  </div>
</section>

<!-- ════════════════════ FOOTER ════════════════════ -->
<footer class="footer">
  <span class="footer-goat">🐐</span>
  <p class="footer-quote">"The journey from understanding a transistor to teaching a machine to think — that's the path of the Computer GOAT."</p>
  <p class="footer-text">
    5 Phases &nbsp;·&nbsp; 26 Topics &nbsp;·&nbsp; ∞ Depth<br>
    Built for those who want to understand the full stack of computing.
  </p>
</footer>

</div><!-- end .content -->

<script>
// ── Toggle individual card ──
function toggleCard(card) {
  card.classList.toggle('open');
}

// ── Toggle all cards in a phase ──
function toggleAllCards(section) {
  const cards = section.querySelectorAll('.topic-card');
  const allOpen = [...cards].every(c => c.classList.contains('open'));
  cards.forEach(c => {
    if (allOpen) c.classList.remove('open');
    else c.classList.add('open');
  });
  const btn = section.querySelector('.control-btn');
  btn.textContent = allOpen ? 'Expand All' : 'Collapse All';
}

// ── Scroll to phase ──
function scrollToPhase(num) {
  document.getElementById('phase' + num).scrollIntoView({ behavior: 'smooth', block: 'start' });
}

// ── Intersection Observer for fade-in ──
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      entry.target.classList.add('visible');
    }
  });
}, { threshold: 0.05, rootMargin: '0px 0px -50px 0px' });

document.querySelectorAll('.phase-section').forEach(s => observer.observe(s));

// ── Progress bar ──
window.addEventListener('scroll', () => {
  const scrollTop = window.scrollY;
  const docHeight = document.documentElement.scrollHeight - window.innerHeight;
  const progress = (scrollTop / docHeight) * 100;
  document.getElementById('progressBar').style.width = progress + '%';
});

// ── Active nav dot ──
const phaseSections = document.querySelectorAll('.phase-section');
const navDots = document.querySelectorAll('.phase-nav-dot');

window.addEventListener('scroll', () => {
  let currentPhase = null;
  phaseSections.forEach(section => {
    const rect = section.getBoundingClientRect();
    if (rect.top < window.innerHeight * 0.5 && rect.bottom > 0) {
      currentPhase = section.dataset.phase;
    }
  });

  navDots.forEach(dot => {
    dot.classList.toggle('active', dot.dataset.phase === currentPhase);
  });
});

// ── Prevent card toggle when clicking inside content ──
document.querySelectorAll('.topic-content').forEach(content => {
  content.addEventListener('click', (e) => e.stopPropagation());
});
</script>

</body>
</html>