/* Functional Rust Website Styles */
/* ⚠️  STATIC FILE — not regenerated by generate-site.ts
   If you add new CSS classes to generate-site.ts templates,
   you MUST also add the styles here. */

:root {
  --rust-orange:   #ff7b00;
  --rust-dark:     #1a1a1a;
  --ocaml-orange:  #ec6813;
  --bg-dark:       #0d1117;
  --bg-light:      #161b22;
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --border-color:  #30363d;
  --success-green: #2ea043;
  /* Theme-aware variables (overridden in light mode) */
  --bg-hover:        #1c2130;
  --bg-card-active:  #161929;
  --bg-count-tint:   rgba(255,255,255,0.08);
  --bg-count-strong: rgba(255,255,255,0.2);
  --bg-stripe:       rgba(255,255,255,0.02);
  --bg-inline:       #0d1117;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--rust-orange), var(--ocaml-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Progress Bar */
.progress-bar {
  background: var(--bg-dark);
  border-radius: 8px;
  height: 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rust-orange), var(--ocaml-orange));
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

/* Intro Section */
.intro {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.intro h2 {
  margin-bottom: 1rem;
  color: var(--rust-orange);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.feature h3 {
  margin-bottom: 0.5rem;
  color: var(--ocaml-orange);
  font-size: 1.1rem;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Search */
.search-section {
  margin-bottom: 3rem;
}

.search-box {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.3s;
}

.search-box:focus {
  outline: none;
  border-color: var(--rust-orange);
}

/* Category Sections */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  color: var(--rust-orange);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

/* Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.example-card {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.example-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--rust-orange), var(--ocaml-orange));
  transform: scaleY(0);
  transition: transform 0.3s;
}

.example-card:hover {
  border-color: var(--rust-orange);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.example-card:hover::before {
  transform: scaleY(1);
}

.example-number {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.example-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  background: var(--success-green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Example Page */
.example-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--rust-orange);
}

.example-meta {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Code Section */
.code-section {
  margin: 2rem 0;
}

.code-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-button {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
}

.tab-button.active {
  background: var(--rust-orange);
  border-color: var(--rust-orange);
  color: white;
}

.tab-button:hover:not(.active) {
  background: var(--bg-dark);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.code-block {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-block.ocaml {
  border-left: 4px solid var(--ocaml-orange);
}

.code-block.rust {
  border-left: 4px solid var(--rust-orange);
}

/* Navigation */
.navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  margin: 3rem 0;
  align-items: center;
}

.nav-button {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s;
  font-weight: 600;
}

.nav-button:hover {
  background: var(--rust-orange);
  border-color: var(--rust-orange);
  color: white;
}

.nav-button.home {
  background: var(--rust-orange);
  border-color: var(--rust-orange);
  color: white;
}

.nav-button.prev {
  justify-self: start;
}

.nav-button.next {
  justify-self: end;
}

/* Comparison Section */
.comparison-section {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
}

.comparison-section h2 {
  color: var(--success-green);
  margin-bottom: 1.5rem;
}

.comparison-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.comparison-content th,
.comparison-content td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.comparison-content th {
  background: var(--bg-dark);
  font-weight: 600;
}

/* ── Topic cards grid ────────────────────────────────── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0 24px;
}

.topic-card {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--topic-color, var(--rust-orange));
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topic-card:hover {
  border-color: var(--topic-color, var(--rust-orange));
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.topic-emoji { font-size: 1.5rem; margin-bottom: 4px; }
.topic-name  { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.topic-count { font-size: 0.75rem; color: var(--topic-color, var(--rust-orange)); font-weight: 600; }
.topic-desc  { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; margin-top: 4px; }
.topic-levels{ font-size: 0.7rem; color: var(--text-secondary); margin-top: auto; padding-top: 6px; }

/* Minimal site header for sub-pages (path pages, example pages) */
.site-mini-header {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}
.site-mini-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rust-orange);
  text-decoration: none;
}
.site-mini-title:hover { opacity: 0.85; }

/* Top nav breadcrumb bar (used on path pages + example pages) */
.page-breadcrumb {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  font-size: 0.9rem;
}
.page-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.page-breadcrumb a:hover { color: var(--rust-orange); }
.example-nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-sep { color: var(--border-color); }

/* Breadcrumb button (matches breadcrumb link style, used for in-page back navigation) */
.breadcrumb-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.breadcrumb-btn:hover { color: var(--rust-orange); }

/* Bottom of a drilled-down section */
.section-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.topic-section-title { font-size: 1.1rem; margin: 0 0 4px 0; }

.topic-examples-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: 10px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border: 1px solid var(--border-color);
}

