/* ===== Design Tokens ===== */
:root {
  --color-header: #e9e9e9;
  --color-bg: #e9e9e9;
  --color-surface: #ffffff;
  --color-border: #000000;
  --color-text: #000000;
  --color-text-muted: #555555;
  --color-accent: #000000;
  --color-orange: #f97316;
  --color-orange-dark: #ea6c0a;
  --color-teal: #0d9488;
  --color-purple: #7c3aed;
  --color-blue: #3b82f6;

  --cat-foundation: #7c3aed;
  --cat-pipeline: #f97316;
  --cat-kubernetes: #3b82f6;
  --cat-operations: #0d9488;

  --font-body: 'Space Mono', monospace;
  --font-mono: 'Space Mono', monospace;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-sm: 2px 2px 0 #000;
  --shadow-md: 4px 4px 0 #000;
  --shadow-lg: 6px 6px 0 #000;
  --transition: 0.15s;

  --content-max: 1280px;
  --sidebar-w: 260px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: #e9e9e9;
  color: #000;
  line-height: 1.7;
  font-size: 16px;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Typography ===== */
h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 400; letter-spacing: 0.02em; line-height: 0.95; }
h2 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 400; letter-spacing: 0.02em; }
h3 { font-size: 1.2rem; font-weight: 700; font-family: var(--font-body); }
h4 { font-size: 1rem; font-weight: 700; font-family: var(--font-body); }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
code { font-family: var(--font-mono); font-size: 0.875em; background: #fff; padding: 0.15em 0.4em; border: 1px solid #000; border-radius: 0; }

/* ===== Global Nav ===== */
.site-header {
  background: #e9e9e9;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
  border-bottom: 2px solid #000;
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo span { color: var(--color-accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.nav-links a {
  color: #374151;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 0;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: #e9e9e9; background: #000; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.btn-primary {
  background: #000;
  color: #fff;
  padding: 0.5rem 1.1rem;
  border: 2px solid #000;
  border-radius: 0;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: #fff; color: #000; text-decoration: none; }
.search-btn {
  background: #fff;
  border: 2px solid #000;
  border-radius: 0;
  color: #374151;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: 'Space Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition), color var(--transition);
}
.search-btn:hover { background: #000; color: #e9e9e9; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--color-accent); }

/* ===== Hero ===== */
.hero {
  background: #e9e9e9;
  border-bottom: 2px solid #000;
  color: var(--color-accent);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
  padding: 0.3rem 0.8rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero h1 { color: var(--color-accent); margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--color-accent); }
.hero-sub { font-size: 0.8rem; color: #555; max-width: 600px; margin: 0 auto 2.5rem; }
.hero-ctas { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }
.btn-secondary {
  background: #fff;
  border: 2px solid #000;
  border-radius: 0;
  color: var(--color-accent);
  padding: 0.7rem 1.5rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.btn-secondary:hover { background: #000; color: #e9e9e9; text-decoration: none; }
.btn-large { padding: 0.8rem 2rem; font-size: 0.75rem; }
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  border-top: 2px solid #000;
  padding-top: 2rem;
}
.stat { text-align: center; }
.stat-num { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; color: var(--color-accent); }
.stat-label { font-size: 0.8rem; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== Section Layout ===== */
.section { padding: 4rem 1.5rem; }
.section-inner { max-width: var(--content-max); margin: 0 auto; }
.section-header { margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--color-text-muted); font-size: 1rem; }
.section-alt { background: #f5f5f5; }

/* ===== Category Grid ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.cat-card {
  background: var(--color-surface);
  border: 2px solid #000;
  border-radius: 0;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cat-card:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 #000; text-decoration: none; }
.cat-icon {
  width: 48px; height: 48px;
  border-radius: 0;
  border: 2px solid #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.cat-card h3 { font-size: 1.05rem; }
.cat-card p { font-size: 0.875rem; color: var(--color-text-muted); margin: 0; }
.cat-count { font-size: 0.8rem; font-weight: 600; margin-top: auto; }

/* ===== Guide Grid ===== */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ===== Learning Path ===== */
.path-phases { display: flex; flex-direction: column; gap: 1.5rem; }
.phase {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.phase-num {
  width: 52px; height: 52px;
  border-radius: 0;
  border: 2px solid #000;
  background: #000;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.phase-body h3 { margin-bottom: 0.5rem; }
.phase-guides { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.phase-guides li a { color: var(--color-text-muted); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.phase-guides li a:hover { color: var(--color-accent); }
.phase-guides li a::before { content: '→'; color: var(--color-accent); }

/* ===== Footer ===== */
.site-footer {
  background: #e9e9e9;
  color: var(--color-text-muted);
  border-top: 2px solid #000;
  padding: 3rem 1.5rem;
  text-align: center;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; }
.footer-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; font-weight: 400; letter-spacing: 0.05em; color: var(--color-accent); margin-bottom: 0.5rem; }
.footer-logo span { color: var(--color-accent); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; list-style: none; }
.footer-links a { color: #555; font-size: 0.875rem; }
.footer-links a:hover { color: var(--color-accent); }
.footer-copy { font-size: 0.8rem; color: #555; }

/* ===== Search Overlay ===== */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 10vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  background: #fff;
  border-radius: 0;
  border: 2px solid #000;
  width: 100%; max-width: 600px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-input-wrap { display: flex; align-items: center; padding: 1rem 1.25rem; border-bottom: 2px solid #000; gap: 0.75rem; }
.search-input-wrap svg { color: var(--color-text-muted); flex-shrink: 0; }
#search-input { border: none; outline: none; font-size: 1.1rem; flex: 1; font-family: 'Space Mono', monospace; }
.search-close { background: none; border: none; cursor: pointer; color: var(--color-text-muted); font-size: 1.2rem; }
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item { padding: 0.85rem 1.25rem; border-bottom: 1px solid #000; cursor: pointer; transition: background var(--transition); }
.search-result-item:hover { background: #f5f5f5; }
.search-result-item h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.search-result-item p { font-size: 0.8rem; color: var(--color-text-muted); margin: 0; }
.search-empty { padding: 2rem; text-align: center; color: var(--color-text-muted); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: #fff;
  border-bottom: 2px solid #000;
  padding: 0.75rem 1.5rem;
}
.breadcrumb-inner { max-width: var(--content-max); margin: 0 auto; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--color-text-muted); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb-sep { color: #888; }
.breadcrumb-current { color: var(--color-text); font-weight: 500; }

/* ===== Guide Layout ===== */
.guide-layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 3rem;
  align-items: start;
}
.guide-content { min-width: 0; }
.guide-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; padding-top: 1rem; border-top: 2px solid #000; }
.guide-content h3 { margin-top: 1.75rem; margin-bottom: 0.75rem; }
.guide-sidebar { position: sticky; top: 84px; }

/* ===== Guide Meta ===== */
.guide-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.75rem;
}
.meta-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 0;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
}
.badge-difficulty-beginner { background: #dcfce7; color: #166534; }
.badge-difficulty-intermediate { background: #fef9c3; color: #854d0e; }
.badge-difficulty-advanced { background: #fee2e2; color: #991b1b; }
.badge-time { background: #f1f5f9; color: #475569; }
.badge-category { color: #fff; }
.badge-foundation { background: var(--cat-foundation); }
.badge-pipeline { background: var(--cat-pipeline); }
.badge-kubernetes { background: var(--cat-kubernetes); }
.badge-operations { background: var(--cat-operations); }

/* ===== Sidebar Widget ===== */
.sidebar-widget {
  background: var(--color-surface);
  border: 2px solid #000;
  border-radius: 0;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.sidebar-widget h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); margin-bottom: 1rem; }
.toc-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.toc-list a { font-size: 0.875rem; color: var(--color-text-muted); display: block; padding: 0.2rem 0; border-left: 2px solid transparent; padding-left: 0.75rem; transition: color var(--transition), border-color var(--transition); }
.toc-list a:hover, .toc-list a.active { color: var(--color-accent); border-left-color: #000; text-decoration: none; }
.sidebar-guides { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.sidebar-guides a { font-size: 0.875rem; color: var(--color-text-muted); padding: 0.3rem 0; display: block; }
.sidebar-guides a:hover { color: var(--color-accent); }
.sidebar-guides a.current { color: var(--color-accent); font-weight: 600; }

/* ===== Guide Nav (prev/next) ===== */
.guide-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.guide-nav-card {
  background: var(--color-surface);
  border: 2px solid #000;
  border-radius: 0;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition);
}
.guide-nav-card:hover { box-shadow: 4px 4px 0 #000; text-decoration: none; }
.guide-nav-card.next { text-align: right; }
.guide-nav-label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.guide-nav-card h4 { font-size: 0.9rem; color: var(--color-accent); }

/* ===== Category Landing ===== */
.category-hero {
  padding: 3.5rem 1.5rem;
  color: #fff;
}
.category-hero h1 { color: inherit; margin-bottom: 0.75rem; }
.category-hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; }
.cat-hero-foundation { background: #6d28d9; color: #fff; }
.cat-hero-pipeline { background: #f97316; color: #000; }
.cat-hero-pipeline h1, .cat-hero-pipeline p { color: #000; }
.cat-hero-kubernetes { background: #3b82f6; color: #fff; }
.cat-hero-operations { background: #0d9488; color: #fff; }

/* ===== 404 ===== */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.error-code { font-family: 'Bebas Neue', sans-serif; font-size: 8rem; font-weight: 400; color: #888; line-height: 1; }
.error-title { font-size: 1.5rem; margin-bottom: 0.75rem; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { display: none; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: #e9e9e9; border-bottom: 2px solid #000; padding: 1rem; z-index: 99; }
  .hamburger { display: block; }
  .hero { padding: 3rem 1.5rem; }
  .guide-nav { grid-template-columns: 1fr; }
  .phase { grid-template-columns: 1fr; }
  .phase-num { display: none; }
}
