/* Discovery Quest — course walkthrough pages (/courses/*).
   Builds on /styles.css (shared tokens, nav, footer, atmosphere). This file adds
   the doc-style layout for the SEO/AEO course pages: breadcrumbs, world/stage
   sections, per-step cards with pedagogy + the open .course.yml snippet. Zero JS. */

.doc {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px 96px;
}

/* ---- breadcrumbs ---- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 26px 0 8px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); text-decoration: underline; }
.crumbs .sep { color: var(--muted-dim); }
.crumbs [aria-current] { color: var(--text); }

/* ---- page header ---- */
.doc-head { padding: 8px 0 18px; border-bottom: 1px solid var(--panel-edge); margin-bottom: 30px; }
.doc-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 12px;
}
.doc-title { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: clamp(30px, 6vw, 46px); line-height: 1.05; margin: 0 0 14px; color: var(--text); }
.doc-lede { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 60ch; margin: 0 0 20px; }
.doc-lede strong { color: var(--text); }

/* ---- stat row ---- */
.stats { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 20px 0 6px; }
.stat {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 9px 14px;
}
.stat b { font-family: "Baloo 2", sans-serif; font-size: 19px; color: var(--gold-bright); }
.stat span { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---- open-source banner (the selling point) ---- */
.opensource {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  background: linear-gradient(180deg, rgba(34,211,238,0.08), rgba(34,211,238,0.02));
  border: 1px solid rgba(34,211,238,0.28); border-radius: 16px;
  padding: 16px 18px; margin: 26px 0;
}
.opensource p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); flex: 1 1 320px; }
.opensource p strong { color: var(--text); }
.opensource .btn { flex: 0 0 auto; }

/* ---- generic prose ---- */
.doc h2.section-h {
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin: 40px 0 14px;
}
.doc p.note { font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* ---- world / station nav grid on the overview ---- */
.world-list { display: grid; gap: 14px; margin: 8px 0; }
.world-card {
  display: block; text-decoration: none;
  background: var(--panel); border: 1px solid var(--panel-edge); border-left: 4px solid var(--wc, var(--cyan));
  border-radius: 14px; padding: 16px 18px; transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.world-card:hover { transform: translateY(-2px); background: rgba(40,47,92,0.6); }
.world-card .wc-top { display: flex; align-items: center; gap: 10px; }
.world-card .wc-emoji { font-size: 24px; }
.world-card .wc-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 19px; color: var(--text); margin: 0; }
.world-card .wc-num { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted-dim); }
.world-card .wc-blurb { font-size: 14px; color: var(--muted); margin: 8px 0 10px; line-height: 1.5; }
.world-card .wc-stations { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-station { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(150,165,230,0.1); border-radius: 999px; padding: 3px 10px; }

/* ---- stage page: world hero accent ---- */
.world-hero { border-left: 5px solid var(--wc, var(--cyan)); padding-left: 18px; }

/* ---- station block ---- */
.station { margin: 0 0 14px; padding: 30px 0 8px; border-top: 1px solid var(--panel-edge); }
.station:first-of-type { border-top: 0; }
.station-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.station-icon { font-size: 26px; }
.station-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 23px; color: var(--text); margin: 0; }
.station-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }

/* primitive chips — name an engine board/view (link to the reference) */
.prim {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--cyan); background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.25); border-radius: 8px; padding: 3px 9px; text-decoration: none;
}
.prim:hover { background: rgba(34,211,238,0.16); }
.prim .prim-kind { color: var(--muted-dim); font-weight: 800; }
.prim--board { color: var(--gold-bright); background: rgba(255,185,83,0.08); border-color: rgba(255,185,83,0.28); }
.prim--board:hover { background: rgba(255,185,83,0.16); }

/* ---- step card (one lesson section) ---- */
.step {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 16px;
  padding: 18px 20px; margin: 0 0 16px;
}
.step-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.step-n {
  flex: 0 0 auto; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 13px;
  color: var(--ink); background: var(--gold-bright); border-radius: 8px; padding: 2px 9px;
}
.step-label { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 18px; color: var(--text); margin: 0; }
.step-why { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.step-why strong { color: var(--parchment); font-weight: 800; }
.step-why code, .step-meta code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--cyan); background: rgba(34,211,238,0.08); padding: 1px 5px; border-radius: 5px; }

.step-sub { font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-dim); margin: 16px 0 7px; }
.step-sub:first-of-type { margin-top: 0; }