.topic-emoji-lg { font-size: 2rem; flex-shrink: 0; }

.back-to-topics {
  margin-left: auto;
  background: var(--rust-orange);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.back-to-topics:hover { opacity: 0.85; }

/* ── Path cards (homepage view 3) ────────────────────── */
.paths-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 24px;
}

.path-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--path-color, var(--rust-orange));
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.path-card:hover {
  background: var(--bg-hover);
  border-color: var(--path-color, var(--rust-orange));
  transform: translateX(4px);
}

.path-emoji  { font-size: 1.8rem; flex-shrink: 0; width: 2.4rem; text-align: center; }
.path-content{ flex: 1; min-width: 0; }
.path-name   { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.path-tagline{ font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.path-meta   { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.path-count  {
  background: var(--bg-count-tint);
  color: var(--path-color, var(--rust-orange));
  border: 1px solid var(--path-color, var(--rust-orange));
  border-radius: 12px; padding: 2px 9px; font-size: 0.75rem; font-weight: 700;
}
.path-for    { font-size: 0.75rem; color: var(--text-secondary); }
.path-arrow  { font-size: 1.2rem; color: var(--path-color, var(--rust-orange)); opacity: 0.6; flex-shrink: 0; transition: transform 0.2s; }
.path-card:hover .path-arrow { opacity: 1; transform: translateX(3px); }

/* ── Path detail page ─────────────────────────────────── */
.path-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, color-mix(in srgb, var(--path-color) 10%, var(--bg-dark)) 100%);
  border-bottom: 2px solid var(--path-color, var(--rust-orange));
  padding: 2rem 0;
}

.path-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.path-hero-emoji { font-size: 3rem; flex-shrink: 0; }
.path-tagline-lg { font-size: 1rem; color: var(--text-secondary); margin: 0.3rem 0; }
.path-description { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; max-width: 600px; }
.path-hero-meta  { display: flex; gap: 16px; margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-secondary); }

.path-start-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}
.path-start-btn:hover { opacity: 0.85; }

.path-page { padding: 2rem 0; }

.path-examples-list { display: flex; flex-direction: column; gap: 6px; }

.path-example-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
}
.path-example-row:hover {
  border-color: var(--rust-orange);
  background: var(--bg-hover);
  transform: translateX(3px);
}

.path-step    { font-size: 0.7rem; color: var(--text-secondary); min-width: 20px; text-align: right; }
.path-ex-num  { font-size: 0.75rem; color: var(--text-secondary); min-width: 36px; }
.path-ex-title{ flex: 1; font-size: 0.9rem; }
.path-arrow-sm{ color: var(--text-secondary); font-size: 0.85rem; }

.diff-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--bg-count-tint); }

/* ── Markdown tables in comparison sections ───────────── */
.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}
.md-table th {
  background: var(--bg-light);
  color: var(--rust-orange);
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
}
.md-table td {
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.5;
}
.md-table tr:nth-child(even) td { background: var(--bg-stripe); }
.md-table tr:hover td { background: rgba(224,93,38,0.05); }

/* ── Concept video embed (example pages) ─────────────── */
.concept-video-section {
  margin: 0 0 2rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-light);
}
.concept-video-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
}
.concept-video-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rust-orange);
}
.concept-video-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.concept-video {
  width: 100%;
  display: block;
  background: var(--bg-inline);
}

