  :root {
    --color-background: #fdfaf6;
    --color-text: #2e2e2e;
    --color-header: #ece7e1;
    --color-nav: #e6e1dc;
    --color-command-block: #e8e4de;
    --color-copy-button: #6ca0dc;
    --color-checkmark: #6bb07f;
    --bg-image: none;
    --active-link-font-size: 1.1rem;
  }
  
  :root[data-theme='dark'] {
    --color-background: #171717;
    --color-text: #ffffff;
    --color-header: rgba(0, 0, 0, 0.5);
    --color-nav: #1f1f1f;
    --color-command-block: #2d2d2d;
    --color-copy-button: #2196F3;
    --color-checkmark: #4CAF50;
    --bg-image: none;
    --active-link-font-size: 1.1rem;
  }
  
  /* GLOBAL RESET & BASE STYLES */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    font-size: 100%;
    scroll-behavior: smooth;
  }

  body {
    font-family: Arial, sans-serif;
    background-color: var(--color-background);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--color-text);
    width: 100%;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
  }

  main {
    overflow-x: hidden;
  }
  
  .markdown-output {
    overflow-x: hidden;
  }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h5 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

h6 {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

/* Paragraph */
p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 1rem;
}

/* Links */
a {
  color: #0092ca;
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

a:hover {
  color: #005b8a;
  text-decoration: underline;
}

/* Responsive Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Responsive Grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.col {
  flex: 1;
  padding: 10px;
  min-width: 250px;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

td, th {
  padding: 5px 0;
}

/* Buttons */
button {
  background-color: #0092ca;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: #005b8a;
}

section {
  width: 100%;
  padding: 20px 10px;
}

  /* HEADER */
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-header);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    width: 100%;
    padding: 10px 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  }
  
  .logo {
    display: flex;
    align-items: center;
    gap: 20px;
  }
  
  .logo img {
    height: 65px;
    width: auto;
  }
  
  .logo h1 {
    font-size: 2rem;
    color: var(--color-text);
    margin: 0;
  }
  
  /* HAMBURGER ICON */
  .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
  }
  
  .hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
  }
  