/* narration / what the child sees & hears */
.beats { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.beats li { font-size: 14px; line-height: 1.5; color: var(--muted); padding-left: 16px; position: relative; }
.beats li::before { content: "“"; position: absolute; left: 0; color: var(--muted-dim); font-weight: 800; }

/* the open .course.yml snippet (how it's configured — for humans and agents) */
.yml {
  margin: 0; background: #0e1124; border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 13px 15px; overflow-x: auto;
}
.yml pre { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.55; color: #cdd6f9; white-space: pre; tab-size: 2; }
.yml .k { color: #8fb3ff; }   /* keys */
.yml .s { color: #b6e3a7; }   /* strings */
.yml .n { color: #f0b86e; }   /* numbers */
.yml .c { color: var(--muted-dim); }

/* preview — a still image or a looping clip, full-width below the config */
.shot--media { position: relative; max-width: 600px; }
.shot--media img, .shot--media video {
  display: block; width: 100%; height: auto; border-radius: 14px;
  border: 1px solid var(--panel-edge); box-shadow: 0 16px 40px rgba(8, 10, 25, 0.4);
  background: #0f1430;
}
/* a small badge marking a clip that replays the lesson's motion */
.shot-badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em; color: var(--cyan);
  background: rgba(14, 17, 36, 0.72); border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px; padding: 3px 9px; backdrop-filter: blur(4px);
}
.shot--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; max-width: 600px; text-align: center;
  background: repeating-linear-gradient(45deg, rgba(150, 165, 230, 0.04) 0 10px, transparent 10px 20px);
  border: 1px dashed var(--panel-edge); border-radius: 12px; padding: 16px;
}
.shot--empty .shot-icon { font-size: 26px; }
.shot--empty .shot-cap { font-size: 12px; font-weight: 700; color: var(--muted-dim); }
.shot--empty .shot-cap code { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }

/* ---- prev/next pager ---- */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--panel-edge); }
.pager a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; max-width: 46%; }
.pager a:hover { color: var(--cyan); }
.pager .pg-dir { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-dim); }
.pager .pg-next { text-align: right; margin-left: auto; }

/* ---- primitives reference ---- */
.prim-table { width: 100%; border-collapse: collapse; margin: 6px 0 26px; font-size: 13.5px; }
.prim-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-dim); padding: 8px 10px; border-bottom: 1px solid var(--panel-edge); }
.prim-table td { padding: 11px 10px; border-bottom: 1px solid var(--panel-edge); color: var(--muted); vertical-align: top; line-height: 1.5; }
.prim-table td.kind { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--cyan); white-space: nowrap; }
.prim-table td.fields { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted-dim); }

/* ---- "How it teaches" pillars (self-contained; no entrance animation dependency) ---- */
.doc .pillars { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 6px 0 8px; }
@media (min-width: 640px) { .doc .pillars { grid-template-columns: 1fr 1fr; } }
.doc .pillar { opacity: 1; transform: none; animation: none; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 16px 18px; }
.doc .pillar h3 { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 16px; color: var(--text); margin: 0 0 7px; }
.doc .pillar p { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0; }

/* ---- FAQ (also emitted as FAQPage JSON-LD for answer engines) ---- */
.faq { display: grid; gap: 10px; max-width: 760px; }
.faq-item { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 2px 16px; }
.faq-item summary { cursor: pointer; font-weight: 800; color: var(--text); padding: 13px 0; list-style: none; font-size: 15px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "＋"; color: var(--cyan); font-weight: 800; margin-right: 10px; }
.faq-item[open] summary::before { content: "－"; }
.faq-item p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; font-size: 14.5px; }

/* ---- create-a-course: the AI prompt builder ---- */
.cf label { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-dim); margin: 0 0 6px; }
.cf-input, .cf-select {
  width: 100%; box-sizing: border-box; background: #0e1124; border: 1px solid var(--panel-edge);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 15px; outline: none;
}
.cf-input::placeholder { color: var(--muted-dim); }
.cf-input:focus, .cf-select:focus { border-color: rgba(255, 185, 83, 0.6); }
.cf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cf-chip {
  font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(150, 165, 230, 0.08);
  border: 1px solid var(--panel-edge); border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.cf-chip:hover { border-color: rgba(255, 185, 83, 0.5); color: var(--text); }
.cf-two { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 640px) { .cf-two { grid-template-columns: 1fr 1fr; } }
.cf-prompthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.cf-copy {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 0;
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 14px; color: #11160b;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-radius: 11px; padding: 9px 16px;
}
.cf-copy:hover { filter: brightness(1.05); }

/* ---- back-to-top / section anchors offset ---- */
.station[id], .world-sec[id] { scroll-margin-top: 80px; }
