/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --warm: #ff6b35;
  --warm-dim: rgba(255, 107, 53, 0.15);
  --success: #4caf50;
  --warning: #ffc107;
  --danger: #f44336;
  --radius: 8px;
  --max-w: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* ===== SECTIONS ===== */
section {
  padding: 80px 24px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ===== HERO ===== */
.hero {
  padding-top: 140px;
  padding-bottom: 100px;
  text-align: center;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  border-radius: 50px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
  text-decoration: none;
  color: #000;
}

/* ===== MANAGER CALLOUT (hero) ===== */
.manager-callout {
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.manager-callout-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.manager-callout-img {
  flex-shrink: 0;
  width: 360px;
  margin-right: -80px;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

img.manager-callout-img {
  display: block;
}

/* placeholder version */
.manager-callout-img.img-placeholder {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .manager-callout {
    flex-direction: column;
  }

  .manager-callout-text {
    padding-right: 0;
  }

  .manager-callout-img {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    margin-top: 16px;
  }
}

/* ===== HOW IT WORKS ===== */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.how-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.how-icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}

.how-card h3 {
  margin-bottom: 8px;
}

.how-card p {
  color: var(--text-muted);
  font-size: 15px;
}

.how-arrow {
  display: none;
}

/* ===== PARTS LIST ===== */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.part-card h3 {
  font-size: 15px;
}

.part-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.part-card .part-note {
  font-size: 12px;
  color: var(--accent);
}

/* ===== PCB IMAGES ===== */
.pcb-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pcb-images img {
  width: 100%;
  border: 1px solid var(--border);
}

@media (max-width: 480px) {
  .pcb-images {
    grid-template-columns: 1fr;
  }
}

/* ===== IMAGE PLACEHOLDER ===== */
.img-placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 24px 0;
}

.img-placeholder .label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

/* ===== STEPS ===== */
.steps {
  counter-reset: step;
  margin-top: 32px;
}

.step {
  position: relative;
  padding-left: 56px;
  margin-bottom: 40px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.step h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.step p, .step ul {
  color: var(--text-muted);
  font-size: 15px;
}

.step ul {
  margin-top: 8px;
  padding-left: 20px;
}

.step li {
  margin-bottom: 4px;
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

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

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-muted);
}

/* ===== CODE BLOCKS ===== */
code {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

/* ===== LED STATUS ===== */
.led-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.led-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.led-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.led-dot.blue { background: #2196f3; box-shadow: 0 0 8px #2196f3; }
.led-dot.cyan { background: #00bcd4; box-shadow: 0 0 8px #00bcd4; }
.led-dot.green { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.led-dot.red { background: #f44336; box-shadow: 0 0 8px #f44336; }
.led-dot.yellow { background: #ffc107; box-shadow: 0 0 8px #ffc107; }
.led-dot.white { background: #fff; box-shadow: 0 0 8px #fff; }
.led-dot.purple { background: #9c27b0; box-shadow: 0 0 8px #9c27b0; }

.led-label {
  font-size: 14px;
}
.led-label strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.led-label span {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== DOWNLOAD BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
  text-decoration: none;
  color: #000;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ===== FAQ / ACCORDION ===== */
.faq-list {
  margin-top: 24px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  padding: 18px 40px 18px 0;
  cursor: pointer;
  position: relative;
}

.faq-q::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item.open .faq-q::after {
  content: "\2212";
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-a-inner {
  padding: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* ===== CALLOUT ===== */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  margin: 20px 0;
  border-left: 3px solid;
}

.callout-info {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.callout-warn {
  background: var(--warm-dim);
  border-color: var(--warm);
}

/* ===== WIRING DIAGRAM ===== */
.wiring-ascii {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.wiring-ascii pre {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--accent);
}

/* ===== FOOTER ===== */
.footer {
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  list-style: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .parts-grid {
    grid-template-columns: 1fr;
  }

  .step {
    padding-left: 44px;
  }

  .hero {
    padding-top: 110px;
    padding-bottom: 60px;
  }

  section {
    padding: 60px 20px;
  }

  .led-grid {
    grid-template-columns: 1fr;
  }
}
