/* The quest layer gives the learning pages a shared game map while leaving
   activities, lesson content, and the editor's working controls intact. */
:root {
  --ink: #202c58;
  --muted: #53627e;
  --paper: #f5f7ff;
  --line: #d8def0;
  --blue: #3652d5;
  --blue-dark: #293c9b;
  --blue-soft: #e8edff;
  --cyan: #77dce9;
  --lime: #c8f277;
  --yellow: #ffdc70;
  --coral: #ff8d82;
}

body { background: var(--paper); }
.site-header { position: sticky; top: 0; box-shadow: 0 4px 0 rgba(35, 52, 113, .08); }
.brand-mark { background: #304cc5; box-shadow: 3px 3px 0 #84dfec; }
.main-nav .nav-worlds { color: var(--blue-dark); }
.main-nav .nav-contribute { background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 #d9aa3e; }
.main-nav .nav-contribute:hover { background: var(--lime); color: var(--ink); }
.footer-inner .nav-editor { color: white; font-size: .86rem; font-weight: 750; text-underline-offset: 3px; }

/* Welcome screen and puzzle portal */
.home-intro {
  padding: 70px 0 88px;
  background: radial-gradient(circle at 73% 22%, #5369c8 0, transparent 25%),
    radial-gradient(circle at 10% 86%, #405aa4 0, transparent 28%),
    linear-gradient(135deg, #162451, #263e84 60%, #304695);
  color: white;
}
.home-intro::before {
  opacity: .65;
  background-image: radial-gradient(#c8d6ff 1.5px, transparent 1.5px),
    radial-gradient(#b6f4ef 1px, transparent 1px);
  background-position: 0 0, 42px 58px;
  background-size: 108px 108px, 137px 137px;
  mask-image: none;
}
.home-intro-grid { gap: 58px; }
.home-intro .eyebrow { color: #d9f58c; }
.intro-copy h1 { max-width: 710px; font-size: clamp(3.2rem, 6vw, 5.4rem); }
.intro-copy h1 span { color: var(--yellow); }
.intro-copy h1 span::after { border-color: var(--cyan); }
.intro-lede { max-width: 560px; color: #e2eaff; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.hero-actions .primary-button { background: var(--yellow); color: var(--ink); box-shadow: 0 7px 0 #c99d37; }
.hero-actions .primary-button:hover { box-shadow: 0 5px 0 #c99d37; }
.hero-text-link { color: white; font-weight: 800; text-underline-offset: 4px; }
.math-board { border-color: #1d2b5c; box-shadow: 15px 17px 0 var(--cyan), 0 25px 50px rgba(4, 13, 44, .27); color: var(--ink); }
.math-board::before {
  content: "PLAY • NOTICE • LEARN";
  position: absolute;
  right: -13px;
  top: -20px;
  z-index: 1;
  padding: 8px 13px;
  border-radius: 9px;
  background: var(--lime);
  color: #29420c;
  font: 850 .64rem/1 "Avenir Next", Avenir, sans-serif;
  letter-spacing: .1em;
  transform: rotate(7deg);
}

/* A tiny, local quest log makes progress visible without scores or accounts. */
.quest-log { position: relative; z-index: 2; margin-top: -38px; scroll-margin-top: 90px; }
.quest-log-inner {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 128px;
  padding: 20px 26px;
  border: 2px solid #24336b;
  border-radius: 24px;
  background: white;
  box-shadow: 0 8px 0 #c9d3f1;
}
.quest-log-medal { display: grid; place-items: center; width: 64px; height: 64px; border: 3px solid #24336b; border-radius: 18px; background: var(--yellow); color: #26366f; font-size: 2rem; box-shadow: 4px 5px 0 var(--cyan); transform: rotate(-6deg); }
.quest-log-copy .eyebrow { margin-bottom: 2px; }
.quest-log-copy h2 { margin: 0; font-size: 1.42rem; line-height: 1.2; }
.quest-log-copy p:last-child { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.quest-log-steps { display: flex; gap: 14px; }
.quest-log-steps span { display: flex; align-items: center; gap: 7px; color: #415179; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.quest-log-steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); }

/* Four distinct worlds form a visible route into the full topic library. */
#worlds, #topics { scroll-margin-top: 90px; }
.quick-start { padding: 78px 0 46px; }
.quick-start .section-heading-row { margin-bottom: 28px; }
.world-path { position: relative; gap: 18px; }
.world-path::before { content: ""; position: absolute; top: 50%; left: 3%; right: 3%; border-top: 4px dashed #a7b6dd; transform: rotate(-2deg); }
.quick-path {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 272px;
  padding: 20px;
  border: 2px solid #28366f;
  border-radius: 24px;
  background: #dff8e9;
  box-shadow: 0 8px 0 #9acfb3;
  overflow: hidden;
}
.quick-path::after { content: ""; position: absolute; width: 122px; height: 122px; right: -34px; top: 28px; border: 15px solid rgba(255,255,255,.36); border-radius: 50%; pointer-events: none; }
.quick-path:nth-child(2) { background: #fff0d7; box-shadow: 0 8px 0 #e5c086; }
.quick-path:nth-child(3) { background: #dff2ff; box-shadow: 0 8px 0 #9ec9eb; }
.quick-path:nth-child(4) { background: #ece6ff; box-shadow: 0 8px 0 #beb0ee; }
.quick-path:hover { border-color: #28366f; background: inherit; transform: translateY(-5px); }
.quick-path:nth-child(1):hover { background: #dff8e9; }
.quick-path:nth-child(2):hover { background: #fff0d7; }
.quick-path:nth-child(3):hover { background: #dff2ff; }
.quick-path:nth-child(4):hover { background: #ece6ff; }
.world-number { position: relative; z-index: 1; color: #364675; font-size: .7rem; font-weight: 900; letter-spacing: .09em; }
.world-number span { color: #53617d; }
.quick-path-icon, .quick-path:nth-child(2) .quick-path-icon, .quick-path:nth-child(3) .quick-path-icon, .quick-path:nth-child(4) .quick-path-icon {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  border: 2px solid #29376c;
  border-radius: 19px;
  background: white;
  color: #2a418c;
  box-shadow: 4px 5px 0 rgba(33, 48, 102, .18);
  font: 850 2.1rem/1 Georgia, serif;
  transform: rotate(-6deg);
}
.quick-path:nth-child(2) .quick-path-icon { color: #a75631; transform: rotate(5deg); }
.quick-path:nth-child(3) .quick-path-icon { color: #146c92; }
.quick-path:nth-child(4) .quick-path-icon { color: #6d49aa; transform: rotate(5deg); }
.quick-path-copy { position: relative; z-index: 1; }
.quick-path-copy strong { font-size: 1.24rem; letter-spacing: -.025em; }
.quick-path-copy small { margin-top: 5px; color: #405273; font-size: .84rem; line-height: 1.42; }
.world-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: auto; padding-top: 9px; border-top: 1px solid rgba(34, 47, 95, .2); color: #263d93; font-size: .82rem; font-weight: 850; }
.world-action span:last-child { font-size: 1.2rem; }

/* Starter cards and the quest board */
.recommended-section { padding: 35px 0 58px; }
.recommended-grid { gap: 16px; }
.topic-card { min-height: 206px; padding: 20px; border: 2px solid #d3daf0; border-radius: 21px; box-shadow: 0 6px 0 #e0e6f4; }
.topic-card:hover { border-color: #91a8eb; box-shadow: 0 8px 0 #ced9f5; }
.topic-card-icon { width: 45px; height: 45px; border-radius: 14px; background: var(--yellow); color: var(--ink); }
.topic-card > strong { font-size: 1.08rem; }
.topic-card-skill { font-size: .86rem; }
.topic-card-footer { align-items: flex-end; padding-top: 12px; border-top: 1px dashed #c8d0e5; }
.topic-card-footer span:last-child { color: var(--blue-dark); white-space: nowrap; }
.topic-card.is-complete { border-color: #8ac3a1; background: #f7fff9; }
.topic-card.is-complete .topic-card-icon { background: var(--lime); }
.topic-card.is-complete [data-quest-status] { color: #226242; }
.recent-section { background: #eaf0ff; }
.recent-topic.is-complete { border-color: #8ac3a1; background: #f7fff9; }
.topics-section { padding: 76px 0 105px; background: linear-gradient(#f7f8ff, #eef3ff); }
.topic-tools { padding: 16px; border: 2px solid #d3dbef; border-radius: 22px; box-shadow: 0 6px 0 #e3e8f5; }
.topic-search { min-height: 56px; }
.filter-button { border: 1px solid transparent; }
.filter-button.is-active { background: var(--blue-dark); box-shadow: 0 3px 0 #1c2c77; }
.subject-index { top: 95px; padding: 18px; border: 2px solid #273873; border-radius: 20px; background: #263b78; box-shadow: 0 6px 0 #aebce7; }
.subject-index-label { color: #d4e4ff; }
.subject-button { color: #f4f6ff; }
.subject-button:hover { background: #425aa2; color: white; }
.subject-button.is-active { background: var(--yellow); color: var(--ink); }
.subject-button.is-active .subject-count { background: #fff6d7; color: var(--ink); }
.subject-count { background: #e7ecff; }
.topic-group { border: 2px solid #d7dff0; border-radius: 20px; box-shadow: 0 6px 0 #e0e7f3; }
.topic-group-header { padding: 22px 24px; background: #e9e5ff; }
.topic-group:nth-child(2) .topic-group-header { background: #e1f3fc; }
.topic-group:nth-child(3) .topic-group-header { background: #fff0d8; }
.topic-group:nth-child(4) .topic-group-header { background: #dff6e8; }
.topic-group:nth-child(5) .topic-group-header { background: #e8edff; }
.topic-group:nth-child(6) .topic-group-header { background: #ffe9e4; }
.topic-group:nth-child(7) .topic-group-header { background: #e7f6de; }
.topic-group-kicker { color: #41578c; }
.unit-heading { color: #586987; }
.topic-row { border: 1px solid #e3e8f3; background: #fcfdff; }
.topic-row:hover { border-color: #9eb4ef; background: #f0f4ff; }
.topic-icon { background: #e4eaff; }
.topic-row.is-complete { border-color: #b4d7bf; background: #f3fbf5; }
.topic-row.is-complete .topic-icon { background: var(--lime); color: #295324; }
.quest-complete-label { display: block; margin-top: 5px; color: #246744; font-size: .74rem; font-weight: 850; }
.quest-complete-label[hidden] { display: none; }
.group-expand { border: 1px dashed #9dafd8; background: #f7f9ff; }

/* The Quest Board is a playable picker: filter, choose a realm, or draw a quest. */
.topic-tools { margin-bottom: 22px; }
.unfinished-filter { grid-column: 1 / -1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 12px; border: 1px solid #bcc9e7; border-radius: 999px; background: #f6f8ff; color: #354980; font: 800 .82rem/1.2 "Avenir Next", Avenir, sans-serif; cursor: pointer; }
.unfinished-filter span { font-size: 1.25rem; line-height: 1; }
.unfinished-filter:hover, .unfinished-filter.is-active { border-color: #3f58b6; background: #e7edff; }
.unfinished-filter.is-active { box-shadow: inset 0 0 0 1px #3f58b6; }
.quest-compass { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 14px 21px; margin: 0 0 36px; padding: 23px 26px; border: 2px solid #23356f; border-radius: 24px; background: radial-gradient(circle at 96% 10%, #5068b7 0, transparent 25%), linear-gradient(125deg, #253878, #373d91); color: white; box-shadow: 0 7px 0 #b4c5ec; }
.compass-art { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid #21346e; border-radius: 50%; background: #e6fbf2; color: #2d4897; box-shadow: 4px 5px 0 #82dbdc; font-size: 2.4rem; }
.compass-art::after { content: ""; position: absolute; width: 3px; height: 34px; border-radius: 3px; background: #e87369; transform: rotate(35deg); }
.compass-copy .eyebrow { margin-bottom: 2px; color: var(--lime); }
.compass-copy h3 { margin: 0; font-size: 1.52rem; line-height: 1.15; letter-spacing: -.035em; }
.compass-copy p:last-child { margin: 5px 0 0; color: #dbe5ff; font-size: .88rem; }
.compass-button { min-height: 48px; display: inline-flex; align-items: center; gap: 17px; padding: 0 17px; border: 0; border-radius: 13px; background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 #c79d3c; font: 850 .9rem/1 "Avenir Next", Avenir, sans-serif; cursor: pointer; }
.compass-button:hover { transform: translateY(2px); box-shadow: 0 3px 0 #c79d3c; }
.compass-button:disabled { opacity: .5; cursor: default; transform: none; }
.compass-button span { font-size: 1.2rem; }
.compass-result { grid-column: 1 / -1; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 8px; padding: 15px; border: 1px solid #b6c5ed; border-radius: 17px; background: white; color: var(--ink); animation: quest-reveal .25s ease-out both; }
.compass-result[hidden] { display: none; }
@keyframes quest-reveal { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.compass-result-symbol { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border: 2px solid #243772; border-radius: 14px; background: var(--lime); font: 800 1.5rem/1 Georgia, serif; }
.compass-result-copy, .compass-result-copy > * { display: block; min-width: 0; }
.compass-result-copy small { color: var(--blue-dark); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.compass-result-copy strong { margin-top: 2px; font-size: 1.03rem; line-height: 1.3; }
.compass-result-copy > span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.compass-result-link { padding: 10px 14px; border-radius: 11px; background: var(--blue-dark); color: white; font-size: .83rem; font-weight: 850; text-decoration: none; white-space: nowrap; }
.compass-result-link:hover { background: #192e85; }

.topic-directory { display: block; }
.subject-index { position: static; margin-bottom: 28px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.realm-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 17px; }
.realm-heading .eyebrow { margin-bottom: 2px; }
.realm-heading h3 { margin: 0; font-size: 1.55rem; line-height: 1.2; letter-spacing: -.035em; }
.realm-heading > p { max-width: 340px; margin: 0; color: var(--muted); font-size: .87rem; }
.subject-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.subject-button { --realm-bg: #e4f7eb; --realm-edge: #a5d7b6; --realm-accent: #1b6a4a; position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-rows: 1fr auto; align-items: start; gap: 8px 10px; min-height: 132px; padding: 15px; border: 2px solid var(--realm-edge); border-radius: 19px; background: var(--realm-bg); color: var(--ink); box-shadow: 0 5px 0 color-mix(in srgb, var(--realm-edge) 65%, white); font: inherit; text-align: left; }
.subject-button:nth-child(1) { --realm-bg: #263b79; --realm-edge: #24366c; --realm-accent: #d3ec86; color: white; }
.subject-button:nth-child(3) { --realm-bg: #fff0d8; --realm-edge: #e8c48b; --realm-accent: #9c6222; }
.subject-button:nth-child(4) { --realm-bg: #ffebe5; --realm-edge: #e7b5a4; --realm-accent: #9e4b37; }
.subject-button:nth-child(5) { --realm-bg: #e5f3ff; --realm-edge: #a9cce8; --realm-accent: #266789; }
.subject-button:nth-child(6) { --realm-bg: #e8e9ff; --realm-edge: #b7bde9; --realm-accent: #4655a5; }
.subject-button:nth-child(7) { --realm-bg: #fff0da; --realm-edge: #e4c190; --realm-accent: #976226; }
.subject-button:nth-child(8) { --realm-bg: #efe9ff; --realm-edge: #c4b3ea; --realm-accent: #7454a0; }
.subject-button:hover { background: var(--realm-bg); color: inherit; transform: translateY(-2px); }
.subject-button.is-active { border-color: #213672; background: var(--realm-bg); color: inherit; box-shadow: 0 5px 0 #516ba9, inset 0 0 0 1px #213672; }
.subject-button:first-child:is(:hover, .is-active) { color: white; }
.subject-button:disabled { opacity: .42; }
.realm-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid currentColor; border-radius: 13px; background: rgba(255,255,255,.73); color: var(--realm-accent); font: 850 1.4rem/1 Georgia, serif; }
.subject-button:first-child .realm-icon { background: var(--yellow); color: var(--ink); }
.realm-copy, .realm-copy strong, .realm-copy small { display: block; min-width: 0; }
.realm-copy strong { font-size: .94rem; line-height: 1.2; }
.realm-copy small { margin-top: 5px; color: inherit; font-size: .73rem; line-height: 1.25; opacity: .82; }
.subject-count, .subject-button.is-active .subject-count { min-width: 30px; padding: 5px 7px; background: rgba(255,255,255,.86); color: #283a76; }
.realm-progress { position: relative; grid-column: 1 / -1; padding-top: 12px; color: inherit; font-size: .72rem; font-weight: 800; }
.realm-progress::before, .realm-progress::after { content: ""; position: absolute; top: 1px; left: 0; height: 5px; border-radius: 99px; }
.realm-progress::before { right: 0; background: rgba(51, 71, 124, .17); }
.realm-progress::after { width: var(--realm-progress, 0%); background: var(--realm-accent); }
.topic-results { scroll-margin-top: 96px; }
.results-summary { align-items: center; margin-bottom: 14px; }
.results-count { font-size: .98rem; color: #374b83; }
.group-stats { display: grid; justify-items: end; gap: 3px; color: #425581; }
.group-stats [data-group-progress] { font-size: .73rem; font-weight: 800; }
.topic-group.is-focused { border-color: #8da5df; box-shadow: 0 8px 0 #c7d4ef; }
.unit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; padding: 18px; counter-reset: stage; }
.unit-group { min-width: 0; margin: 0; padding: 14px; border: 1px dashed #bfcae0; border-radius: 16px; background: #f9fbff; counter-increment: stage; }
.unit-group + .unit-group { border-top: 1px dashed #bfcae0; }
.unit-heading { display: flex; align-items: center; gap: 8px; min-height: 29px; margin-bottom: 10px; color: #415483; }
.unit-heading::before { content: counter(stage, decimal-leading-zero); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #e3eaff; color: var(--blue-dark); font-size: .66rem; }
.topic-list { grid-template-columns: 1fr; }
.topic-row { min-height: 86px; border: 1px solid #dbe3f1; border-radius: 13px; background: white; box-shadow: 0 3px 0 #ebeff6; }
.topic-row:hover { transform: translateX(3px); box-shadow: 0 4px 0 #d9e2f4; }
.topic-row.is-complete { border-color: #a7d2b7; }
.group-expand { width: calc(100% - 36px); margin-inline: 18px; border: 1px solid #bbc9e7; background: #edf2ff; }
.group-expand::before { content: "✦ "; color: #415fbe; }
.help-strip { background: linear-gradient(120deg, #273a78, #3d3184); }
.help-strip .eyebrow { color: var(--lime); }

/* Every lesson is a mission with three clear stops. */
.lesson-hero { padding: 36px 0 44px; border-color: #233772; background: radial-gradient(circle at 85% 20%, #4d69b4 0, transparent 24%), linear-gradient(135deg, #243774, #334b96); color: white; }
.lesson-hero::after { border-color: rgba(133, 225, 235, .28); }
.breadcrumb { margin-bottom: 28px; color: #d6dfff; }
.breadcrumb a { color: #e7f8ad; }
.lesson-title-row .eyebrow { color: var(--lime); }
.lesson-summary { color: #e5ecff; }
.lesson-symbol { border-color: #1b2b60; color: var(--ink); }
.lesson-meta { margin-top: 30px; }
.lesson-meta div { border-color: rgba(255,255,255,.24); }
.lesson-meta dt { color: #bfcefa; }
.mission-map { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 32px; }
.mission-map a { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 5px 15px 5px 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(255,255,255,.12); color: white; font-size: .85rem; font-weight: 800; text-decoration: none; }
.mission-map a:hover { background: rgba(255,255,255,.24); }
.mission-map span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--ink); }
.lesson-layout { padding-top: 58px; }
.lesson-nav { top: 95px; border: 2px solid #d8e0f1; border-radius: 20px; box-shadow: 0 5px 0 #e2e8f4; }
.lesson-nav > p { color: var(--blue-dark); }
.lesson-nav ol { counter-reset: map-step; }
.lesson-nav li a { display: flex; align-items: flex-start; gap: 9px; }
.lesson-nav li a::before { counter-increment: map-step; content: counter(map-step); flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: .7rem; font-weight: 850; }
.interactive-lab { border-color: #273873; box-shadow: 9px 10px 0 var(--yellow); }
.lab-heading .eyebrow { color: #415cc9; }
.lab-badge { background: #fff1bd; color: #6f4c0a; }
.lesson-chapter-heading { margin: 60px 0 22px; }
.lesson-chapter-heading .eyebrow { margin-bottom: 5px; }
.lesson-chapter-heading h2 { margin: 0; font-size: 2rem; line-height: 1.18; letter-spacing: -.04em; }
.lesson-chapter-heading p:last-child { margin: 6px 0 0; color: var(--muted); }
.lesson-section { border: 2px solid #d9e1f0; border-radius: 19px; box-shadow: 0 5px 0 #e4e9f3; }
.lesson-section > summary::before { content: attr(data-section-number); display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-dark); font: 850 .82rem/1 "Avenir Next", Avenir, sans-serif; }
.lesson-section[open] { border-color: #b9c8ee; }
.lesson-section[open] > summary::before { background: var(--yellow); color: var(--ink); }
.quest-completion { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px 22px; margin-top: 66px; padding: 28px; border: 3px solid #273873; border-radius: 24px; background: #fff3cf; box-shadow: 9px 10px 0 #ffcf6e; scroll-margin-top: 98px; }
.completion-star { display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid #273873; border-radius: 20px; background: white; color: #e7a02d; font-size: 2.4rem; transform: rotate(-8deg); }
.quest-completion .eyebrow { margin-bottom: 3px; color: #825118; }
.quest-completion h2 { margin: 0; font-size: 1.75rem; line-height: 1.17; letter-spacing: -.035em; }
.quest-completion p:not(.eyebrow) { margin: 6px 0 0; color: #5e5360; }
.complete-quest-button { grid-column: 2; justify-self: start; border: 0; background: var(--blue-dark); color: white; box-shadow: 0 6px 0 #182964; cursor: pointer; font: 800 .95rem/1 "Avenir Next", Avenir, sans-serif; }
.complete-quest-button:hover { box-shadow: 0 4px 0 #182964; }
.quest-completion .quest-feedback { grid-column: 2; margin: 0; font: 750 .88rem/1.4 "Avenir Next", Avenir, sans-serif; }
.quest-feedback:empty { display: none; }
.quest-completion.is-complete { border-color: #2a684b; background: #e7f8e8; box-shadow: 9px 10px 0 #b6e2b5; }
.quest-completion.is-complete .completion-star { color: #2a8055; }
.quest-completion.is-complete .complete-quest-button { background: #276546; box-shadow: 0 6px 0 #16432e; }
.related-guides { border-color: #cdd8eb; }
.related-list > a { border: 2px solid #d8e0ef; box-shadow: 0 3px 0 #e8edf7; }
.community-box { border-color: #315c4e; }

/* The contribution form is the creator camp for students and educators. */
.contributor-page { background: linear-gradient(#eef3ff, #f8faff); }
.contributor-page .workspace-header { position: relative; overflow: hidden; padding: 37px 42px; border: 2px solid #243775; border-radius: 25px; background: radial-gradient(circle at 83% 35%, #6174bd, transparent 25%), linear-gradient(120deg, #263c81, #3c428f); color: white; box-shadow: 0 8px 0 #c8d5f1; }
.contributor-page .workspace-header::after { content: "✦  ✧  ✦"; position: absolute; right: 6%; top: 30%; color: #d2ec9c; font-size: 3rem; letter-spacing: .4em; transform: rotate(-10deg); }
.contributor-page .workspace-header .eyebrow { color: var(--lime); }
.contributor-page .contributor-intro { max-width: 570px; margin: 17px 0 0; color: #e3ebff; font-size: 1.08rem; }
.contributor-page .prototype-notice { border: 1px solid #b9c9f0; background: #e9efff; }
.contributor-page .workflow-steps li > span { border-color: #9eafe0; background: white; }
.contributor-page .workflow-steps li.is-active > span { border-color: #293e96; background: var(--yellow); color: var(--ink); }
.contributor-page .workflow-steps li.is-active strong { color: var(--blue-dark); }
.contributor-page .idea-form { border: 2px solid #cbd7ef; box-shadow: 0 8px 0 #e0e8f5; }
.contributor-page .form-section-heading > span { background: var(--yellow); color: var(--ink); }
.contributor-page .figure-drop { border-color: #9dafd5; background: #f5f8ff; }
.contributor-page .generate-button { --shelf: #1d2f77; background: var(--blue-dark); }

@media (max-width: 1040px) {
  .quest-log-inner { grid-template-columns: 62px minmax(0, 1fr); }
  .quest-log-steps { grid-column: 2; flex-wrap: wrap; }
  .quick-path { min-height: 295px; }
}

@media (max-width: 820px) {
  .home-intro { padding-block: 56px 82px; }
  .intro-copy { text-align: left; }
  .intro-lede { margin-inline: 0; }
  .hero-actions { justify-content: flex-start; }
  .world-path::before { top: 4%; bottom: 4%; left: 50%; width: 0; border-top: 0; border-left: 4px dashed #a7b6dd; transform: none; }
  .quick-path { min-height: 248px; }
  .subject-index { position: static; }
  .subject-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header .brand { font-size: .92rem; }
  .main-nav > a.nav-worlds { display: none; }
  .main-nav a { padding-inline: 8px; }
  .main-nav .nav-contribute { box-shadow: none; }
  .home-intro { padding: 42px 0 72px; }
  .home-intro-grid { gap: 45px; }
  .intro-copy h1 { font-size: clamp(2.3rem, 10.8vw, 3.4rem); }
  .hero-actions { gap: 12px; }
  .home-intro-grid { gap: 26px; }
  .math-board { min-height: 220px; padding-top: 36px; }
  .equation, .equation.has-diagram { min-height: 120px; }
  .math-board::before { right: -3px; }
  .quest-log { margin-top: -30px; }
  .quest-log-inner { grid-template-columns: 48px 1fr; gap: 11px; padding: 17px; border-radius: 19px; }
  .quest-log-medal { width: 46px; height: 46px; border-radius: 13px; font-size: 1.4rem; }
  .quest-log-copy h2 { font-size: 1.18rem; }
  .quest-log-copy p:last-child { font-size: .75rem; }
  .quest-log-steps { grid-column: 1 / -1; justify-content: space-between; gap: 7px; padding-top: 11px; border-top: 1px dashed var(--line); }
  .quest-log-steps span { font-size: .67rem; }
  .quest-log-steps b { width: 21px; height: 21px; }
  .quick-start { padding-top: 57px; }
  .world-path::before { left: 18px; }
  .quick-path { min-height: 0; padding: 19px 20px; }
  .quick-path-copy strong { font-size: 1.2rem; }
  .recommended-section { padding-bottom: 46px; }
  .topic-card { min-height: 178px; }
  .topics-section { padding-block: 55px 75px; }
  .topic-tools { gap: 12px; }
  .unfinished-filter { justify-self: stretch; justify-content: center; }
  .quest-compass { grid-template-columns: 55px minmax(0, 1fr); gap: 12px; padding: 18px; }
  .compass-art { width: 52px; height: 52px; font-size: 1.7rem; }
  .compass-art::after { height: 25px; }
  .compass-copy h3 { font-size: 1.22rem; }
  .compass-copy p:last-child { font-size: .77rem; }
  .compass-button { grid-column: 1 / -1; justify-content: center; }
  .compass-result { grid-template-columns: 43px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .compass-result-symbol { width: 42px; height: 42px; font-size: 1rem; }
  .compass-result-link { grid-column: 1 / -1; text-align: center; }
  .realm-heading { display: block; }
  .realm-heading > p { margin-top: 5px; }
  .subject-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .subject-button { grid-template-columns: 36px 1fr; grid-template-rows: 36px 1fr auto; min-height: 134px; padding: 11px; gap: 6px; font-size: .8rem; }
  .realm-icon { width: 35px; height: 35px; border-radius: 9px; font-size: 1rem; }
  .realm-copy { grid-column: 1 / -1; }
  .realm-copy strong { font-size: .85rem; }
  .realm-copy small { font-size: .69rem; }
  .subject-count { position: absolute; top: 12px; right: 11px; }
  .realm-progress { font-size: .66rem; }
  .unit-list { padding: 12px; }
  .unit-group { padding: 11px; }
  .group-stats { text-align: right; }
  .lesson-hero { padding: 22px 0 30px; }
  .breadcrumb { margin-bottom: 17px; }
  .lesson-title-row { gap: 17px; }
  .lesson-symbol { width: 70px; height: 70px; border-radius: 18px; font-size: 2rem; }
  .lesson-symbol.is-compact { font-size: 1.5rem; }
  .lesson-symbol.is-extra-compact { font-size: 1.2rem; }
  .lesson-summary { margin-top: 10px; }
  .lesson-meta { row-gap: 13px; margin-top: 21px; }
  .mission-map { gap: 6px; margin-top: 19px; }
  .mission-map a { min-height: 40px; padding-right: 10px; font-size: .75rem; }
  .mission-map span { width: 27px; height: 27px; }
  .lesson-chapter-heading { margin-top: 54px; }
  .lesson-chapter-heading h2 { font-size: 1.7rem; }
  .lesson-section > summary { padding-inline: 13px; gap: 11px; }
  .lesson-section > summary::before { width: 28px; height: 28px; }
  .quest-completion { grid-template-columns: 55px minmax(0, 1fr); gap: 11px; padding: 19px; box-shadow: 6px 7px 0 #ffcf6e; }
  .completion-star { width: 54px; height: 54px; border-radius: 15px; font-size: 1.6rem; }
  .quest-completion h2 { font-size: 1.38rem; }
  .complete-quest-button, .quest-completion .quest-feedback { grid-column: 1 / -1; }
  .footer-inner { align-items: flex-start; }
  .contributor-page .workspace-header { padding: 26px 21px; }
  .contributor-page .workspace-header::after { right: -12px; top: 10px; font-size: 1.3rem; }
  .contributor-page .contributor-intro { font-size: .98rem; }
  .contributor-page .workflow-steps { grid-template-columns: 1fr; gap: 12px; margin-block: 25px; }
  .contributor-page .workflow-steps li::after { top: 40px; bottom: -12px; left: 19px; right: auto; width: 2px; height: auto; }
  .contributor-page .workflow-steps li div { background: transparent; }
}

@media (max-width: 420px) {
  .quest-log-steps { display: grid; grid-template-columns: 1fr 1fr; }
  .main-nav .nav-explore { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .quick-path, .topic-card, .topic-row, .primary-button { transition: none; }
  .compass-result { animation: none; }
}
