/* 🏔️ Quantum Ascent — Minimalist Editorial Design System (light-only) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;1,400&display=swap');

:root {
  /* Colors — warm paper, near-black ink, one green brand accent */
  --bg: #f8f6f1;
  --bg2: #f1eee6;
  --panel: #ffffff;
  --line: #e2dfd8;
  --text: #1a1a18;
  --muted: #6b6860;

  --accent: #1f7a4d;
  --accent-bg: #eaf6ee;
  --accent-strong: #17603c;

  --amber: #b45309;
  --amber-bg: #fdf3e7;
  /* Was only ever defined in widgets/_base/widget.css, which loads inside the
     widget iframes — so every use of it on a top-level page (the Summit chip
     on the home page, for one) silently fell back to inherited ink. */
  --amber-strong: #7c3a06;

  --danger: #b3261e;
  --danger-bg: #fbebe9;

  /* Font pairs */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max-w-wide: 1080px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* -------- Global Reset & Base Layout -------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* A page must never scroll sideways. `clip` rather than `hidden` so we do
     not turn <html> into a scroll container (which would break the sticky
     nav and the Kit Check tally). */
  overflow-x: clip;
}

/* The nav is fixed and body is padded 84px to clear it, so an in-page anchor
   would otherwise scroll its target underneath the pill and out of sight. */
[id] {
  scroll-margin-top: 96px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Headings — light serif, never bold */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

a:hover {
  border-bottom-color: currentColor;
}

/* -------- Navigation Header — floating glassmorphism pill -------- */
/* Room for the fixed pill that floats over the top of every page. */
body { padding-top: 84px; }

#nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 940px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(1.25rem, 4vw, 1.75rem);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 99px;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(26, 26, 24, 0.06);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

#nav.scrolled {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 32px rgba(26, 26, 24, 0.10);
}

#nav .nav-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  color: var(--text);
  border-bottom: none;
  white-space: nowrap;
}

#nav .nav-name img,
#nav .nav-name svg {
  width: 24px;
  height: 24px;
}

#nav .nav-name span {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border-bottom: none;
  transition: color 0.2s;
  /* A nav label that wraps is the failure this whole layout was rebuilt to
     stop. Refuse to wrap and refuse to shrink; if it genuinely will not fit,
     the 960px breakpoint below hands over to the burger instead. */
  white-space: nowrap;
  flex: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

#xp-pill {
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--amber);
  background: var(--amber-bg);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  /* The nav is a fixed-height pill, and adding the sign-in button squeezed
     this one until "100 XP · 1/6" wrapped onto three lines and burst out of
     it. Both chips must refuse to shrink and refuse to wrap. */
  white-space: nowrap;
  flex: none;
}
.nav-links > .gsi-btn { flex: none; white-space: nowrap; }

/* ── Toolbox disclosure ──
   A native <details>, so it opens by keyboard and announces its own state
   without a line of JavaScript. nav.js only adds the two conveniences the
   element does not give us: click-outside and Escape to close. */
.nav-group { position: relative; flex: none; }

.nav-group > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  list-style: none;               /* Firefox: hide the default triangle */
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: "▾";
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.2s ease;
}
.nav-group[open] > summary::after { transform: rotate(180deg); }
.nav-group > summary:hover,
.nav-group[open] > summary { color: var(--text); }

/* "You are here" has to survive being inside a closed disclosure, so the
   summary carries the marker on behalf of whichever child is current. */
.nav-group.active > summary {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.nav-drop {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 264px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Opaque, like the mobile panel: at 0.97 the page text underneath was still
     legible through the menu items. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(26, 26, 24, 0.14);
}

.nav-drop a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  border-bottom: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}
.nav-drop a:hover,
.nav-drop a:focus-visible { background: var(--bg2); }
.nav-drop a.active { background: var(--accent-bg); color: var(--accent-strong); }

.nav-drop-note {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
}

/* ── Hamburger button (hidden on desktop) ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  border-bottom: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* X animation when the menu is open (CSS :target, no JS needed) */
#nav:has(#nav-menu:target) .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav:has(#nav-menu:target) .nav-burger span:nth-child(2) { opacity: 0; }
#nav:has(#nav-menu:target) .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dismiss overlay: covers the page while the mobile menu is open */
.nav-dismiss {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  pointer-events: none;
  border-bottom: none;
}
body:has(#nav-menu:target) .nav-dismiss {
  display: block;
  pointer-events: auto;
}

