/* Testers Guild QA Course — Synthwave Edition */

:root {
  /* Charcoal / Graphite dark palette */
  --bg:           #1a1a1a;
  --bg-card:      #222;
  --bg-elevated:  #2e2e2e;
  --border:       #3a3a3a;
  --text:         #f0f0f0;
  --text-muted:   #9a9a9a;

  /* Cyan as primary accent */
  --accent:       #00e5ff;
  --accent-hover: #00b8d4;
  --accent-glow:  rgba(0, 229, 255, 0.22);

  /* Pink as secondary / highlight */
  --pink:         #ff2d78;
  --pink-hover:   #e0005c;
  --pink-glow:    rgba(255, 45, 120, 0.22);

  /* Shared */
  --free-badge:   #00e5ff;
  --radius:       12px;
  --radius-lg:    20px;
  --font:         "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "Cascadia Code", monospace;
  --shadow:       0 4px 32px rgba(0, 0, 0, 0.55);
  --transition:   0.2s ease;
}

/* ═══════════════════════════════════════════════════
   BASE & RESET
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%,  rgba(0, 229, 255, 0.10), transparent),
    radial-gradient(ellipse 55% 40% at 90% 5%,   rgba(255, 45, 120, 0.10), transparent),
    radial-gradient(ellipse 50% 60% at 50% 110%,  rgba(0, 229, 255, 0.06), transparent);
  pointer-events: none;
  z-index: -1;
}

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

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 999;
  font-weight: 600;
}

.skip-link:focus { top: 1rem; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   HEADER & NAVIGATION
═══════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  padding: 0.75rem 1.5rem;
}

.auth-section {
  display: flex;
  align-items: center;
}

#auth-signin {
  display: flex;
  align-items: center;
}

#auth-signin .auth-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#auth-signin .auth-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

#auth-signin .auth-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
}

#auth-signin .auth-google-button > div {
  width: 100% !important;
}

/* Authentication controls */
.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #00e5ff, #00b8d4);
  color: #1a1a1a;
  font-weight: 700;
}

.auth-user .auth-picture {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.6);
}

.auth-user .auth-name {
  color: #1a1a1a;
  font-weight: 700;
  white-space: nowrap;
}

.auth-user .btn-logout {
  background: transparent;
  border: none;
  color: inherit;
  margin-left: 0.4rem;
  padding: 0.25rem;
}

/* Emoji avatar fallback */
.auth-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: #00b8d4;
  font-size: 18px;
  line-height: 1;
  border: 2px solid rgba(255,255,255,0.6);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.logo-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  line-height: 1.2;
}

.logo-suffix {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #00e5ff, #ff2d78);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 2px 14px rgba(0, 229, 255, 0.35);
}

.logo span { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-flag { font-size: 1rem; line-height: 1; }

.nav-links a, .nav-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.nav-links a:hover, .nav-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
}

.badge-free {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 229, 255, 0.12);
  color: var(--free-badge);
  border: 1px solid rgba(0, 229, 255, 0.28);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════
   LAYOUT PRIMITIVES
═══════════════════════════════════════════════════ */
.main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.view { display: none; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   HERO & HERO ACTIONS
═══════════════════════════════════════════════════ */
.hero {
  padding: 3rem 1rem 4rem;
}

/* Hero two-column layout */
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.hero-copy {
  text-align: left;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.hero-panel-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
}

.hero-panel-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.hero-panel-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}

.hero-panel-stat {
  text-align: center;
}

.hero-panel-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.hero-panel-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-badge {
  margin-bottom: 1.25rem;
}

.hero-title,
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #00e5ff 20%, #ff2d78 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 560px;
  margin: 0;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   BUTTONS & ACTIONS
═══════════════════════════════════════════════════ */
.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, #00e5ff, #00b8d4);
  color: #1a1a1a;
  box-shadow: 0 4px 22px rgba(0, 229, 255, 0.35);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00cfeb, #09b);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.5);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.cert-preview,
