html {
  scroll-behavior: smooth;
}

/* CUSTOM SCROLLBAR - Light Mode */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: #0f172a; /* Unified Slate-900 */
  font-family: Inter, sans-serif;
  line-height: 1.7;
  overflow: initial; /* Restore scrolling */
}

strong {
  color: #0f172a;
  font-weight: 700;
}

/* HEADER */
.site-header {
  position: fixed; /* Fixed to top */
  top: 0;
  width: 100%;
  height: 80px;
  padding: 0 40px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background: rgba(255, 255, 255, 0.98); /* Solid white block */
  border-top: 3px solid #0070f3; /* New Smart Blue Accent */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  z-index: 4000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.scrolled {
  height: 60px;
  background: rgba(240, 247, 255, 0.9); /* Azure-tinted glass */
  box-shadow: 0 8px 30px rgba(0, 112, 243, 0.08); /* Blue-tinted depth */
}

/* Scroll Progress Line */
.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0070f3, #00b4ff);
  width: 0%;
  transition: width 0.1s ease;
  z-index: 2001;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  height: 54px;
  mix-blend-mode: multiply; /* Ensures JPEG transparency on light backgrounds */
  filter: contrast(1.1); /* Slightly sharpen the lines */
}

.brand-text {
  display: flex;
  gap: 6px;
  /* Increased gap between Code and To Silicon */
  font-size: 20px;
  font-weight: 600;
  align-items: baseline;
}

.brand-main {
  color: #0f172a;
}

.brand-accent {
  color: #0070f3; /* Electric Blue consistent with Hero */
  font-size: 0.92em;
  font-weight: 600;
}

/* GLOBAL HEADER NAVIGATION */
.nav-item-has-children {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.arrow-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

/* --- DESKTOP VIEW (Widescreen) --- */
@media (min-width: 769px) {
    .site-header {
        height: 80px;
        padding: 0 40px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .brand-group {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .menu-toggle {
        display: none !important; /* Hide burger on desktop */
    }

    .top-right-vertical {
        display: flex !important;
        align-items: center !important;
    }

    .nav-links-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 32px !important;
        flex-direction: row !important;
    }

    .nav-links-wrapper .chevron-icon:not(.arrow-icon) {
        display: none !important;
    }

    .top-right-vertical a.nav-row, .dropdown-trigger {
        text-decoration: none;
        color: #64748b;
        font-size: 14px;
        font-weight: 500;
        transition: color 0.3s ease;
        padding: 0 !important;
        border: none !important;
    }

    .top-right-vertical a.nav-row:hover,
    .top-right-vertical a.nav-row.active,
    .top-right-vertical .dropdown-trigger.active {
        color: #0070f3 !important;
        background: transparent !important;
    }

    /* Desktop Floating Dropdown */
    .nav-submenu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px;
        min-width: 200px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.08);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 9999;
    }

    .nav-item-has-children:hover .nav-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .nav-submenu a {
        display: block;
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 13px;
        color: #475569 !important;
        border: none !important;
    }

    .nav-submenu a:hover {
        background: #f1f5f9;
        color: #0070f3 !important;
    }

    .nav-submenu a.active {
        background: rgba(0, 112, 243, 0.05) !important;
        color: #0070f3 !important;
        font-weight: 600 !important;
    }
}

