/* ═══════════════════════════════════════════════════════
   GUIDE DESIGN SYSTEM — Shared styles for all public guides
   Light theme · Readable · Consistent
   ═══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f8f9fa;
  --border: #e5e7eb;
  --accent: #0066ff;
  --accent2: #7c3aed;
  --accent3: #d97706;
  --accent4: #ef4444;
  --accent5: #22c55e;
  --text: #1a1a2e;
  --text-muted: #4a4a68;
  --text-dim: #6b7280;
  --mono: "Space Mono", monospace;
  --sans: "Inter", sans-serif;
}

/* ── RESET ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.8;
  overflow-x: hidden;
  font-size: 1.05rem;
}

/* Subtle noise texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

/* ── SITE NAVBAR (matches main React app) ── */
.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}
.site-navbar-inner {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.site-navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
}
.site-navbar-logo {
  height: 40px;
  width: auto;
  display: block;
}
.site-navbar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-navbar-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 16px;
}
.site-navbar-links a {
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--sans);
  text-decoration: none;
  transition: opacity 0.2s;
  padding: 4px 8px;
}
.site-navbar-links a:hover {
  opacity: 0.7;
}
.site-navbar-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: #0066ff;
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.site-navbar-cta:hover {
  background: #0052cc;
  opacity: 1 !important;
}
.site-navbar-hamburger {
  display: none;
  font-size: 1.4rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}
.site-navbar-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  height: calc(100vh - 56px);
  background: #ffffff;
  flex-direction: column;
  padding: 24px;
  gap: 16px;
  z-index: 9999;
}
.site-navbar-overlay.open {
  display: flex;
}
.site-navbar-overlay a {
  padding: 12px 8px;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-navbar-overlay a:hover {
  opacity: 0.7;
}
.site-navbar-overlay .site-navbar-cta {
  align-self: flex-start;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .site-navbar-links {
    display: none;
  }
  .site-navbar-hamburger {
    display: block;
  }
}

/* Legacy topbar (kept for backwards compat) */
.guide-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}
.guide-topbar-inner {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.guide-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.guide-topbar-brand img {
  height: 40px;
  width: auto;
  display: block;
}
.guide-topbar-back {
  padding: 6px 16px;
  background: #ffffff;
  color: var(--accent);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.guide-topbar-back:hover {
  background: rgba(0, 102, 255, 0.06);
  border-color: var(--accent);
}

/* Push body content below fixed topbar */
body {
  padding-top: 56px;
}

.home-btn {
  display: none;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 4rem 2rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 102, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    black 0%,
    transparent 100%
  );
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 102, 255, 0.1) 0%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.hero-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid rgba(0, 102, 255, 0.3);
  padding: 0.3rem 1rem;
  border-radius: 2px;
  margin-bottom: 2rem;
  background: rgba(0, 102, 255, 0.06);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s ease both;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.1s ease both;
}
.hero h1 .green {
  color: var(--accent);
}
.hero h1 .purple {
  color: #6d28d9;
}

.hero-sub {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  max-width: 580px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.2s ease both;
  line-height: 1.8;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.3s ease both;
}
.stat {
  text-align: center;
}
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--mono);
  display: block;
}
.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── STICKY NAV ── */
nav,
.toc {
  position: sticky;
  top: 56px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  overflow-x: auto;
}

.nav-inner,
.toc-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  align-items: center;
  white-space: nowrap;
}

nav a,
.toc a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 1rem 1.2rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
nav a:hover,
.toc a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.toc a .nav-icon {
  font-size: 0.7rem;
  opacity: 0.7;
}
.toc a.active {
  color: var(--accent);
  background: rgba(0, 102, 255, 0.08);
  font-weight: 600;
  border-radius: 6px;
}

/* TOC extras */
.toc-progress {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent5) 100%);
  width: 0%;
  transition: width 0.1s linear;
}
.toc-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 12px 0;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.toc-brand span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.toc-brand .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}
.toc-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
  flex: 1;
}
.toc-links::-webkit-scrollbar {
  display: none;
}
.toc-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

/* ── SECTION HEADERS ── */
.section-header {
  margin-bottom: 3rem;
}
.section-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
}
.section-desc {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.95rem;
  margin-top: 0.75rem;
  max-width: 640px;
  line-height: 1.8;
}

