/* ============================================================================
   CodeProven — industrial workshop layer
   ----------------------------------------------------------------------------
   Loaded after the app stylesheet, so it wins on equal specificity. It never
   touches content: it re-points the site's own design tokens at an industrial
   palette and restyles the structural classes the app already uses. Nothing
   here is expressed as a width or a position, so no layout depends on it and
   the site still works if this file fails to load.

   Direction: matte charcoal ground, gunmetal panels, safety orange for
   actions, zinc yellow for caution, terminal cyan for live/active state.
   Hard 1px borders, zero corner radius, dot-matrix ground, hazard striping on
   anything that carries a warning.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
  font-family: 'Oswald';
  src: url('/fonts/oswald.ttf') format('truetype-variations');
  font-weight: 200 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.ttf') format('truetype');
  font-weight: 500 700;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */

:root,
.light,
.dark {
  --background: #1c1a1a;
  --foreground: #e8e6e3;
  --card: #232529;
  --card-foreground: #e8e6e3;
  --popover: #232529;
  --popover-foreground: #e8e6e3;
  --primary: #ff6b35;
  --primary-foreground: #1a0e07;
  --secondary: #2d3142;
  --secondary-foreground: #d6d9e0;
  --muted: #26282c;
  --muted-foreground: #9aa0a6;
  --accent: #00f5d4;
  --accent-foreground: #06201c;
  --destructive: #ff4d4d;
  --destructive-foreground: #fff2ee;
  --border: #e8e6e32e;
  --input: #e8e6e333;
  --ring: #ff6b35;
  --sidebar: #191b1e;
  --sidebar-foreground: #e8e6e3;
  --sidebar-primary: #ff6b35;
  --sidebar-primary-foreground: #17120d;
  --sidebar-accent: #2d3142;
  --sidebar-accent-foreground: #e8e6e3;
  --sidebar-border: #e8e6e32e;
  --sidebar-ring: #ff6b35;
  --radius: 0;

  /* Additions the industrial layer introduces. */
  --tool-yellow: #ffd166;
  --tool-cyan: #00f5d4;
  --steel-1: #2a2d31;
  --steel-2: #202226;
  --grid-line: #e8e6e30f;
  --hazard: repeating-linear-gradient(
    -45deg,
    #2d3142 0 14px,
    #ff6b35 14px 28px
  );
}

/* Blueprint variant, kept so the site's own light/dark switch still means
   something: same engineering drawing, printed on paper instead of steel. */
.light {
  --background: #e9e7e2;
  --foreground: #1c1a1a;
  --card: #f4f2ee;
  --card-foreground: #1c1a1a;
  --popover: #f4f2ee;
  --popover-foreground: #1c1a1a;
  --secondary: #d8d5cf;
  --secondary-foreground: #23252a;
  --muted: #ded9d2;
  --muted-foreground: #55585d;
  --accent: #00706b;
  --accent-foreground: #f4f2ee;
  --border: #1c1a1a2e;
  --input: #1c1a1a33;
  --grid-line: #1c1a1a0f;
}

/* ------------------------------------------------------------- surfaces -- */

html {
  background: var(--background);
}

body {
  font-family: 'JetBrains Mono', 'Share Tech', ui-monospace, monospace;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--foreground);
  background-image:
    radial-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px, 88px 88px;
  background-position: 0 0, 0 0;
}

/* Structure is shown, not implied: nothing is rounded, nothing floats. */
*,
*::before,
*::after {
  border-radius: 0 !important;
}

::selection {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Hard focus ring — visible on every interactive element, on any surface. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ typography -- */

h1, h2, h3, h4,
.hero h1, .section-heading h2, .signal-intro {
  font-family: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
}

h1 { font-weight: 700; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); }
h3 { font-size: 1.12rem; letter-spacing: 0.02em; }

/* The site's em-dash italic accents become a struck-through industrial label
   instead: same hierarchy, no script-adjacent styling. */
h1 i, h2 i, h3 i {
  font-style: normal;
  color: var(--primary);
}

p { max-width: 68ch; }