/* --- MOBILE VIEW (Sidebar Menu) --- */
@media (max-width: 768px) {
    .site-header {
        height: 70px !important;
        padding: 0 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .brand-group {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        height: 100% !important;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 18px;
        cursor: pointer;
        padding: 0;
        background: transparent;
        margin: 0;
        position: relative;
        z-index: 10001;
    }

    .brand {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .brand img {
        height: 32px !important;
        width: auto !important;
    }

    .brand-text {
        font-size: 16px !important;
    }

    .hero-content {
        padding: 0 5% !important;
        text-align: center !important;
    }

    .hero-content h1 {
        font-size: 38px !important;
        letter-spacing: -1.5px !important;
    }

    .menu-toggle span {
        display: block;
        height: 2px;
        width: 100%;
        background: #0070f3;
        border-radius: 4px;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Animation when menu is open - Turns 3 lines into X */
    body.menu-active .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); width: 24px; }
    body.menu-active .menu-toggle span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
    body.menu-active .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); width: 24px; }

    .top-right-vertical {
        position: fixed;
        top: 70px; /* Aligned below mobile header */
        left: 0;
        width: 300px;
        height: calc(100vh - 70px);
        background: white;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column;
        box-shadow: 20px 0 60px rgba(0,0,0,0.1);
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 3000; /* Main Menu layer */
        overflow-y: auto;
    }

    .top-right-vertical.active {
        transform: translateX(0);
    }

    /* Nav Rows */
    .nav-links-wrapper {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .nav-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 16px 20px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        color: #0f172a !important;
        text-decoration: none !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        transition: background 0.2s ease;
        width: 100% !important;
    }

    .nav-row.active, .dropdown-trigger.active {
        background: #f0f7ff !important;
        color: #0070f3 !important;
        border-left: 4px solid #0070f3 !important;
    }

    .nav-row:active, .nav-row:hover {
        background: #f8fafc;
    }

    .chevron-icon {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: #94a3b8;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .nav-item-has-children {
        display: block !important;
        width: 100% !important;
    }

    .nav-submenu {
        display: none;
        flex-direction: column;
        background: #f1f5f9;
        margin: 0;
        padding: 0;
        width: 100%;
        position: static !important;
        transform: none !important;
        left: 0 !important;
        top: 0 !important;
        border-top: 1px solid rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .nav-submenu a {
        display: block !important;
        padding: 18px 20px 18px 45px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #475569 !important;
        text-decoration: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.03) !important;
        white-space: nowrap !important;
    }

    .nav-submenu a.active {
        color: #0070f3 !important;
        background: #f0f7ff !important;
        font-weight: 700 !important;
        border-left: 4px solid #0070f3 !important;
    }

    .nav-submenu a:hover, .nav-submenu a:active {
        color: #0070f3 !important;
        background: rgba(0, 112, 243, 0.02) !important;
    }

    .chevron-icon {
        width: 14px !important;
        height: 14px !important;
        fill: none;
        stroke: #94a3b8 !important;
        stroke-width: 2.5 !important;
        transition: transform 0.3s ease;
    }

    .nav-item-has-children.active .nav-submenu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }

    .nav-item-has-children.active .chevron-icon {
        transform: rotate(90deg) !important;
        stroke: #0070f3 !important;
    }
}
/* END MOBILE VIEW */

/* HERO SECTION - THE SILICON GRID */
.hero {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #fff;
  display: flex;
  align-items: center;
  position: relative;
}

/* GRID OVERLAYS */
.grid-overlay,
.grid-overlay-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 0, 40, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 40, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.grid-overlay-spotlight {
  background-image:
    linear-gradient(rgba(0, 112, 243, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 112, 243, 0.1) 1px, transparent 1px);
  mask-image: radial-gradient(400px circle at var(--cursor-x, 50%) var(--cursor-y, 50%), black 5%, transparent 100%);
  -webkit-mask-image: radial-gradient(400px circle at var(--cursor-x, 50%) var(--cursor-y, 50%), black 5%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 0 10%;
  width: 100%;
  text-align: left; /* Restored Alignment */
}

.hero-content h1 {
  font-size: clamp(48px, 8vw, 105px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -4px;
  color: #0f172a;
  margin-bottom: 30px;
}

.hero-content h1 span {
  background: linear-gradient(90deg, #0070f3, #00b4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(18px, 2vw, 24px);
  color: #475569;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 800px;
}

#typing-text {
  color: #0070f3;
  font-weight: 700;
}

.hero-footer-bar {
  position: absolute;
  bottom: 40px;
  left: 10%;
  right: 10%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: #94a3b8;
}
  margin-left: 3px;
  color: #0070f3;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}
.cta-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 48px;
  animation: smart-float 3s ease-in-out infinite;
}

@keyframes smart-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.cta-trust-line {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #8b949e;
  margin: 0;
  font-weight: 400;
}

.hero-scope-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #64748b; /* Slate-500 visibility boost */
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 40px;
}

/* SCROLL HINT */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0.6;
  animation: fadeUp 1s ease 2s both;
}

.scroll-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, #0070f3, transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.1% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* HERO FOOTER BAR (Single Page) */
.hero-footer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b; /* Slate-500 visibility boost */
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 100;
}

.yt-link {
  color: #888;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s;
}

.yt-link:hover {
  color: #0070f3;
}

.yt-link svg {
  width: 16px;
  height: 16px;
}

.basics-section {
  padding: 140px 0;
  background: #0d1117;
}


.basics-intro {
  display: flex;
  gap: 80px;
  align-items: center;
  margin-bottom: 120px;
}