/* GitHub-style section headers */
.section .section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.section-icon.git-icon {
  background: rgba(234, 88, 12, 0.1);
}
.section-icon.github-icon {
  background: rgba(0, 102, 255, 0.1);
}
.section-icon.intellij-icon {
  background: rgba(239, 68, 68, 0.1);
}
.section-icon.flow-icon {
  background: rgba(0, 102, 255, 0.1);
}
.section-icon.branch-icon {
  background: rgba(124, 58, 237, 0.1);
}
.section-icon.merge-icon {
  background: rgba(217, 119, 6, 0.1);
}
.section-icon.tips-icon {
  background: rgba(0, 102, 255, 0.1);
}
.section .section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 102, 255, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.card .card-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(0, 102, 255, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.card .card-link:hover {
  background: rgba(0, 102, 255, 0.08);
}

/* Grid variants */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* ── STEPS ── */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.step-num {
  min-width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(0, 102, 255, 0.08);
  border: 1px solid rgba(0, 102, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.step-content h3,
.step-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.step-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ── CODE / PROMPT BLOCKS ── */
.prompt-block,
.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 1rem 0;
  overflow-x: auto;
  position: relative;
  color: var(--text-muted);
}
.prompt-block::before,
.code-block::before {
  content: attr(data-label) attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.prompt-block .highlight {
  color: var(--accent);
}
.prompt-block .note {
  color: #6d28d9;
  font-style: italic;
}

/* Code block with header */
.code-block-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.code-header .lang {
  background: rgba(0, 102, 255, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.code-block-wrap pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0;
  background: var(--surface);
}
.code-block-wrap code {
  color: var(--text);
}

/* Syntax highlighting */
.kw {
  color: #db2777;
}
.fn {
  color: #0066ff;
}
.str {
  color: #0066ff;
}
.cm,
.cmt,
.comment {
  color: #9ca3af;
  font-style: italic;
}
.num {
  color: var(--accent3);
}
.var {
  color: var(--text);
}
.op {
  color: #6d28d9;
}
.cmd {
  color: var(--accent);
}
.flag {
  color: var(--accent2);
}
.type {
  color: var(--accent5);
}

/* ── HIGHLIGHT BOXES ── */
.highlight-box {
  background: rgba(0, 102, 255, 0.05);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.highlight-box h4 {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.highlight-box p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  font-family: var(--mono);
}
.highlight-box.purple {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.05);
}
.highlight-box.purple h4 {
  color: #6d28d9;
}
.highlight-box.purple p {
  color: #6d28d9;
}
.highlight-box.amber {
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.05);
}
.highlight-box.amber h4 {
  color: var(--accent3);
}
.highlight-box.amber p {
  color: var(--accent3);
}

/* ── CALLOUT BOXES ── */
.callout {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
}
.callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.callout.tip {
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.2);
  color: var(--accent);
}
.callout.warn {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--accent3);
}
.callout.danger {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent4);
}
.callout.info {
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.2);
  color: var(--accent5);
}
.callout.intellij-tip {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--accent4);
}

/* ── TIP GRID ── */
.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.tip-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.tip-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── TABLES ── */
.ops-table,
.big-table,
.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.ops-table th,
.big-table th,
.shortcut-table th {
  text-align: left;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.08em;
  font-weight: 600;
  background: var(--surface2);
}
.ops-table td,
.big-table td,
.shortcut-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.ops-table tr:hover td,
.big-table tr:hover td,
.shortcut-table tr:hover td {
  background: var(--surface2);
}
.big-table td:first-child {
  color: var(--text);
  font-weight: 600;
}
.op-fast {
  color: var(--accent);
}
.op-medium {
  color: var(--accent3);
}
.op-slow {
  color: var(--accent4);
}

/* ── TAGS / PILLS ── */
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-block;
}
.tag.safe {
  background: rgba(0, 102, 255, 0.08);
  color: var(--accent);
  border-color: rgba(0, 102, 255, 0.2);
}
.tag.caution {
  background: rgba(217, 119, 6, 0.08);
  color: var(--accent3);
  border-color: rgba(217, 119, 6, 0.2);
}
.tag.destructive {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent4);
  border-color: rgba(239, 68, 68, 0.2);
}

.use-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.prob-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.prob-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.15);
  color: var(--accent5);
  font-family: var(--mono);
}