/* THEME TOGGLE BUTTON */
.theme-toggle {
    width: 40px;
    height: 20px;
    background-color: var(--color-text);
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }
  
  /* Glow effect on hover */
  .theme-toggle:hover {
    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.4);
  }
  
  [data-theme='dark'] .theme-toggle:hover {
    box-shadow: 0px 0px 6px rgba(255, 255, 255, 0.4);
  }

  /* The slider container */
  .toggle-slider {
    width: 100%;
    height: 100%;
    border-radius: 50px;
    display: flex;
    align-items: center;
    position: relative;
  }
  
  /* The dot that moves */
  .toggle-dot {
    width: 12px;
    height: 12px;
    background-color: var(--color-background);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 2px;
    transition: left 0.3s ease, background-color 0.3s ease;
  }
  
  /* Move the dot when in dark mode */
  [data-theme='dark'] .toggle-dot {
    left: 20px;
  }
  
  /* Ensure SVG icons are properly placed */
  .theme-toggle svg {
    width: 14px;
    height: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: left 0.3s ease, background-color 0.3s ease;
    fill: var(--color-background);
    z-index: 2;
  }
  
  /* Position moon on the left */
  .moon-icon {
    left: 1px;
    opacity: 0;
  }
  
  /* Position sun on the right */
  .sun-icon {
    right: 1px;
    opacity: 0;
  }
  
  /* Hide the moon icon in light mode */
  [data-theme='light'] .moon-icon {
    opacity: 1;
  }
  
  /* Hide the sun icon in dark mode */
  [data-theme='dark'] .sun-icon {
    opacity: 1;
  }
    
  /* SIDEBAR NAV */
  #sidebarNav {
    position: fixed;
    top: 85px;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: var(--color-nav);
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  @media (max-width: 768px) {
    #sidebarNav {
      transform: translateX(-100%);
    }
  }
  
  #sidebarNav ul {
    list-style-type: none;
  }
  
  #sidebarNav ul li {
    margin-bottom: 10px;
  }
  
  #sidebarNav ul li > span {
    display: inline-block;
    margin-bottom: 5px;
    cursor: pointer;
  }
  
  #sidebarNav li.has-submenu > span .toggle-indicator {
    display: inline-block;
    margin-bottom: 5px;
  }

  #sidebarNav ul ul {
    margin-left: 15px;
    margin-top: 5px;
  }
  
  #sidebarNav a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
    padding: 2px 0;
    font-size: 0.95rem;
    transition: font-size 0.2s, font-weight 0.2s;
  }
  
  #sidebarNav a:hover {
    text-decoration: underline;
  }
  
  /* ACTIVE NAV LINK STYLES */
  #sidebarNav a.active {
    font-weight: bold;
    font-size: var(--active-link-font-size);
  }
  
  /* MAIN CONTENT */
  main {
    margin-left: 250px; /* space for sidebar on desktop */
    padding: 20px;
  }
  
  h2 {
    margin-bottom: 10px;
    color: var(--color-text);
  }
  
  ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-top: 5px;
  }
  
  p, li {
    line-height: 1.5;
  }
  
  /* FOOTER */
  footer {
    position: relative;
    background-color: var(--color-header);
    color: var(--color-text);
    text-align: center;
    padding: 15px;
    margin-top: 40px;
    max-height: 52px;
    z-index: 9999;
    
  }

  .book {
    width: 300px;
    height: auto;
    margin: 10px 30px 20px;
  }

  .markdown-output p {
    white-space: pre-line; /* collapse multiple spaces but respect single newlines */
  }

  /* When nav is opened on mobile, shift into view */
  #sidebarNav.open {
    transform: translateX(0);
  }
  
  /* COMMAND BLOCK (NEW) */
  .cmd-block {
    position: relative;
    background-color: var(--color-command-block);
    color: var(--color-text);
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  .cmd-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    white-space: pre-wrap;
  }
  
  /* Copy Button inside .cmd-block */
  .cmd-block .copy-button {
    position: absolute;
    top: 8px;
    right: 10px;
    background-color: var(--color-copy-button);
    border: none;
    color: white;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .cmd-block .copy-button:hover,
  .cmd-block .copy-button:active {
    background-color: rgba(33, 150, 243, 0.8);
  }
  
  .cmd-block .copy-button.copied {
    background-color: #4CAF50;
  }
  
  /* Checkmark for .cmd-block */
  .cmd-block .checkmark {
    color: var(--color-checkmark);
    font-size: 18px;
    position: absolute;
    top: 10px;
    right: -10px;
    display: none;
  }
  
  .acronyms h3 {
    margin-top: 30px;
  }

  /* Markdown */
  /* 2) Ensure the MD container itself is boxed correctly */
.markdown-output {
  box-sizing: border-box;
  /* if you ever want internal scrolling instead of hiding, use overflow-x: auto; */
  overflow-x: hidden;
}

/* 3) Images & tables in MD should never overflow */
.markdown-output img,
.markdown-output table {
  max-width: 100%;
  display: block;
}

/* wrap tables in a scrollable block if they’re too wide */
.markdown-output table {
  overflow-x: auto;
}

/* 4) Style your MD code blocks exactly like your .cmd-blocks */
.markdown-output pre {
  background-color: var(--color-command-block);
  color: var(--color-text);
  padding: 1em;
  border-radius: 5px;
  margin: 1em 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.4;
  /* allow code blocks to scroll internally if a very long line exists */
  overflow-x: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 5) Inline code styling to match block code */
.markdown-output code {
  background-color: var(--color-command-block);
  color: var(--color-text);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  /* allow long inline snippets to wrap instead of overflow */
  white-space: pre-wrap;
  word-break: break-word;
}

/* space out each MD section */
.markdown-output {
  margin-top: 2rem;
}

/* add more breathing room above every MD header */
.markdown-output h2,
.markdown-output h3 {
  margin-top: 1.5rem;
}

  /* RESPONSIVE */
  @media (max-width: 768px) {
    .hamburger {
      display: flex;
    }
    main {
      margin-left: 0; 
    }
  }
  