@media (max-width: 900px) {
  .basics-intro {
    flex-direction: column;
    gap: 60px;
    text-align: center;
  }
}

.basics-text {
  flex: 1;
}

.basics-text h2 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.basics-text p {
  font-size: 18px;
  line-height: 1.6;
  color: #8b949e;
  margin-bottom: 24px;
}

.strong-line {
  color: #fff !important;
  font-weight: 600;
  border-left: 3px solid #00d4ff;
  padding-left: 20px;
}

.basics-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}

.diagram-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.node-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
}

.node {
  width: 100px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.node.software {
  background: rgba(0, 212, 255, 0.05);
  color: #00d4ff;
}

.node.mcu {
  width: 80px;
  height: 80px;
  background: #161b22;
  color: #fff;
}

.chip-icon {
  width: 40px;
  height: 40px;
}

.node.hardware {
  background: rgba(46, 160, 67, 0.05);
  color: #3fb950;
}

.diagram-arrow {
  width: 40px;
  color: rgba(255, 255, 255, 0.2);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  margin-bottom: 100px;
}

.example-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 40px;
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.example-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.04);
  border-color: #00d4ff;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}

.card-icon {
  font-size: 40px;
  margin-bottom: 24px;
}

.example-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #fff;
}

.example-card p {
  font-size: 15px;
  color: #8b949e;
  line-height: 1.6;
  margin: 0;
}

