/* HVACBlink — Service-Tech Charcoal & LED Signal Red/Amber */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --ink: #18181b;
  --ink-secondary: #3f3f46;
  --ink-muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --charcoal: #18181b;
  --charcoal-elevated: #27272a;
  --charcoal-border: #3f3f46;

  --led-red: #dc2626;
  --led-red-dark: #991b1b;
  --led-red-soft: #fef2f2;
  --led-amber: #f59e0b;
  --led-amber-dark: #b45309;
  --led-amber-soft: #fffbeb;
  --led-green: #16a34a;
  --led-green-soft: #f0fdf4;
  --led-blue: #2563eb;
  --led-blue-soft: #eff6ff;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.06);
  --shadow-md: 0 6px 18px rgba(24, 24, 27, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--charcoal);
  color: #fff;
  border-bottom: 2px solid var(--led-red);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-logo:hover { text-decoration: none; color: #fff; }

.brand-led-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--led-red);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.9), 0 0 2px #fca5a5 inset;
  animation: headerPulse 2.4s infinite;
}

@keyframes headerPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(220, 38, 38, 0.95); }
  50% { opacity: 0.45; box-shadow: 0 0 4px rgba(220, 38, 38, 0.4); }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: #e4e4e7;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  text-decoration: none;
}

.site-nav a.nav-cta {
  background: var(--led-red);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.site-nav a.nav-cta:hover {
  background: #b91c1c;
}

/* Search Bar */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.search-input {
  width: 100%;
  background: var(--charcoal-elevated);
  border: 1px solid var(--charcoal-border);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

.search-input::placeholder { color: #a1a1aa; }
.search-input:focus {
  outline: none;
  border-color: var(--led-amber);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}

.search-results.open { display: block; }

.search-result-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-muted); text-decoration: none; }

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* Hero + Flagship Decoder Console */
.hero-console {
  background: linear-gradient(180deg, #18181b 0%, #27272a 100%);
  color: #fff;
  padding: 2.25rem 0 2.75rem;
  border-bottom: 1px solid var(--charcoal-border);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--led-amber);
  margin-bottom: 0.6rem;
}

.hero-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.75rem, 3.6vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  color: #d4d4d8;
  max-width: 720px;
  font-size: 1.02rem;
}

/* Diagnostic Console Panel */
.decoder-panel {
  background: #111113;
  border: 1px solid #3f3f46;
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.decoder-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.35rem;
  align-items: start;
}

@media (max-width: 820px) {
  .decoder-grid { grid-template-columns: 1fr; }
}

.decoder-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  margin-bottom: 0.4rem;
}

.decoder-select,
.decoder-input {
  width: 100%;
  background: #18181b;
  color: #fff;
  border: 1px solid #52525b;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.96rem;
  font-family: inherit;
}

.decoder-select:focus,
.decoder-input:focus {
  outline: none;
  border-color: var(--led-amber);
}

.mode-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mode-tab {
  background: #18181b;
  color: #d4d4d8;
  border: 1px solid #3f3f46;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--led-red);
  border-color: var(--led-red);
  color: #fff;
}

