* {
  box-sizing: border-box;
}

:root {
  --bg1:#0b1020;
  --bg2:#1a1450;

  --sidebar:#0f172a;
  --border:rgba(255,255,255,.14);

  --text:#eaf0ff;
  --muted:rgba(234,240,255,.75);

  --accent:#22d3ee;
  --accent-soft:rgba(34,211,238,.18);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg2), var(--bg1));
}

.layout {
  display: flex;
  min-height: 100vh;
}

#navbar {
  width: 260px;
  padding: 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
}

#navbar header {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  color: transparent;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background .2s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,.08);
}

#main-doc {
  margin-left: 260px;
  padding: 32px;
  max-width: 900px;
}

.main-section {
  margin-bottom: 48px;
}

.main-section header {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
}

code {
  display: block;
  background: rgba(0,0,0,.35);
  padding: 10px;
  border-radius: 8px;
  margin: 12px 0;
}

ul {
  padding-left: 20px;
}

li {
  margin: 6px 0;
}

body:has(#Introduction:target) a[href="#Introduction"],
body:has(#HTML_Foundations:target) a[href="#HTML_Foundations"],
body:has(#Semantic_HTML:target) a[href="#Semantic_HTML"],
body:has(#CSS_Selectors:target) a[href="#CSS_Selectors"],
body:has(#Box_Model:target) a[href="#Box_Model"],
body:has(#Flexbox_Basics:target) a[href="#Flexbox_Basics"],
body:has(#Forms_and_Validation:target) a[href="#Forms_and_Validation"],
body:has(#Accessibility_Basics:target) a[href="#Accessibility_Basics"],
body:has(#Responsive_Layout:target) a[href="#Responsive_Layout"],
body:has(#Debugging_Tips:target) a[href="#Debugging_Tips"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--accent);
}

@media (max-width: 768px) {
  #navbar {
    position: static;
    width: 100%;
  }

  #main-doc {
    margin-left: 0;
  }

  .layout {
    flex-direction: column;
  }
}