/* Site is light-only now; the toggle markup is being retired from pages,
   this is just a safety net if it lingers anywhere. */
#theme-toggle {
  display: none;
}

/* -------- Layout Containers & Grids -------- */
.container {
  max-width: var(--max-w-wide);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  flex: 1;
}

/* -------- Hero Section -------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  padding: 40px 0 60px;
}

.hero-content {
  flex: 1.2;
  min-width: 320px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-visual {
  flex: 0.8;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(26, 26, 24, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Interactive spinning-coin hero: the first thing a visitor can DO */
.hero-visual-card.coin-card {
  flex-direction: column;
  gap: 12px;
  text-align: center;
  max-width: 340px;
}
.coin-card #hero-coin { display: block; }
.coin-caption {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 44px;
}
.coin-caption b { color: var(--text); }
.coin-live {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  min-height: 24px;
}
.coin-live.pop { animation: coin-pop 0.35s; }
@keyframes coin-pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.coin-tally {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 20px;
}
.coin-tally b { color: var(--text); }
.coin-cta { min-height: 20px; }

/* Both of these are empty until the first slap, and reserving their height
   (plus two flex gaps) left ~64px of blank card foot on every first visit.
   Collapse them until they have something to say. .coin-live keeps its
   min-height, because its text changes on every slap and must not jolt. */