.cert-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.cert-preview {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.cert-preview__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cert-preview__title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cert-preview__name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.cert-preview__track {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.cert-preview__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-card {
  padding: 1rem;
}

.cert-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cert-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cert-card__header h4 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.cert-card__header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.cert-card__action {
  white-space: nowrap;
}

.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cert-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.cert-modal__content {
  position: relative;
  width: min(100%, 940px);
  max-height: 94vh;
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.cert-modal__frame-wrap {
  flex: 1;
  min-height: 420px;
  overflow: hidden;
}

.cert-modal__iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.cert-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(26, 26, 26, 0.94);
}

.cert-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   INSTALL BANNER (PWA)
═══════════════════════════════════════════════════ */
.install-banner {
  display: none;
  background: linear-gradient(135deg, rgba(0,229,255,0.08), rgba(255,45,120,0.06));
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.install-banner.visible {
  display: block;
}

.install-banner-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.25rem;
}

.install-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.install-banner-copy {
  flex: 1;
}

.install-banner-copy strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.install-banner-copy p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.install-banner-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 0.9rem;
  justify-content: flex-end;
}

.install-banner-btn {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════
   GUIDANCE PANEL
═══════════════════════════════════════════════════ */
.guidance-panel {
  margin: 3rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.guidance-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
}

.guidance-panel-header {
  text-align: center;
  margin-bottom: 2rem;
}

.guidance-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.guidance-panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.guidance-panel-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
}

.guidance-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.guidance-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.guidance-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
}

.guidance-index {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.guidance-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.guidance-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════════════════════════
   BRAND GRID
═══════════════════════════════════════════════════ */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.brand-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.brand-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.brand-card:hover {
  border-color: rgba(0, 229, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08);
}

.brand-card:hover::after {
  opacity: 1;
}

.brand-card-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.brand-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.brand-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════════════════════════
   HOME QUICK ACTIONS
═══════════════════════════════════════════════════ */
.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.quick-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  background: var(--bg-elevated);
  transform: translateX(3px);
  text-decoration: none;
}

.quick-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.quick-card-copy {
  flex: 1;
  min-width: 0;
}

.quick-card-copy h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.quick-card-copy p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.quick-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   HOME DISCOVERY PANEL & SECTION HEADING ROW
═══════════════════════════════════════════════════ */
.home-discovery-panel {
  margin: 1.5rem 0 0.5rem;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
}

.section-heading-row .section-sub {
  margin: 0;
  text-align: right;
}

.section-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.hero-cta-group {
  margin: 1.5rem 0 2rem;
}