.basics-footer {
  text-align: center;
  padding-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.basics-footer p {
  color: #8b949e;
  margin-bottom: 32px;
  font-size: 18px;
}

.cta-btn {
  padding: 14px 36px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cta-btn.primary {
  background: linear-gradient(135deg, #0070f3, #005ce6);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(0, 118, 255, 0.39);
}

.cta-btn.primary:hover {
  background: linear-gradient(135deg, #0070f3, #004ecc);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 118, 255, 0.23);
}

.cta-btn.secondary {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
}

.cta-btn.secondary:hover {
  border-color: #0070f3;
  color: #0070f3;
  background: #f8fafc;
  transform: translateY(-2px);
}

.hero-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: #888;
  letter-spacing: 2px;
  text-align: center;
}

@keyframes glow-pulse {

  0%,
  100% {
    text-shadow: 0 0 3px rgba(0, 212, 255, 0.1);
  }

  50% {
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
  }

  /* Softened blur and opacity */
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-nav a.active {
    color: #0070f3 !important;
    font-weight: 750 !important;
    background: #f8fbff !important;
    border-left: 4px solid #0070f3 !important;
    padding-left: 12px !important;
    display: block !important;
}

/* SECTION REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: transform, opacity;
}

.reveal.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveals for children */
.reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-group.reveal-active > * {
  opacity: 1;
  transform: translateY(0);
}

/* Add delays to children in groups */
.reveal-group.reveal-active > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-group.reveal-active > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-group.reveal-active > *:nth-child(3) { transition-delay: 0.3s; }
/* DELAYS RESTORED */
.reveal-group.reveal-active > *:nth-child(4) { transition-delay: 0.4s; }

/* CONTAINER */
.section-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 48px;
}

@media (max-width: 768px) {
  .section-container {
    padding: 100px 24px 40px; /* Offset for mobile fixed header */
  }
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 40px 40px; /* Offset for fixed header */
}

.page-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 32px;
  color: #0f172a;
  margin-bottom: 40px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 16px;
}

/* ARTICLES LIST */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.article-card {
  display: block;
  background: #f9f9f9;
  padding: 24px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.article-card:hover {
  background: #f0f4ff;
  border-color: #0070f3;
  transform: translateX(4px);
}

.article-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.article-card h2 {
  color: #0f172a;
  font-size: 20px;
  margin: 0 0 8px 0;
}

.article-card p {
  color: #555;
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

/* ARTICLE CONTENT */
.article-container {
  max-width: 720px;
}

.article-header {
  margin-bottom: 40px;
  text-align: center;
}

.article-header h1 {
  font-size: 36px;
  color: #0f172a;
  margin-bottom: 12px;
}

.article-content {
  font-size: 18px;
}

.article-content p {
  line-height: 1.8;
  color: #333;
  margin-bottom: 32px;
}

.article-content h3 {
  color: #0f172a;
  font-size: 22px;
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-content ul {
  margin-bottom: 24px;
  line-height: 1.8;
  color: #333;
}

.article-content ul li {
  margin-bottom: 8px;
}

/* CODE BLOCKS */
.code-block {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin: 24px 0;
  overflow: hidden;
}

.code-title {
  background: #e1e4e8;
  color: #24292e;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #d0d7de;
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: #24292e;
}

.cmd {
  font-family: "JetBrains Mono", monospace;
  background: #f6f8fa;
  padding: 12px;
  border-left: 3px solid #0066cc;
  font-size: 13px;
  color: #555;
}

.cmd code {
  color: #0070f3;
}

.note {
  margin-top: 48px;
  border: 1px solid #0066cc;
  background: rgba(0, 102, 204, 0.05);
  padding: 16px;
  border-radius: 6px;
  color: #0070f3;
}


/* TYPING ANIMATION */
.cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background-color: #00d4ff;
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* NEXT UP HINT */
.next-up-hint {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  animation: fadeUp 1s cubic-bezier(0.19, 1, 0.22, 1) 1.5s both;
}

.hint-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
}

.hint-link {
  color: #0070f3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 100px;
  background: #f9f9f9;
}

.hint-link:hover {
  border-color: #0070f3;
  color: #0052a3;
  background: #f0f4ff;
  box-shadow: none;
}

/* ROADMAP SECTION */
.roadmap-section {
  padding: 140px 0;
  background: #ffffff;
  position: relative;
  border-top: none;
}

.roadmap-header {
  text-align: center;
  margin-bottom: 80px;
}

.roadmap-header .badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 102, 204, 0.1);
  color: #0070f3;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.roadmap-header h2 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #0f172a;
}

.roadmap-header h2 span {
  background: linear-gradient(90deg, #0070f3, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.roadmap-header p {
  color: #555;
  font-size: clamp(16px, 2vw, 18px);
  max-width: 600px;
  margin: 0 auto;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.roadmap-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  padding: 48px 40px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.roadmap-card:hover {
  transform: translateY(-8px);
  border-color: #0070f3;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.roadmap-card.active {
  border-color: #0070f3;
  background: #f0f4ff;
  box-shadow: none;
}

.card-level {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #0070f3;
  margin-bottom: 24px;
  letter-spacing: 2px;
  font-weight: 600;
}

.roadmap-card h3 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.roadmap-card p {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
  flex-grow: 0;
}

.card-topics {
  list-style: none;
  padding: 0;
  margin: 0 0 48px 0;
  flex-grow: 1;
}

.card-topics li {
  color: #333;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-topics li::before {
  content: '→';
  color: #0070f3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
}

.card-btn {
  display: inline-block;
  padding: 14px 28px;
  background: #f9f9f9;
  color: #333;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
  border: 1px solid #ccc;
}

.roadmap-card.active .card-btn {
  background: #0066cc;
  color: #fff;
  border-color: #0070f3;
}

.card-btn:hover {
  background: #0066cc;
  color: #fff;
  border-color: #0070f3;
}

.roadmap-card.active .card-btn:hover {
  background: #0052a3;
  color: #fff;
  border-color: #0052a3;
}

/* PROGRESS BAR */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 2000;
}

.progress-bar {
  height: 100%;
  background: #00d4ff;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
}

/* IDE LAYOUT (Code Snippets) */
.ide-container {
  display: flex;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
}

@media (max-width: 900px) {
  .ide-container {
    flex-direction: column;
    margin-top: 0;
  }

  .ide-left,
  .ide-right {
    width: 100%;
    padding: 30px 20px;
    border-right: none;
  }

  .ide-left {
    border-bottom: 1px solid #1f2428;
  }

  .ide-right {
    min-height: 500px;
    padding: 40px 15px;
  }
}

/* LEFT PANE */
.ide-left {
  flex: 1;
  padding: 48px;
  border-right: 1px solid #d0d7de;
  background: #f6f8fa;
}

.problem-header .badge {
  background: rgba(46, 160, 67, 0.1);
  color: #2da44e;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.problem-header h1 {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  margin: 16px 0 24px;
  color: #0f172a;
}

.ide-left p {
  color: #555;
  line-height: 1.6;
}

.constraints {
  margin-top: 32px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
}

.constraints h3 {
  font-size: 14px;
  color: #0f172a;
  margin-top: 0;
}

.constraints ul {
  margin: 0;
  padding-left: 20px;
  color: #8b949e;
  font-size: 14px;
}

.constraints li {
  margin-bottom: 8px;
}

.constraints li {
  margin-bottom: 8px;
}

/* BUTTONS */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 10px 20px;
  border-radius: 6px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.btn-primary {
  background: #238636;
  color: #fff;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-secondary {
  background: #1f6feb;
  color: #fff;
}

.btn-secondary:hover {
  background: #388bfd;
}

.btn-danger {
  background: #da3633;
  color: #fff;
}

.btn-danger:hover {
  background: #f85149;
}

/* DEBUG STATUS */
.debug-status {
  padding: 12px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  margin-top: 24px;
}

/* MEMORY VIEW */
.memory-window {
  margin-top: 32px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
}

.memory-header {
  background: #161b22;
  padding: 8px 16px;
  font-size: 12px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.memory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.memory-table th {
  text-align: left;
  padding: 8px 16px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  font-weight: normal;
}

.memory-table td {
  padding: 8px 16px;
  color: #c9d1d9;
  border-bottom: 1px solid #21262d;
}

.memory-table tr:last-child td {
  border-bottom: none;
}

.val-change {
  animation: flash 1s ease-out;
  color: #00d4ff !important;
}

@keyframes flash {
  0% {
    background: rgba(0, 212, 255, 0.2);
  }

  100% {
    background: transparent;
  }
}


/* RIGHT PANE */
.ide-right {
  flex: 1.5;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.editor-window {
  width: 100%;
  max-width: 800px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.editor-header {
  background: #e1e4e8;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d0d7de;
}

.editor-header .dots {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}

.dot.yellow {
  background: #ffbd2e;
}

.dot.green {
  background: #27c93f;
}

.editor-header .filename {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: #24292e;
}

.editor-content {
  padding: 24px;
  overflow-x: auto;
}

/* EDITOR LINES */
.code-line {
  padding: 2px 4px;
  min-height: 24px;
  /* Ensure empty lines have height */
  border-left: 3px solid transparent;
  white-space: pre;
}

.code-line.active {
  background: rgba(210, 153, 34, 0.15);
  border-left: 3px solid #d29922;
  /* Yellow highlight */
}


/* MANUAL SYNTAX HIGHLIGHTING COLORS */
.keyword {
  color: #ff7b72;
}

.string {
  color: #a5d6ff;
}

.comment {
  color: #8b949e;
  font-style: italic;
}

@media (max-width: 900px) {
  .ide-container {
    flex-direction: column;
    margin-top: 0;
  }

  .ide-left,
  .ide-right {
    width: 100%;
    padding: 30px 20px;
    border-right: none;
  }

  .ide-left {
    border-bottom: 1px solid #1f2428;
  }

  .ide-right {
    min-height: 500px;
    padding: 40px 15px;
  }
}

  .hero-content {
    padding: 60px 24px;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 38px;
  }
}

/* ADDITIONAL GLOBAL UTILITIES */
.hl-keyword {
  color: #569cd6;
}

.hl-type {
  color: #4ec9b0;
}

.hl-literal {
  color: #b5cea8;
}

.hl-comment {
  color: #6a9955;
}

/* TERMINAL SIMULATION */
.terminal-window {
  width: 100%;
  max-width: 320px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  margin-top: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  font-family: "JetBrains Mono", monospace;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal-header {
  background: #e1e4e8;
  padding: 8px 16px;
  border-bottom: 1px solid #d0d7de;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
}

.close-terminal {
  font-size: 16px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.close-terminal:hover {
  color: #333;
}


.terminal-content {
  padding: 10px;
  font-size: 11px;
}

.terminal-content .line {
  margin-bottom: 6px;
  color: #24292e;
}

.terminal-content .prompt {
  color: #2da44e;
  margin-right: 8px;
}

.terminal-content .output {
  color: #0070f3;
  font-weight: 600;
}

.terminal-content .success {
  color: #555;
  margin-top: 12px;
  font-style: italic;
}

/* PREMIUM UI TOKENS (Match Image) */
:root {
    --bg-deep: #ffffff;
    --card-bg: #f9f9f9;
    --card-border: #e5e7eb;
    --cyan-glow: rgba(0, 102, 204, 0.1);
}

.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-card:hover {
    border-color: #0070f3;
    background: #f0f4ff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.process-node-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.node-icon-wrapper {
    width: 64px;
    height: 64px;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 24px;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.02);
}

.node-icon-wrapper.cyan {
    border-color: #0070f3;
    box-shadow: none;
    color: #0070f3;
}

.process-arrow-v2 {
    width: 32px;
    height: 1px;
    background: #e5e7eb;
    position: relative;
}

.process-arrow-v2::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 6px;
    height: 6px;
    border-top: 1px solid #ccc;
    border-right: 1px solid #ccc;
    transform: rotate(45deg);
}

.comparison-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 40px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.comparison-table th {
    text-align: left;
    padding: 16px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e5e7eb;
}

.comparison-table td {
    padding: 16px;
    color: #333;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table strong {
    color: #0f172a;
}

.article-hero-v2 {
    padding: 100px 0 40px;
}

.article-hero-v2 h1 {
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
}

.article-text-muted {
    color: #555;
    font-size: 18px;
    line-height: 1.6;
}

.highlight-border {
  border-left: 3px solid #0066cc;
  padding: 18px 24px;
  background: #f0f4ff;
  color: #0f172a;
  font-style: italic;
  margin: 16px 0;
  border-radius: 4px;
}

/* UNIFIED PREMIUM LAYOUT CLASSES */
.bg-gray-800 { background-color: #1a1a1a; }
.bg-gray-900 { background-color: #111111; }

.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 24px; }

.grid-md-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.grid-md-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.grid-md-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.flex-md-row {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

@media (min-width: 768px) {
    .grid-md-2 { grid-template-columns: 1.2fr 1fr; }
    .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-md-4 { grid-template-columns: repeat(4, 1fr); }
    .flex-md-row { flex-direction: row; justify-content: center; }
}

/* Process Flow Components */
.process-flow {
    display: flex;
    align-items: center;
    gap: 20px;
}

.process-step {
    text-align: center;
}

.process-step .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.process-step .box {
    padding: 12px 24px;
    border-radius: 12px;
    background: #f9f9f9;
    border: 1px solid #d0d7de;
    color: #333;
    font-size: 15px;
    min-width: 100px;
}

.process-step .box.highlight {
    background: #f0f4ff;
    border-color: #0070f3;
    color: #0070f3;
    padding: 16px 32px;
    border-radius: 16px;
}

.process-arrow-v3 {
    color: #ccc;
    font-size: 20px;
}

.characteristic-card {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.characteristic-card:hover {
    border-color: #0070f3;
    transform: translateY(-4px);
}

.component-card {
    background: #f9f9f9;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.component-card h3 {
    color: #0070f3;
    margin-bottom: 12px;
    font-size: 18px;
}

.component-card p {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* COLORED BLOCK VARIANTS */
.block-azure {
    background: rgba(0, 150, 255, 0.03) !important;
    border-color: rgba(0, 150, 255, 0.1) !important;
}
.block-azure:hover { border-color: rgba(0, 150, 255, 0.3) !important; }

.block-cyan {
    background: rgba(0, 212, 255, 0.03) !important;
    border-color: rgba(0, 212, 255, 0.1) !important;
}
.block-cyan:hover { border-color: rgba(0, 212, 255, 0.3) !important; }

.block-emerald {
    background: rgba(46, 160, 67, 0.03) !important;
    border-color: rgba(46, 160, 67, 0.1) !important;
}
.block-emerald:hover { border-color: rgba(46, 160, 67, 0.3) !important; }

.block-purple {
    background: rgba(138, 43, 226, 0.03) !important;
    border-color: rgba(138, 43, 226, 0.1) !important;
}
.block-purple:hover { border-color: rgba(138, 43, 226, 0.3) !important; }

.block-gold {
    background: rgba(255, 215, 0, 0.03) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
}
.block-gold:hover { border-color: rgba(255, 215, 0, 0.3) !important; }

/* POINT LIST STYLING */
.point-list {
    list-style: none;
    padding: 0;
    margin: 32px 0;
}

.point-list li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
    line-height: 1.4;
}

.point-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 1px;
    background: #0066cc;
    transition: width 0.3s ease;
}

.point-list li:hover::before {
    width: 16px;
    background: #0052a3;
}


.article-text-muted {
  color: #555;
  line-height: 1.4;
}
/* BLOCK DIAGRAM */
.block-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.diagram-block {
  padding: 16px 24px;
  background: #f9f9f9;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #333;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.diagram-block.highlight {
  border-color: #0070f3;
  background: #f0f4ff;
  color: #0070f3;
  box-shadow: none;
}

.diagram-arrow {
  color: #ccc;
  font-size: 20px;
}

strong, b {
  color: #0d0d1a !important;
  font-weight: 700 !important;
}

.text-block-border {
    padding: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9f9f9;
    height: 100%;
    transition: all 0.3s ease;
    color: #333;
}

.text-block-border h2, .text-block-border h3 {
    border-bottom-color: #e5e7eb !important;
    color: #0d0d1a !important;
}

.text-block-border:hover {
    border-color: #0070f3;
}

/* BACKGROUND UTILITIES */
.wafer-background {
    display: none; /* Removed background entirely */
}

.tech-highlight {
    color: #0070f3;
    font-weight: 600;
}
/* COURSE LAYOUT WITH SIDEBAR (UNIVERSAL) */
.layout-with-sidebar {
    display: block !important;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 100px;
    padding-left: 24px;
    padding-right: 24px;
}

.course-sidebar {
    position: fixed !important;
    top: 70px !important;
    right: 0 !important;
    width: 300px !important;
    height: calc(100vh - 70px) !important;
    background: white !important;
    z-index: 2000 !important;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block !important;
    padding: 32px 24px !important; /* Adjusted padding for better scroll room */
    box-shadow: -15px 10px 40px rgba(0,0,0,0.08) !important;
    border-left: 1px solid #e2e8f0 !important;
    overflow-y: overlay !important; /* Premium overlay scrollbar */
}

/* Custom Premium Scrollbar for Sidebar */
.course-sidebar::-webkit-scrollbar {
    width: 4px;
}

.course-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.course-sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.course-sidebar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.course-sidebar.active {
    transform: translateX(0);
}

.course-content {
    width: 100% !important;
}

.topic-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 24px !important;
    width: 100% !important;
}

.inline-course-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    background: #0070f3;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 112, 243, 0.2);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #94a3b8 !important;
    text-decoration: none;
    text-transform: uppercase;
}

.close-sidebar-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}
/* UNIVERSAL CONTENT CONTAINER */
.course-content {
    width: 100% !important;
    padding-bottom: 100px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-bottom: 6px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    user-select: none;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
}

.sidebar-section-title::before {
    content: '▼';
    font-size: 8px;
    color: #ccc;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    display: inline-block;
    margin-top: 2px;
}

/* When collapsed, show Right Arrow */
.sidebar-section.collapsed .sidebar-section-title::before {
    content: '▶';
}

/* Hide the nav links when collapsed */
.sidebar-section.collapsed .sidebar-nav,
.sidebar-section.collapsed .sidebar-sub-group-links {
    display: none;
}

/* SUB-GROUP (Nested Toggle) */
.sidebar-sub-group {
    margin: 5px 0 5px 10px;
    border-left: 1px solid #f1f5f9;
    padding-left: 8px;
}

.sidebar-sub-group-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    padding: 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: color 0.2s ease;
}

.sidebar-sub-group-title:hover {
    color: #64748b;
}

.sidebar-sub-group-title::before {
    content: '▼';
    font-size: 7px;
    color: #cbd5e1;
    transition: transform 0.2s ease;
}

.sidebar-sub-group.collapsed .sidebar-sub-group-title::before {
    content: '▶';
}

.sidebar-sub-group.collapsed .sidebar-sub-group-links {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

/* Base topic link */
/* Sidebar Primary Links (Chapters) */
.sidebar-chapter {
    margin-bottom: 2px;
}

.sidebar-chapter-title {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px 12px !important;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-chapter-title::before {
    content: '▶';
    font-size: 8px;
    color: #ccc;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
}

/* Active or Open Chapter shows Down Arrow */
.sidebar-chapter.active .sidebar-chapter-title::before,
.sidebar-chapter.open .sidebar-chapter-title::before {
    content: '▼' !important;
}

/* Ensure sub-links follow the wrapper state */
.sidebar-chapter .sidebar-nested-links {
    display: none !important;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 12px;
}

.sidebar-chapter.active .sidebar-nested-links,
.sidebar-chapter.open .sidebar-nested-links {
    display: block !important;
}

.sidebar-nav a {
    text-decoration: none;
    color: #555;
    font-size: 13px;
    padding: 3px 6px 3px 10px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
    display: block;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
}

.sidebar-nav a:hover {
    background: #f0f4ff;
    color: #0070f3;
}

.sidebar-nav a.active {
    background: #f0f7ff !important;
    color: #0070f3 !important;
    font-weight: 700 !important;
    border-left: 4px solid #0070f3 !important;
    padding-left: 10px !important;
    border-radius: 0 4px 4px 0 !important;
}

/* Sub-subtopic (§ level) — indented, smaller, lighter */
.sidebar-nav a.sidebar-sub {
    font-size: 11.5px;
    color: #64748b;
    padding-left: 24px;
}

.sidebar-nav a.sidebar-sub:hover {
    color: #0070f3;
    background: #f5f7ff;
}

/* PREMIUM FOOTER */
.site-footer {
  background: #0d1117;
  color: #8b949e;
  padding: 100px 0 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.footer-brand {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
}

.footer-youtube {
  color: #fff;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.footer-youtube:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ff0000;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.1);
}

.footer-bottom {
  margin-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  width: 100%;
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555;
}

@media (max-width: 600px) {
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

/* ==========================================================================
   ARTICLE DESIGN SYSTEM - Think-Embedded
   ========================================================================== */

.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 40px 60px;
}

.article-hero-v2 {
    margin-bottom: 60px;
    animation: fadeUp 0.8s ease-out;
}

.article-hero-v2 h1 {
    margin-bottom: 24px;
    font-size: clamp(32px, 5vw, 48px);
    color: #0f172a;
    line-height: 1.1;
}

.hero-v2-span {
    background: linear-gradient(90deg, #0070f3, #00b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.article-text-sub {
    font-size: 19px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 32px;
}

.video-wrapper {
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 112, 243, 0.05);
}

.video-wrapper iframe {
    width: 100%;
    height: 450px;
    border: 0;
}

.highlight-box {
    display: inline-block;
    padding: 16px 24px;
    font-size: 17px;
    line-height: 1.6;
    background: #f0f7ff;
    border-left: 4px solid #0070f3;
    color: #0f172a;
    border-radius: 0 12px 12px 0;
    margin-bottom: 40px;
}

/* GRIDS */
.grid-md-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin: 40px 0;
}

.grid-md-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

/* CONTENT BLOCKS */
.text-block-border {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 32px;
    border-radius: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.text-block-border:hover {
    transform: translateY(-4px);
    border-color: #0070f3;
}

.text-block-border h2, .text-block-border h3 {
    color: #0f172a;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    font-size: 22px !important;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.tech-highlight {
    color: #0070f3;
    font-weight: 600;
    background: rgba(0, 112, 243, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.point-list {
    list-style: none;
    padding: 0;
}

.point-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: #475569;
}

.point-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #0070f3;
    font-weight: bold;
}

.section-header-accent {
    border-left: 4px solid #0070f3;
    padding-left: 20px;
    margin: 60px 0 32px;
    font-size: 28px;
    color: #0f172a;
}

.footer-cta {
    margin-top: 100px;
    padding: 60px 0;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.badge-new {
    background: #f0f7ff;
    color: #0070f3;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    .article-container {
        padding: 100px 24px 40px;
    }
    .video-wrapper iframe {
        height: 250px;
    }
}

    /* UNIVERSAL LAYOUT SYNCED */

    /* OVERLAY DIMMER */
    body.sidebar-active::after {
        content: '';
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: 100vh;
        background: transparent;
        backdrop-filter: none;
        z-index: 1000;
        pointer-events: none;
    }
}

.sidebar-nested-links {
    display: none !important;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 12px;
    width: auto;
}

/* Active chapter default: Open */
.sidebar-nav > a.active + .sidebar-nested-links {
    display: block !important;
}

/* Manual Overrides for Toggle */
.sidebar-nested-links.manual-open {
    display: block !important;
}

.sidebar-nested-links.manual-collapsed {
    display: none !important;
}

.sidebar-nested-links a {
    display: block !important;
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 13px !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 6px 0 !important;
    line-height: 1.4 !important;
}

.sidebar-nested-links a:hover {
    color: #0070f3 !important;
}

/* CODE BLOCKS - Fancy Dark 'Cyber-Textbook' Style */
.code-block {
    background: #0f172a; /* Deep Slate */
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    margin: 32px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.code-block:hover {
    box-shadow: 0 15px 40px rgba(0, 112, 243, 0.1);
    border-color: #0070f3;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1e293b; /* Slightly lighter slate */
    border-bottom: 1px solid #334155;
}

.code-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mac-style Window Controls */
.window-controls {
    display: flex;
    gap: 6px;
}

.window-controls span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.control-red { background: #ff5f56; }
.control-yellow { background: #ffbd2e; }
.control-green { background: #27c93f; }

.code-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

.code-language {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.code-block pre {
    margin: 0;
    padding: 24px;
    overflow-x: auto;
    background: #0f172a; /* Match container */
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14.5px;
    line-height: 1.7;
    color: #e2e8f0; /* Crisp light text */
}