/* Benefits Unlocked — Pixel Quest theme overlay */
:root {
  --pixel-blue: #1a3fd4;
  --pixel-blue-dark: #0f2a9e;
  --pixel-blue-light: #3b5fff;
  --pixel-red: #e52525;
  --pixel-red-dark: #a81818;
  --pixel-orange: #ff6b00;
  --pixel-gold: #ffd700;
  --pixel-gold-dark: #c9a000;
  --pixel-green: #00e676;
  --pixel-purple: #7c3aed;
  --pixel-surface: #fffef5;
  --pixel-text: #1a1040;
  --pixel-text-muted: #4a4080;
  --pixel-border: #0a0a2e;
  --pixel-shadow: 4px 4px 0 var(--pixel-border);
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --quest-width: 96px;

  --bg: #1a3fd4;
  --surface: var(--pixel-surface);
  --text: var(--pixel-text);
  --text-muted: var(--pixel-text-muted);
  --accent: var(--pixel-gold);
  --accent-light: #fff8c4;
  --accent-dark: var(--pixel-gold-dark);
  --accent-glow: rgba(255, 215, 0, 0.45);
  --success: var(--pixel-green);
  --radius: 0;
  --shadow: var(--pixel-shadow);
  --shadow-hover: 6px 6px 0 var(--pixel-border);
  --font: var(--font-body);
  --font-display: var(--font-pixel);
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--pixel-text);
  background-color: var(--pixel-blue);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.35) 2px, transparent 2px),
    radial-gradient(circle at 88% 15%, rgba(255, 215, 0, 0.5) 3px, transparent 3px),
    radial-gradient(circle at 75% 85%, rgba(255, 255, 255, 0.25) 2px, transparent 2px),
    radial-gradient(circle at 20% 70%, rgba(255, 107, 0, 0.35) 2px, transparent 2px),
    linear-gradient(180deg, var(--pixel-blue-light) 0%, var(--pixel-blue) 40%, var(--pixel-blue-dark) 100%);
  background-size: 120px 120px, 160px 160px, 140px 140px, 100px 100px, 100% 100%;
  image-rendering: pixelated;
}

body.has-quest-sidebar {
  padding-right: calc(var(--quest-width) + 12px);
}

.container.content,
.container-wide {
  background: var(--pixel-surface);
  border: 3px solid var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  margin-top: 1rem;
}

.page-home .container-wide {
  background: rgba(255, 254, 245, 0.95);
}

.page-victory .container,
.page-victory .container-wide {
  background: transparent;
  border: none;
  box-shadow: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-pixel);
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
}

h1 { font-size: clamp(0.85rem, 3.5vw, 1.15rem); line-height: 1.6; }
h2 { font-size: clamp(0.7rem, 2.5vw, 0.85rem); }
h3 { font-size: clamp(0.6rem, 2vw, 0.75rem); }

/* Readable body copy — not pixel, still on-brand */
p, li, blockquote,
.subtitle, .hero p, .complete-lead,
.feature-card p, .module-card p,
.video-meta, .video-section p,
.deliverables-lead, .deliverables-more,
.resource-intro, .resource-section p,
.disclaimer, .sources, .sources li,
.official-links, .official-links a,
.site-footer, .site-footer p,
.stat span, .sidebar-progress,
.download-card p, .preview-item > p,
.written-supplement, .written-supplement li,
.takeaway-list, .checklist li,
.cert-label, .certificate-section > p,
.lesson-nav .prev, .lesson-header .subtitle,
.course-hero p, .quest-label {
  font-family: var(--font-body);
}

.hero p {
  font-size: 1.125rem;
  font-weight: 600;
}

.supplement-note {
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
  background: rgba(255, 215, 0, 0.15);
  border-left: 4px solid var(--pixel-gold);
  color: var(--pixel-text);
}

a {
  color: var(--pixel-gold-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

a:hover { color: var(--pixel-orange); }

/* Header */
.site-header {
  background: var(--pixel-surface);
  border-bottom: 4px solid var(--pixel-border);
  backdrop-filter: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.logo {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--pixel-text);
  text-transform: uppercase;
}

.logo span {
  background: none;
  -webkit-text-fill-color: var(--pixel-red);
  color: var(--pixel-red);
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--pixel-text-muted);
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--pixel-red);
}

