:root {
  color-scheme: dark;
  --ink: #f4f1ff;
  --muted: #aaa5bc;
  --paper: #0d0b16;
  --rule: #302a44;
  --violet: #9f8cff;
  --cyan: #54e7d7;
  --gold: #ffd479;
  --rose: #ff7d9f;
  --panel: #171326;
  --panel-strong: #201a35;
  --learning-accent: var(--cyan);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 7%, rgb(102 77 194 / 24%), transparent 25rem),
    radial-gradient(circle at 8% 28%, rgb(35 180 170 / 12%), transparent 28rem),
    var(--paper);
  font-size: 1.04rem;
  line-height: 1.72;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(circle, rgb(255 255 255 / 14%) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}

.lesson-content { padding-top: 1rem; }

.lesson-content .masthead {
  position: relative;
  overflow: hidden;
  margin: 1rem 0 3rem;
  padding: clamp(2rem, 7vw, 4.5rem);
  border: 1px solid var(--rule);
  border-radius: 1.35rem;
  background: linear-gradient(145deg, rgb(32 26 53 / 96%), rgb(15 13 25 / 96%));
  box-shadow: 0 2rem 6rem rgb(0 0 0 / 30%);
}

.lesson-content .masthead::after {
  position: absolute;
  top: -5rem;
  right: -4rem;
  width: 15rem;
  height: 15rem;
  border: 1px solid rgb(159 140 255 / 35%);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem rgb(84 231 215 / 5%),
    0 0 0 4.5rem rgb(159 140 255 / 4%);
  content: "";
}

.lesson-content .eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 .8rem;
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lesson-content h1 {
  position: relative;
  z-index: 1;
  max-width: 13ch;
  margin: 0;
  font: 800 clamp(2.8rem, 8vw, 5.8rem)/.93 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
}

.lesson-content .subtitle {
  position: relative;
  z-index: 1;
  max-width: 43rem;
  margin: 1.4rem 0 0;
  color: #c8c2d9;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  line-height: 1.5;
}

.lesson-content h2 {
  margin: 3.6rem 0 1rem;
  color: #fff;
  font: 750 clamp(1.75rem, 4vw, 2.45rem)/1.12 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}

.lesson-content h3 {
  margin: 2.4rem 0 .7rem;
  color: var(--cyan);
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: .02em;
}

.lesson-content p,
.lesson-content li { max-width: 72ch; }

.lesson-content a {
  color: var(--cyan);
  text-decoration-color: rgb(84 231 215 / 45%);
  text-underline-offset: .17em;
}

.lesson-content strong { color: #fff; }

.lesson-content code {
  padding: .12em .34em;
  border: 1px solid rgb(159 140 255 / 24%);
  border-radius: .32rem;
  background: rgb(159 140 255 / 10%);
  color: #ded7ff;
  font: .9em/1.4 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.lesson-content pre {
  margin: 1.4rem 0 2rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid #383050;
  border-radius: .85rem;
  background: #090811;
  box-shadow: inset .22rem 0 0 var(--violet);
  line-height: 1.55;
  tab-size: 2;
}

.lesson-content pre code {
  padding: 0;
  border: 0;
  background: none;
  color: #eeeaff;
  font-size: .88rem;
}

.lesson-content blockquote {
  margin: 1.5rem 0;
  padding: .3rem 1.25rem;
  border-left: .24rem solid var(--gold);
  background: linear-gradient(90deg, rgb(255 212 121 / 9%), transparent);
  color: #ded7c7;
}

.lesson-content table {
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  border-radius: .8rem;
  background: rgb(23 19 38 / 88%);
}

.lesson-content th,
.lesson-content td {
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.lesson-content th { color: var(--cyan); font-size: .85rem; }

.mission,
.checkpoint,
.concept,
.warning,
.try-it {
  max-width: 52rem;
  margin: 1.7rem 0;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: .9rem;
  background: rgb(23 19 38 / 90%);
}

.mission {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: var(--rule);
}

.mission > div { padding: 1.15rem; background: var(--panel); }

.mission p { margin: .25rem 0 0; line-height: 1.45; }

.label {
  color: var(--cyan);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.checkpoint { border-color: rgb(84 231 215 / 42%); }
.concept { border-color: rgb(159 140 255 / 45%); }
.warning { border-color: rgb(255 125 159 / 46%); }
.try-it { border-color: rgb(255 212 121 / 48%); }

.checkpoint > :first-child,
.concept > :first-child,
.warning > :first-child,
.try-it > :first-child { margin-top: 0; }

.checkpoint > :last-child,
.concept > :last-child,
.warning > :last-child,
.try-it > :last-child { margin-bottom: 0; }

.file-tree {
  display: inline-block;
  min-width: min(100%, 24rem);
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: .75rem;
  background: #0a0912;
  color: #d9d3eb;
  font: .92rem/1.7 "SFMono-Regular", Consolas, monospace;
  white-space: pre;
}

.lesson-content kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: .08em .4em;
  border: 1px solid #554b70;
  border-bottom-width: 3px;
  border-radius: .32rem;
  background: #211b34;
  color: #fff;
  font: .82em/1.4 system-ui, sans-serif;
  text-align: center;
}

.frame-lab {
  margin: 2rem 0;
  padding: clamp(1rem, 4vw, 1.6rem);
  border: 1px solid #453a63;
  border-radius: 1rem;
  background: linear-gradient(145deg, #1c1730, #100d1c);
}

.frame-lab h3 { margin-top: 0; }

.frame-lab__controls {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 1rem 0 1.3rem;
}

.frame-lab button {
  padding: .6rem .85rem;
  border: 1px solid #594b7d;
  border-radius: .55rem;
  background: #27203d;
  color: #fff;
  font: 700 .9rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.frame-lab button:hover,
.frame-lab button:focus-visible,
.frame-lab button[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #173d3b;
  outline: none;
}

.frame-lab__results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.frame-lab__result {
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  background: rgb(9 8 17 / 76%);
}

.frame-lab__result strong {
  display: block;
  margin-top: .25rem;
  color: var(--gold);
  font-size: 1.6rem;
}

.frame-lab__bar {
  display: block;
  width: 0;
  height: .45rem;
  margin-top: .7rem;
  border-radius: 999px;
  background: var(--rose);
  transition: width 420ms ease;
}

.frame-lab__result:last-child .frame-lab__bar { background: var(--cyan); }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.lesson-content details {
  margin: 1.25rem 0;
  padding: .9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  background: rgb(23 19 38 / 72%);
}

.lesson-content summary { color: var(--gold); font-weight: 750; cursor: pointer; }

.course-navigator { border-color: #3c3454; background: rgb(13 11 22 / 92%); }
.course-navigator__menu { --bg: #151124; border-color: #453b62; background: #151124; }

.learning-home { border-color: #403653; background: rgb(13 11 22 / 88%); }

@media (max-width: 700px) {
  .mission { grid-template-columns: 1fr; }
  .frame-lab__results { grid-template-columns: 1fr; }
  .lesson-content .masthead { padding: 2rem 1.35rem; }
  .lesson-content pre { margin-inline: -.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .frame-lab__bar { transition: none; }
}