code, kbd, pre, .mono, samp {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------------------------------------------------------------- chrome -- */

.site-header {
  background: color-mix(in srgb, var(--background) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.site-header a {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12.5px;
}

.site-header nav a {
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  border-bottom-color: var(--primary);
  color: var(--foreground);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--steel-2);
}

/* --------------------------------------------------------------- blocks -- */

.button,
.button-primary,
.button-dark,
.button-light,
.button-outline {
  border: 1px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12.5px;
  font-weight: 500;
  padding: 0.7em 1.15em;
  transition: background-color 120ms linear, color 120ms linear, transform 120ms linear;
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.button-primary:hover {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

.button-outline,
.button-dark,
.button-light {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.button-outline:hover,
.button-dark:hover,
.button-light:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.button:active, .button-primary:active { transform: translateY(1px); }

.text-link {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
}

.text-link:hover { border-bottom-color: var(--primary); }

/* Panels: a flat plate with an exposed edge and a brushed-steel shadow. */
.project-card,
.category-row,
.download-item,
.stat,
.course-module,
.faq-item,
.legal-section,
.library-controls,
.track-progress,
.lesson-list > li,
.home-project-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 #ffffff0a,
    0 1px 0 #00000059,
    0 10px 22px -18px #000000cc;
}

.project-card:hover,
.home-project-card:hover,
.category-row:hover,
.download-item:hover {
  border-color: var(--primary);
  box-shadow:
    inset 0 1px 0 #ffffff0f,
    0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent),
    0 14px 26px -20px #000;
}

/* Section headings get a rule and a labelled tick, like a drawing sheet. */
.section-heading {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
}

.section-heading > div > span:first-child,
.eyebrow,
[class*='eyebrow'] {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--tool-yellow);
}

/* ---------------------------------------------------------------- tables -- */

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  background: var(--steel-2);
}

td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

/* ------------------------------------------------------------------ code -- */

pre,
.arduino-preview {
  background: #131417;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tool-cyan);
}

.arduino-preview-titlebar {
  background: var(--steel-1);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
}

.preview-window-dots i {
  background: var(--muted-foreground) !important;
}

.preview-window-dots i:first-child { background: var(--primary) !important; }

.arduino-preview code { color: #d8dee9; }

/* --------------------------------------------------------------- hazard -- */

/* Anything the site already flags as a caution becomes an actual hazard
   plate: striped edge, yellow label, no ambiguity about what it is. */
.detail-note,
.permission-note,
.wireless-consent,
.guide-validation-note,
.lesson-note,
.lesson-board-reference {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--tool-yellow) 45%, var(--border));
  background: color-mix(in srgb, var(--tool-yellow) 7%, var(--card));
  padding: 1rem 1.1rem 1rem 1.35rem;
  overflow: hidden;
}

.detail-note::before,
.permission-note::before,
.wireless-consent::before,
.guide-validation-note::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--hazard);
  background-size: 200% 200%;
}

.detail-note::after,
.guide-validation-note::after {
  content: attr(data-cpx-plate);
  position: absolute;
  top: 0;
  right: 0;
  background: var(--tool-yellow);
  color: #1c1a1a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 2px 8px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- forms -- */

input,
select,
textarea {
  background: var(--steel-2);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0.5rem 0.6rem;
}

input:focus,
select:focus { border-color: var(--primary); }

input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  padding: 0;
}

.search-box::before { color: var(--primary); }

