/* USB Cable Nerve Decoder — Styles */
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #22263a;
  --bg-surface: #141722;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --text-dim: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --border: #2a2e3d;
  --border-light: #373c50;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--accent); color: #fff;
  padding: 8px 16px; z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.1rem;
}
.logo:hover, .logo:focus-visible { text-decoration: none; color: var(--accent); }
.logo-icon { color: var(--accent); flex-shrink: 0; }

.main-nav ul { display: flex; list-style: none; gap: 24px; }
.main-nav a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* Hero */
.hero-section { padding: 60px 0 40px; }
.hero-content { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 520px; margin: 0 auto; }

/* Decoder Card */
.decoder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.decoder-progress {
  height: 4px; background: var(--border);
  border-radius: 2px; margin-bottom: 28px; overflow: hidden;
}
.decoder-progress-bar {
  height: 100%; background: var(--accent);
  border-radius: 2px; transition: width 0.3s ease;
  width: 20%;
}
.decoder-step { display: none; }
.decoder-step.active { display: block; }
.decoder-step h2 { font-size: 1.3rem; margin-bottom: 6px; }
.step-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.option-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.option-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  color: var(--text); cursor: pointer; text-align: left;
  transition: all var(--transition);
  font-family: inherit; font-size: 0.95rem;
}
.option-btn:hover, .option-btn:focus-visible {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}
.option-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.option-label { font-weight: 600; display: block; margin-bottom: 4px; }
.option-desc { font-size: 0.8rem; color: var(--text-muted); }
.connector-svg { width: 48px; height: 32px; margin-bottom: 10px; color: var(--accent); }

.decoder-result { display: none; }
.decoder-result.visible { display: block; }
.result-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.result-content h3 {
  font-size: 1.4rem; color: var(--accent);
  margin-bottom: 12px;
}
.result-specs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin: 16px 0;
}
.result-spec {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.result-spec-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.result-spec-value { font-size: 1.05rem; font-weight: 600; margin-top: 2px; }
.result-note { color: var(--text-muted); font-size: 0.9rem; margin-top: 12px; }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.decoder-back { display: none; margin-top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--bg-surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover, .btn-secondary:focus-visible { border-color: var(--accent); background: var(--bg-card-hover); text-decoration: none; }
.btn-ghost { background: none; color: var(--text-muted); padding: 8px 0; }
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--text); text-decoration: none; }

/* Section styles */
section { padding: 60px 0; }
section:nth-child(even) { background: var(--bg-surface); }
.section-intro { color: var(--text-muted); max-width: 600px; margin-bottom: 32px; }
section h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }

/* Comparison Table */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.comparison-table th {
  background: var(--bg-card); color: var(--text-muted);
  font-weight: 600; text-transform: uppercase; font-size: 0.75rem;
  letter-spacing: 0.05em; padding: 12px 16px;
  text-align: left; border-bottom: 1px solid var(--border);
}
.comparison-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: var(--bg-card-hover); }
.comparison-table td:first-child { font-weight: 600; color: var(--text); }

/* Card Grids */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.info-card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.info-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.info-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Scenario Grid */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.scenario-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  border-left: 3px solid var(--accent);
}
.scenario-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.scenario-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Label Template */
.label-template {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.label-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  font-size: 0.9rem;
}
.label-color { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }

/* Future Grid */
.future-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.future-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.future-card h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--cyan); }
.future-card p { color: var(--text-muted); font-size: 0.9rem; }

/* FAQ */
.faq-list { max-width: 720px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600;
  color: var(--text); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--text-dim); transition: transform var(--transition); }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--bg-card-hover); }
.faq-item p { padding: 0 20px 16px; color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }
.footer-links h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 12px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; }
.footer-bottom p { color: var(--text-dim); font-size: 0.8rem; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-size: 0.9rem; z-index: 1000;
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Responsive */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 16px 20px; }
  .main-nav.open ul { flex-direction: column; gap: 12px; }
  .nav-toggle { display: flex; }
  .hero-section { padding: 40px 0 24px; }
  .decoder-card { padding: 20px; }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  section { padding: 40px 0; }
}

@media (max-width: 480px) {
  .option-grid { grid-template-columns: 1fr; }
  .result-specs { grid-template-columns: 1fr 1fr; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
}

/* Print */
@media print {
  .site-header, .site-footer, .decoder-card, .hero-section, .faq-section { display: none; }
  .labels-section { display: block !important; }
  body { background: #fff; color: #000; }
  .label-item { border: 1px solid #ccc; }
}

/* Focus visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Selection */
::selection { background: var(--accent); color: #fff; }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