.coin-tally:empty,
.coin-cta:empty { display: none; }
.coin-cta a {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  cursor: pointer;
  font-size: 15px;
  font-family: var(--font-body);
  gap: 8px;
  transition: background-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn:active {
  transform: scale(0.98);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  background: var(--bg2);
  border-color: var(--muted);
}

/* Secondary outline-accent style (class name kept for HTML compatibility) */
.btn.violet {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.violet:hover {
  background: var(--accent-bg);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* -------- Card Panels & Grid Layouts -------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(26, 26, 24, 0.03);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.panel.card, .grid3 .panel {
  cursor: pointer;
}

.panel.card:hover, .grid3 .panel:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(26, 26, 24, 0.07);
}

.panel h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.panel p.muted {
  font-size: 15px;
  line-height: 1.7;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* -------- "Start here" route band --------
   Deliberately a vertical numbered list rather than three cards in a row.
   Cards side by side read as three alternatives you pick between; a numbered
   column with a rail down the left reads as one thing after another, which is
   what this actually is. The shape has to carry the ordering, because that
   ordering is the exact thing a first-time visitor was missing. */
.startpath {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.startpath > li {
  counter-increment: step;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px 22px 76px;
  box-shadow: 0 2px 8px rgba(26, 26, 24, 0.03);
}

.startpath > li::before {
  content: counter(step);
  position: absolute;
  left: 24px;
  top: 23px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

/* The rail joining one step to the next — "then this" made visible. */
.startpath > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 39px;
  top: 63px;
  bottom: -15px;
  width: 2px;
  background: var(--line);
}

.startpath h3 {
  font-size: 19px;
  margin-bottom: 8px;
  color: var(--text);
}

.startpath p {
  font-size: 15px;
  line-height: 1.7;
}

.startpath .btn {
  margin-top: 14px;
}

/* Step 2 is a fork, not a list. Two bordered boxes side by side say "pick one"
   in a way two stacked paragraphs never do — and the recommended one is marked,
   so a beginner who has no basis for choosing is not left to flip a coin. */
.track-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.track {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg);
}

.track.recommended {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.track > b {
  display: block;
  margin-bottom: 4px;
}

.track p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  .track-pick {
    grid-template-columns: 1fr;
  }
}

.step-tag {
  display: inline-block;
  margin-left: 8px;
  vertical-align: 3px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

h2.section {
  margin: 60px 0 24px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  position: relative;
  display: inline-block;
}

h2.section::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

.muted {
  color: var(--muted);
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--amber);
  background: var(--amber-bg);
  color: var(--amber);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 13px;
  font-weight: 500;
  margin: 2px;
}

/* Honest signifier for basecamps not yet built: reads "locked / coming soon",
   never the ✓ used for completed work. */
.soon-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}
.panel.locked { opacity: 0.72; }
.panel.locked h3 { color: var(--muted); }
.marker-lock { color: var(--muted); }

/* Inline glossary term: a quiet dotted underline that reveals a definition
   on hover, keyboard focus, or tap. */
.gterm {
  position: relative;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  color: inherit;
}
.gterm:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.gtip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 70;
  width: max-content;
  max-width: min(280px, calc(100vw - 28px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(26, 26, 24, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.gterm:hover .gtip,
.gterm:focus .gtip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 520px) { .gtip { max-width: min(220px, calc(100vw - 28px)); } }

/* XP pill reads as an interactive control, not just a number */
#xp-pill:hover { color: var(--text); }
#xp-pill { transition: color 0.15s; }

/* First-visit orientation bubble pointing at the XP pill */
.pill-coach {
  position: fixed;
  z-index: 60;
  max-width: 300px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  box-shadow: 0 8px 28px rgba(26, 26, 24, 0.16);
  animation: coach-in 0.35s ease-out;
}
.pill-coach::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: var(--panel);
  border-left: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  transform: rotate(45deg);
}
.pill-coach button {
  display: block;
  margin: 10px 0 0 auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
@keyframes coach-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------- Ascent Map (SVG styling) -------- */
#mountain {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(26, 26, 24, 0.03);
}

.camp {
  cursor: pointer;
}

.camp circle.node {
  fill: var(--panel);
  stroke: var(--line);
  stroke-width: 2;
  transition: stroke 0.2s, fill 0.2s;
}

.camp:hover circle.node {
  stroke: var(--accent);
  fill: var(--accent-bg);
}

.camp.done circle.node {
  fill: var(--accent);
  stroke: var(--accent);
}

.camp.available circle.node {
  stroke: var(--accent);
  fill: var(--accent-bg);
}

/* Locked camps read as not-yet-open (dashed, dimmed) but stay clickable —
   the module page shows an honest "coming soon" preview of what's inside. */
.camp.locked { opacity: 0.6; }
.camp.locked circle.node { stroke-dasharray: 3 4; }

/* "Start here" beacon on the next basecamp you should climb */
.camp .start-here {
  fill: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.camp .pulse-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: camp-pulse 1.8s ease-out infinite;
}
@keyframes camp-pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .camp .pulse-ring { animation: none; opacity: 0.5; }
}

.camp text {
  fill: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
}

.camp text.sub {
  fill: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.trail {
  stroke: var(--line);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1 6;
}

.trail.lit {
  stroke: var(--accent);
}

/* -------- Quiz -------- */
.quiz-q {
  margin: 24px 0;
}

.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 10px 0;
  cursor: pointer;
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.15s, background-color 0.15s;
}

.quiz-opt:hover {
  border-color: var(--accent);
  background-color: var(--accent-bg);
}

/* Right/wrong must not rely on colour alone (≈8% of boys are colourblind):
   pair every colour with a shape glyph. */
.quiz-opt.correct {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.quiz-opt.correct::after {
  content: " ✓";
  float: right;
  color: var(--accent);
  font-weight: 700;
}
.quiz-opt.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.quiz-opt.wrong::after {
  content: " ✗";
  float: right;
  color: var(--danger);
  font-weight: 700;
}

.quiz-opt[disabled] {
  cursor: default;
}

.quiz-explain {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 12px;
  border-left: 2px solid var(--accent);
  padding: 10px 16px;
  background: var(--bg2);
  border-radius: 0 8px 8px 0;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------- Progress Ring -------- */
.ring {
  transform: rotate(-90deg);
}

.ring .track {
  stroke: var(--line);
  fill: none;
}

.ring .val {
  stroke: var(--accent);
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s;
}

/* -------- Footer -------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 30px 40px;
  color: var(--muted);
  font-size: 14px;
  /* Every footer here is one sentence. `display: flex; space-between` made
     each text node and link its own flex item and threw them to opposite ends
     of a 1280px page — "Built for the ... WISER ... Export progress" with
     yawning gaps. It is prose; lay it out as prose. */
  text-align: center;
  background: var(--bg);
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--accent);
}

/* -------- Learning List -------- */
.learning-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.learning-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s;
}

.learning-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* -------- Split-Pane Workspace (Analogy Studio) -------- */
.workspace {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  align-items: flex-start;
}
.workspace-left {
  flex: 1;
}
.workspace-right {
  flex: 1.2;
  position: sticky;
  top: 90px;
}
.prompt-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.prompt-header h3 {
  margin-bottom: 0;
  font-size: 18px;
}
.prompt-placeholder {
  color: var(--muted);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px 20px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
#prompt-out {
  white-space: pre-wrap;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  overflow-y: auto;
  max-height: 420px;
  flex: 1;
}
.workspace select, .workspace input[type="text"] {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  margin: 6px 0 20px;
  outline: none;
  transition: border-color 0.15s;
}
.workspace select:focus, .workspace input[type="text"]:focus {
  border-color: var(--accent);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13.5px;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
    align-items: stretch;
  }
  .workspace-right {
    position: static;
  }
}