.nav-links a.nav-logout {
  color: var(--pixel-text-muted);
}

.nav-links a.nav-logout:hover {
  color: var(--pixel-orange);
}

.nav-links a.nav-logout[aria-busy="true"] {
  opacity: 0.65;
  cursor: wait;
}

/* Buttons */
.btn {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  border-radius: 0;
  border: 3px solid var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pixel-border);
}

.btn-primary {
  background: var(--pixel-gold);
  color: var(--pixel-text);
  box-shadow: var(--pixel-shadow);
}

.btn-primary:hover {
  background: var(--pixel-orange);
  color: #fff;
}

.btn-secondary {
  background: var(--pixel-surface);
  color: var(--pixel-text);
  border: 3px solid var(--pixel-border);
}

.btn-secondary:hover {
  background: var(--accent-light);
  color: var(--pixel-text);
}

.nav-back-wrap {
  margin: 0 0 1.25rem;
}

.btn-back {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.5rem;
  line-height: 1.6;
  padding: 0.5rem 0.75rem;
}

/* Hero */
body.page-home {
  background-color: var(--pixel-blue);
}

.hero {
  padding: 3rem 1.25rem 4rem;
}

.hero-bg {
  background: none;
  animation: none;
}

.hero-art {
  max-width: 420px;
  margin: 0 auto 1.5rem;
  image-rendering: pixelated;
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.35));
}

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-badge {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  background: var(--pixel-red);
  color: #fff;
  border: 3px solid var(--pixel-border);
  border-radius: 0;
  box-shadow: var(--pixel-shadow);
  text-transform: uppercase;
}

.hero h1 {
  color: var(--pixel-gold);
  background: none;
  -webkit-text-fill-color: var(--pixel-gold);
  max-width: 28ch;
}

.hero p {
  color: #fff;
  font-size: 1.4rem;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.stat {
  background: var(--pixel-surface);
  border: 3px solid var(--pixel-border);
  border-radius: 0;
  box-shadow: var(--pixel-shadow);
}

.stat strong {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--pixel-red);
}

.stat span {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  text-transform: uppercase;
}

/* Cards */
.feature-card,
.preview-item,
.module-card,
.video-lesson,
.download-card,
.certificate-section,
.course-hero,
.written-supplement,
.sources,
.video-section {
  border-radius: 0;
  border: 3px solid var(--pixel-border);
  box-shadow: var(--pixel-shadow);
}

.feature-card:hover,
.module-card:hover,
.download-card:hover,
.preview-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pixel-border);
}

.feature-card-1 { border-top: 6px solid var(--pixel-red); }
.feature-card-2 { border-top: 6px solid var(--pixel-gold); }
.feature-card-3 { border-top: 6px solid var(--pixel-green); }

.preview-item {
  background: var(--pixel-surface);
}

.preview-cta {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  line-height: 1.6;
  color: var(--pixel-red);
}

.course-hero {
  background: var(--pixel-surface);
  border-left: 8px solid var(--pixel-gold);
}

.course-hero h1 { color: var(--pixel-red); }

.module-num {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  border-radius: 0;
  border: 2px solid var(--pixel-border);
  background: var(--pixel-gold);
  color: var(--pixel-text);
}

.module-card.done .module-num {
  background: var(--pixel-green);
  color: var(--pixel-text);
}

.progress-bar-wrap {
  border-radius: 0;
  border: 2px solid var(--pixel-border);
  background: rgba(0, 0, 0, 0.15);
  height: 14px;
}

.progress-bar {
  border-radius: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--pixel-gold) 0,
    var(--pixel-gold) 8px,
    var(--pixel-orange) 8px,
    var(--pixel-orange) 16px
  );
  transition: width 0.5s steps(8);
}

/* Lesson */
.lesson-meta {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--pixel-red);
}

.disclaimer {
  border-radius: 0;
  border: 3px solid var(--pixel-red-dark);
  background: #ffe8e8;
  box-shadow: var(--pixel-shadow);
}

