/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:      #0a0f1e;
  --bg2:     #0f172a;
  --bg3:     #1e293b;
  --cyan:    #00f5d4;
  --purple:  #a855f7;
  --gold:    #f59e0b;
  --text:    #e2e8f0;
  --muted:   #64748b;
  --border:  #1e293b;
  --r:       12px;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.65; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg); } ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 0; justify-content: space-between;
  padding: 0 40px; height: 58px;
  background: rgba(10,15,30,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,245,212,.12);
}
.nav-logo { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.nav-logo span { color: var(--cyan); }
.nav-links { display: flex; gap: 6px; }
.nav-links a { font-size: 13px; color: var(--muted); padding: 6px 14px; border-radius: 8px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(0,245,212,.08); }
.nav-hud { display: flex; align-items: center; gap: 16px; }

/* ── HUD ── */
.hud-wrap { display: flex; align-items: center; gap: 10px; }
#hud-level { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
#hud-xp { font-size: 12px; color: var(--cyan); font-weight: 600; min-width: 60px; }
.hud-bar-track { width: 90px; height: 6px; background: #1e293b; border-radius: 3px; overflow: hidden; }
#hud-bar { height: 100%; width: 0%; border-radius: 3px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ── Canvas particle bg ── */
#particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden;
  padding: 100px 40px 80px; text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,245,212,.07) 0%, transparent 70%);
}
.hero-badge { display: inline-block; background: rgba(0,245,212,.1); border: 1px solid rgba(0,245,212,.3); color: var(--cyan); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; padding: 4px 16px; border-radius: 99px; margin-bottom: 24px; }
.hero h1 { font-size: clamp(32px, 5vw, 60px); font-weight: 800; letter-spacing: -2px; line-height: 1.1; color: #fff; margin-bottom: 16px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 17px; color: var(--muted); max-width: 540px; margin: 0 auto 40px; line-height: 1.7; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 13px 28px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: transform .15s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #00b8a3); color: #0a0f1e; box-shadow: 0 0 24px rgba(0,245,212,.3); }
.btn-primary:hover { box-shadow: 0 0 36px rgba(0,245,212,.5); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid #334155; }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Stats bar ── */
.stats-bar { display: flex; justify-content: center; gap: 48px; padding: 32px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg2); flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--cyan); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }

/* ── Section ── */
.section { max-width: 1100px; margin: 0 auto; padding: 72px 24px; }
.section-title { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 8px; letter-spacing: -.5px; }
.section-sub { font-size: 15px; color: var(--muted); margin-bottom: 44px; }

/* ── Module cards ── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.module-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 32px;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: pointer;
}
.module-card::before { content: ''; position: absolute; inset: 0; background: var(--card-glow, rgba(0,245,212,.04)); opacity: 0; transition: opacity .3s; border-radius: 16px; }
.module-card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.module-card:hover::before { opacity: 1; }
.module-card.done { border-color: rgba(0,245,212,.4); }
.module-card.done::after { content: '✓'; position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; background: var(--cyan); color: #0a0f1e; font-weight: 900; font-size: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.module-num { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 16px; }
.module-icon { font-size: 36px; margin-bottom: 16px; }
.module-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.module-desc { font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 24px; }
.module-meta { display: flex; align-items: center; justify-content: space-between; }
.module-xp { font-size: 12px; font-weight: 700; color: var(--cyan); background: rgba(0,245,212,.1); padding: 3px 10px; border-radius: 99px; }
.module-progress { font-size: 12px; color: var(--muted); }
.progress-bar { width: 100%; height: 4px; background: #1e293b; border-radius: 2px; margin-top: 16px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); border-radius: 2px; transition: width .8s cubic-bezier(.4,0,.2,1); }

/* ── Badge shelf ── */
.badge-shelf { display: flex; gap: 16px; flex-wrap: wrap; }
.badge-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; min-width: 180px; transition: border-color .2s; }
.badge-item.earned { border-color: rgba(168,85,247,.5); background: rgba(168,85,247,.08); }
.badge-item.earned .badge-icon { filter: none; }
.badge-icon { font-size: 28px; filter: grayscale(1) opacity(.3); transition: filter .3s; }
.badge-info strong { font-size: 13px; color: #fff; display: block; }
.badge-info span { font-size: 11px; color: var(--muted); }

/* ── Content page layout ── */
.content-hero { padding: 60px 40px 40px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--cyan); }
.content-hero h1 { font-size: clamp(26px, 4vw, 44px); font-weight: 800; letter-spacing: -1px; color: #fff; margin-bottom: 10px; }
.content-hero p { font-size: 16px; color: var(--muted); max-width: 600px; }
.xp-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,245,212,.1); border: 1px solid rgba(0,245,212,.25); color: var(--cyan); font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 99px; margin-top: 16px; }

/* ── Lesson blocks ── */
.lesson-wrap { max-width: 860px; margin: 0 auto; padding: 60px 24px; }
.lesson-block { margin-bottom: 56px; }
.lesson-block h2 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.lesson-block p { font-size: 15px; color: #94a3b8; line-height: 1.8; margin-bottom: 12px; }
.lesson-block ul { padding-left: 20px; color: #94a3b8; font-size: 15px; line-height: 1.9; }
.lesson-block li { margin-bottom: 4px; }
.highlight { color: var(--cyan); font-weight: 600; }

/* ── Info cards ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.info-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.info-card .ic-icon { font-size: 24px; margin-bottom: 10px; }
.info-card h3 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.info-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--cyan), var(--purple)); }
.tl-item { position: relative; margin-bottom: 32px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); border: 2px solid var(--bg); box-shadow: 0 0 8px var(--cyan); }
.tl-item h3 { font-size: 15px; font-weight: 700; color: var(--cyan); margin-bottom: 4px; }
.tl-item p { font-size: 14px; color: var(--muted); }
.tl-year { font-size: 11px; color: #475569; margin-bottom: 2px; letter-spacing: .5px; }

/* ── Tool cards ── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tool-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 14px; padding: 24px; transition: border-color .2s, transform .15s; }
.tool-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.tool-card .tc-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tool-card .tc-icon { font-size: 28px; }
.tool-card .tc-name { font-size: 16px; font-weight: 700; color: #fff; }
.tool-card .tc-by { font-size: 11px; color: var(--muted); }
.tool-card p { font-size: 13px; color: #94a3b8; line-height: 1.6; margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; background: rgba(168,85,247,.15); color: #d8b4fe; border: 1px solid rgba(168,85,247,.25); padding: 2px 10px; border-radius: 99px; }

/* ── Quiz ── */
.quiz-block { background: var(--bg2); border: 1px solid rgba(0,245,212,.2); border-radius: 16px; padding: 32px; margin-top: 40px; }
.quiz-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 24px; }
.quiz-q { margin-bottom: 28px; }
.quiz-q p { font-size: 15px; color: #e2e8f0; font-weight: 500; margin-bottom: 14px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; cursor: pointer; font-size: 14px; color: #94a3b8; transition: border-color .2s, background .2s; }
.quiz-opt:hover { border-color: var(--cyan); background: rgba(0,245,212,.05); color: #e2e8f0; }
.quiz-opt input { accent-color: var(--cyan); }
.quiz-opt.correct { border-color: var(--cyan); background: rgba(0,245,212,.1); color: #e2e8f0; }
.quiz-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.08); color: #fca5a5; }
.quiz-submit { margin-top: 20px; width: 100%; padding: 14px; font-size: 15px; font-weight: 700; background: linear-gradient(135deg, var(--purple), #7c3aed); color: #fff; border: none; border-radius: 10px; cursor: pointer; transition: opacity .2s, transform .15s; }
.quiz-submit:hover { opacity: .9; transform: translateY(-1px); }
.quiz-result { margin-top: 20px; padding: 16px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; display: none; }
.quiz-result.pass { background: rgba(0,245,212,.1); border: 1px solid rgba(0,245,212,.3); color: var(--cyan); }
.quiz-result.fail { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }

/* ── Complete button ── */
.complete-section { text-align: center; padding: 40px 24px; border-top: 1px solid var(--border); }
.complete-section p { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* ── Toasts ── */
.xp-toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 9999;
  background: rgba(10,15,30,.95); border: 1px solid rgba(0,245,212,.4);
  border-radius: 12px; padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  transform: translateY(20px); opacity: 0; transition: transform .3s, opacity .3s;
  backdrop-filter: blur(8px);
}
.xp-toast.show { transform: translateY(0); opacity: 1; }
.xp-num { font-size: 20px; font-weight: 800; color: var(--cyan); }
.xp-reason { font-size: 13px; color: #94a3b8; }

.badge-toast {
  position: fixed; bottom: 32px; left: 32px; z-index: 9999;
  background: rgba(10,15,30,.95); border: 1px solid rgba(168,85,247,.5);
  border-radius: 12px; padding: 14px 20px; display: flex; align-items: center; gap: 14px;
  transform: translateY(20px); opacity: 0; transition: transform .3s, opacity .3s;
  backdrop-filter: blur(8px); box-shadow: 0 0 30px rgba(168,85,247,.2);
}
.badge-toast.show { transform: translateY(0); opacity: 1; }
.bt-icon { font-size: 32px; }
.bt-text { font-size: 13px; color: #94a3b8; line-height: 1.5; }
.bt-text strong { color: var(--purple); font-size: 14px; }

/* ── Typewriter cursor ── */
.tw-cursor { animation: blink .7s step-end infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

/* ── Fade-in ── */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ── Glow pulse on hero ── */
.glow-ring { position: absolute; width: 600px; height: 600px; border-radius: 50%; border: 1px solid rgba(0,245,212,.06); left: 50%; top: 50%; transform: translate(-50%,-50%); animation: pulse-ring 4s ease-in-out infinite; pointer-events: none; }
.glow-ring:nth-child(2) { width: 900px; height: 900px; animation-delay: 1.5s; border-color: rgba(168,85,247,.04); }
@keyframes pulse-ring { 0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: .6; } 50% { transform: translate(-50%,-50%) scale(1.04); opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav { padding: 0 20px; }
  .nav-links { display: none; }
  .hero { padding: 72px 20px 56px; }
  .stats-bar { gap: 28px; }
  .section { padding: 48px 20px; }
}
