/* ESP32 Engine — Main Stylesheet v3.0
   Design: minimal, educational, single-accent blue
   No gradients on UI, no colored shadows, no float animations */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Single accent — calm technical blue */
  --primary:       #2563EB;
  --primary-dark:  #1D4ED8;
  --accent:        #60A5FA;
  --accent-soft:   #EFF6FF;

  /* Neutral surface system */
  --bg:            #F9FAFB;
  --surface:       #FFFFFF;
  --text:          #111827;
  --text-muted:    #6B7280;
  --border:        #E5E7EB;

  /* Colorless shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 14px rgba(0,0,0,0.09);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.12);

  /* Geometry */
  --radius:        6px;
  --radius-lg:     10px;

  /* Typography — single font family */
  --font:          Inter, system-ui, -apple-system, sans-serif;
  --font-display:  Inter, system-ui, -apple-system, sans-serif;
  --font-mono:     'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;

  /* Layout */
  --wrap:          1200px;
  --header-h:      64px;
  --transition:    0.16s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 1.0625rem;
  line-height: 1.65; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 700;
  line-height: 1.25; color: var(--text); margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.625rem, 3.5vw, 2.375rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 800; }
h3 { font-size: clamp(1rem, 2.5vw, 1.125rem); }
p { margin: 0 0 1rem; }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
.meta { color: var(--text-muted); font-size: 0.9375rem; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.42s cubic-bezier(0.4,0,0.2,1), transform 0.42s cubic-bezier(0.4,0,0.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.is-visible.stagger-why { transition-delay: calc(var(--i, 0) * 70ms); }

/* ===== NAVIGATION ===== */
.site-nav-sticky {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav-sticky.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header { height: var(--header-h); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 100%; }

/* Logo */
.site-logo { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; flex-shrink: 0; text-decoration: none; }
.site-logo:hover { color: var(--text); }
.logo-mark {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark::before {
  content: "32"; color: #fff; font-size: 0.75rem; font-weight: 800;
  letter-spacing: -0.02em; font-family: var(--font-mono);
}
.logo-text { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.015em; }
.logo-accent { color: var(--primary); }
.logo-tagline { display: none; font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

/* Nav links */
.top-nav { display: flex; align-items: center; gap: 0.1rem; margin-left: auto; }
.top-nav a { padding: 0.45rem 0.75rem; border-radius: var(--radius); color: var(--text-muted); font-weight: 500; font-size: 0.9375rem; transition: all var(--transition); }
.top-nav a:hover { color: var(--text); background: var(--bg); }
.top-nav a.active { color: var(--primary); background: var(--accent-soft); font-weight: 600; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: #9CA3AF; background: var(--bg); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; border: none; background: none; cursor: pointer; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay[hidden] { display: none; }
.search-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.search-overlay-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,0.5); }
.search-overlay-panel { position: relative; width: min(92%, 600px); background: var(--surface); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.search-overlay-form { display: flex; gap: 0.6rem; align-items: center; }
.search-overlay-form input { flex: 1; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9375rem; font-family: inherit; background: var(--bg); color: var(--text); outline: none; }
.search-overlay-form input:focus { border-color: var(--primary); }
.search-close { position: absolute; top: 0.75rem; right: 0.75rem; border: none; background: none; font-size: 1.375rem; cursor: pointer; color: var(--text-muted); line-height: 1; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.575rem 1.1rem; border-radius: var(--radius); font-weight: 600; font-size: 0.9375rem;
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--transition); font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: #9CA3AF; background: var(--bg); color: var(--text); }
.btn-lg { padding: 0.725rem 1.375rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-card { padding: 0; background: none; border: none; color: var(--primary); font-weight: 600; font-size: 0.9375rem; cursor: pointer; }

/* ===== HERO ===== */
.hero-home {
  background: linear-gradient(135deg, #0C1628 0%, #162040 45%, #1E293B 100%);
  color: #fff; padding: clamp(2.5rem, 7vw, 5rem) 0;
  overflow: hidden; position: relative;
}
/* Radial glow overlays */
.hero-home::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 68% 30%, rgba(37,99,235,0.22) 0%, transparent 58%),
    radial-gradient(ellipse 40% 55% at 8%  75%, rgba(96,165,250,0.1)  0%, transparent 55%);
  pointer-events: none; z-index: 0;
}
/* Dot-grid texture */
.hero-home::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(96,165,250,0.07) 1px, transparent 1px);
  background-size: 30px 30px; pointer-events: none; z-index: 0;
}
.hero-home-inner { display: grid; grid-template-columns: 1fr 0.8fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }

/* Eyebrow — pill badge */
.hero-home .hero-eyebrow {
  display: inline-flex; align-items: center;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); background: rgba(37,99,235,0.2); border: 1px solid rgba(96,165,250,0.32);
  border-radius: 100px; padding: 0.28rem 0.9rem; margin-bottom: 1.1rem;
}

/* Hero headings */
.hero-home h1 {
  color: #fff; margin-bottom: 1rem;
  font-size: clamp(2rem, 4.5vw, 2.875rem);
  letter-spacing: -0.028em; line-height: 1.15;
}
.hero-home .hero-sub { color: rgba(255,255,255,0.7); font-size: 1.0625rem; max-width: 36rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0; }

/* CTA buttons */
.hero-home .btn-primary { box-shadow: 0 4px 18px rgba(37,99,235,0.5); }
.hero-home .btn-primary:hover { box-shadow: 0 6px 26px rgba(37,99,235,0.62); transform: translateY(-1px); }
.hero-home .btn-secondary { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.2); }
.hero-home .btn-secondary:hover { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.34); }