.deliverables {
  border-radius: 0;
  border: 3px solid var(--pixel-gold);
  background: linear-gradient(180deg, #2a1a6e, #1a1040);
  box-shadow: var(--pixel-shadow);
}

.deliverables h2 {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--pixel-gold);
}

.download-card-inline {
  border-radius: 0;
  border: 2px solid var(--pixel-gold);
}

.download-card-featured {
  border: 3px solid var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  background: var(--pixel-gold);
}

.download-card-featured .download-btn {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  line-height: 1.6;
  text-transform: uppercase;
  background: transparent;
  color: var(--pixel-text);
  border: none;
  box-shadow: none;
}

.download-card-featured:hover {
  background: var(--pixel-orange);
}

.download-card-featured:hover .download-btn {
  color: #fff;
}

.download-card-featured .download-card-body strong {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 2.8vw, 0.85rem);
  line-height: 1.5;
}

.download-card-featured .download-card-content p {
  font-size: 1rem;
}

.mark-complete {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  border-radius: 0;
  border: 3px dashed var(--pixel-gold-dark);
  background: var(--accent-light);
  box-shadow: var(--pixel-shadow);
  text-transform: uppercase;
}

.mark-complete:hover { background: var(--pixel-gold); }
.mark-complete.completed {
  background: var(--pixel-green);
  border-style: solid;
  color: var(--pixel-text);
  cursor: pointer;
}

.mark-complete.completed:hover {
  background: #b8f5d4;
  border-color: var(--pixel-text-muted);
}

.lesson-nav .next {
  border-radius: 0;
  border: 3px solid var(--pixel-border);
  background: var(--pixel-gold);
  color: var(--pixel-text);
  box-shadow: var(--pixel-shadow);
}

.course-video {
  border-radius: 0;
  border: 4px solid var(--pixel-border);
  display: block;
}

.video-transcript-link {
  border-radius: 0;
  border: 3px solid var(--pixel-border);
  background: var(--pixel-gold);
  color: var(--pixel-text);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
  font-family: var(--font-body);
  font-size: 1rem;
}

.video-transcript-link:hover {
  background: #ffe566;
  color: var(--pixel-text);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.video-lesson .video-transcript-link {
  margin-top: 0;
  border-top: none;
}

.site-footer {
  background: var(--pixel-surface);
  border-top: 4px solid var(--pixel-border);
  font-size: 1.1rem;
}

/* Completion page */
.page-complete {
  background: var(--pixel-blue);
}

.complete-badge {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  border-radius: 0;
  border: 3px solid var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  background: var(--pixel-gold);
  color: var(--pixel-text);
}

.complete-main h1 {
  color: var(--pixel-gold);
  -webkit-text-fill-color: var(--pixel-gold);
}

.complete-trophy {
  max-width: 280px;
  margin: 0 auto 1.5rem;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.4));
}

.confetti {
  background-image:
    radial-gradient(circle, var(--pixel-gold) 3px, transparent 3px),
    radial-gradient(circle, var(--pixel-red) 3px, transparent 3px),
    radial-gradient(circle, #fff  2px, transparent 2px);
  opacity: 0.25;
}

/* Side quest progress bar */
.quest-sidebar {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: 0;
  width: var(--quest-width);
  bottom: 8px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  background: var(--pixel-surface);
  border-left: 4px solid var(--pixel-border);
  border-top: 4px solid var(--pixel-border);
  border-bottom: 4px solid var(--pixel-border);
  box-shadow: -4px 4px 0 rgba(0, 0, 0, 0.25);
}

.quest-sidebar[hidden] { display: none; }

.quest-title {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  text-align: center;
  color: var(--pixel-red);
  margin: 0 0 4px;
  line-height: 1.5;
}

.quest-boss-zone {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  width: 72px;
  height: auto;
  flex-shrink: 0;
  margin-bottom: 4px;
  align-items: center;
  justify-items: center;
}

.quest-chest-guarded {
  position: relative;
  grid-row: 2;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  z-index: 1;
  filter: brightness(0.75) saturate(0.8);
  transition: filter 0.4s, transform 0.4s;
}

.quest-boss-zone .quest-dragon {
  position: relative;
  grid-row: 1;
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.35));
  transition: opacity 0.4s, transform 0.4s;
}

