:root {
  --bg: #1a3a6b;
  --bg-card: #1f4275;
  --bg-code: #162f5a;
  --bg-hover: #162030;
  --border: #1c2a3a;
  --border-hover: #2a4060;
  --text: #b8c5d4;
  --text-dim: #5a6a7a;
  --text-bright: #e4ebf2;
  --cyan: #44ccbb;
  --blue: #3d7ab8;
  --green: #4caf93;
  --red: #c96b65;
  --yellow: #d4a84b;
  --magenta: #b07cc6;
  --orange: #d48a4b;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

.glow { height: 3px; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--green)); position: sticky; top: 0; z-index: 100; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px 100px; }

.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--border); margin-bottom: 48px; }
.hero-tag { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--cyan); padding: 3px 10px; display: inline-block; margin-bottom: 16px; opacity: 0.8; }
.hero h1 { font-size: 40px; font-weight: 800; color: var(--text-bright); line-height: 1.15; margin-bottom: 14px; }
.hero h1 em { color: var(--cyan); font-style: normal; }
.hero p { font-size: 17px; color: var(--text-dim); max-width: 600px; }

.step { margin-bottom: 48px; animation: fadeUp 0.4s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.step-num { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 2px; color: var(--cyan); display: block; margin-bottom: 4px; }
h2 { font-size: 26px; font-weight: 700; color: var(--text-bright); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
h3 { font-size: 18px; font-weight: 600; color: var(--blue); margin: 24px 0 10px; }
p { margin-bottom: 14px; }
strong { color: var(--text-bright); }

code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--bg-hover); color: var(--cyan); padding: 2px 6px; border-radius: 3px; }
pre code { background: none; padding: 0; color: var(--text); }

.cmd { background: var(--bg-code); border: 1px solid var(--border); border-left: 3px solid var(--green); padding: 14px 18px; margin: 12px 0 18px; font-family: 'JetBrains Mono', monospace; font-size: 14px; line-height: 1.6; position: relative; overflow-x: auto; border-radius: 0 4px 4px 0; }
.cmd .prompt { color: var(--green); user-select: none; }
.cmd .txt { color: var(--text); }
.cmd-copy { position: absolute; top: 8px; right: 8px; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim); padding: 4px 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; cursor: pointer; border-radius: 3px; transition: all 0.2s; }
.cmd-copy:hover { color: var(--cyan); border-color: var(--cyan); }

.note { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--yellow); padding: 14px 18px; margin: 16px 0; font-size: 14px; border-radius: 0 4px 4px 0; }
.note::before { content: 'NOTE'; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--yellow); display: block; margin-bottom: 4px; }

.tree { background: var(--bg-card); border: 1px solid var(--border); padding: 18px 24px; margin: 16px 0 24px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.7; border-radius: 4px; }
.tree .dir { color: var(--blue); font-weight: 600; }
.tree .file { color: var(--text); }
.tree .hl { color: var(--cyan); }

.file-card { border: 1px solid var(--border); margin-bottom: 6px; border-radius: 4px; overflow: hidden; animation: fadeUp 0.3s ease-out both; transition: border-color 0.2s; }
.file-card:hover { border-color: var(--border-hover); }

.file-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; cursor: pointer; background: var(--bg-card); transition: background 0.2s; gap: 12px; }
.file-header:hover { background: var(--bg-hover); }