/* Stat pills */
.hero-stat-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.hero-stat-pill {
  background: rgba(37,99,235,0.14); border: 1px solid rgba(96,165,250,0.22);
  border-radius: var(--radius); padding: 0.6rem 1rem;
}
.hero-stat-pill strong { display: block; font-size: 1.1875rem; color: #fff; font-weight: 800; line-height: 1.1; }
.hero-stat-pill span { display: block; font-size: 0.6875rem; color: rgba(255,255,255,0.5); margin-top: 0.1rem; }

/* Hero visual — chip glow + float cards */
.hero-visual-frame { position: relative; }
.hero-visual-frame::before {
  content: ''; position: absolute;
  top: -25px; left: -25px; right: -25px; bottom: -25px;
  background: radial-gradient(ellipse at 50% 55%, rgba(37,99,235,0.28) 0%, transparent 62%);
  filter: blur(26px); pointer-events: none; z-index: 0;
}
.hero-board-svg { width: 100%; max-width: 240px; margin: 0 auto; opacity: 0.95; position: relative; z-index: 1; }
.hero-float-stack { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.hero-float-card {
  position: absolute;
  background: rgba(10,20,40,0.72);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.875rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.07);
}
.hero-float-card-a { top: 8%; right: 0; }
.hero-float-card-b { bottom: 30%; left: -5%; }
.hero-float-card-c { bottom: 5%; right: 10%; }
.hero-float-hd { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.35rem; }
.hero-float-hd i { font-size: 0.875rem; color: var(--accent); }
.hero-float-label { color: rgba(255,255,255,0.42); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-float-card strong { display: block; font-size: 1rem; color: var(--accent); font-weight: 700; }

/* ===== CATEGORY BANNER ===== */
.category-banner { background: #1E293B; color: #fff; padding: clamp(2rem, 5vw, 3rem) 0; }
.category-banner-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.category-banner h1 { color: #fff; }
.category-banner .hero-sub { color: rgba(255,255,255,0.72); font-size: 1.0625rem; }
.category-banner .hero-eyebrow { color: var(--accent); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.breadcrumb-light a { color: rgba(255,255,255,0.6); }
.breadcrumb-light a:hover { color: #fff; }
.breadcrumb-light li:not(:last-child)::after { color: rgba(255,255,255,0.3); }
.category-banner-visual {
  width: 100px; height: 100px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
}
.category-banner-visual svg { width: 48px; height: 48px; color: rgba(255,255,255,0.85); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.badge-light { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.88); border: 1px solid rgba(255,255,255,0.16); }

/* ===== SIDEBAR LAYOUT ===== */
.layout-with-sidebar { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 2rem 0 3rem; align-items: start; }
.sidebar-categories { position: sticky; top: calc(var(--header-h) + 1rem); }
.sidebar-categories-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; }
.sidebar-title { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.65rem; }
.sidebar-cat-nav { display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-cat-nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border-radius: var(--radius); color: var(--text-muted); font-weight: 500; font-size: 0.9375rem; transition: all var(--transition); }
.sidebar-cat-nav a:hover { background: var(--bg); color: var(--text); }
.sidebar-cat-nav a.is-active { background: var(--accent-soft); color: var(--primary); font-weight: 600; }
.sidebar-cat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.sidebar-cat-nav a.is-active .sidebar-cat-dot { background: var(--primary); }

/* ===== FILTERS ===== */
.filters-sticky { position: sticky; top: var(--header-h); z-index: 50; background: rgba(249,250,251,0.97); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 0.85rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.filters-bar .search-panel { display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; }
.filters-bar input, .filters-bar select { padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9375rem; background: var(--surface); color: var(--text); font-family: inherit; outline: none; }
.filters-bar input:focus, .filters-bar select:focus { border-color: var(--primary); }
.filter-meta { margin-top: 0.5rem; }

/* ===== SECTION HEADERS ===== */
.section-premium, .portal-section { padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-eyebrow {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--primary); margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.45rem;
}
.section-eyebrow::before {
  content: ''; flex-shrink: 0;
  width: 3px; height: 11px; border-radius: 2px;
  background: var(--primary);
}
.section-sub { color: var(--text-muted); max-width: 36rem; margin-top: 0.35rem; font-size: 0.9375rem; }
.section-head-portal { margin-bottom: 1.5rem; }
.section-head-portal-inline { margin-bottom: 1.25rem; }
.portal-duo-col { display: flex; flex-direction: column; }

/* ===== PROJECT / POST CARDS ===== */
.grid-projects, .post-grid-4, .grid-compact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.project-card-item, .modern-card, .post-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; color: var(--text);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.project-card-item:hover, .modern-card:hover, .post-card:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; color: var(--text); }
.card-media, .post-thumb, .card-thumb { aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; background: var(--bg); border-bottom: 1px solid var(--border); }
.card-thumb svg, .post-thumb svg { width: 40px; height: 40px; color: var(--text-muted); opacity: 0.45; }
.card-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.6rem; }
.card-body h2, .card-body h3 { font-size: 1rem; margin-bottom: 0.4rem; line-height: 1.35; }
.card-desc { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 0.75rem; flex: 1; }
.card-footer { margin-top: auto; }

/* ===== BADGES ===== */
.badge { display: inline-flex; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-cat { background: var(--accent-soft); color: var(--primary); }
.badge-beginner { background: #DCFCE7; color: #15803D; }
.badge-intermediate { background: #FEF9C3; color: #854D0E; }
.badge-advanced { background: #FEE2E2; color: #B91C1C; }
.badge-time { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-featured { background: var(--primary); color: #fff; }

/* ===== CATEGORY THUMB TINTS (flat, no gradient) ===== */
.t-iot        { background: #EFF4FF; }
.t-home       { background: #FDF2F8; }
.t-cam        { background: #F0F0FF; }
.t-robot      { background: #F0FDF4; }
.t-sensor     { background: #FFFBEB; }
.t-ai         { background: #FAF5FF; }
.t-security   { background: #FFF1F2; }
.t-led        { background: #FFF7ED; }
.t-agriculture { background: #F0FDF4; }
.t-default    { background: var(--bg); }

/* ===== GUIDE CARDS ===== */
.guide-tracks-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.guide-track-card, .guide-home-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.15rem; color: var(--text); display: flex; flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.guide-track-card:hover, .guide-home-card:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); color: var(--text); }
.guide-track-badge { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); margin-bottom: 0.5rem; }
.guide-home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

/* ===== CAROUSEL ===== */
.carousel-shell { overflow: hidden; }
.carousel-track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.carousel-card {
  flex: 0 0 min(280px, 82vw); scroll-snap-align: start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; display: flex; gap: 0.85rem; color: var(--text);
  transition: box-shadow var(--transition);
}
.carousel-card:hover { box-shadow: var(--shadow-md); color: var(--text); }
.carousel-card-thumb { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.carousel-card-body { display: flex; flex-direction: column; gap: 0.25rem; }
.carousel-card-meta { font-size: 0.8125rem; color: var(--text-muted); }
.carousel-controls { display: flex; align-items: center; gap: 0.4rem; }
.carousel-btn { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 1.125rem; color: var(--text-muted); transition: all var(--transition); }
.carousel-btn:hover { border-color: #9CA3AF; color: var(--text); }

/* ===== PORTAL DUO ===== */
.portal-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.tutorial-list { display: flex; flex-direction: column; gap: 0.3rem; }
.tutorial-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.85rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: box-shadow var(--transition), border-color var(--transition);
}
.tutorial-row:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); color: var(--text); }
.tutorial-icon { width: 38px; height: 38px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tutorial-meta strong { display: block; font-size: 0.9375rem; }
.tutorial-cat { font-size: 0.8125rem; color: var(--text-muted); }
.tutorial-arrow { margin-left: auto; color: var(--text-muted); font-size: 0.875rem; }
.pop-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.tech-cat-card, .pop-cat {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.85rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-weight: 500; font-size: 0.9375rem; color: var(--text); transition: all var(--transition);
}
.tech-cat-card:hover { border-color: #D1D5DB; background: var(--bg); color: var(--text); }
.pop-cat-icon { width: 30px; height: 30px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }

/* ===== ROADMAP & STATS ===== */
.roadmap-track-premium { display: flex; flex-direction: column; }
.roadmap-node-premium {
  display: flex; gap: 0.85rem; padding: 0.85rem 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.roadmap-num { font-weight: 800; color: var(--text-muted); font-size: 0.875rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.roadmap-connector-premium { width: 1px; height: 10px; background: var(--border); margin-left: 1.6rem; }
/* Roadmap phase colour — mirrors the learning path card accent colours */
.roadmap-track-premium > div:nth-child(1) .roadmap-num { color: #10B981; }
.roadmap-track-premium > div:nth-child(3) .roadmap-num { color: var(--primary); }
.roadmap-track-premium > div:nth-child(5) .roadmap-num { color: #D97706; }
.roadmap-track-premium > div:nth-child(7) .roadmap-num { color: #EF4444; }
.portal-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
.portal-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; text-align: center; }
.portal-stat strong { display: block; font-size: 1.625rem; color: var(--text); font-weight: 700; line-height: 1.1; margin-bottom: 0.2rem; }
.portal-stat span { font-size: 0.8125rem; color: var(--text-muted); }
.why-grid-premium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.why-card-premium {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem; position: relative; overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.why-card-premium::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--primary); transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s ease;
}
.why-card-premium:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: transparent; }
.why-card-premium:hover::after { transform: scaleX(1); }
.why-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft);
  margin-bottom: 1rem;
  transition: background var(--transition), transform var(--transition);
}
.why-icon-wrap i { font-size: 1.375rem; color: var(--primary); transition: color var(--transition); }
.why-card-premium:hover .why-icon-wrap { background: var(--primary); transform: scale(1.07); }
.why-card-premium:hover .why-icon-wrap i { color: #fff; }
.why-card-premium strong { display: block; font-size: 1rem; font-weight: 600; margin-bottom: 0.45rem; color: var(--text); }
.why-card-premium p { font-size: 0.9375rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.stats-highlights { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.stats-highlight { display: flex; align-items: center; gap: 0.55rem; font-size: 0.875rem; color: var(--text-muted); }
.stats-highlight-icon { flex-shrink: 0; font-size: 0.9375rem; color: var(--primary); width: 1.125rem; text-align: center; }
.roadmap-link { display: inline-block; margin-top: 1rem; color: var(--primary); font-weight: 600; font-size: 0.875rem; }
.portal-roadmap-stats { align-items: start; }
.roadmap-panel, .stats-panel { display: flex; flex-direction: column; }

/* ===== CTA PANEL ===== */
.portal-cta {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 55%, #1a3a8f 100%);
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: var(--radius-lg); padding: 2.5rem; margin-bottom: 2rem;
  position: relative; overflow: hidden;
}
.portal-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 85% 40%, rgba(255,255,255,0.1) 0%, transparent 55%);
  pointer-events: none;
}
.portal-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; position: relative; z-index: 1; }
.portal-cta-text h2 { margin-bottom: 0.25rem; color: #fff; }
.portal-cta-text p { color: rgba(255,255,255,0.72); margin: 0; font-size: 0.9375rem; }
.portal-cta-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.portal-cta .btn-primary { background: #fff; color: #1D4ED8; border-color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.portal-cta .btn-primary:hover { background: #EFF6FF; color: #1D4ED8; box-shadow: 0 6px 18px rgba(0,0,0,0.22); transform: translateY(-1px); }
.portal-cta .btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.28); }
.portal-cta .btn-secondary:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.42); }

/* ===== COMMUNITY PANEL ===== */
.community-panel {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: #1E293B; color: #fff; border-radius: var(--radius-lg); padding: 1.75rem 2rem;
}
.community-panel h2 { color: #fff; margin-bottom: 0.25rem; }
.community-lead { color: rgba(255,255,255,0.7); }
.community-panel-actions { margin-left: auto; display: flex; gap: 0.65rem; flex-wrap: wrap; }
.community-panel .btn-secondary { background: rgba(255,255,255,0.09); color: #fff; border-color: rgba(255,255,255,0.18); }
.community-panel .btn-secondary:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== FOOTER ===== */
.site-footer { background: #1E293B; color: rgba(255,255,255,0.7); padding: 3rem 0 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-brand strong { color: #fff; font-size: 1rem; display: block; margin-bottom: 0.2rem; }
.footer-tagline { color: var(--accent); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.65rem; }
.footer-brand p { font-size: 0.9375rem; line-height: 1.6; color: rgba(255,255,255,0.55); }
.footer-social { display: flex; gap: 0.5rem; margin-top: 1rem; }
.footer-social a { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius); background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); transition: background var(--transition); }
.footer-social a:hover { background: rgba(255,255,255,0.14); color: #fff; }
.footer-col h4 { color: #fff; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 0.75rem; }
.footer-col a { display: block; color: rgba(255,255,255,0.55); font-size: 0.9375rem; padding: 0.2rem 0; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.25rem; font-size: 0.875rem; color: rgba(255,255,255,0.35); }

/* ===== BREADCRUMB ===== */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.875rem; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ===== ARTICLE SHELL ===== */
.article-shell { display: grid; grid-template-columns: 200px 1fr 220px; gap: 2rem; padding: 2rem 0 3rem; align-items: start; }
.sidebar-left, .sidebar-right { position: sticky; top: calc(var(--header-h) + 1rem); }
.sidebar-sticky { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; }
.sidebar-sticky h3 { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.6rem; }
.side-list { list-style: none; padding: 0; margin: 0; }
.side-list a { display: block; padding: 0.4rem 0.6rem; border-radius: var(--radius); color: var(--text-muted); font-size: 0.875rem; transition: all var(--transition); }
.side-list a:hover, .side-list a.is-active { background: var(--accent-soft); color: var(--primary); }
.sidebar-divider { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.article-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2rem); }
.project-hero-banner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.project-hero-image { width: 110px; height: 110px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); }
.project-hero-image svg { width: 56px; height: 56px; color: var(--text-muted); opacity: 0.6; }
.article-lead { font-size: 1.0625rem; color: var(--text-muted); line-height: 1.7; }
.article-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.75rem 0; }

/* ===== DIFFICULTY TABS ===== */
.difficulty-tabs { display: flex; gap: 0.35rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.difficulty-tab { padding: 0.45rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-weight: 500; font-size: 0.875rem; transition: all var(--transition); color: var(--text-muted); font-family: inherit; }
.difficulty-tab:hover { border-color: #9CA3AF; color: var(--text); }
.difficulty-switcher #level-radio-beginner:checked ~ .difficulty-tabs label[for="level-radio-beginner"],
.difficulty-switcher #level-radio-intermediate:checked ~ .difficulty-tabs label[for="level-radio-intermediate"],
.difficulty-switcher #level-radio-advanced:checked ~ .difficulty-tabs label[for="level-radio-advanced"] {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== ACCORDIONS ===== */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.4rem; overflow: hidden; }
.accordion-header { padding: 0.8rem 1rem; font-weight: 600; background: var(--surface); cursor: pointer; font-size: 0.9375rem; color: var(--text); }
.accordion-content { padding: 1rem; border-top: 1px solid var(--border); }

/* ===== WIRING TABLE ===== */
.wiring-table-wrap { overflow-x: auto; }
.wiring-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.wiring-table th, .wiring-table td { padding: 0.6rem 0.75rem; border: 1px solid var(--border); text-align: left; }
.wiring-table th { background: var(--bg); color: var(--text); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== CODE BLOCK — GitHub Dark ===== */
.code-block { position: relative; margin: 1.25rem 0; border-radius: var(--radius); overflow: hidden; border: 1px solid #30363D; }
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #161B22; color: #8B949E; font-size: 0.75rem; font-weight: 600;
  padding: 0.4rem 0.85rem; letter-spacing: 0.04em;
}
.code-block pre {
  margin: 0; background: #0D1117; color: #E6EDF3;
  padding: 1rem 1.1rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.9375rem; line-height: 1.65; border: none;
}
.level-code { font-family: var(--font-mono); }
.copy-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  color: #8B949E; border-radius: 4px; padding: 0.2rem 0.5rem;
  font-size: 0.6875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.copy-btn:hover { background: rgba(255,255,255,0.1); color: #E6EDF3; }
.copy-btn.copied { background: rgba(63,185,80,0.12); border-color: rgba(63,185,80,0.3); color: #3FB950; }

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.85rem 0; border: none; background: none; text-align: left;
  font-weight: 600; cursor: pointer; font-family: inherit;
  font-size: 0.9375rem; color: var(--text); transition: color var(--transition);
}
.faq-q:hover { color: var(--primary); }
.faq-q .plus { font-size: 1.125rem; color: var(--text-muted); flex-shrink: 0; transition: transform var(--transition); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; font-size: 0.9375rem; color: var(--text-muted); line-height: 1.7; }
.faq-item.is-open .faq-a, .faq-item.open .faq-a { max-height: 600px; padding-bottom: 0.85rem; }
.faq-item.is-open .plus, .faq-item.open .plus { transform: rotate(45deg); }
.faq-q[aria-expanded="true"] + .faq-a { max-height: 600px; padding-bottom: 0.85rem; }
.faq-q[aria-expanded="true"] .plus { transform: rotate(45deg); }

/* ===== RELATED GRID ===== */
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.related-card { display: flex; gap: 0.6rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: all var(--transition); }
.related-card:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); color: var(--text); }
.related-thumb { width: 42px; height: 42px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg); }

/* ===== STATIC & GUIDE INDEX ===== */
.guide-page, .static-page, .guide-index-page { padding: 2rem 0 3rem; }
.guide-index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.guide-index-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.15rem; color: var(--text); text-decoration: none;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.guide-index-card:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; color: var(--text); }
.guide-index-card h3 { font-size: 1rem; margin: 0; line-height: 1.35; }
.guide-index-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; flex: 1; }
.promo-box { background: var(--accent-soft); border: 1px solid #BFDBFE; border-radius: var(--radius); padding: 1rem; }
.promo-box strong { color: var(--primary); }

/* ===== PAGINATION ===== */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; padding: 1.5rem 0; }
.pagination-current { font-weight: 700; color: var(--primary); }
.filter-hidden, .page-hidden { display: none !important; }
.section-actions { text-align: center; padding: 1rem 0; }
.nav-links { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; margin: 1.5rem 0; }
.nav-links a, .nav-links span { padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-weight: 500; font-size: 0.9375rem; transition: all var(--transition); }
.nav-links a:hover { background: var(--bg); border-color: #D1D5DB; color: var(--text); }
.nav-links .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== COOKIE CONSENT ===== */
.cookie-consent { position: fixed; bottom: 0; left: 0; right: 0; z-index: 150; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0,0,0,0.06); padding: 1rem; }
.cookie-consent-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: var(--wrap); margin: 0 auto; }
.cookie-actions { display: flex; gap: 0.5rem; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 90;
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); font-size: 1rem;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { border-color: #9CA3AF; color: var(--text); }

/* ===== MOBILE SECTION NAV ===== */
.mobile-section-nav { display: none; margin-bottom: 1rem; }
.mobile-nav-select { width: 100%; padding: 0.6rem; border-radius: var(--radius); border: 1px solid var(--border); font-family: inherit; }

/* Mobile guide TOC — generated by JS, hidden on desktop */
.guide-mobile-toc { display: none; margin-bottom: 1.25rem; }
.guide-mobile-toc select {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.9375rem;
  background: var(--surface); color: var(--text); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

/* ===== STEPS ===== */
.steps-compact { display: flex; flex-direction: column; gap: 0.65rem; }
.step { display: flex; gap: 0.75rem; align-items: flex-start; }
.step-no { font-weight: 800; color: var(--primary); font-size: 0.9375rem; flex-shrink: 0; width: 1.75rem; }
.detail-list { padding-left: 1.25rem; }
.detail-list li { margin-bottom: 0.3rem; }

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: #9CA3AF; }
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ===== READING PROGRESS BAR ===== */
.reading-progress { position: fixed; top: 0; left: 0; width: 0%; height: 2px; background: var(--primary); z-index: 300; transition: width 0.08s linear; pointer-events: none; }

/* ===== GUIDE DOCS LAYOUT ===== */
.guide-docs-wrap { padding: 0 0 3rem; }
.guide-docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; padding-top: 1.5rem; align-items: start; }
.guide-toc-sidebar {
  position: sticky; top: calc(var(--header-h) + 1.25rem);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  display: flex; flex-direction: column; gap: 1rem;
}
.toc-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
.toc-title { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); font-weight: 700; margin: 0 0 0.6rem; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.toc-list li a {
  display: block; padding: 0.35rem 0.55rem; border-radius: 4px;
  color: var(--text-muted); font-size: 0.875rem; line-height: 1.35;
  transition: all var(--transition); border-left: 2px solid transparent; text-decoration: none;
}
.toc-list li a:hover { color: var(--text); background: var(--bg); }
.toc-list li a.is-active { color: var(--primary); background: var(--accent-soft); border-left-color: var(--primary); font-weight: 600; }
.toc-list .toc-h3 a { padding-left: 1rem; font-size: 0.8125rem; }
.toc-empty { color: var(--text-muted); font-size: 0.875rem; }
.toc-back-link { display: block; padding: 0.6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: 0.875rem; font-weight: 600; text-align: center; transition: all var(--transition); }
.toc-back-link:hover { color: var(--primary); border-color: var(--primary); }

/* Guide info sidebar */
.guide-info-list { display: flex; flex-direction: column; gap: 0.5rem; }
.guide-info-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.guide-info-label { font-size: 0.8125rem; color: var(--text-muted); }
.guide-info-val { font-size: 0.875rem; font-weight: 500; color: var(--text); }

/* Guide article header */
.guide-article-header { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.guide-article-header h1 { margin-bottom: 0.6rem; }

/* Guide article body */
.guide-article-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.75; max-width: 72ch;
}
.guide-article-body h2 {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  margin-top: 2rem; margin-bottom: 0.65rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.guide-article-body h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.guide-article-body h3 { font-size: clamp(1rem, 2vw, 1.0625rem); margin-top: 1.5rem; margin-bottom: 0.45rem; }
.guide-article-body p { margin-bottom: 1rem; }
.guide-article-body ul, .guide-article-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.guide-article-body li { margin-bottom: 0.3rem; }
.guide-article-body pre, .guide-article-body code { font-family: var(--font-mono); }
.guide-article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9375rem; }
.guide-article-body th, .guide-article-body td { padding: 0.6rem 0.75rem; border: 1px solid var(--border); text-align: left; }
.guide-article-body th { background: var(--bg); color: var(--text); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Guide FAQ */
.guide-faq-section { margin-top: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 1.75rem); }
.guide-faq-title { font-size: 1.125rem; margin-bottom: 1.25rem; }

/* Guide related */
.guide-related-section { margin-top: 2rem; }
.guide-related-section > h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.related-guides-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
.related-guide-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.related-guide-card:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); color: var(--text); }
.related-guide-card strong { font-size: 0.9375rem; line-height: 1.35; }
.related-guide-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.2rem; }
.related-guide-arrow { color: var(--primary); font-size: 0.875rem; margin-top: auto; }

/* Guide prev/next nav */
.guide-bottom-nav { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.75rem; }
.guide-nextprev { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.guide-nextprev-link {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); text-decoration: none; color: var(--text);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.guide-nextprev-link:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); color: var(--text); }
.guide-nextprev-link.is-next { text-align: right; }
.guide-nextprev-dir { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.guide-nextprev-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.guide-nextprev-arrow { color: var(--primary); }

/* ===== GUIDE ARCHIVE PHASE SECTIONS ===== */
.guide-phase-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0 2rem; }
.phase-tab {
  padding: 0.45rem 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-weight: 500; font-size: 0.875rem;
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.phase-tab:hover { border-color: #9CA3AF; color: var(--text); }
.phase-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.guide-phase-section { margin-bottom: 3rem; }
.guide-phase-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--border); }
.guide-phase-badge { background: var(--primary); color: #fff; padding: 0.2rem 0.7rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
.guide-phase-count { color: var(--text-muted); font-size: 0.875rem; font-weight: 500; }

/* ===== HERO SEARCH ===== */
.hero-search-wrap { position: relative; max-width: 520px; margin: 1.25rem 0 1rem; }
.hero-search-box {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius); padding: 0.6rem 1rem; transition: all var(--transition);
}
.hero-search-box:focus-within { border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.1); }
.hero-search-icon { color: rgba(255,255,255,0.4); flex-shrink: 0; }
.hero-search-input { background: none; border: none; outline: none; color: #fff; font-size: 0.9375rem; flex: 1; min-width: 0; }
.hero-search-input::placeholder { color: rgba(255,255,255,0.38); }
.hero-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; max-height: 380px; overflow-y: auto;
}
.hero-search-results:not([hidden]) { display: block; }
.search-result-item {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.7rem 1rem; color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.is-focused { background: var(--bg); }
.search-result-title { font-weight: 600; font-size: 0.9375rem; }
.search-result-type { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.search-result-excerpt { font-size: 0.85rem; color: var(--text-muted); }
.search-result-highlight { background: rgba(37,99,235,0.15); border-radius: 2px; padding: 0 1px; }
.search-no-results { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.search-loading { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ===== LEARNING PATH CARDS ===== */
.learning-path-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.learning-path-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.learning-path-card:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; }
.learning-path-card-new { border-color: #BFDBFE; }
.learning-path-new-badge {
  position: absolute; top: -9px; right: 1rem;
  background: var(--primary); color: #fff;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.15rem 0.55rem; border-radius: 4px;
}
.learning-path-header { display: flex; align-items: flex-start; gap: 0.75rem; }
.learning-path-num { font-size: 1.5rem; font-weight: 800; color: #CBD5E1; line-height: 1; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.learning-path-phase { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); display: block; margin-bottom: 0.2rem; }
.learning-path-header h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.learning-path-card > p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; margin: 0; }
.learning-path-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.learning-path-list li a { color: var(--text-muted); font-size: 0.875rem; display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0; transition: color var(--transition); }
.learning-path-list li a:hover { color: var(--primary); }
.learning-path-list li a::before { content: '›'; color: var(--primary); opacity: 0.55; }

/* Phase colour coding — helps beginners see progression at a glance */
.learning-path-card:nth-child(1) { border-left-color: #10B981; border-left-width: 3px; }
.learning-path-card:nth-child(1) .learning-path-num  { color: #10B981; }
.learning-path-card:nth-child(1) .learning-path-phase { color: #059669; }
.learning-path-card:nth-child(2) { border-left-color: var(--primary); border-left-width: 3px; }
.learning-path-card:nth-child(2) .learning-path-num  { color: var(--primary); }
.learning-path-card:nth-child(3) { border-left-color: #F59E0B; border-left-width: 3px; }
.learning-path-card:nth-child(3) .learning-path-num  { color: #D97706; }
.learning-path-card:nth-child(3) .learning-path-phase { color: #B45309; }
.learning-path-card:nth-child(4) { border-left-color: #EF4444; border-left-width: 3px; }
.learning-path-card:nth-child(4) .learning-path-num  { color: #EF4444; }
.learning-path-card:nth-child(4) .learning-path-phase { color: #DC2626; }

/* ===== POPULAR GUIDES GRID ===== */
.popular-guides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.pop-guide-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.15rem; color: var(--text); text-decoration: none;
  display: flex; flex-direction: column; gap: 0.45rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.pop-guide-card:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; color: var(--text); }
.pop-guide-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pop-guide-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.pop-guide-excerpt { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.pop-guide-arrow { font-size: 0.8125rem; color: var(--primary); font-weight: 600; margin-top: auto; }

/* ===== CATEGORY SIDEBAR GUIDE LINKS ===== */
.sidebar-related-guides { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sidebar-guide-link { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: 5px; color: var(--text-muted); text-decoration: none; font-size: 0.8375rem; transition: all var(--transition); }
.sidebar-guide-link:hover { color: var(--primary); background: var(--accent-soft); }
.sidebar-guide-title { flex: 1; line-height: 1.3; }
.sidebar-guide-arrow { color: var(--primary); flex-shrink: 0; opacity: 0.55; }
.cat-empty { color: var(--text-muted); padding: 2rem 0; }

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --bg:          #0F172A;
  --surface:     #1E293B;
  --text:        #F1F5F9;
  --text-muted:  #94A3B8;
  --border:      #334155;
  --accent-soft: #172554;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.5);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.6);
}
[data-theme="dark"] .site-nav-sticky { background: rgba(15,23,42,0.97); }
[data-theme="dark"] .filters-sticky { background: rgba(15,23,42,0.97); }
[data-theme="dark"] .hero-home { background: linear-gradient(135deg, #060D1F 0%, #0C1628 45%, #0F172A 100%); }
[data-theme="dark"] .category-banner { background: #0F172A; }
[data-theme="dark"] .community-panel { background: #0F172A; }
[data-theme="dark"] .site-footer { background: #0F172A; border-top: 1px solid rgba(255,255,255,0.06); }
[data-theme="dark"] .filters-bar input,
[data-theme="dark"] .filters-bar select,
[data-theme="dark"] .search-overlay-form input { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .search-overlay-panel { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .accordion-header { background: var(--surface); }
[data-theme="dark"] .badge-time { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .wiring-table th { background: var(--bg); color: var(--text); }
[data-theme="dark"] .difficulty-tab { background: var(--surface); color: var(--text-muted); }
[data-theme="dark"] body { color-scheme: dark; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-projects, .post-grid-4, .guide-tracks-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-home-inner { grid-template-columns: 1fr; }
  .category-banner-inner { grid-template-columns: 1fr; }
  .category-banner-visual { display: none; }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar-categories { position: static; }
  .article-shell { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { position: static; }
  .why-grid-premium { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .filters-bar .search-panel { grid-template-columns: 1fr 1fr; }
  .guide-docs-layout { grid-template-columns: 200px 1fr; gap: 1.5rem; }
  .guide-index-grid { grid-template-columns: repeat(2, 1fr); }
  .popular-guides-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .learning-path-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .top-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); flex-direction: column;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); z-index: 99;
    transform: translateY(-110%); opacity: 0; pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .top-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .header-actions { margin-left: 0; }
  .header-inner { flex-wrap: wrap; }
  .grid-projects, .guide-home-grid, .guide-index-grid,
  .portal-duo, .why-grid-premium { grid-template-columns: 1fr; }
  .guide-tracks-grid { grid-template-columns: 1fr; }
  .project-hero-banner { grid-template-columns: 1fr; }
  .project-hero-image { width: 100%; height: 90px; border-radius: var(--radius); }
  .footer-grid { grid-template-columns: 1fr; }
  .mobile-section-nav { display: block; }
  .guide-mobile-toc { display: block; }
  .sidebar-left { display: none; }
  .filters-bar .search-panel { grid-template-columns: 1fr; }
  .article-shell { grid-template-columns: 1fr; }
  .guide-docs-layout { grid-template-columns: 1fr; }
  .guide-toc-sidebar { position: static; max-height: none; }
  .related-guides-grid { grid-template-columns: 1fr; }
  .learning-path-grid { grid-template-columns: 1fr; }
  .popular-guides-grid { grid-template-columns: 1fr; }
  .guide-nextprev { grid-template-columns: 1fr; }
  .hero-search-wrap { max-width: 100%; }
  .hero-home-visual { display: none; }
  .portal-duo { gap: 1.5rem; }
  .portal-cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 900px) {
  .logo-tagline { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== ANIMATION SYSTEM ===== */

/* Keyframes */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0%   { opacity: 0.6; transform: scale(1); }
  60%  { opacity: 0;   transform: scale(1.25); }
  100% { opacity: 0;   transform: scale(1.25); }
}

/* Hero entrance — class names match front-page.php HTML */
.hero-home-content .hero-eyebrow { animation: fade-in 0.5s ease 0.05s both; }
.hero-home-content h1             { animation: fade-up 0.55s cubic-bezier(0.4,0,0.2,1) 0.12s both; }
.hero-home-content .hero-sub      { animation: fade-up 0.5s cubic-bezier(0.4,0,0.2,1) 0.22s both; }
.hero-search-wrap                 { animation: fade-up 0.5s cubic-bezier(0.4,0,0.2,1) 0.3s both; }
.hero-actions                     { animation: fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.38s both; }
.hero-stat-row                    { animation: fade-up 0.45s cubic-bezier(0.4,0,0.2,1) 0.45s both; }

/* Hero float cards stagger */
.hero-float-card-a { animation: scale-in 0.5s cubic-bezier(0.4,0,0.2,1) 0.55s both; }
.hero-float-card-b { animation: scale-in 0.5s cubic-bezier(0.4,0,0.2,1) 0.68s both; }
.hero-float-card-c { animation: scale-in 0.5s cubic-bezier(0.4,0,0.2,1) 0.8s both; }

/* Why-card stagger — transition-delay driven by --i */
.why-card-premium.is-visible {
  transition-delay: calc(var(--i, 0) * 75ms);
}

/* Portal stat counter pulse on appear */
.portal-stat.is-counting strong {
  animation: pulse-ring 0.6s ease;
}

/* Learning path card entrance */
.learning-path-card.is-visible,
.guide-card.is-visible {
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* Micro-interaction: card subtle scale on hover */
.guide-card         { transition: transform var(--transition), box-shadow var(--transition); }
.guide-card:hover   { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.learning-path-card { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.learning-path-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Tutorial row hover accent */
.tutorial-row .tutorial-arrow { transition: transform var(--transition); }
.tutorial-row:hover .tutorial-arrow { transform: translateX(4px); }

/* Pop-cat card hover */
.pop-cat { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.pop-cat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Button press effect */
.btn:active { transform: translateY(1px); }

/* Back-to-top with icon */
.back-to-top { display: flex; align-items: center; justify-content: center; }
.back-to-top i { font-size: 1rem; line-height: 1; }

/* Search overlay animation */
.search-overlay:not([hidden]) .search-overlay-panel {
  animation: scale-in 0.2s cubic-bezier(0.4,0,0.2,1) both;
}
.search-overlay:not([hidden]) .search-overlay-backdrop {
  animation: fade-in 0.2s ease both;
}

/* Ripple keyframe (triggered by JS) */
@keyframes ripple-expand {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(1); opacity: 0; }
}

/* Nav toggle → animated X when open */
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Dark mode: why-icon-wrap */
[data-theme="dark"] .why-icon-wrap { background: rgba(37,99,235,0.18); }
[data-theme="dark"] .why-card-premium:hover .why-icon-wrap { background: var(--primary); }

/* Dark mode: hero float cards */
[data-theme="dark"] .hero-float-card { background: rgba(5,12,28,0.8); border-color: rgba(255,255,255,0.1); }

/* Dark mode: icon thumbnail tints — replace light pastels with dark blue tint */
[data-theme="dark"] .t-iot,
[data-theme="dark"] .t-home,
[data-theme="dark"] .t-cam,
[data-theme="dark"] .t-robot,
[data-theme="dark"] .t-sensor,
[data-theme="dark"] .t-ai,
[data-theme="dark"] .t-security,
[data-theme="dark"] .t-led,
[data-theme="dark"] .t-agriculture { background: rgba(37,99,235,0.14); }

/* Dark mode: SVG currentColor → accent blue on all icon boxes */
[data-theme="dark"] .pop-cat-icon,
[data-theme="dark"] .tutorial-icon,
[data-theme="dark"] .carousel-card-thumb { color: var(--accent); }

/* Dark mode: tutorial rows and category cards readable on dark surface */
[data-theme="dark"] .tutorial-row { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .tech-cat-card,
[data-theme="dark"] .pop-cat { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .tech-cat-card:hover,
[data-theme="dark"] .pop-cat:hover { border-color: #475569; background: #263148; }

/* ===== DARK MODE: WHOLE-SITE ALIGNMENT ===== */

/* Guide + content card hover glow */
[data-theme="dark"] .pop-guide-card:hover     { border-color: rgba(37,99,235,0.45); box-shadow: 0 4px 22px rgba(37,99,235,0.18); }
[data-theme="dark"] .guide-track-card:hover,
[data-theme="dark"] .guide-home-card:hover    { border-color: rgba(37,99,235,0.4); box-shadow: 0 2px 14px rgba(37,99,235,0.14); }
[data-theme="dark"] .related-guide-card:hover { border-color: rgba(37,99,235,0.4); box-shadow: 0 2px 12px rgba(37,99,235,0.12); }
[data-theme="dark"] .tutorial-row:hover       { border-color: rgba(37,99,235,0.4); box-shadow: 0 2px 14px rgba(37,99,235,0.12); }
[data-theme="dark"] .carousel-card:hover      { box-shadow: 0 4px 22px rgba(37,99,235,0.2); border-color: rgba(37,99,235,0.35); }

/* Why-cards — blue glow on hover */
[data-theme="dark"] .why-card-premium         { background: #1a2840; }
[data-theme="dark"] .why-card-premium:hover   { box-shadow: 0 6px 28px rgba(37,99,235,0.22); border-color: rgba(37,99,235,0.35); }

/* Learning path — phase-coloured hover shadows match the card left-border colours */
[data-theme="dark"] .learning-path-card { background: #1a2840; }
[data-theme="dark"] .learning-path-card:nth-child(1):hover { box-shadow: 0 6px 26px rgba(16,185,129,0.22); }
[data-theme="dark"] .learning-path-card:nth-child(2):hover { box-shadow: 0 6px 26px rgba(37,99,235,0.22); }
[data-theme="dark"] .learning-path-card:nth-child(3):hover { box-shadow: 0 6px 26px rgba(245,158,11,0.22); }
[data-theme="dark"] .learning-path-card:nth-child(4):hover { box-shadow: 0 6px 26px rgba(239,68,68,0.22); }

/* Stats counters — accent blue for numbers in dark mode */
[data-theme="dark"] .portal-stat strong { color: var(--accent); }
[data-theme="dark"] .portal-stat        { background: #1a2840; border-color: var(--border); }

/* Roadmap nodes — slightly elevated surface in dark mode */
[data-theme="dark"] .roadmap-node-premium { background: #1a2840; border-color: var(--border); }

/* Section eyebrow bar — brighter in dark mode */
[data-theme="dark"] .section-eyebrow::before { background: var(--accent); }
[data-theme="dark"] .section-eyebrow { color: var(--accent); }

/* Pop guide card base in dark */
[data-theme="dark"] .pop-guide-card { background: #1a2840; border-color: var(--border); }
[data-theme="dark"] .pop-guide-card .pop-guide-arrow { color: var(--accent); }

/* ===== PREREQUISITE SIDEBAR BLOCK ===== */
.toc-prereqs { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .75rem; }
.prereq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.prereq-link {
  display: flex; align-items: flex-start; gap: .45rem;
  font-size: .8rem; color: var(--text-muted); text-decoration: none; line-height: 1.35;
}
.prereq-link:hover { color: var(--primary); }
.prereq-dot {
  flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%;
  margin-top: .28em;
}
.prereq-phase-link {
  font-size: .8rem; text-decoration: none; font-weight: 500;
}
.prereq-phase-link:hover { text-decoration: underline; }
[data-theme="dark"] .prereq-link { color: var(--text-muted); }
[data-theme="dark"] .prereq-link:hover { color: var(--accent); }

/* ===== PROJECTS-TO-BUILD ON GUIDE PAGES ===== */
.guide-projects-section { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.section-intro { color: var(--text-muted); font-size: .9rem; margin: -.25rem 0 1rem; }
.guide-projects-grid { display: flex; flex-direction: column; gap: .6rem; }
.guide-project-card {
  display: flex; align-items: center; gap: .85rem;
  padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.guide-project-card:hover {
  border-color: rgba(37,99,235,.35); box-shadow: 0 2px 12px rgba(37,99,235,.12);
}
.guide-project-thumb {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.guide-project-thumb svg { width: 22px; height: 22px; }
.guide-project-body { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.guide-project-body strong { font-size: .925rem; font-weight: 600; }
.guide-project-body .meta { font-size: .78rem; color: var(--text-muted); }
.guide-project-arrow { color: var(--text-muted); font-size: .9rem; }
.guide-project-card:hover .guide-project-arrow { color: var(--primary); }
[data-theme="dark"] .guide-project-card { background: #1a2840; border-color: var(--border); }
[data-theme="dark"] .guide-project-card:hover { border-color: rgba(37,99,235,.45); }

/* ===== PHASE LANDING PAGES ===== */
.phase-hero {
  background: linear-gradient(135deg, rgba(15,23,42,.03) 0%, rgba(15,23,42,.07) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 2.5rem;
}
.phase-hero-inner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem;
}
.phase-hero-num {
  font-size: clamp(5rem, 12vw, 9rem); font-weight: 900; line-height: 1;
  color: var(--phase-colour, var(--primary)); opacity: .12;
  flex-shrink: 0; pointer-events: none; -webkit-user-select: none; user-select: none;
}
[data-theme="dark"] .phase-hero { background: linear-gradient(135deg,rgba(30,41,59,.5) 0%,rgba(15,23,42,.7) 100%); }

.phase-progress-strip {
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.phase-step {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text-muted);
  font-size: .8rem; transition: border-color .2s, color .2s, background .2s;
}
.phase-step:hover { border-color: var(--step-colour); color: var(--step-colour); }
.phase-step.is-current {
  border-color: var(--step-colour); background: var(--step-colour);
  color: #fff; font-weight: 600;
}
.phase-step-num {
  font-weight: 700; font-size: .75rem;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: currentColor; color: var(--step-colour);
  flex-shrink: 0;
}
.phase-step.is-current .phase-step-num { background: rgba(255,255,255,.25); color: #fff; }

.phase-guide-list { padding-bottom: 4rem; }

.guide-card-num {
  font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 22px; opacity: .85;
}

.phase-nav-row {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--border);
}
.phase-nav-link {
  display: flex; flex-direction: column; gap: .15rem;
  text-decoration: none; color: var(--text); padding: .85rem 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 0; flex: 1; max-width: 45%;
  transition: border-color .2s, box-shadow .2s;
}
.phase-nav-link:hover { border-color: var(--step-colour); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.phase-nav-link.is-next { text-align: right; }
.phase-nav-dir { font-size: .75rem; color: var(--text-muted); }
.phase-nav-title { font-weight: 600; font-size: .9rem; }
[data-theme="dark"] .phase-nav-link { border-color: var(--border); }
[data-theme="dark"] .phase-nav-link:hover { border-color: var(--step-colour); }

/* ===== RELATED GUIDES ON PROJECT PAGES ===== */
.project-related-guides .related-guides-grid { margin-top: .5rem; }