.glass-radio-group,
.select-controls {
  background: var(--steel-2);
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------------- print -- */

@media print {
  .site-header,
  .site-footer,
  .cpx-toolbar,
  .download-grid,
  .arduino-preview-footer,
  .library-controls,
  .course-orbit-visual,
  [data-cpx-hide-print] {
    display: none !important;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    background-image: none !important;
    font-size: 11pt;
  }

  a { color: #000; text-decoration: underline; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; }

  .detail-section,
  .legal-section,
  .faq-item,
  article {
    break-inside: avoid;
    border: 1px solid #bbb !important;
    box-shadow: none !important;
    background: none !important;
  }

  h1, h2, h3 { color: #000; }

  /* Every printed guide carries its own source line. */
  body::after {
    content: 'codeproven.pages.dev — educational project notes. Verify ratings, pinouts and local rules before you build.';
    display: block;
    margin-top: 18pt;
    border-top: 1pt solid #000;
    padding-top: 6pt;
    font-size: 9pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Enhancements added by /assets/bench.js
   ========================================================================== */

/* --- copy button on the sketch preview ---------------------------------- */
.cpx-copy {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  cursor: pointer;
}

.cpx-copy:hover { border-color: var(--primary); color: var(--primary); }
.cpx-copy[data-state='done'] { border-color: var(--tool-cyan); color: var(--tool-cyan); }

/* --- bill of materials -------------------------------------------------- */
.cpx-bom {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.cpx-bom li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
}

.cpx-bom li:last-child { border-bottom: 0; }
.cpx-bom input { margin-top: 3px; flex: none; }
.cpx-bom label { cursor: pointer; }
.cpx-bom input:checked + label { color: var(--muted-foreground); text-decoration: line-through; }

.cpx-meter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.75rem;
}

.cpx-meter b { color: var(--tool-cyan); font-weight: 500; }

.cpx-bar {
  flex: 1;
  height: 6px;
  background: var(--steel-2);
  border: 1px solid var(--border);
}

.cpx-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 180ms linear;
}

/* --- build-step checklist ---------------------------------------------- */
.cpx-steps { list-style: none; counter-reset: cpx-step; padding-left: 0; }

.cpx-steps li {
  counter-increment: cpx-step;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}

.cpx-steps li::before {
  content: counter(cpx-step, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--primary);
  border: 1px solid var(--border);
  text-align: center;
  padding: 2px 0;
  height: fit-content;
}

.cpx-steps input { margin-top: 5px; }
.cpx-steps label { cursor: pointer; display: flex; gap: 0.6rem; }
.cpx-steps input:checked + span { color: var(--muted-foreground); }

.cpx-steps li[data-done='1']::before {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* --- hazard plate ------------------------------------------------------- */
.cpx-hazards {
  border: 1px solid color-mix(in srgb, var(--destructive) 45%, var(--border));
  background: color-mix(in srgb, var(--destructive) 6%, var(--card));
  margin-bottom: 1.4rem;
}

.cpx-hazards > header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--hazard);
  color: #1c1a1a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
}

.cpx-hazards > header b { background: #1c1a1a; color: var(--tool-yellow); padding: 1px 6px; }
.cpx-hazards ul { list-style: none; margin: 0; padding: 0.7rem 1rem; }
.cpx-hazards li { font-size: 13px; padding: 0.15rem 0; }
.cpx-hazards li::before { content: '▚ '; color: var(--destructive); }

/* --- interactive schematic --------------------------------------------- */
.cpx-scope {
  border: 1px solid var(--border);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 20px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 20px 100%,
    #16181b;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

.cpx-scope svg { display: block; width: 100%; height: auto; touch-action: none; }
.cpx-scope svg * { transition: stroke 120ms linear, fill 120ms linear, opacity 120ms linear; }
.cpx-scope svg .cpx-hot { stroke: var(--tool-cyan) !important; }

.cpx-scope[data-trace='1'] svg .cpx-hot {
  filter: drop-shadow(0 0 4px var(--tool-cyan));
}

.cpx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--steel-2);
  padding: 5px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.cpx-toolbar button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
  font: inherit;
  padding: 3px 8px;
  cursor: pointer;
}

.cpx-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.cpx-toolbar button[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.cpx-toolbar .cpx-zoom-readout { margin-left: auto; }

/* --- feedback + keyboard hints (bench dock removed at the owner's request) - */

.cpx-feedback {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.cpx-feedback button {
  background: transparent;
  border: 1px solid var(--border);
  color: inherit;
  font: inherit;
  padding: 2px 7px;
  cursor: pointer;
}

.cpx-feedback button:hover { border-color: var(--primary); color: var(--primary); }
.cpx-feedback button[aria-pressed='true'] { border-color: var(--tool-cyan); color: var(--tool-cyan); }

.cpx-kbd {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 55;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.cpx-kbd kbd {
  background: var(--steel-2);
  border: 1px solid var(--border);
  padding: 0 4px;
  color: var(--foreground);
}

@media (max-width: 640px) {
  .cpx-kbd { display: none; }
}

/* --- part search + card badges (bench.js) ------------------------------- */
.cpx-partbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tool-yellow);
  padding: 0.7rem 0.9rem;
  box-shadow: inset 0 1px 0 #ffffff0a, 0 1px 0 #00000059;
}

.cpx-partbar label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tool-yellow);
}

.cpx-partbar input[type='search'] { flex: 1 1 260px; min-width: 0; }

.cpx-partbar .cpx-feedback { margin: 0; }

.cpx-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
}

