:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #213e36;
  background: #f7f8f2;
  --green: #173d33;
  --lime: #d5ef91;
  --rule: #ccd4c8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.masthead,
main {
  width: min(76rem, 92%);
  margin-inline: auto;
}
.masthead {
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}
a {
  color: inherit;
  text-underline-offset: 0.25em;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 750;
  text-decoration: none;
}
.brand span {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--green);
  color: var(--lime);
  border-radius: 0.5rem;
  font-size: 1.65rem;
}
nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.9rem;
}
nav a {
  text-decoration: none;
}
nav a:hover,
.brand:hover {
  text-decoration: underline;
}
.skip {
  position: absolute;
  transform: translateY(-150%);
  background: white;
  padding: 0.75rem;
}
.skip:focus {
  transform: none;
}
:focus-visible {
  outline: 3px solid #b05f24;
  outline-offset: 3px;
}
.lesson,
.recovery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3rem, 6vw, 6rem);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}
.copy {
  max-width: 35rem;
}
h1,
h2,
p,
figure {
  margin: 0;
}
h1,
.copy > h2:not(.prompt),
.recovery h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  letter-spacing: -0.053em;
  line-height: 1;
  text-wrap: balance;
}
h1 {
  font-size: clamp(3.7rem, 6.7vw, 6.5rem);
}
h2 {
  font-size: clamp(2.45rem, 3.5vw, 3.75rem);
}
p {
  font-size: 1.04rem;
  line-height: 1.63;
}
.copy p,
.recovery p {
  margin-top: 1.1rem;
}
.copy .lead {
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.prompt {
  margin-top: 2rem;
  font-size: 1.08rem;
}
.prompt + p {
  margin-top: 0.4rem;
}
.observe {
  border-left: 0.23rem solid #8eb14b;
  padding-left: 1rem;
}
.inset {
  position: relative;
  overflow: hidden;
  border: 1px solid #bccbbf;
  border-radius: 1rem;
  background: #fff;
}
figcaption {
  padding: 1rem 1.2rem;
  background: var(--green);
  color: #f7faf4;
  font-weight: 650;
  font-size: 1.07rem;
}
.map {
  position: relative;
  height: clamp(16rem, 26vw, 22rem);
  background-color: var(--green);
  background-image: radial-gradient(#577364 1px, transparent 1px);
  background-size: 18px 18px;
}
.map svg {
  display: block;
  width: 100%;
  height: 100%;
}
.map-stat {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  color: #e7f1dd;
  line-height: 1.2;
}
.map-stat strong {
  font:
    normal clamp(2rem, 3.2vw, 3.2rem)/1.12 Georgia,
    serif;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.map-stat span {
  font-size: 0.87rem;
}
.route-track {
  fill: none;
  stroke: #799687;
  stroke-width: 7;
}
.route-thread {
  fill: none;
  stroke: #d4e3d7;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}
.station circle {
  fill: #e5efd9;
  stroke: #25493b;
  stroke-width: 1.5;
}
.station text {
  fill: #edf4e7;
  font:
    600 13px system-ui,
    sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
}
.vehicle text {
  fill: white;
  font:
    bold 12px system-ui,
    sans-serif;
  text-anchor: middle;
}
.loads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.85rem 0.5rem;
  background: #eaf0e4;
}
.loads > span {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  color: #455d4e;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.loads > span + span {
  border-left: 1px solid #cbd6c5;
}
.loads b {
  font-size: 0.88rem;
  color: #203b30;
}
.loads b::before {
  display: inline-block;
  content: '';
  margin-right: 0.28rem;
  width: 0.58rem;
  height: 0.58rem;
  background: var(--bus);
  border-radius: 50%;
}
.transport {
  padding: 1rem;
}
.toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
button,
select {
  font: inherit;
  cursor: pointer;
}
.toolbar button,
.toolbar select {
  font-size: 0.87rem;
  color: var(--green);
  background: #fff;
  border: 1px solid #bcc8bd;
  border-radius: 0.4rem;
  padding: 0.45rem 0.55rem;
  min-height: 2.5rem;
}
.toolbar button:hover:enabled,
select:hover {
  background: #edf2e7;
}
.toolbar .play {
  min-width: 4.6rem;
  color: white;
  background: var(--green);
  border-color: var(--green);
  font-weight: 700;
}
.toolbar .play:hover:enabled {
  background: #305b43;
}
.toolbar button:disabled {
  opacity: 0.5;
  cursor: default;
}
.toolbar label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.85rem;
}
.timeline {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  margin-top: 0.9rem;
  color: #466052;
  font-size: 0.84rem;
}
.clock {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  font-weight: 650;
}
input[type='range'] {
  grid-column: 1/-1;
  width: 100%;
  margin: 0;
  accent-color: #477050;
}
.notice:not(:empty) {
  margin-top: 0.5rem;
  font-size: 0.88rem;
}
.recovery {
  margin-block: 2rem;
  padding: clamp(1.5rem, 4vw, 3.4rem);
  background: #e6edda;
  border-radius: 1rem;
  border: 0;
}
.recovery p {
  max-width: 40rem;
}
.lab-link {
  display: inline-block;
  border-radius: 0.45rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--green);
  font-weight: 650;
  text-decoration: none;
}
.lab-link:hover {
  text-decoration: underline;
}
@media (max-width: 780px) {
  .lesson,
  .recovery {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .copy,
  .inset {
    width: 100%;
    max-width: 38rem;
    margin: 0 auto;
  }
  .map {
    height: 18rem;
  }
  .recovery p {
    margin-top: 0.65rem;
  }
}
@media (max-width: 580px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.85rem;
    gap: 0.7rem;
  }
  nav {
    gap: 1.15rem;
  }
  .lesson {
    padding-block: 2.25rem;
  }
  .transport {
    padding: 0.75rem;
  }
}