.quest-boss-zone.quest-cleared .quest-dragon {
  opacity: 0;
  transform: scale(0.3) translateY(-12px);
  pointer-events: none;
}

.quest-boss-zone.quest-cleared .quest-chest-guarded {
  filter: drop-shadow(0 0 8px #ffd700) brightness(1.1);
  transform: scale(1.08);
}

.quest-boss-zone::after {
  content: "🔒";
  position: absolute;
  bottom: 2px;
  right: 0;
  font-size: 0.65rem;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.3s;
}

.quest-boss-zone.quest-cleared::after {
  content: "✨";
  opacity: 1;
}

.quest-track {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 200px;
  margin: 4px 0;
}

.quest-track-bg {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 12px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    180deg,
    #ccc 0, #ccc 4px,
    #999 4px, #999 8px
  );
  border: 2px solid var(--pixel-border);
}

.quest-dragon,
.quest-chest {
  image-rendering: pixelated;
}

.quest-knight {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translateX(-50%);
  z-index: 3;
  transition: bottom 0.6s steps(8);
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

.quest-knight.quest-knight-bump {
  animation: knightBump 0.35s steps(4);
}

@keyframes knightBump {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.15); }
}

.quest-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  text-align: center;
  color: var(--pixel-text-muted);
  margin: 2px 0;
  line-height: 1.4;
}

.quest-count {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--pixel-gold-dark);
  background: var(--pixel-text);
  color: var(--pixel-gold);
  padding: 4px 6px;
  border: 2px solid var(--pixel-border);
  margin-top: 4px;
}

.quest-mute {
  margin-top: 6px;
  padding: 4px;
  background: transparent;
  border: 2px solid var(--pixel-border);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.quest-mute:hover { background: var(--accent-light); }

/* Victory animation page */
.page-victory {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--pixel-blue);
}

.victory-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#victory-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 80vh;
  border: 4px solid var(--pixel-border);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}

.victory-hud {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--pixel-gold);
  text-shadow: 2px 2px 0 #000;
  margin-top: 1rem;
  text-align: center;
  min-height: 2em;
}

.victory-skip {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--pixel-border);
  cursor: pointer;
  z-index: 10;
}

.final-test-card {
  display: block;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--pixel-red);
  color: var(--pixel-cream);
  border: 4px solid var(--pixel-border);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: transform 0.1s;
}

.final-test-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
  color: var(--pixel-cream);
}

.final-test-card.final-test-passed {
  background: #0f2a9e;
  border-color: var(--pixel-gold);
}

.final-test-badge {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--pixel-gold);
  display: block;
  margin-bottom: 0.5rem;
}

.final-test-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  margin: 0 0 0.5rem;
  line-height: 1.6;
}

.final-test-card p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

@media (max-width: 900px) {
  .quest-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72px;
    flex-direction: row;
    border-left: none;
    border-top: 4px solid var(--pixel-border);
    padding: 4px 8px;
  }

  body.has-quest-sidebar {
    padding-right: 0;
    padding-bottom: 80px;
  }

  .quest-boss-zone {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 80px;
    height: 56px;
    margin-right: 4px;
    flex-shrink: 0;
  }

  .quest-boss-zone .quest-dragon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .quest-boss-zone .quest-chest-guarded {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .quest-track {
    flex: 1;
    min-height: unset;
    height: 48px;
    margin: 0 8px;
  }

  .quest-track-bg {
    left: 8px;
    right: 8px;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 12px;
    transform: translateY(-50%);
  }

  .quest-boss-zone {
    order: 3;
    margin-right: 0;
  }

  .quest-boss-zone::after {
    bottom: 4px;
    right: 2px;
    font-size: 0.5rem;
  }

  .quest-knight {
    top: 50%;
    bottom: auto !important;
    left: 0;
    transform: translate(-50%, -50%);
    transition: left 0.6s steps(8);
  }

  .quest-title,
  .quest-label { display: none; }

  .quest-count {
    font-size: 0.32rem;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  h1 { font-size: 0.75rem; }
}
