:root {
  --bg: #111512;
  --panel: #191e1a;
  --line: #343c35;
  --muted: #9ba79e;
  --text: #eef1e9;
  --lime: #d1fa69;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 5px;
}
header {
  height: 96px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand b {
  background: var(--lime);
  color: var(--bg);
  font: 600 25px var(--mono);
  padding: 3px 8px;
}
.beta {
  color: var(--muted);
  font: 12px var(--mono);
  margin-left: 20px;
}
nav {
  display: flex;
  gap: 34px;
  font-size: 14px;
}
nav span {
  color: var(--lime);
}
main {
  min-height: calc(100vh - 175px);
}
.wrap {
  max-width: 1360px;
  margin: auto;
  padding: 65px 5%;
}
.eyebrow {
  font: 12px var(--mono);
  letter-spacing: 2px;
  color: var(--lime);
  text-transform: uppercase;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
  padding-bottom: 75px;
}
h1 {
  font-size: clamp(46px, 5.4vw, 78px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -4px;
  margin: 25px 0;
}
h1 em {
  font-style: normal;
  color: var(--lime);
}
.intro {
  color: var(--muted);
  max-width: 450px;
  font-size: 18px;
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  background: var(--lime);
  color: #111512;
  border: 1px solid var(--lime);
  padding: 13px 21px;
  font-size: 14px;
  font-weight: 600;
}
.btn:hover {
  background: #e1ff9c;
}
.btn.secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}
.actions {
  display: flex;
  gap: 14px;
  margin: 30px 0 20px;
}
.micro {
  font: 12px var(--mono);
  color: var(--muted);
}
.terminal {
  background: #090d0a;
  border: 1px solid #485249;
  box-shadow: 12px 12px 0 #1e261c;
  min-width: 0;
}
.termbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 12px var(--mono);
}
.dots {
  letter-spacing: 5px;
  color: #7b897d;
}
.demo {
  padding: 27px;
  font: 14px/2 var(--mono);
  min-height: 305px;
}
.green {
  color: var(--lime);
}
.dim {
  color: var(--muted);
}
.demo .response {
  color: #a6bab0;
  margin: 5px 0 16px;
}
.caret {
  display: inline-block;
  background: var(--lime);
  width: 9px;
  height: 18px;
  vertical-align: middle;
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.terminal-note {
  display: flex;
  justify-content: space-between;
  font: 12px var(--mono);
  color: var(--muted);
  margin: 25px 0 0;
}
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 25px 25px 25px 0;
}
.stat strong {
  font: 500 30px var(--sans);
  display: block;
}
.stat span {
  font: 12px var(--mono);
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 48px 0 22px;
}
h2 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 5px 0;
}
.chapter-row {
  display: grid;
  grid-template-columns: 65px 1fr 1fr 110px 25px;
  align-items: center;
  gap: 20px;
  padding: 23px 0;
  border-top: 1px solid var(--line);
}
.chapter-row:hover {
  background: #1b221a;
}
.chapter-row .num {
  color: var(--lime);
  font: 14px var(--mono);
}
.chapter-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}
.chapter-row code {
  color: var(--muted);
  font: 12px var(--mono);
}
.chapter-row small {
  color: var(--muted);
  font: 12px var(--mono);
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px 5%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font: 11px var(--mono);
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: 245px minmax(280px, 390px) minmax(350px, 1fr);
  min-height: calc(100vh - 175px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 18px;
}
.sidebar .eyebrow {
  margin: 0 10px 22px;
}
.sidechapter {
  font: 12px var(--mono);
  color: var(--muted);
  margin: 23px 10px 8px;
}
.missionlink {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.4;
}
.missionlink.active {
  background: #2c3822;
  color: var(--lime);
  border-left: 2px solid var(--lime);
}
.missionlink.locked {
  opacity: 0.4;
}
.lesson {
  padding: 32px 28px;
  border-right: 1px solid var(--line);
}
.lesson h2 {
  font-size: 30px;
  line-height: 1.15;
  margin: 18px 0;
}
.lesson p {
  color: #bcc6bc;
}
.lesson code,
.hint code {
  font: 14px var(--mono);
  color: var(--lime);
  background: #242d23;
  padding: 2px 4px;
}
.goal {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  margin: 25px 0;
}
.goal p {
  margin-bottom: 0;
  color: var(--text);
}
.lesson .btn {
  width: 100%;
  margin-top: 12px;
}
.hint {
  font-size: 14px;
  padding: 15px 0;
  color: #c5cebd;
}
.hint pre {
  white-space: pre-wrap;
  font: 13px/1.7 var(--mono);
  color: var(--lime);
}
.practice {
  padding: 32px;
  min-width: 0;
}
.practice .terminal {
  box-shadow: none;
  min-height: 460px;
}
.output {
  padding: 20px 20px 0;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.7 var(--mono);
}
.output p {
  margin: 0 0 10px;
}
.commandline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 22px;
  font: 14px var(--mono);
}
.commandline input {
  background: transparent;
  color: var(--text);
  border: 0;
  outline: none !important;
  width: 100%;
  font: 14px var(--mono);
  min-width: 0;
}
.error {
  color: #ffac97;
}
.success {
  border: 1px solid var(--lime);
  padding: 18px;
  margin-bottom: 20px;
  background: #222e1b;
  animation: reveal 0.25s ease-out;
}
.success strong {
  color: var(--lime);
}
@keyframes reveal {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.textbtn {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  font: 12px var(--mono);
}
details {
  font-size: 14px;
  color: var(--muted);
  margin-top: 28px;
}
summary {
  cursor: pointer;
}
details pre {
  font: 12px/1.8 var(--mono);
  white-space: pre-wrap;
}
.progress {
  height: 3px;
  background: #333d31;
  margin: 20px 0;
}
.progress div {
  height: 100%;
  background: var(--lime);
}
.courseintro {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: end;
}
.courseintro h1 {
  font-size: 52px;
  letter-spacing: -2px;
}
.pill {
  border: 1px solid var(--line);
  padding: 6px 10px;
  font: 12px var(--mono);
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 270px 420px 1fr;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 200px 1fr;
  }
  .practice {
    grid-column: 2;
  }
  .lesson {
    border-right: 0;
  }
  .sidebar {
    grid-row: 1/3;
  }
  .hero {
    gap: 35px;
  }
  .beta {
    display: none;
  }
}
@media (max-width: 700px) {
  header {
    height: 76px;
  }
  .brand {
    font-size: 14px;
  }
  nav {
    gap: 15px;
  }
  nav a {
    font-size: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 35px;
  }
  .wrap {
    padding: 35px 6%;
  }
  h1 {
    letter-spacing: -2px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .chapter-row {
    grid-template-columns: 30px 1fr 25px;
    gap: 10px;
  }
  .chapter-row code,
  .chapter-row small {
    display: none;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .lesson,
  .practice {
    padding: 25px;
  }
  .practice {
    padding-top: 0;
  }
  .courseintro {
    display: block;
  }
  footer span:last-child {
    display: none;
  }
  .terminal-note {
    gap: 10px;
  }
  .demo {
    font-size: 12px;
    padding: 18px;
  }
  .actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
/* Keep the shell prompt intact even when the current path is long. */
.commandline label {
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.termbar > span {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero .terminal {
    max-width: 620px;
  }
}
@media (max-width: 420px) {
  .termbar {
    gap: 10px;
    padding: 12px;
  }
  .termbar > span:last-child {
    display: none;
  }
  .toolbar {
    flex-wrap: wrap;
  }
}
/* Teaching and practice are visually distinct; worked examples are always visible. */
.worked-example {
  margin: 26px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.syntax {
  margin: 15px 0;
  display: grid;
  gap: 6px;
}
.syntax > span {
  font: 12px var(--mono);
  color: var(--muted);
}
.syntax code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px;
}
.example-step {
  margin: 18px 0;
}
.example-step pre {
  margin: 0;
  padding: 14px;
  font: 13px/1.8 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 2px solid #627b3a;
  background: #090d0a;
}
.example-step p {
  font-size: 14px;
  margin: 8px 0 0;
}
.worked-example .micro {
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (min-width: 1101px) {
  .practice {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
  }
}
/* The invisible full transcript reserves the final height, avoiding layout jumps. */
.example-frame {
  display: grid;
}
.example-frame pre {
  grid-area: 1 / 1;
  min-width: 0;
}
.example-measure {
  visibility: hidden;
}
.example-cursor {
  color: var(--lime);
  animation: blink 1s steps(1) infinite;
  position: absolute;
}
.example-cursor[hidden] {
  display: none;
}
.example-controls {
  display: flex;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin: 18px 0;
  align-items: center;
}
.example-controls .textbtn {
  font-size: 13px;
  color: var(--lime);
  min-height: 30px;
}
.example-status {
  flex-basis: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .example-cursor {
    animation: none;
  }
}
