:root {
  --purple: #6543ce;
  --teal: #087b6d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}
code, pre, .font-mono { font-family: "JetBrains Mono", monospace; }

/* ---- HERO ---- */
.hero {
  position: relative;
  background: linear-gradient(160deg, #0f0f1e 0%, #191330 55%, #10241f 100%);
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(101,67,206,0.35), transparent 70%),
    radial-gradient(500px 300px at 85% 30%, rgba(8,123,109,0.30), transparent 70%);
  pointer-events: none;
}
.hero-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 1px;
  color: #a78bfa;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.3);
  padding: 5px 12px; border-radius: 999px;
}
.hero-title {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800; line-height: 0.95;
  color: #fff; letter-spacing: -0.02em;
  margin: 0 0 12px;
  background: linear-gradient(90deg, #fff 40%, #c4b5fd 70%, #5eead4);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cursor-blink { -webkit-text-fill-color: #5eead4; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tag { font-size: clamp(1.1rem, 3vw, 1.5rem); color: #e2e8f0; font-weight: 500; margin: 0 0 14px; }
.hero-code {
  font-family: "JetBrains Mono", monospace; font-size: 0.85em;
  background: rgba(255,255,255,0.08); color: #5eead4;
  padding: 2px 8px; border-radius: 6px;
}
.hero-desc { color: #94a3b8; max-width: 640px; line-height: 1.7; margin: 0 0 28px; font-size: 1.02rem; }

.hero-progress {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 18px 20px; max-width: 640px;
  backdrop-filter: blur(8px);
}
.prog-track { height: 12px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--teal));
  border-radius: 999px; transition: width 0.7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 16px rgba(94,234,212,0.4);
}

.btn-primary {
  background: linear-gradient(90deg, var(--purple), #7c5ce0);
  color: #fff; font-weight: 700; padding: 12px 24px;
  border: none; border-radius: 12px; cursor: pointer; font-size: 1rem;
  box-shadow: 0 8px 24px -6px rgba(101,67,206,0.6);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -6px rgba(101,67,206,0.8); }
.btn-ghost {
  background: rgba(255,255,255,0.08); color: #e2e8f0; font-weight: 600;
  padding: 12px 22px; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px; cursor: pointer; font-size: 1rem;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* ---- CONTROLS ---- */
.controls-bar {
  background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 10px 40px -12px rgba(30,27,75,0.25);
  border: 1px solid #eceafb;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.search-wrap { position: relative; flex: 1 1 240px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; }
.search-input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 14px; outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--purple); }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid #e2e8f0;
  background: #fff; color: #64748b; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.pill:hover { border-color: #cbd5e1; }
.pill-active { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn-tool {
  padding: 9px 14px; border-radius: 10px; border: 1.5px solid #e2e8f0;
  background: #fff; color: #475569; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.btn-tool:hover { border-color: var(--teal); color: var(--teal); }
.hidden { display: none; }

/* ---- PHASE CARD ---- */
.phase-card { transition: box-shadow .2s; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-family: "JetBrains Mono", monospace; }
.chip-grey { background: #f1f5f9; color: #64748b; }
.chip-amber { background: #fef3c7; color: #b45309; }
.chip-teal { background: #ccfbf1; color: var(--teal); }

@keyframes expand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.animate-expand { animation: expand .25s ease; }

.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; color: #94a3b8; font-family: "JetBrains Mono", monospace;
}
.handbook-tag {
  display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 12px;
  background: #1e1b3a; color: #c4b5fd; padding: 7px 14px; border-radius: 8px;
  border: 1px solid #322b5c;
}

.task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: #f8fafc;
  border: 1px solid #eef2f7; cursor: pointer; transition: background .15s;
}
.task-row:hover { background: #f1f5f9; }
.task-done { background: #f0fdf9; border-color: #ccfbf1; }
.task-done .task-text { color: #94a3b8; text-decoration: line-through; }
.task-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  background: #ede9fe; color: var(--purple); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: "JetBrains Mono", monospace;
}
.task-check { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.task-text { flex: 1; font-size: 14px; line-height: 1.5; color: #334155; }
.inline-code {
  font-family: "JetBrains Mono", monospace; font-size: 0.88em;
  background: #eef2ff; color: #4f46e5; padding: 1px 6px; border-radius: 5px;
}

.resource-link {
  display: block; padding: 11px 14px; border-radius: 10px;
  border: 1px solid #e2e8f0; text-decoration: none; transition: all .15s; background: #fff;
}
.resource-link:hover { border-color: var(--teal); background: #f0fdf9; }

.mentor-box {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #99f6e4; border-left: 4px solid var(--teal);
  border-radius: 12px; padding: 14px 16px;
}
.mentor-head { font-weight: 700; color: var(--teal); font-size: 14px; margin-bottom: 6px; }

.exit-box {
  background: linear-gradient(135deg, #faf5ff, #f5f3ff);
  border: 1px solid #ddd6fe; border-left: 4px solid var(--purple);
  border-radius: 12px; padding: 14px 16px; color: #4c1d95;
}
.exit-head { font-weight: 700; color: var(--purple); font-size: 14px; margin-bottom: 6px; }

.reflect-area {
  width: 100%; margin-top: 8px; padding: 12px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; font-family: inherit; font-size: 14px;
  resize: vertical; outline: none; transition: border-color .15s;
}
.reflect-area:focus { border-color: var(--purple); }

/* ---- SHAPE ICONS ---- */
.shape-wrap { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shape {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.3);
}
.shape-num { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 18px; }
.shape-circle { border-radius: 50%; }
.shape-rounded { border-radius: 14px; }
.shape-hexagon { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%); }
.shape-diamond { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.shape-diamond .shape-num { transform: none; }
.shape-triangle { clip-path: polygon(50% 8%, 95% 92%, 5% 92%); }
.shape-triangle .shape-num { transform: translateY(6px); }
.shape-check {
  position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px;
  background: var(--teal); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* ---- SECTION HEADINGS ---- */
.sec-heading { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: #1e293b; letter-spacing: -0.02em; margin: 0 0 6px; }
.sec-sub { color: #64748b; margin: 0 0 20px; max-width: 620px; line-height: 1.6; }

/* ---- STUDY LOOP ---- */
.loop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.loop-card {
  position: relative; background: #fff; border-radius: 14px; padding: 18px 16px;
  border: 1px solid #eceafb; box-shadow: 0 4px 16px -8px rgba(101,67,206,0.2);
  animation: expand .4s ease both;
}
.loop-num {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--teal)); color: #fff;
  font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.loop-step { font-size: 1.15rem; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.loop-desc { font-size: 13px; color: #64748b; line-height: 1.5; }
.loop-arrow {
  position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  color: #cbd5e1; font-size: 20px; font-weight: 700; z-index: 2;
}
@media (max-width: 640px) { .loop-arrow { display: none; } }

/* ---- LAB ---- */
.lab-card {
  display: flex; flex-wrap: wrap; gap: 24px;
  background: #fff; border-radius: 18px; padding: 24px;
  border: 1px solid #eceafb; box-shadow: 0 6px 24px -10px rgba(101,67,206,0.2);
}
.lab-card > div { flex: 1 1 320px; }
.lab-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lab-list li { font-size: 14px; color: #475569; }
.term-block { background: #0f1117; border-radius: 12px; overflow: hidden; border: 1px solid #1f2430; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #171a22; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f56; } .dot-y { background: #ffbd2e; } .dot-g { background: #27c93f; }
.term-title { margin-left: 8px; font-family: "JetBrains Mono", monospace; font-size: 12px; color: #6b7280; }
.term-body {
  margin: 0; padding: 16px; font-family: "JetBrains Mono", monospace; font-size: 12.5px;
  color: #9ae6b4; line-height: 1.8; white-space: pre-wrap; overflow-x: auto;
}

/* ---- COMPASS ---- */
.compass-wrap { position: relative; }
.compass-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 60px; height: 60px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 4px 20px -4px rgba(101,67,206,0.4); z-index: 5;
  border: 2px solid #ede9fe;
}
@media (max-width: 700px) { .compass-center { display: none; } }
.compass-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 500px) { .compass-grid { grid-template-columns: 1fr; } }
.compass-card {
  background: #fff; border-radius: 14px; padding: 18px;
  border: 1px solid #eceafb; box-shadow: 0 4px 16px -8px rgba(8,123,109,0.2);
  transition: transform .15s;
}
.compass-card:hover { transform: translateY(-3px); }
.compass-dir {
  font-family: "JetBrains Mono", monospace; font-weight: 800; color: var(--teal);
  font-size: 13px; opacity: 0.5;
}
.compass-label { font-size: 1.15rem; font-weight: 800; color: #1e293b; margin: 2px 0 8px; }
.compass-cmd {
  display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 12px;
  background: #1e1b3a; color: #5eead4; padding: 5px 10px; border-radius: 7px; margin-bottom: 8px;
}
.compass-desc { font-size: 13px; color: #64748b; line-height: 1.5; }

/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border-radius: 12px; border: 1px solid #eceafb; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; padding: 16px 18px; background: none; border: none;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 1rem; color: #1e293b;
}
.faq-q:hover { background: #faf9ff; }
.faq-toggle { color: var(--purple); font-size: 22px; font-weight: 400; transition: transform .2s; }
.rotate-45 { transform: rotate(45deg); }
.faq-a { padding: 0 18px 18px; color: #64748b; line-height: 1.7; margin: 0; font-size: 14.5px; animation: expand .2s ease; }

/* ---- EMPTY ---- */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; border-radius: 16px; border: 1px dashed #cbd5e1; }

/* ---- FOOTER ---- */
.footer { text-align: center; margin-top: 60px; padding: 40px 20px; border-top: 1px solid #eceafb; }
.footer-main { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin: 0; }
.footer-link { color: var(--purple); text-decoration: none; font-weight: 600; background: none; border: none; cursor: pointer; font-size: inherit; }
.footer-link:hover { text-decoration: underline; }
.footer-fine { color: #94a3b8; font-size: 13px; margin-top: 14px; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e1b3a; color: #fff; padding: 13px 22px; border-radius: 12px;
  font-weight: 600; font-size: 14px; z-index: 100;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.4);
  border: 1px solid #322b5c;
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }