@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --purple-50: #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;
  --purple-800: #5b21b6;
  --purple-900: #4c1d95;

  --amber-100: #fef3c7;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-700: #15803d;

  --red-100: #fee2e2;
  --red-600: #dc2626;

  --bg: #faf9f7;
  --surface: #ffffff;
  --border: #e8e4f0;
  --text: #1e1b2e;
  --text-muted: #6b6580;

  --primary: var(--purple-600);
  --primary-hover: var(--purple-700);
  --accent: var(--amber-400);

  --radius-sm: 0.5rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.08);
  --shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
  --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.16);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

/* ── Utility: btn ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--purple-50);
  transform: translateY(-1px);
}
.btn-amber {
  background: var(--amber-400);
  color: var(--text);
  border-color: var(--amber-400);
}
.btn-amber:hover {
  background: var(--amber-500);
  border-color: var(--amber-500);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--purple-50);
  color: var(--primary);
}
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

/* ── Utility: card ─────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ── Utility: badge ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.badge-purple {
  background: var(--purple-100);
  color: var(--purple-700);
}
.badge-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}
.badge-green {
  background: var(--green-100);
  color: var(--green-700);
}
.badge-level1 { background: var(--amber-100); color: var(--amber-600); }
.badge-level2 { background: var(--purple-100); color: var(--purple-700); }
.badge-level3 { background: var(--green-100); color: var(--green-700); }

/* ── Layout helpers ────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container-sm {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 3rem 0; }
.section-lg { padding: 4.5rem 0; }

/* ── Page header band ──────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-800) 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
}
.page-header h1 { color: #fff; }
.page-header p { color: rgba(255,255,255,0.85); }

/* ── Nav ───────────────────────────────────────────── */
.site-nav {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

/* push page content below the fixed nav */
body { padding-top: 56px; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--primary-hover); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--purple-50);
  color: var(--primary);
  text-decoration: none;
}

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  background: var(--purple-900);
  color: rgba(255,255,255,0.7);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  margin-top: 4rem;
}
.site-footer a { color: rgba(255,255,255,0.9); }

/* ── Form elements ─────────────────────────────────── */
.form-group { margin-bottom: 1.125rem; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.375rem;
  font-size: 0.9rem;
}
.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── Assessment UI ─────────────────────────────────── */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.75rem;
}
.item-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  border-radius: var(--radius);
  border: 2.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text);
}
.item-btn:hover { border-color: var(--purple-300); background: var(--purple-50); }
.item-btn.correct {
  background: var(--green-100);
  border-color: var(--green-600);
  color: var(--green-700);
}
.item-btn.incorrect {
  background: var(--red-100);
  border-color: var(--red-600);
  color: var(--red-600);
}

/* ── Progress bar ──────────────────────────────────── */
.progress-bar {
  height: 0.5rem;
  background: var(--purple-100);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple-400, #a78bfa));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* ── Skill step card ───────────────────────────────── */
.step-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.875rem;
}
.step-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--purple-100);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.4rem 0.5rem;
    overflow: visible;
  }
  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
    width: 100%;
  }
  .nav-links a {
    font-size: 0.72rem;
    padding: 0.35rem 0.2rem;
    text-align: center;
    white-space: nowrap;
    display: block;
  }
  body { padding-top: 88px; }
  .section { padding: 2rem 0; }
  .section-lg { padding: 3rem 0; }
}