.file-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--text-bright); white-space: nowrap; }
.file-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.file-desc { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

.file-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chevron { color: var(--text-dim); font-size: 10px; transition: transform 0.2s; }
.file-card.open .chevron { transform: rotate(180deg); }

.badge { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 1.5px; padding: 2px 8px; border-radius: 2px; font-weight: 600; flex-shrink: 0; }
.badge-source { background: var(--green); color: #000; opacity: 0.85; }
.badge-header { background: var(--blue); color: #fff; opacity: 0.85; }
.badge-make { background: var(--orange); color: #000; opacity: 0.85; }

.btn-copy { display: flex; align-items: center; gap: 5px; background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); padding: 4px 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; cursor: pointer; border-radius: 3px; transition: all 0.2s; white-space: nowrap; }
.btn-copy:hover { color: var(--cyan); border-color: var(--cyan); }
.btn-copy.copied { color: var(--green); border-color: var(--green); }
.copy-label { pointer-events: none; }

.file-body { display: none; border-top: 1px solid var(--border); }
.file-card.open .file-body { display: block; }
.file-body pre { background: var(--bg-code); padding: 16px 20px; margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; overflow-x: auto; color: var(--text); }

.copy-all-bar { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; }
.copy-all-bar span { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-dim); }
.btn-all { display: flex; align-items: center; gap: 6px; background: var(--cyan); color: #000; border: none; padding: 8px 18px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 3px; transition: all 0.2s; letter-spacing: 0.5px; }
.btn-all:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-all.copied { background: var(--green); }
.btn-download { display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; border: none; padding: 8px 18px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 3px; transition: all 0.2s; letter-spacing: 0.5px; }
.btn-download:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-download.done { background: var(--green); color: #000; }
.btn-group { display: flex; gap: 8px; }

.script-block { background: var(--bg-code); border: 1px solid var(--border); border-left: 3px solid var(--magenta); padding: 16px 20px; margin: 12px 0 18px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; position: relative; overflow-x: auto; border-radius: 0 4px 4px 0; }
.script-block .cmt { color: var(--text-dim); }
.script-block .cmd { background: none; border: none; padding: 0; margin: 0; border-left: none; border-radius: 0; }

.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.concept-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 16px; }
.concept-card .c-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--cyan); display: block; margin-bottom: 6px; }
.concept-card .c-value { font-size: 15px; font-weight: 600; color: var(--text-bright); display: block; margin-bottom: 4px; }
.concept-card .c-desc { font-size: 12px; color: var(--text-dim); }

.terminal-preview { background: #0c0c0c; border: 1px solid #333; border-radius: 8px; margin-top: 32px; overflow: hidden; box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(68,204,187,0.08); }
.terminal-preview .term-bar { background: #1a1a1a; padding: 10px 14px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid #333; }
.terminal-preview .td { width: 12px; height: 12px; border-radius: 50%; }
.terminal-preview .td-r { background: #ff5f56; }
.terminal-preview .td-y { background: #ffbd2e; }
.terminal-preview .td-g { background: #27c93f; }
.terminal-preview .term-title { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #666; margin-left: 12px; }
.terminal-preview .term-body { padding: 20px 28px; font-family: 'JetBrains Mono', monospace; font-size: 13.5px; line-height: 1.55; white-space: pre; overflow-x: auto; color: #bbb; }
.terminal-preview .tc { color: #56d4c8; }
.terminal-preview .tb { color: #5a9fd4; }
.terminal-preview .tg { color: #4caf93; }
.terminal-preview .ty { color: #d4a84b; }
.terminal-preview .tw { color: #e8edf3; }
.terminal-preview .tr { color: #c96b65; }
.terminal-preview .td2 { color: #555; }
.terminal-preview .tbg-cyan { background: #1a4040; color: #fff; font-weight: 700; }
.terminal-preview .caption { padding: 0 28px 16px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: #5a6a7a; }

.footer { margin-top: 60px; padding: 24px 0; border-top: 1px solid var(--border); text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-dim); }
.footer a { color: var(--cyan); text-decoration: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  color: #fff;
  background: linear-gradient(135deg, #3d7ab8 0%, #2a5a8a 100%);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(61, 122, 184, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.02em;
  font-family: 'DM Sans', sans-serif;
}
.back-link .back-arrow { display: inline-block; transition: transform 0.2s; }
.back-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(61, 122, 184, 0.6); }
.back-link:hover .back-arrow { transform: translateX(-4px); }
.back-link:active { transform: translateY(0); box-shadow: 0 4px 14px rgba(61, 122, 184, 0.45); }

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .file-desc { display: none; }
  .file-header { padding: 8px 12px; }
}

/* ── Inline-style replacement utilities ── */
.dim { color: var(--text-dim); }
.mt-16 { margin-top: 16px; }

.delay-0   { animation-delay: 0s; }
.delay-40  { animation-delay: 0.04s; }
.delay-50  { animation-delay: 0.05s; }
.delay-80  { animation-delay: 0.08s; }
.delay-100 { animation-delay: 0.1s; }
.delay-120 { animation-delay: 0.12s; }
.delay-150 { animation-delay: 0.15s; }
.delay-160 { animation-delay: 0.16s; }
.delay-200 { animation-delay: 0.2s; }
.delay-240 { animation-delay: 0.24s; }
.delay-250 { animation-delay: 0.25s; }
.delay-280 { animation-delay: 0.28s; }
.delay-300 { animation-delay: 0.3s; }
.delay-320 { animation-delay: 0.32s; }
.delay-350 { animation-delay: 0.35s; }
.delay-360 { animation-delay: 0.36s; }
.delay-400 { animation-delay: 0.4s; }
.delay-440 { animation-delay: 0.44s; }
.delay-480 { animation-delay: 0.48s; }
.delay-520 { animation-delay: 0.52s; }
.delay-560 { animation-delay: 0.56s; }
.delay-600 { animation-delay: 0.6s; }
.delay-640 { animation-delay: 0.64s; }