/* ── Path trailer (path pages) — compact banner ───────── */
.path-trailer-wrap {
  margin: 0 0 1.5rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-inline);
  max-height: 200px;
  display: flex;
  justify-content: center;
}
.path-trailer-wrap video {
  display: block;
  height: 200px;
  width: auto;
  object-fit: contain;
  background: var(--bg-inline);
}

/* Coming Soon panel */
.coming-soon-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 2rem;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  text-align: center;
  color: var(--text-secondary);
}

.coming-soon-icon {
  font-size: 2.5rem;
  animation: pulse 2s infinite;
}

.coming-soon-panel strong {
  font-size: 1.1rem;
  color: var(--rust-orange);
}

.coming-soon-panel p {
  font-size: 0.875rem;
  margin: 0;
  max-width: 320px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* OCaml reveal (collapsible in comparison section) */
.ocaml-reveal {
  margin: 1rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.ocaml-reveal summary {
  padding: 0.6rem 1rem;
  cursor: pointer;
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.ocaml-reveal summary::-webkit-details-marker { display: none; }

.ocaml-reveal summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.ocaml-reveal[open] summary::before {
  transform: rotate(90deg);
}

.ocaml-reveal summary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ocaml-reveal[open] summary {
  border-bottom: 1px solid var(--border-color);
}

.ocaml-reveal pre {
  margin: 0;
  border-radius: 0;
  border: none;
}

/* Footer */
footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
}

footer a {
  color: var(--rust-orange);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .examples-grid {
    grid-template-columns: 1fr;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .navigation {
    grid-template-columns: 1fr;
  }
  
  .nav-button.prev,
  .nav-button.next {
    justify-self: stretch;
  }
}

/* ===== PROGRESSIVE LEVELS (added 2026-03-03) ===== */

/* Level cards (replaces old tab strip) */
.level-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 24px;
}

.level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--lc, var(--rust-orange));
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.level-card:hover {
  border-color: var(--lc, var(--rust-orange));
  background: var(--bg-hover);
  transform: translateX(4px);
}

.level-card.active {
  border-color: var(--lc, var(--rust-orange));
  background: var(--bg-card-active);
  box-shadow: 0 0 0 1px var(--lc);
}

.lc-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 2.4rem;
  text-align: center;
}

.lc-content { flex: 1; min-width: 0; }

.lc-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.lc-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.lc-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.lc-count {
  background: var(--bg-count-tint);
  color: var(--lc, var(--rust-orange));
  border: 1px solid var(--lc, var(--rust-orange));
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 700;
}