/* ── BADGES ── */
.badge-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
}
.badge.git {
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.3);
}
.badge.github {
  color: var(--accent5);
  border-color: rgba(0, 102, 255, 0.3);
}
.badge.intellij {
  color: var(--accent4);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Difficulty badges */
.diff-easy,
.easy-badge {
  background: rgba(0, 102, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 102, 255, 0.2);
}
.diff-medium,
.medium-badge {
  background: rgba(217, 119, 6, 0.08);
  color: var(--accent3);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.diff-hard,
.hard-badge {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent4);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.difficulty-badge,
.pattern-difficulty {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ── FLOW DIAGRAMS ── */
.flow-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
}
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.flow-box {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.flow-box.working {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.2);
}
.flow-box.staging {
  background: rgba(217, 119, 6, 0.08);
  color: var(--accent3);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.flow-box.local {
  background: rgba(0, 102, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 102, 255, 0.2);
}
.flow-box.remote {
  background: rgba(0, 102, 255, 0.08);
  color: var(--accent5);
  border: 1px solid rgba(0, 102, 255, 0.2);
}
.flow-box.pr {
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent2);
  border: 1px solid rgba(124, 58, 237, 0.2);
}
.flow-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Branch visualization */
.branch-viz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin: 20px 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 2;
  overflow-x: auto;
}
.branch-viz .main-line {
  color: var(--accent);
}
.branch-viz .feature-line {
  color: var(--accent5);
}
.branch-viz .hotfix-line {
  color: var(--accent4);
}
.branch-viz .release-line {
  color: var(--accent2);
}
.branch-viz .commit {
  color: var(--accent3);
}
.branch-viz .label {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}
.branch-viz .label.main {
  background: rgba(0, 102, 255, 0.1);
  color: var(--accent);
}
.branch-viz .label.feature {
  background: rgba(0, 102, 255, 0.1);
  color: var(--accent5);
}
.branch-viz .label.hotfix {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent4);
}
.branch-viz .label.release {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent2);
}

/* Visual diagrams (DSA) */
.diagram-row {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.diagram-node {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  color: var(--accent);
  font-weight: 700;
  position: relative;
}
.diagram-arrow {
  color: var(--text-muted);
  padding: 0 0.3rem;
}
.diagram-ptr {
  position: absolute;
  top: -1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--accent3);
  white-space: nowrap;
}

/* ── COMPARISON TABLE ── */
.vs-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.vs-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.vs-col h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.vs-col.do h4 {
  color: var(--accent);
}
.vs-col.dont h4 {
  color: var(--accent4);
}
.vs-col ul {
  list-style: none;
  padding: 0;
}
.vs-col li {
  padding: 6px 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.vs-col li::before {
  margin-right: 8px;
}
.vs-col.do li::before {
  content: "✅";
}
.vs-col.dont li::before {
  content: "❌";
}

/* ── ACCORDION ── */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
details summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}
details summary:hover {
  background: rgba(0, 102, 255, 0.04);
}
details[open] summary {
  border-bottom: 1px solid var(--border);
}
details .details-content {
  padding: 20px;
}

/* ── KEYBOARD SHORTCUTS ── */
kbd {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 1px 0 var(--border);
}

