:root {
  --bg: #0b1020;
  --bg-2: #0f1530;
  --panel: #121a36;
  --panel-2: #182246;
  --border: #243056;
  --text: #e6ecff;
  --muted: #97a3c7;
  --accent: #38f9b8;
  --accent-2: #5ad7ff;
  --danger: #ff6b6b;
  --warn: #ffce5b;
  --term-bg: #05080f;
  --term-text: #c9ffe6;
  --term-prompt: #38f9b8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2a5e 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #15314a 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
}

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(11, 16, 32, 0.7);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; letter-spacing: 0.3px;
}
.brand-mark { color: var(--accent); font-size: 18px; transform: translateY(-1px); }
.brand-name { font-size: 18px; }
.accent { color: var(--accent); }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 80px 0 40px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: 12px;
  color: var(--accent); margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1; margin: 0 0 18px;
  background: linear-gradient(90deg, #fff 0%, #c8d4ff 60%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); font-size: 18px; max-width: 720px; }
.hero-cta { display: flex; gap: 12px; margin: 28px 0 24px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #042018;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

.warning-banner {
  border: 1px solid rgba(255, 206, 91, 0.35);
  background: rgba(255, 206, 91, 0.08);
  color: #f6e2a3;
  padding: 12px 14px; border-radius: 10px; font-size: 14px;
  max-width: 720px;
}
.warning-banner strong { color: var(--warn); }

/* Labs grid */
.labs-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 60px 0 20px; flex-wrap: wrap;
}
.labs-header h2 { font-size: 28px; margin: 0; }
#lab-search {
  flex: 1; max-width: 360px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font: inherit;
}
#lab-search:focus { outline: none; border-color: var(--accent); }

.lab-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 80px;
}

.lab-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}
.lab-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 100px at 0% 0%, rgba(56, 249, 184, 0.12), transparent 60%);
  pointer-events: none;
}
.lab-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.lab-card .module {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent);
}
.lab-card h3 { margin: 0; font-size: 19px; }
.lab-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.lab-card .start {
  align-self: flex-start; margin-top: 8px;
  color: var(--accent); font-weight: 600; font-size: 14px;
}
.lab-card .start::after { content: " \2192"; }

/* About */
.about { padding: 60px 0 40px; border-top: 1px solid var(--border); margin-top: 40px; }
.about-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.about h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent); }
.about p { color: var(--muted); margin: 0; font-size: 15px; }
.about code {
  background: var(--panel); padding: 2px 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px; padding: 24px 0; color: var(--muted); font-size: 13px;
}

/* Lab page */
.lab-body { background-attachment: fixed; }
.lab-main { padding: 30px 24px 60px; }
.lab-header { margin-bottom: 24px; }
.lab-header h1 { font-size: clamp(26px, 3.5vw, 38px); margin: 6px 0 12px; }
.lab-header .lede { color: var(--muted); font-size: 16px; }

.lab-layout {
  display: grid; gap: 22px;
  grid-template-columns: 320px 1fr;
}
@media (max-width: 900px) {
  .lab-layout { grid-template-columns: 1fr; }
}

.lab-sidebar { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.panel h3 {
  margin: 0 0 10px; font-size: 14px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent);
}
.panel-muted h3 { color: var(--muted); }
.panel ul { list-style: none; padding: 0; margin: 0; }
.objectives li, .hints li, .builtins li {
  padding: 6px 0; font-size: 14px; color: var(--text);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.objectives li:last-child, .hints li:last-child, .builtins li:last-child { border-bottom: 0; }
.builtins code, .panel code {
  background: var(--bg-2); color: var(--accent);
  padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12px;
}
.objectives li {
  display: flex; align-items: flex-start; gap: 8px;
}
.objectives li .check {
  display: inline-block; width: 16px; height: 16px;
  border: 1px solid var(--border); border-radius: 4px;
  margin-top: 3px; flex-shrink: 0; background: var(--bg-2);
}
.objectives li.done { color: var(--muted); text-decoration: line-through; }
.objectives li.done .check {
  background: var(--accent); border-color: var(--accent); position: relative;
}
.objectives li.done .check::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px; border: solid #042018;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Terminal */
.lab-terminal-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.terminal {
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--term-text);
  padding: 18px 18px 14px;
  height: 560px;
  overflow-y: auto;
  box-shadow: var(--shadow), inset 0 0 80px rgba(56, 249, 184, 0.04);
  position: relative;
}
.terminal::before {
  content: ""; position: absolute; top: 12px; left: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff5f56;
  box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #27c93f;
}
.terminal { padding-top: 38px; }
.terminal-line { white-space: pre-wrap; word-break: break-word; }
.terminal-line.cmd { color: #fff; }
.terminal-line.err { color: var(--danger); }
.terminal-line.ok { color: var(--accent); }
.terminal-line.dim { color: var(--muted); }
.term-g { color: #5cffb1; }
.term-r { color: #ff8b8b; }
.term-y { color: #ffe17a; }
.term-c { color: #7ad9ff; }
.term-m { color: #d99dff; }

.term-prompt {
  color: var(--term-prompt); font-weight: 600;
}
.term-input-row { display: flex; align-items: baseline; gap: 8px; }
.term-input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--term-text); font: inherit; caret-color: var(--accent);
}

.completion {
  background: rgba(56, 249, 184, 0.1);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--accent);
}
.completion.hidden { display: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #2f3d6e; }
