/* EMBER learner home — the unified, branded dashboard. Standalone-safe: defines
   the dark-theme fallbacks so it renders even before theme.js applies the tenant
   palette. Premium card grid, fully responsive + accessible. */
:root {
  --bg: #0e1116; --panel: #161b22; --panel2: #1c232d; --line: #2a323d;
  --ink: #e7edf3; --muted: #93a1b0; --brand: #ff7a18; --brand2: #7ec9ff;
  --good: #3fb950; --bad: #f85149; --partial: #d29922;
  --radius: 14px; --shadow: 0 8px 24px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand);
  color: #160a04; padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip-link:focus { left: 12px; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #11161d, var(--bg)); }
.brand-mark { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.ember-badge { line-height: 0; }
.ember-badge svg { filter: drop-shadow(0 4px 10px rgba(255,122,24,.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-product { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand-tagline { color: var(--muted); font-size: 12px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: var(--brand2); text-decoration: none; font-size: 14px;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.topnav a:hover { background: var(--panel2); text-decoration: none; }
.topnav a.legacy { color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.ghost-btn { cursor: pointer; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px;
  font-size: 13px; font-weight: 600; }
.ghost-btn:hover { border-color: var(--brand2); }
.ghost-btn.active { border-color: var(--brand); color: var(--brand); }

a:focus-visible, button:focus-visible, .comp-row:focus-visible, .qcard:focus-visible {
  outline: 2px solid var(--brand2); outline-offset: 2px; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 56px; }
.wrap:focus { outline: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 { font-size: 16px; margin: 0 0 14px; }
.progress-section, .quick-section { margin-top: 30px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); min-height: 210px; display: flex; }
.hero-bg { position: absolute; inset: 0;
  background-image: url('/sim-assets/_worked/fire-warden.png');
  background-size: cover; background-position: center 32%; }
/* Dark scrim, heaviest on the left so the copy stays legible over any scene. */
.hero-scrim { position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10,13,18,.94) 0%, rgba(10,13,18,.86) 38%, rgba(10,13,18,.45) 72%, rgba(10,13,18,.25) 100%),
    linear-gradient(0deg, rgba(255,122,24,.10), rgba(126,201,255,.05)); }
.hero-inner { position: relative; display: flex; align-items: center; gap: 22px; padding: 26px 28px; }
.welcome-ember { line-height: 0; flex: none; filter: drop-shadow(0 6px 16px rgba(255,122,24,.30)); }
.welcome-copy h1 { margin: 0 0 5px; font-size: 27px; letter-spacing: -.01em; }
.welcome-sub { margin: 0; color: #d7dee7; font-size: 15px; max-width: 46ch; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
/* Primary "what to do next" call-to-action — gently pulses to draw the eye. */
.hero-cta {
  display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800;
  color: #160a04; background: var(--brand, #ff7a18); border: 0; border-radius: 999px;
  padding: 11px 22px; text-decoration: none; transition: filter .15s ease, transform .15s ease;
  box-shadow: 0 4px 16px rgba(255,122,24,.35); animation: heroPulse 2.6s ease-in-out infinite;
}
.hero-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes heroPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255,122,24,.35); }
  50%      { box-shadow: 0 4px 26px rgba(255,122,24,.65); }
}
@media (prefers-reduced-motion: reduce) { .hero-cta { animation: none; } }
.intro-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600;
  color: #e7edf3; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 9px 16px;
  text-decoration: none; transition: filter .15s ease, transform .15s ease, background .15s ease;
}
.intro-btn:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.intro-btn:focus-visible { outline: 2px solid var(--brand2, #7ec9ff); outline-offset: 2px; }

/* Module thumbnail on the competency rows (order: circle → image → title). */
.comp-thumb { width: 64px; height: 40px; flex: none; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: #0a0e1c; }

/* ── Recommendation ────────────────────────────────────────────────────── */
.rec-mount { margin-top: 22px; }
.rec { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: linear-gradient(135deg, rgba(255,122,24,.14), rgba(126,201,255,.08));
  border: 1px solid var(--brand); border-radius: var(--radius); padding: 16px 20px; }
.rec.capstone, .rec.stretch { border-color: var(--good);
  background: linear-gradient(135deg, rgba(63,185,80,.14), rgba(126,201,255,.06)); }
.rec-tag { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--brand2); margin-bottom: 5px; }
.rec-reason { margin: 0; font-size: 15px; line-height: 1.45; }
.rec-btn { flex: none; cursor: pointer; white-space: nowrap; text-decoration: none;
  background: var(--brand); color: #160a04; border: 0; font-weight: 700;
  border-radius: 9px; padding: 12px 20px; font-size: 14px; }
.rec-btn:hover { filter: brightness(1.08); }

/* ── Progress ──────────────────────────────────────────────────────────── */
.progress-pct { font-size: 20px; font-weight: 800; color: var(--brand); }
.progress-bar { height: 10px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; margin: 4px 0 18px; }
.progress-bar i { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--good)); transition: width .6s ease; }
.comp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comp-empty { color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; font-size: 14px; }
.comp-row { display: flex; align-items: center; gap: 12px; text-decoration: none;
  color: inherit; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; }
a.comp-row:hover { border-color: var(--brand2); }
.comp-row.locked { opacity: .6; }
.comp-icon { width: 28px; height: 28px; flex: none; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; background: var(--panel2);
  border: 1px solid var(--line); font-size: 14px; }
.comp-icon.mastered { background: rgba(63,185,80,.15); border-color: var(--good); color: var(--good); }
.comp-icon.passed { background: rgba(126,201,255,.12); border-color: var(--brand2); color: var(--brand2); }
.comp-icon.in-progress { border-color: var(--brand); color: var(--brand); }
.comp-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.comp-score { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.comp-chip { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.comp-chip.mastered { color: var(--good); border-color: var(--good); }
.comp-chip.passed { color: var(--brand2); border-color: var(--brand2); }
.comp-chip.in-progress { color: var(--brand); border-color: var(--brand); }

/* ── Quick-link cards ──────────────────────────────────────────────────── */
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.qcard { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.qcard:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.qcard.is-locked { opacity: .7; }
.qcard.is-locked:hover { transform: none; border-color: var(--line); }
.qcard-icon { font-size: 26px; line-height: 1; }
.qcard-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.qcard-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.card-badge.due { color: var(--partial); border-color: var(--partial); }
.card-badge.ready { color: var(--good); border-color: var(--good); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.page-footer { max-width: 960px; margin: 0 auto; padding: 0 20px 40px;
  color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .wrap { padding: 22px 16px 48px; }
  .hero-inner { flex-direction: column; text-align: center; gap: 14px; padding: 22px 18px; }
  .hero-actions { justify-content: center; }
  .welcome-sub { max-width: none; }
  .comp-thumb { width: 52px; height: 34px; }
  .rec { flex-direction: column; align-items: stretch; }
  .rec-btn { text-align: center; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .progress-bar i { transition: none; }
  .qcard { transition: none; }
  .qcard:hover { transform: none; }
}