/* ── DSA-SPECIFIC: BIG O GRID ── */
.bigo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 3rem;
}
.bigo-card {
  background: var(--surface);
  padding: 1.5rem;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.bigo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.bigo-card:hover {
  background: var(--surface2);
}
.bigo-card.o1::before {
  background: var(--accent);
}
.bigo-card.ologn::before {
  background: #22c55e;
}
.bigo-card.on::before {
  background: var(--accent3);
}
.bigo-card.onlogn::before {
  background: #ea580c;
}
.bigo-card.on2::before {
  background: var(--accent4);
}
.bigo-card.o2n::before {
  background: #b91c1c;
}
.bigo-card.on-fact::before {
  background: #7f1d1d;
}
.complexity-label {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.bigo-card.o1 .complexity-label {
  color: var(--accent);
}
.bigo-card.ologn .complexity-label {
  color: #0066ff;
}
.bigo-card.on .complexity-label {
  color: var(--accent3);
}
.bigo-card.onlogn .complexity-label {
  color: #ea580c;
}
.bigo-card.on2 .complexity-label {
  color: var(--accent4);
}
.bigo-card.o2n .complexity-label {
  color: #b91c1c;
}
.bigo-card.on-fact .complexity-label {
  color: #7f1d1d;
}
.complexity-name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.complexity-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.complexity-example {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--surface2);
  border-radius: 4px;
  border-left: 3px solid;
}
.bigo-card.o1 .complexity-example {
  border-color: var(--accent);
}
.bigo-card.ologn .complexity-example {
  border-color: #0066ff;
}
.bigo-card.on .complexity-example {
  border-color: var(--accent3);
}
.bigo-card.onlogn .complexity-example {
  border-color: #ea580c;
}
.bigo-card.on2 .complexity-example {
  border-color: var(--accent4);
}
.bigo-card.o2n .complexity-example {
  border-color: #b91c1c;
}
.bigo-card.on-fact .complexity-example {
  border-color: #7f1d1d;
}

/* ── DSA-SPECIFIC: DATA STRUCTURES ── */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.ds-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.ds-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 102, 255, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.ds-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.ds-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.ds-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

/* ── DSA-SPECIFIC: PATTERNS ── */
.patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.pattern-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.pattern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.pattern-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.pattern-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 28px;
}
.pattern-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}
.pattern-body {
  padding: 1.25rem 1.5rem;
}
.pattern-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}
.pattern-when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #6d28d9;
  padding: 0.6rem 0.8rem;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 4px;
  margin-bottom: 1rem;
  line-height: 1.7;
}
.pattern-when strong {
  color: #5b21b6;
}
.example-problems {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.example-problems strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── LEETCODE-SPECIFIC ── */

/* Leetcode header */
header {
  position: relative;
  text-align: center;
  padding: 80px 20px 40px;
  z-index: 1;
}
header h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(
    135deg,
    var(--text) 0%,
    var(--accent) 50%,
    var(--accent2) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px;
  margin: 0 auto 40px;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.stat-easy .stat-num {
  color: var(--accent);
}
.stat-medium .stat-num {
  color: var(--accent3);
}
.stat-hard .stat-num {
  color: var(--accent4);
}
.stat-total .stat-num {
  color: var(--accent5);
}

.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 30px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.filter-btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 7px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent5);
  color: var(--accent5);
  background: rgba(0, 102, 255, 0.06);
}
.filter-btn.easy.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 102, 255, 0.06);
}
.filter-btn.medium.active {
  border-color: var(--accent3);
  color: var(--accent3);
  background: rgba(217, 119, 6, 0.06);
}
.filter-btn.hard.active {
  border-color: var(--accent4);
  color: var(--accent4);
  background: rgba(239, 68, 68, 0.06);
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  transition:
    border-color 0.3s,
    transform 0.2s;
  animation: fadeUp 0.4s ease both;
}
.question-card:hover {
  border-color: rgba(0, 102, 255, 0.3);
  transform: translateY(-1px);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
}
.q-number {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 28px;
}
.q-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}
.topic-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.2);
}
.toggle-icon {
  color: var(--text-muted);
  font-size: 18px;
  min-width: 20px;
  text-align: center;
}
.card-body {
  display: none;
  padding: 0 24px 24px;
}
.card-body.open {
  display: block;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}
.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent5);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 102, 255, 0.15);
}
.problem-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 20px;
  font-family: var(--mono);
}
.complexity-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.complexity-item {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.complexity-item span {
  color: var(--accent);
  font-weight: 600;
}
.explanation {
  background: rgba(0, 102, 255, 0.04);
  border-left: 3px solid var(--accent5);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-muted);
  font-family: var(--mono);
}
.explanation strong {
  color: var(--text);
}

/* Leetcode pre blocks */
.question-card pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 16px;
  position: relative;
}
.question-card pre::before {
  content: "JAVA";
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.question-card code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text);
}

/* GitHub profile link */
.github-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 22px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.github-profile-link:hover {
  background: rgba(0, 102, 255, 0.06);
  border-color: var(--accent);
  color: var(--accent);
}

/* Leetcode header tag */
.header-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent5);
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.2);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

/* ── SCROLL ANIMATION ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── FOOTER ── */
footer,
.footer {
  padding: 3rem 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
footer span {
  color: var(--accent);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem;
  }
  .hero h1 {
    font-size: clamp(2rem, 6vw, 4rem);
  }
  .hero-stats {
    gap: 1.5rem;
  }
  .container {
    padding: 0 1.5rem;
  }
  .card-grid,
  .tip-grid,
  .ds-grid,
  .patterns-grid {
    grid-template-columns: 1fr;
  }
  .bigo-grid {
    grid-template-columns: 1fr;
  }
  .step {
    flex-direction: column;
    gap: 1rem;
  }
  .vs-table {
    grid-template-columns: 1fr;
  }
  .toc-brand {
    display: none;
  }
  nav a,
  .toc a {
    font-size: 0.76rem;
    padding: 5px 9px;
  }
}
