/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

/* === Tokens === */
:root {
  --bg: #0A0F1C;
  --surface: #1E293B;
  --inset: #0F172A;
  --cyan: #22D3EE;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-muted: #475569;
  --green: #10B981;
  --yellow: #F59E0B;
  --red: #EF4444;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

html { background: var(--bg); color: var(--text-primary); }
body { font-family: var(--font-sans); line-height: 1.5; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === Nav === */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 0 48px;
}
nav .logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}
nav .nav-links {
  display: flex;
  gap: 32px;
}
nav .nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.15s;
}
nav .nav-links a:hover { color: var(--cyan); }

/* === Footer === */
footer {
  text-align: center;
  padding: 48px;
}
footer ul {
  display: flex;
  justify-content: center;
  gap: 24px;
}
footer li, footer a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
footer a:hover { color: var(--text-tertiary); }

/* === Page wrapper === */
.page-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-body.wide { max-width: 1000px; }

/* === Section label === */
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* === Hero (homepage) === */
.hero {
  text-align: center;
  padding: 80px 24px 0;
}
.hero .prompt {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
}
.hero .subtitle {
  font-size: 17px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

/* === Diagnosis === */
.diagnosis {
  text-align: center;
  margin-top: 56px;
}
.diagnosis .question-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.diagnosis .step-num {
  width: 28px;
  height: 28px;
  border-radius: 100px;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--bg);
  flex-shrink: 0;
}
.diagnosis .step-num.answered {
  background: var(--surface);
  color: var(--cyan);
}
.diagnosis .question {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
}
.diagnosis .question.answered {
  color: var(--text-tertiary);
  font-size: 16px;
}
.diagnosis .options {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.diagnosis .option {
  background: var(--surface);
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  min-width: 180px;
}
.diagnosis .option:hover { border-color: var(--cyan); }
.diagnosis .option.selected { border-color: var(--cyan); }
.diagnosis .browse-link {
  display: block;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.diagnosis .browse-link:hover { color: var(--text-tertiary); }

.diagnosis .step2 { margin-top: 40px; }
.diagnosis .step2-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 680px;
  margin: 0 auto;
}

/* === Choice card (used in step2 and accordion) === */
.choice-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  padding: 18px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.choice-card:hover { background: #253348; }
.choice-card .label { font-size: 15px; font-weight: 500; }
.choice-card .arrow { color: var(--text-tertiary); font-size: 18px; }

/* === Panic callout (homepage) === */
.panic-callout {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  padding: 20px 24px;
  border-radius: 8px;
  max-width: 680px;
  margin: 56px auto 0;
}
.panic-callout .icon { color: var(--cyan); font-size: 24px; flex-shrink: 0; }
.panic-callout h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.panic-callout p { font-size: 13px; color: var(--text-tertiary); line-height: 1.4; }

/* === Code block === */
.code-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--inset);
  padding: 14px 20px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  gap: 12px;
}
.code-block .cmd {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.code-block .prefix { color: var(--cyan); font-weight: 600; flex-shrink: 0; }
.code-block code { color: var(--text-primary); white-space: pre-wrap; word-break: break-all; }
.code-block .copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
  font-size: 14px;
}
.code-block .copy-btn:hover { color: var(--text-secondary); }
.code-block .copy-btn.copied { color: var(--green); }

/* === Explainer === */
.explainer {
  display: flex;
  gap: 12px;
  background: var(--inset);
  padding: 16px 20px;
  border-radius: 6px;
  align-items: flex-start;
}
.explainer .icon { color: var(--cyan); flex-shrink: 0; font-size: 16px; margin-top: 2px; }
.explainer.warning .icon { color: var(--yellow); }
.explainer p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* === Danger badge === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge.safe { background: #065F4620; color: var(--green); }
.badge.safe .dot { background: var(--green); }
.badge.caution { background: #78350F20; color: var(--yellow); }
.badge.caution .dot { background: var(--yellow); }
.badge.danger { background: #7F1D1D20; color: var(--red); }
.badge.danger .dot { background: var(--red); }

/* === Solution page === */
.solution-header { margin-bottom: 40px; }
.solution-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 24px;
  transition: opacity 0.15s;
}
.solution-header .back-link:hover { opacity: 0.8; }
.solution-header h1 {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}
.solution-header .description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Quick answer box === */
.quick-answer {
  background: var(--surface);
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 40px;
}
.quick-answer .section-label { color: var(--cyan); margin-bottom: 16px; }
.quick-answer p { font-size: 15px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.quick-answer .code-block { margin-bottom: 8px; }
.quick-answer .code-block:last-child { margin-bottom: 0; }
.quick-answer .explainer { margin-top: 16px; }

/* === Sub-scenario === */
.scenarios { margin-bottom: 40px; }
.scenarios > .section-label { color: var(--text-tertiary); }
.scenario {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.scenario-header h3 { font-size: 15px; font-weight: 600; }
.scenario > p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.scenario .steps { display: flex; flex-direction: column; gap: 12px; }
.scenario .steps .step-text { font-size: 14px; font-weight: 500; }
.scenario .explainer { margin-top: 16px; }

/* === Problem index grid === */
.category { margin-bottom: 48px; }
.category:last-child { margin-bottom: 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.problem-card {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.15s;
}
.problem-card:hover { background: #253348; }
.problem-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.problem-card h3 { font-size: 15px; font-weight: 600; }
.problem-card .card-desc { font-size: 13px; color: var(--text-tertiary); line-height: 1.4; }
.problem-card .card-cmd {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--cyan);
}

/* === Before you panic page === */
.panic-header .icon { font-size: 32px; color: var(--cyan); margin-bottom: 16px; }
.panic-header h1 {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
}
.panic-header p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 40px;
}
.panic-section { margin-bottom: 40px; }
.panic-section .section-label { color: var(--cyan); }
.panic-section.danger .section-label { color: var(--red); }
.panic-section p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.panic-section ul { padding-left: 8px; }
.panic-section li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.panic-section li::before { content: "• "; }
.checklist {
  background: var(--surface);
  padding: 24px;
  border-radius: 8px;
}
.checklist .section-label { color: var(--cyan); margin-bottom: 16px; }
.check-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.check-item:last-child { margin-bottom: 0; }
.check-item .check {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}
.check-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* === Responsive === */
@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 15px; }
  .diagnosis .options { flex-direction: column; align-items: center; }
  .diagnosis .option { width: 100%; max-width: 300px; }
  .category-grid { grid-template-columns: 1fr; }
  .page-body { padding: 32px 16px 64px; }
  .solution-header h1 { font-size: 24px; }
  .panic-header h1 { font-size: 28px; }
}