/* ═══════════════════════════════════════════════════
   DASHBOARD ACTIONS
═══════════════════════════════════════════════════ */
.dashboard-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Search icon inside input wrapper */
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Continue banner */
.continue-banner {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(255, 45, 120, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.continue-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.continue-label {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.continue-lesson { font-weight: 600; font-size: 1.05rem; }
.continue-track { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Search */
.search-bar-wrap {
  position: relative;
  margin-bottom: 2rem;
  max-width: 520px;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-elevated); }

.search-skeleton-group {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.search-skeleton-item {
  min-height: 78px;
}

.search-result-title {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
}

.search-result-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.search-empty {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Dashboard header */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.footer-sub { margin-top: 0.5rem; opacity: 0.7; }

/* Section titles */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Track cards grid */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.track-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--track-color, var(--accent));
}

.track-card:hover {
  border-color: var(--track-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.track-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.track-icon { font-size: 2rem; }

.track-unlocked {
  font-size: 0.7rem;
  background: rgba(0, 229, 255, 0.12);
  color: var(--free-badge);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.track-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.track-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.track-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.track-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--bg-elevated);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.track-progress {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.progress-fill {
  height: 100%;
  background: var(--track-color, var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Track detail */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.track-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--track-color, var(--accent));
}

.track-hero h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.track-hero-desc { color: var(--text-muted); margin-bottom: 1rem; }

.course-list { display: flex; flex-direction: column; gap: 1rem; }

.course-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.course-header {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.course-num {
  width: 28px;
  height: 28px;
  background: var(--track-color, var(--accent));
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.lesson-list { list-style: none; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.lesson-item:hover { background: rgba(255, 255, 255, 0.03); }

.lesson-item.completed { opacity: 0.85; }

.lesson-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.lesson-item.completed .lesson-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-weight: 500; font-size: 0.95rem; }
.lesson-duration { font-size: 0.8rem; color: var(--text-muted); }

.lesson-unlock {
  font-size: 0.7rem;
  color: var(--free-badge);
  font-weight: 600;
}

/* Lesson view */
.lesson-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { order: 2; }
}

.lesson-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-track { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.sidebar-course { font-weight: 600; margin-bottom: 1rem; font-size: 0.9rem; }

.sidebar-lessons { list-style: none; }

.sidebar-lesson {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  transition: var(--transition);
}

.sidebar-lesson:hover { background: var(--bg-elevated); color: var(--text); }
.sidebar-lesson.active { background: rgba(0, 229, 255, 0.10); color: var(--accent); font-weight: 500; }
.sidebar-lesson.done::before { content: "✓ "; color: var(--accent); }

.lesson-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.lesson-content h1 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.lesson-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.lesson-meta-item {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lesson-body {
  font-size: 1rem;
  line-height: 1.75;
}

.lesson-body h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--accent);
}

.lesson-body ul, .lesson-body ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}

.lesson-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 1rem 0;
  line-height: 1.5;
}

.lesson-resources {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.lesson-resources h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.resource-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.resource-link:hover {
  border-left: 3px solid var(--accent);
  text-decoration: none;
  padding-left: calc(0.9rem - 3px);
}

.lesson-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  animation: skeletonShimmer 1.2s infinite;
}

.skeleton {
  display: block;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  margin-bottom: 0.8rem;
  opacity: 0.88;
}

.skeleton-line {
  height: 0.95rem;
  width: 100%;
}

.skeleton-line-sm { height: 0.8rem; width: 50%; }
.skeleton-line-xs { height: 0.7rem; width: 38%; }
.skeleton-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.dash-card h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.dash-card .value { font-size: 2rem; font-weight: 700; color: var(--accent); }

/* Features section */
.features {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer strong { color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #2e2e2e;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.2);
  z-index: 200;
  animation: slideUp 0.3s ease;
  display: none;
}

.toast.show { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Persona picker */
.persona-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.persona-title {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.persona-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.25rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: var(--transition);
  text-align: center;
}

.persona-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.persona-card.active {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18);
}

.persona-emoji { font-size: 2rem; }
.persona-name { font-weight: 700; font-size: 1rem; }
.persona-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Tier badges */
.tier-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tier-beginner     { background: rgba(0, 229, 255, 0.12);  color: #00e5ff; }
.tier-intermediate { background: rgba(255, 45, 120, 0.12); color: #ff2d78; }
.tier-senior       { background: rgba(160, 160, 160, 0.14); color: #c0c0c0; }

.track-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }

.badge-rec {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 45, 120, 0.15);
  color: var(--pink);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.track-recommended {
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.12);
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #1a1a1a; font-weight: 700; }

/* Lesson enrichment boxes */
.lesson-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.lesson-header-row h1 { margin-bottom: 0; flex: 1; }

.lesson-box {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.lesson-box h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }

.lesson-box-beginner {
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.22);
}

.lesson-box-beginner h3 { color: #00e5ff; }

.lesson-box-senior {
  background: rgba(160, 160, 160, 0.07);
  border: 1px solid rgba(160, 160, 160, 0.22);
  margin-top: 1.5rem;
}

.lesson-box-senior h3 { color: #c0c0c0; }

.lesson-box p { font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); }

/* Roadmap */
.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.roadmap-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.roadmap-card > p { color: var(--text-muted); margin-bottom: 1.25rem; }

.roadmap-steps { display: flex; flex-direction: column; gap: 1rem; }

.roadmap-step {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.roadmap-step-num {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #00e5ff, #ff2d78);
  color: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.roadmap-step-body { flex: 1; }
.roadmap-why { font-size: 0.85rem; color: var(--text-muted); margin: 0.35rem 0 0.75rem; }

/* Glossary */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.glossary-card h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.glossary-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links { justify-content: center; }
  .lang-toggle { justify-content: center; }
  .hero { padding: 2rem 0.5rem 3rem; }
  .lesson-content { padding: 1.25rem; }
  .search-bar-wrap { max-width: 100%; }
}


/* ═══════════════════════════════════════════════════
   THEME VARIANTS
═══════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:           #f2f2f2;
  --bg-card:      #fff;
  --bg-elevated:  #e8e8e8;
  --border:       #d0d0d0;
  --text:         #1a1a1a;
  --text-muted:   #666;
  --accent:       #09b;
  --accent-hover: #079;
  --accent-glow:  rgba(0, 153, 187, 0.2);
  --pink:         #cc005a;
  --pink-hover:   #aa0048;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.10);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%,  rgba(0, 153, 187, 0.07), transparent),
    radial-gradient(ellipse 55% 40% at 90% 5%,   rgba(204, 0, 90, 0.06),  transparent);
}

[data-theme="light"] .header {
  background: rgba(242, 242, 242, 0.94);
  border-bottom-color: rgba(0, 153, 187, 0.18);
}

/* Search icon is rendered via HTML span — no background-image needed */

[data-theme="light"] .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #09b, #079);
  box-shadow: 0 4px 18px rgba(0, 153, 187, 0.3);
}

[data-theme="light"] .tier-beginner     { background: rgba(0, 153, 187, 0.1);  color: #07a; }
[data-theme="light"] .tier-intermediate { background: rgba(204, 0, 90, 0.1);   color: #aa0050; }
[data-theme="light"] .tier-senior       { background: rgba(80, 80, 80, 0.12);  color: #444; }

[data-theme="light"] .lesson-box-beginner {
  background: rgba(0, 153, 187, 0.06);
  border-color: rgba(0, 153, 187, 0.2);
}
[data-theme="light"] .lesson-box-beginner h3 { color: #07a; }

[data-theme="light"] .lesson-box-senior {
  background: rgba(80, 80, 80, 0.06);
  border-color: rgba(80, 80, 80, 0.18);
}
[data-theme="light"] .lesson-box-senior h3 { color: #555; }

[data-theme="light"] .discord-banner {
  background: linear-gradient(135deg, #f0f0f0 0%, #fff 40%, #f5f5f5 100%);
}

[data-theme="light"] .discord-cta { color: #1a1a1a; }

/* ═══════════════════════════════════════════════════
   ICON TOGGLES (theme / senior mode)
═══════════════════════════════════════════════════ */
.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-toggle:hover { border-color: var(--accent); transform: scale(1.05); }
.icon-toggle.active-toggle { border-color: var(--accent); background: rgba(0, 229, 255, 0.10); }

.header-toggles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   TRACK COMPLETE BADGE
═══════════════════════════════════════════════════ */
.badge-complete {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.track-complete { border-color: rgba(0, 229, 255, 0.4) !important; }
.track-complete .progress-fill { background: linear-gradient(90deg, var(--accent), var(--pink)) !important; }

/* ═══════════════════════════════════════════════════
   CODE BLOCKS WITH COPY BUTTON
═══════════════════════════════════════════════════ */
.code-block {
  position: relative;
  margin: 1rem 0;
}

.code-block pre {
  margin: 0;
  padding-top: 2.5rem;
}

.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  z-index: 2;
}

.code-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════
   BOOKMARK BUTTON
═══════════════════════════════════════════════════ */
.btn-bookmark {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}

.btn-bookmark:hover { border-color: var(--accent); color: var(--accent); }
.btn-bookmark.bookmarked { border-color: #eab308; color: #eab308; background: rgba(234,179,8,0.1); }

/* ═══════════════════════════════════════════════════
   LABS
═══════════════════════════════════════════════════ */
.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
}

.lab-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lab-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lab-track-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.lab-card h3 { font-size: 1rem; margin: 0; }
.lab-card h3 a { color: var(--text); text-decoration: none; }
.lab-card h3 a:hover { color: var(--accent); }
.lab-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; flex: 1; margin: 0; }

.lab-open-btn { align-self: flex-start; margin-top: auto; }

/* ═══════════════════════════════════════════════════
   QUIZ
═══════════════════════════════════════════════════ */
.quiz-card {
  max-width: 720px;
  margin: 0 auto;
}

.quiz-track-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-track-header .track-icon { font-size: 2rem; }
.quiz-track-header h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.quiz-meta { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.quiz-passed-banner {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
}

.quiz-form { display: flex; flex-direction: column; gap: 1.5rem; }

.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.quiz-q-text { font-size: 1rem; margin-bottom: 1rem; line-height: 1.55; }

.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; }

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
  font-size: 0.95rem;
}

.quiz-option:hover { border-color: var(--accent); }
.quiz-radio { accent-color: var(--accent); }
.quiz-option-text { flex: 1; }

.quiz-option.correct      { border-color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.quiz-option.wrong-opt.selected-opt { border-color: #ef4444; background: rgba(239,68,68,0.1); }

.quiz-explain {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: rgba(59,130,246,0.08);
  border-left: 3px solid #60a5fa;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quiz-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.quiz-result {
  margin-top: 1.5rem;
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.quiz-result-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.quiz-result-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.quiz-result-score { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1rem; }

.quiz-passed { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); }
.quiz-failed { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.25); }

/* ═══════════════════════════════════════════════════
   CHECKLIST
═══════════════════════════════════════════════════ */
.checklist-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checklist-header h3 { font-size: 1rem; margin: 0; }
.checklist-progress { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

.checklist-items { display: flex; flex-direction: column; gap: 0.6rem; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  background: var(--bg-elevated);
}

.checklist-item:hover { border-color: var(--accent); }
.checklist-item.checked { text-decoration: line-through; opacity: 0.7; border-color: var(--accent); }
.checklist-check { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

.checklist-complete {
  margin-top: 1rem;
  text-align: center;
  padding: 0.75rem;
  background: rgba(16,185,129,0.1);
  border-radius: 8px;
  font-weight: 600;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   ACHIEVEMENTS
═══════════════════════════════════════════════════ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
}

.achievement-card.unlocked {
  border-color: rgba(234,179,8,0.35);
  background: rgba(234,179,8,0.05);
}

.achievement-card.locked {
  opacity: 0.55;
  filter: grayscale(60%);
}

.achievement-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ach-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.ach-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.ach-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

/* section title small */
.section-title-sm {
  font-size: 1.35rem;
  margin-top: 1.5rem;
}

/* dashboard bookmarks section */
.dashboard-bookmarks-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════
   SENIOR MODE — hide primer boxes
═══════════════════════════════════════════════════ */
.senior-mode .lesson-box-beginner { display: none !important; }

/* ═══════════════════════════════════════════════════
   MOBILE NAV
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: stretch; }
  .header-actions { flex-direction: column; align-items: stretch; }
  .nav-links { justify-content: center; flex-wrap: wrap; }
  .lang-toggle { justify-content: center; }
  .header-toggles { justify-content: center; }
  .hero { padding: 2rem 0.5rem 3rem; }
  .lesson-content { padding: 1.25rem; }
  .search-bar-wrap { max-width: 100%; }
  .tracks-grid { grid-template-columns: 1fr; }
  .labs-grid { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .quiz-track-header { flex-direction: column; align-items: flex-start; }
  .lesson-actions { flex-direction: column; }
  .lesson-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 1.25rem; }
  .persona-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   SYNTHWAVE EXTRA POLISH
═══════════════════════════════════════════════════ */

/* Scanlines overlay — very subtle, only on dark theme */
[data-theme="dark"] body::after,
:root body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: -1;
}

/* Cyan glow on card hover */
.track-card:hover {
  box-shadow: 0 6px 30px rgba(0, 229, 255, 0.12), var(--shadow);
}

/* Pink glow for recommended cards */
.track-recommended:hover {
  box-shadow: 0 6px 30px rgba(255, 45, 120, 0.14), var(--shadow);
}

/* Progress fill — cyan gradient */
.progress-fill {
  background: linear-gradient(90deg, var(--accent), #00cfeb);
}

/* Dash card value — cyan */
.dash-card .value { color: var(--accent); }

/* Search focus glow */
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

/* Active nav underline synthwave */
.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 2px;
}

/* Badge free — cyan outline */
.badge-free {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.3);
}

/* Lesson check filled */
.lesson-item.completed .lesson-check {
  background: linear-gradient(135deg, var(--accent), #00cfeb);
  border-color: var(--accent);
  color: #1a1a1a;
}

/* Course number bubble */
.course-num {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #1a1a1a;
}

/* Glossary card title */
.glossary-card h3 { color: var(--accent); }

/* Quiz explain border */
.quiz-explain { border-left-color: var(--accent); }

/* Checklist progress label */
.checklist-progress { color: var(--accent); }

/* Achievement unlocked border */
.achievement-card.unlocked {
  border-color: rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.04);
}

/* Roadmap card left border gradient */
.roadmap-card {
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--accent), var(--pink)) 1;
}

/* Footer accent */
.footer strong { color: var(--accent); }

/* Scrollbar synthwave */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--pink));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ═══════════════════════════════════════════════════
   DISCORD BANNER
═══════════════════════════════════════════════════ */
.discord-banner {
  display: block;
  margin-bottom: 2rem;
  text-decoration: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #222 40%, #2a2a2a 100%);
  border: 1px solid rgba(88, 101, 242, 0.45);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.15), 0 8px 32px rgba(88, 101, 242, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.discord-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.4), 0 12px 40px rgba(88, 101, 242, 0.28);
  text-decoration: none;
}

/* Glow strip at the top */
.discord-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00e5ff, #5865f2, #ff2d78, #00e5ff);
  background-size: 200% 100%;
  animation: discord-stripe 3s linear infinite;
}

@keyframes discord-stripe {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.discord-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.5rem;
  position: relative;
}

.discord-icon {
  color: #5865f2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 8px rgba(88, 101, 242, 0.6));
}

.discord-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.discord-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5865f2;
}

.discord-cta {
  font-size: 1rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.3;
}

/* Pulsing green "online" dot */
.discord-pulse {
  width: 12px;
  height: 12px;
  background: #23a55a;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.7);
  animation: discord-dot-pulse 2s ease-in-out infinite;
}

@keyframes discord-dot-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(35, 165, 90, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(35, 165, 90, 0.0); }
  100% { box-shadow: 0 0 0 0   rgba(35, 165, 90, 0.0); }
}

/* Footer discord link */
.footer-discord {
  margin-top: 0.75rem;
}

.footer-discord a {
  color: #7289da;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-discord a:hover {
  color: #00e5ff;
  text-decoration: none;
}

@media (max-width: 640px) {
  .discord-cta { font-size: 0.9rem; }
  .discord-banner-inner { gap: 0.9rem; padding: 0.9rem 1rem; }
}