.cpx-badges b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 1px 5px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cpx-level { border-color: color-mix(in srgb, var(--tool-cyan) 40%, var(--border)) !important; color: var(--tool-cyan) !important; }
.cpx-level-expert { border-color: var(--destructive) !important; color: var(--destructive) !important; }
.cpx-level-advanced { border-color: var(--primary) !important; color: var(--primary) !important; }
.cpx-haz { border-color: color-mix(in srgb, var(--tool-yellow) 45%, var(--border)) !important; color: var(--tool-yellow) !important; }

/* A card that does not match the part search recedes rather than disappears:
   the app's own filter is still in charge of what is on screen. */
[data-cpx-part='0'] .project-card-copy,
[data-cpx-part='0'] h3 {
  opacity: 0.3;
}

[data-cpx-part='1'] .project-card-top { border-left: 2px solid var(--tool-cyan); padding-left: 8px; }

/* --- traced wiring ------------------------------------------------------ */
@keyframes cpx-flow {
  to { stroke-dashoffset: -32; }
}

.cpx-scope svg .cpx-flow {
  stroke-dasharray: 7 9;
  animation: cpx-flow 900ms linear infinite;
}

/* --- bill of materials cross-reference ---------------------------------- */
.cpx-bom li[data-cpx-hit='1'] {
  background: color-mix(in srgb, var(--tool-cyan) 12%, transparent);
  outline: 1px solid color-mix(in srgb, var(--tool-cyan) 40%, transparent);
}

.cpx-hazards li { color: var(--foreground); }

/* --- bill of materials / step rows, after the insert-only rewrite -------- */
.cpx-bom li[data-owned='1'] { color: var(--muted-foreground); }
.cpx-bom li[data-owned='1'] { text-decoration: line-through; }
.cpx-bom li input { margin-top: 4px; }

.cpx-steps { list-style: none; counter-reset: cpx-step; padding-left: 0; }
.cpx-steps li {
  counter-increment: cpx-step;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}
.cpx-steps li input { grid-column: 1; grid-row: 1; margin: 5px 0 0; }
.cpx-steps li > :not(input) { grid-column: 2; }
.cpx-steps li::before {
  content: counter(cpx-step, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--primary);
  border: 1px solid var(--border);
  text-align: center;
  padding: 1px 0;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}
