:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-code: #1c2333;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --border: #30363d;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --ps-color: #e8792e;
  --vba-color: #8250df;
  --js-color: #d9a200;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 0 20px;
}

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

header {
  text-align: center;
  padding: 60px 20px 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

header h1 { font-size: 2.5em; margin-bottom: 12px; }
header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: 1.1em; }
header .subtitle { margin-top: 8px; font-size: 0.9em; color: var(--text-muted); }

main { max-width: 900px; margin: 0 auto; }

section { margin-bottom: 50px; }

h2 {
  font-size: 1.4em;
  margin-bottom: 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Steps */
.steps { display: flex; gap: 20px; flex-wrap: wrap; }
.step {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  position: relative;
}
.step-num {
  position: absolute;
  top: -10px;
  left: 15px;
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
}
.step h3 { margin-bottom: 8px; font-size: 1em; }
.step p { color: var(--text-muted); font-size: 0.9em; }

/* Tutorial cards */
.tutorial-list { display: flex; flex-direction: column; gap: 12px; }

.tutorial-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.2s;
}
.tutorial-card:hover { border-color: var(--accent); text-decoration: none; }

.tutorial-num {
  font-size: 2em;
  font-weight: bold;
  color: var(--text-muted);
  min-width: 40px;
  line-height: 1;
}

.tutorial-body h3 {
  margin-bottom: 6px;
  font-size: 1.05em;
  border: none;
  padding: 0;
  color: var(--text);
}

.tutorial-body p {
  color: var(--text-muted);
  font-size: 0.9em;
}

.tag {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag.powershell { background: #e8792e22; color: var(--ps-color); }
.tag.vba { background: #8250df22; color: var(--vba-color); }
.tag.javascript { background: #d9a20022; color: var(--js-color); }

/* Tools */
.tools ul { list-style: none; }
.tools li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95em;
  color: var(--text-muted);
}
.tools li:last-child { border-bottom: none; }

footer {
  text-align: center;
  padding: 30px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9em;
}

/* ===== Tutorial page styles ===== */

.tutorial-header {
  margin-bottom: 30px;
}
.tutorial-header h1 { font-size: 1.8em; margin: 10px 0; }
.tutorial-header .meta { color: var(--text-muted); font-size: 0.9em; }
.tutorial-header .meta span { margin-right: 20px; }

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.9em;
}

.step-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.step-section h3 {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-section h3 .step-badge {
  background: var(--accent);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  flex-shrink: 0;
}

.step-section p, .step-section ul { color: var(--text-muted); margin-bottom: 12px; }
.step-section ul { padding-left: 20px; }
.step-section li { margin-bottom: 4px; }

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  line-height: 1.5;
  margin: 12px 0;
  position: relative;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block .filename {
  display: block;
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.output-green { color: var(--green); }
.output-yellow { color: var(--yellow); }
.output-red { color: var(--red); }
.output-dim { color: var(--text-muted); }

.diff-add { color: var(--green); }
.diff-remove { color: var(--red); }

.verdict {
  background: var(--bg-card);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.verdict h4 { color: var(--green); margin-bottom: 8px; }

@media (max-width: 600px) {
  header h1 { font-size: 1.8em; }
  .steps { flex-direction: column; }
  .tutorial-card { flex-direction: column; gap: 10px; }
  .tutorial-num { font-size: 1.5em; }
}