.lc-for {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.lc-arrow {
  font-size: 1.2rem;
  color: var(--lc, var(--rust-orange));
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.level-card:hover .lc-arrow,
.level-card.active .lc-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.level-count {
  background: var(--bg-count-strong);
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 700;
}

/* Level sections */
.level-section { display: none; margin-bottom: 40px; }
.level-section.active { display: block; }

.levels-container.active { display: block; }

.level-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.level-header h2 { color: var(--rust-orange); font-size: 1.4rem; }
.level-desc { color: var(--text-secondary); font-size: 13px; flex: 1; }
.level-badge {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* Level-coloured cards */
.example-card.level-1 { border-left: 3px solid #2ea043; }
.example-card.level-2 { border-left: 3px solid #1f6feb; }
.example-card.level-3 { border-left: 3px solid var(--rust-orange); }
.example-card.level-4 { border-left: 3px solid #db61a2; }
.example-card.level-5 { border-left: 3px solid #f85149; }

/* Example card meta row */
.example-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
/* Shared pill style for topic and path badges on cards */
.topic-pill, .path-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.category-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Difficulty badges on example pages */
.diff-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.diff-beginner     { background: #0d2a0f; color: #2ea043; border: 1px solid #2ea043; }
.diff-intermediate { background: #0d1e3a; color: #1f6feb; border: 1px solid #1f6feb; }
.diff-advanced     { background: #2d1800; color: var(--rust-orange); border: 1px solid var(--rust-orange); }
.diff-expert       { background: #2d0a24; color: #db61a2; border: 1px solid #db61a2; }
.diff-master       { background: #2d0a0a; color: #f85149; border: 1px solid #f85149; }

/* Improved example-meta on example pages */
.example-meta { font-size: 13px; color: var(--text-secondary); margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Level-based difficulty badges (replaces text-based) */
.diff-level1 { background: #0d2a0f; color: #2ea043; border: 1px solid #2ea043; }
.diff-level2 { background: #0d1e3a; color: #1f6feb; border: 1px solid #1f6feb; }
.diff-level3 { background: #2d1800; color: #ff7b00; border: 1px solid #ff7b00; }
.diff-level4 { background: #2d0a24; color: #db61a2; border: 1px solid #db61a2; }
.diff-level5 { background: #2d0a0a; color: #f85149; border: 1px solid #f85149; }

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  border-color: var(--rust-orange);
  color: var(--text-primary);
}

/* ===== SMOOTH THEME TRANSITIONS ===== */
body, header, footer,
.example-card, .level-card, .topic-card, .path-card,
.code-block, .tab-button, .nav-button, .search-box,
.site-mini-header, .page-breadcrumb, .topic-examples-header,
.comparison-section, .concept-video-section, .path-example-row,
.ocaml-reveal summary, .diff-badge, .diff-level1, .diff-level2,
.diff-level3, .diff-level4, .diff-level5,
.diff-beginner, .diff-intermediate, .diff-advanced, .diff-expert, .diff-master,
.category-tag, .coming-soon-panel, .path-header,
.theme-toggle-btn, .search-box, .intro, .feature {
  transition: background-color 0.2s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}
code, pre, code *, pre * { transition: none; }

/* ===== LIGHT MODE ===== */
/* All theme-aware values controlled via CSS variable overrides.
   Only element-specific overrides for things not using CSS vars go here. */
html[data-theme="light"] {
  --bg-dark:         #f0f2f5;
  --bg-light:        #ffffff;
  --bg-hover:        #eef1f7;
  --bg-card-active:  #e8f0fe;
  --bg-count-tint:   rgba(0,0,0,0.05);
  --bg-count-strong: rgba(0,0,0,0.09);
  --bg-stripe:       rgba(0,0,0,0.025);
  --bg-inline:       #f0f2f5;
  --text-primary:    #1f2328;
  --text-secondary:  #57606a;
  --border-color:    #d0d7de;
  --success-green:   #1a7f37;
}

/* Diff badges — override hardcoded dark backgrounds */
html[data-theme="light"] .diff-level1,
html[data-theme="light"] .diff-beginner     { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
html[data-theme="light"] .diff-level2,
html[data-theme="light"] .diff-intermediate { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
html[data-theme="light"] .diff-level3,
html[data-theme="light"] .diff-advanced     { background:#fff7ed; color:#9a3412; border:1px solid #fdba74; }
html[data-theme="light"] .diff-level4,
html[data-theme="light"] .diff-expert       { background:#fdf4ff; color:#86198f; border:1px solid #e879f9; }
html[data-theme="light"] .diff-level5,
html[data-theme="light"] .diff-master       { background:#fef2f2; color:#991b1b; border:1px solid #fca5a5; }

/* Code blocks — light Prism theme */
html[data-theme="light"] pre[class*="language-"] { background: var(--bg-dark) !important; }
html[data-theme="light"] code[class*="language-"] { text-shadow: none !important; }

/* Path header gradient adapts via --bg-dark override */
/* No extra rule needed — color-mix() picks up the new --bg-dark automatically */

/* Search box placeholder */
html[data-theme="light"] .search-box::placeholder { color: #9ca3af; }

.code-block.other {
  border-left: 4px solid #6c757d;
}
