/* The illustrated document is the baseline. Motion is a progressive enhancement. */
.world-media {
  display: none;
}
.world-enhanced .world-media {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.world-enhanced .world-media > .world-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  z-index: 0;
}
.world-media video,
.world-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.world-canvas.painted {
  opacity: 1;
}
.world-enhanced .world-scenes .world-picture {
  display: none;
}
.world-enhanced .world-scene {
  background: transparent;
}
.learning-world {
  background: var(--paper);
  --world-height: 100svh;
  --world-span: 120svh;
}
.world-stage {
  position: relative;
}
.world-scene {
  position: relative;
  min-height: 720px;
  isolation: isolate;
  display: flex;
  align-items: center;
}
.world-scene:first-child {
  padding-top: 110px;
}
.world-picture {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.world-picture img,
.world-picture video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.world-picture video {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.world-picture video.painted {
  opacity: 1;
}
.world-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    #fbf6eff7 0%,
    #fbf6efdb 28%,
    #fbf6ef36 56%,
    transparent 72%
  );
}
.world-copy {
  width: min(540px, 43%);
  margin-left: max(5vw, calc((100vw - 1280px) / 2));
  padding: 60px 0;
}
.world-eyebrow {
  font-size: 11px;
  letter-spacing: 1.65px;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 18px;
}
.world-copy h1,
.world-copy h2 {
  font-size: clamp(36px, 4.2vw, 66px);
  line-height: 1.04;
  letter-spacing: -2.6px;
}
.world-intro {
  font-size: 17px;
  max-width: 380px;
  margin-top: 24px;
  color: var(--ink);
  line-height: 1.6;
}
.world-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
}
.world-actions .button {
  min-height: 48px;
  font-size: 13px;
  padding: 13px 18px;
  gap: 12px;
}
.world-skip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 800;
}
.world-skip:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.world-controls[hidden],
.world-mode[hidden] {
  display: none;
}
.world-controls {
  position: absolute;
  z-index: 4;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbf6eff5;
  box-shadow: 0 8px 28px #163f3612;
  max-width: calc(100% - 24px);
}
.world-chapters {
  display: flex;
  gap: 4px;
}
.world-chapters a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}
.world-chapters a[aria-current="step"] {
  background: var(--terracotta-dark);
  color: var(--paper);
}
.chapter-number {
  font-size: 10px;
  opacity: 0.75;
}
.world-mode,
.world-exit {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-size: 23px;
}
.world-mode:hover,
.world-exit:hover {
  background: var(--mint);
}
.world-scroll-hint {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--ink);
  padding: 5px 12px;
  border-radius: 20px;
  background: #fbf6efe8;
  font-size: 11px;
  font-weight: 800;
}
.world-scroll-hint span {
  margin-left: 8px;
}
.world-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  overflow: hidden;
}
.world-progress span {
  display: block;
  background: var(--terracotta);
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
}
.world-enhanced {
  height: calc(var(--world-height) + 4 * var(--world-span));
}
.world-enhanced .world-stage {
  position: sticky;
  top: 0;
  height: var(--world-height);
  /* Keep the scroll distance stable, but let Safari's bars resize the visible stage. */
  height: 100dvh;
  overflow: hidden;
}
.world-enhanced .world-scenes {
  height: 100%;
}
.world-enhanced .world-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding-top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.world-enhanced .world-scene.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.world-enhanced .world-copy {
  padding-top: 95px;
  padding-bottom: 125px;
}
.world-static .world-controls {
  position: relative;
  bottom: auto;
  width: max-content;
  margin: 22px 0;
}
.world-static .world-scroll-hint,
.world-static .world-progress {
  display: none;
}
@media (min-width: 1500px) {
  .world-copy {
    width: 540px;
  }
}
@media (max-width: 1000px) {
  .world-copy {
    width: 46%;
    margin-left: 5vw;
  }
  .chapter-name {
    display: none;
  }
  .world-chapters a {
    padding: 0;
  }
  .chapter-number {
    font-size: 12px;
    opacity: 1;
  }
}
@media (max-width: 700px) {
  .world-enhanced .world-stage {
    /* Freeze the stage during toolbar collapse/expansion. Width changes reset it. */
    height: var(--world-height);
  }
  .world-enhanced .world-media {
    bottom: auto;
    height: 54%;
  }
  .world-scene {
    min-height: 0;
    display: block;
    padding-top: 0;
    background: var(--paper);
  }
  .world-scene:first-child {
    padding-top: 0;
  }
  .world-picture {
    position: relative;
    height: 48svh;
    min-height: 270px;
    z-index: 0;
  }
  .world-scene:first-child .world-picture {
    height: 56svh;
    min-height: 340px;
  }
  .world-picture img,
  .world-picture video {
    object-position: 50% 50%;
  }
  .world-scene::after {
    display: none;
  }
  .world-copy {
    position: relative;
    width: auto;
    margin: 0;
    padding: 30px 24px 42px;
    background: var(--paper);
    border-radius: 28px 28px 0 0;
    margin-top: -25px;
  }
  .world-eyebrow {
    font-size: 9px;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
  }
  .world-copy h1,
  .world-copy h2 {
    font-size: clamp(32px, 8.3vw, 45px);
    letter-spacing: -1.4px;
    line-height: 1.05;
  }
  .world-intro {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 14px;
    max-width: 440px;
  }
  .world-actions {
    margin-top: 18px;
    gap: 0;
  }
  .world-actions .button {
    font-size: 12px;
    min-height: 44px;
    padding: 11px 15px;
  }
  .world-skip {
    min-height: 44px;
    font-size: 11px;
  }
  /* Only the shared loading poster belongs behind the canvas. Scene posters
     must stay hidden, including the more specific first-child scene. */
  .world-enhanced .world-media > .world-picture {
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 54%;
    min-height: 0;
  }
  .world-enhanced .world-copy {
    position: absolute;
    left: 0;
    right: 0;
    top: 51%;
    bottom: 0;
    padding: 24px 24px 90px;
    margin: 0;
  }
  .world-enhanced .world-copy h1,
  .world-enhanced .world-copy h2 {
    font-size: clamp(28px, 7.4vw, 38px);
  }
  .world-enhanced .world-intro {
    font-size: 13px;
    margin-top: 12px;
  }
  .world-enhanced .world-actions {
    margin-top: 12px;
  }
  .world-enhanced .world-skip {
    display: none;
  }
  .world-controls {
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 4px;
    border-radius: 14px;
    padding: 6px;
  }
  .world-scroll-hint {
    bottom: calc(100% + 6px);
    font-size: 10px;
  }
  .world-enhanced .world-scroll-hint {
    left: auto;
    right: 22px;
    top: auto;
    bottom: calc(49% + 16px);
    transform: none;
    background: #fbf6efed;
  }
  .world-mode,
  .world-exit {
    border-color: transparent;
  }
  .world-static .world-controls {
    flex-wrap: wrap;
  }
}
@media (max-width: 700px) {
  .world-enhanced.world-compact .world-media {
    height: 49%;
  }
  .world-enhanced.world-compact .world-picture,
  .world-enhanced.world-compact .world-scene:first-child .world-picture {
    height: 49%;
  }
  .world-enhanced.world-compact .world-copy {
    top: 46%;
    padding-top: 18px;
  }
  .world-enhanced.world-compact .world-copy h1,
  .world-enhanced.world-compact .world-copy h2 {
    font-size: 28px;
  }
  .world-enhanced.world-compact .world-eyebrow {
    margin-bottom: 8px;
    font-size: 8px;
  }
  .world-enhanced.world-compact .world-intro {
    font-size: 12px;
    margin-top: 9px;
  }
  .world-enhanced.world-compact .world-actions {
    margin-top: 9px;
  }
  .world-enhanced.world-compact .world-scroll-hint {
    bottom: calc(54% + 12px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .world-picture video {
    display: none;
  }
}