.marker-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* -------- Desktop-First Responsive Styles -------- */
@media (max-width: 1024px) {
  .container {
    padding: 32px 20px;
  }
  .hero {
    gap: 40px;
  }
  .grid3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 30px;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero p.lead {
    margin-left: auto;
    margin-right: auto;
  }
  footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* The pill needs about 880px of content: logo 180 + four entries 288 + the
   sign-in button 117 + the XP pill 119 + the gaps between them. Below that it
   has to collapse, and 640px was far too late — measured in Chromium at a
   900px viewport, "Start here" and "The Ascent" were still wrapping onto two
   lines each. This breakpoint is the measurement, not a guess. */
@media (max-width: 960px) {
  /* Show the hamburger; collapse the links into a drop-down panel */
  .nav-burger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: calc(1rem + 52px + 8px);
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.25rem 0.75rem;
    /* Fully opaque: at 0.97 the hero headline was still legible through the
       open menu, which made both unreadable. A menu is not a glass surface. */
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(26, 26, 24, 0.12);
    z-index: 99;
  }

  #nav-menu:target {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }

  /* Every row already has a hairline under it, so a green underline reads as a
     divider rather than as "you are here". Mark the current page by weight and
     colour instead. */
  .nav-links a.active {
    border-bottom-color: var(--line);
    color: var(--accent-strong);
    font-weight: 600;
  }

  .nav-links #xp-pill {
    margin-top: 0.75rem;
  }

  /* Inside the burger panel there is no room to float anything: the Toolbox
     becomes an inline accordion, indented so the nesting is still legible. */
  .nav-group {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }
  .nav-group > summary {
    padding: 0.75rem 0;
    font-size: 0.95rem;
  }
  .nav-group.active > summary {
    border-bottom: none;
    padding-bottom: 0.75rem;
  }
  .nav-drop {
    position: static;
    transform: none;
    min-width: 0;
    padding: 0 0 0.5rem 0.9rem;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-drop a {
    width: auto;
    padding: 0.5rem 0.6rem;
    border-bottom: none;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  #nav {
    gap: 12px;
  }
  #nav .nav-name {
    font-size: 18px;
  }

  .grid3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  /* Narrow screens cannot spare 76px of gutter for the step numbers, so the
     badge sits inline above the heading instead of beside it. */
  .startpath > li {
    padding: 20px;
  }
  .startpath > li::before {
    position: static;
    margin-bottom: 10px;
  }
  .startpath > li:not(:last-child)::after {
    display: none;
  }
  .btn {
    width: 100%;
    margin-bottom: 8px;
  }
  .btn.ghost {
    margin-bottom: 0;
  }
}

/* -------- Widget stage — frames an embedded widget so it reads as a special,
   hands-on instrument rather than a plain box blended into the page. -------- */
.widget-stage {
  margin: 16px 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(26, 26, 24, 0.08);
  overflow: hidden;
}

.widget-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  background: var(--accent-bg);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.widget-stage-label {
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.widget-stage-pop {
  font-size: 12.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.widget-stage iframe {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
}

/* Hero kicker — names the programme this was built for, above the headline.
   Real orientation for a visitor arriving from the challenge, and it puts
   "WISER Education Challenge 2026" high in the document where it belongs
   rather than only in the footer. */
.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero-kicker a { color: var(--accent); font-weight: 700; }