.cpx-steps li[data-done='1'] { color: var(--muted-foreground); }
.cpx-steps li[data-done='1']::before {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ============================================================================
   Dark-surface repairs
   ----------------------------------------------------------------------------
   The app was authored light-first: several components set a dark text colour
   directly (#20251f, #4e5049, #765034) and only corrected it under `.light`,
   or relied on a pale panel background that the industrial layer replaces with
   a dark plate. Against a dark plate those values match the surface and the
   text disappears. Every selector below is one of those cases, re-pointed at
   the theme tokens.
   ========================================================================== */

.home-project-card { color: var(--foreground); background: var(--card); border-color: var(--border); }
.home-project-card h3 { color: var(--foreground); }
.home-project-card p { color: var(--muted-foreground); }
.home-project-meta { color: var(--tool-yellow); }
.home-project-status { color: var(--muted-foreground); }

.faq-item summary { color: var(--foreground); }
.faq-item summary span { color: var(--primary); }
.faq-item p { color: var(--muted-foreground); }

.detail-meta b { color: var(--muted-foreground); }
.detail-meta span { color: var(--foreground); }

.download-item { color: var(--primary); background: var(--card); }
.download-item b { color: var(--foreground); }
.download-item small { color: var(--muted-foreground); }
.download-item.is-coming { color: var(--muted-foreground); }
.download-item.is-coming b { color: var(--muted-foreground); }

.course-module { background: var(--card); color: var(--foreground); border-color: var(--border); }
.course-module h3 { color: var(--foreground); }
.course-module p, .course-module span { color: var(--muted-foreground); }
.course-module.module-dark { background: var(--steel-1); color: var(--foreground); border-color: var(--border); }
.course-module.module-dark h3 { color: var(--foreground); }
.course-module.module-dark span { color: var(--muted-foreground); }

.collection-switch-label, .collection-switch-note { color: var(--muted-foreground); }
.lesson-board-reference figcaption { color: var(--muted-foreground); }

.category-row { color: var(--muted-foreground); }
.category-name { color: var(--foreground); }
.category-blurb, .category-count { color: var(--muted-foreground); }

.stat span { color: var(--muted-foreground); }
.signal-note { color: var(--muted-foreground); }
.signal-note em { color: var(--tool-cyan); font-style: normal; }
.signal-intro { color: var(--foreground); }

.contribute-copy p, .about-founder-preview p, .library-hero p,
.course-hero-copy > p, .community-hero p { color: var(--muted-foreground); }

.lesson-question { color: var(--primary); }
.lesson-explanation h3, .lesson-check h3, .course-sources h2 { color: var(--foreground); }
.lesson-explanation li, .lesson-check p, .course-sources > p, .course-sources li { color: var(--muted-foreground); }

.wireless-consent b, .detail-section a { color: var(--primary); }
.permission-note span { color: var(--muted-foreground); }

.site-footer, .signal-strip { color: var(--muted-foreground); }
.footer-note, .footer-links a, .footer-links button, .footer-label, .footer-bottom { color: var(--muted-foreground); }
.footer-links a:hover, .footer-links button:hover { color: var(--foreground); }

.legal-section h2 { color: var(--foreground); }
.legal-section p, .legal-hero p { color: var(--muted-foreground); }

/* Belt and braces: anything the runtime audit cannot measure still inherits a
   light colour on a dark page. */
html.dark body, html.dark main { color: var(--foreground); }

/* ---------------------------------------------------------------------------
   Theme switching is off. Dark is the site, not a preference: a light variant
   that half the components were never checked against is not a feature.
   -------------------------------------------------------------------------- */
[data-slot='theme-toggle'], .theme-toggle, .theme-switcher,
[aria-label^='Switch to'] { display: none !important; }

/* --- preview build stamp ------------------------------------------------- */
.cpx-build {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 58;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--muted-foreground) 70%, transparent);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  border: 1px solid var(--border);
  padding: 2px 7px;
  pointer-events: none;
}

@media print { .cpx-build { display: none; } }

/* --- the header mark ------------------------------------------------------ */
/* The app sized the logo to a 148×54 box and cropped it with object-fit:
   cover, which cut the top and bottom off the wordmark. The mark is now shown
   whole, at a height the header can actually hold. */
.brand-logo,
.brand {
  width: auto !important;
  height: 30px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.brand { height: auto !important; }

.site-header .brand-logo { filter: none !important; }

@media (max-width: 640px) {
  .brand-logo { height: 24px !important; }
}

/* --- the quotes band ------------------------------------------------------
   Injected after the app's own markup, so it sits below the footer and cannot
   be re-rendered away. Dark plate, accent rule on the left, monospace
   attribution — the same language as the rest of the industrial layer. */
.cpx-quotes {
  background: var(--steel-1, #14161a);
  border-top: 1px solid var(--border, #3a3f47);
  padding: 3rem 1.25rem 3.25rem;
}

.cpx-quotes-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.cpx-quotes h2 {
  font-family: "Oswald", var(--font-display, inherit);
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: var(--foreground, #e9e6df);
}

.cpx-quotes-lede {
  margin: 0 0 1.75rem;
  max-width: 46rem;
  color: var(--muted-foreground, #b9b4a8);
  font-size: 0.95rem;
}

.cpx-quotes-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.cpx-quotes-grid li {
  margin: 0;
}

.cpx-quotes-grid blockquote {
  margin: 0;
  height: 100%;
  background: var(--steel-2, #1b1e23);
  border: 1px solid var(--border, #3a3f47);
  border-left: 3px solid var(--accent, #d8a04a);
  border-radius: 0.5rem;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
}

.cpx-quotes-grid p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--foreground, #e9e6df);
}

.cpx-quotes-grid cite {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground, #8a857a);
  font-style: normal;
}

.cpx-quotes-rule {
  background: var(--steel-2, #1b1e23);
  border: 1px dashed var(--border, #3a3f47);
  border-radius: 0.5rem;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
}

.cpx-quotes-rule p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--foreground, #e9e6df);
}

.cpx-quotes-rule b {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #d8a04a);
  margin-bottom: 0.35rem;
}

.cpx-quotes-rule cite {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground, #8a857a);
  font-style: normal;
}