.tap-zone {
  background: #18181b;
  border: 1px dashed #52525b;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.tap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 1.2rem;
  background: var(--led-red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
  transition: transform 0.08s, background 0.15s;
  user-select: none;
  touch-action: manipulation;
}

.tap-btn:active {
  transform: scale(0.97);
  background: #b91c1c;
}

.tap-sub-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.btn-ghost-dark {
  background: #27272a;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost-dark:hover { background: #3f3f46; }

.tap-readout {
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--led-amber);
}

/* LED Sight-Glass Housing */
.led-stage {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: var(--radius);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.led-bezel-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.led-bezel {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3f3f46, #09090b 75%);
  border: 3px solid #52525b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.led-diode {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3f1d1d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.06s, box-shadow 0.06s;
}

.led-diode.lit-red {
  background: radial-gradient(circle at 35% 35%, #fecaca, #ef4444 45%, #dc2626 100%);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.95), 0 0 8px rgba(254, 202, 202, 0.8);
}

.led-diode.lit-amber {
  background: radial-gradient(circle at 35% 35%, #fef3c7, #fbbf24 45%, #f59e0b 100%);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.95), 0 0 8px rgba(254, 243, 199, 0.8);
}

.led-diode.lit-green {
  background: radial-gradient(circle at 35% 35%, #dcfce7, #22c55e 45%, #16a34a 100%);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.9);
}

.led-digital-display {
  min-width: 78px;
  height: 52px;
  padding: 0 0.7rem;
  border-radius: 8px;
  background: #09090b;
  border: 2px solid #52525b;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ef4444;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
}

.led-digital-display.active { display: inline-flex; }

.led-meta-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.2rem;
}

.led-meta-pattern {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--led-amber);
}

.decoder-result-body {
  border-top: 1px solid #27272a;
  padding-top: 0.9rem;
  font-size: 0.92rem;
  color: #e4e4e7;
}

.decoder-result-body p { margin: 0 0 0.75rem; }

.decoder-result-list {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  color: #d4d4d8;
}

.decoder-result-list li { margin-bottom: 0.3rem; }

.decoder-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--led-red);
  color: #fff;
}

.btn-primary:hover { background: #b91c1c; color: #fff; }

.btn-amber {
  background: var(--led-amber);
  color: #18181b;
}

.btn-amber:hover { background: #d97706; color: #18181b; }

.btn-outline-dark {
  background: transparent;
  border-color: #52525b;
  color: #fff;
}

.btn-outline-dark:hover { background: #27272a; color: #fff; }

.btn-outline-light {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-outline-light:hover { background: var(--surface-muted); color: var(--ink); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.badge-lockout { background: #fee2e2; color: #991b1b; }
.badge-safety-limit { background: #ffedd5; color: #9a3412; }
.badge-airflow { background: #dbeafe; color: #1e40af; }
.badge-ignition { background: #fef3c7; color: #92400e; }
.badge-electrical { background: #f3e8ff; color: #6b21a8; }
.badge-normal { background: #dcfce7; color: #166534; }

.code-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.88rem;
  background: var(--charcoal);
  color: var(--led-amber);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* Sections & Grids */
.section {
  padding: 2.5rem 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: none;
  border-color: var(--led-red);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin: 0;
  font-size: 1.06rem;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.breadcrumbs a { color: var(--ink-secondary); }
.breadcrumbs a:hover { color: var(--led-red); }

/* Page Header (Subpages) */
.page-hero {
  background: var(--charcoal);
  color: #fff;
  padding: 2rem 0;
  border-bottom: 1px solid var(--charcoal-border);
}

.page-hero .breadcrumbs { color: #a1a1aa; }
.page-hero .breadcrumbs a { color: #e4e4e7; }

.page-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.2;
}

.page-hero p {
  margin: 0;
  color: #d4d4d8;
  max-width: 760px;
}

/* Filter Bar on Brand Hubs */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  background: var(--surface);
}

.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--charcoal);
  color: #fff;
  border-color: var(--charcoal);
}

/* Detail Page Layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.45rem;
  margin-bottom: 1.2rem;
}

.prose-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.22rem;
  letter-spacing: -0.015em;
}

.prose-card h3 {
  margin: 1.1rem 0 0.45rem;
  font-size: 1.02rem;
}

.prose-card p { margin: 0 0 0.8rem; color: var(--ink-secondary); }
.prose-card p:last-child { margin-bottom: 0; }

.check-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink-secondary);
}

.check-list li {
  margin-bottom: 0.5rem;
}

/* Safety Callout */
.callout {
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.2rem;
  border-left: 4px solid;
}

.callout-danger {
  background: var(--led-red-soft);
  border-color: var(--led-red);
  color: #7f1d1d;
}

.callout-amber {
  background: var(--led-amber-soft);
  border-color: var(--led-amber);
  color: #78350f;
}

.callout-info {
  background: var(--led-blue-soft);
  border-color: var(--led-blue);
  color: #1e3a8a;
}

.callout strong { display: block; margin-bottom: 0.25rem; }

/* Part Card */
.part-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--led-amber);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.part-card h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.part-card p { margin: 0 0 0.85rem; font-size: 0.88rem; color: var(--ink-secondary); }

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}

.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.faq-item p {
  margin: 0.5rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.93rem;
}

/* Tool Forms (Capacitor Verifier) */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: inherit;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--led-red);
}

.spec-result-box {
  margin-top: 1.25rem;
  background: var(--charcoal);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
}

.spec-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 0.9rem 0;
}

@media (max-width: 640px) {
  .spec-stat-grid { grid-template-columns: 1fr; }
}

.spec-stat {
  background: var(--charcoal-elevated);
  border: 1px solid var(--charcoal-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.spec-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.spec-stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--led-amber);
  margin-top: 0.2rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--surface-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  background: var(--charcoal);
  color: #a1a1aa;
  border-top: 1px solid var(--charcoal-border);
  padding: 2.25rem 0;
  margin-top: 3rem;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

.site-footer h4 {
  color: #fff;
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: #d4d4d8; }
.site-footer a:hover { color: #fff; }

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid #27272a;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
