/* A dedicated product theater; the worksheet remains the WebGL fallback. */
#how {
  grid-template-columns: 0.94fr 1.06fr;
  gap: clamp(36px, 5vw, 80px);
  padding-top: 100px;
  align-items: center;
}
#how .how-copy {
  position: static;
}
#how h2 {
  font-size: clamp(34px, 3.6vw, 53px);
  line-height: 1.08;
  letter-spacing: -0.055em;
  margin-bottom: 32px;
}
#how .step {
  border: 0;
  border-bottom: 1px solid #dce3f1;
  padding: 22px 16px;
  border-radius: 8px 8px 0 0;
  transition:
    background 0.3s,
    border-color 0.3s;
}
#how .step.active {
  background: linear-gradient(105deg, #eaf0ff, #eff4ff66);
  border-color: #365bfa;
}
#how .step-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #ced8ed;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 10px;
}
#how .step.active .step-num {
  color: white;
  background: #365bfa;
  border-color: #365bfa;
  box-shadow: 0 3px 10px #365bfa33;
}
#how .step strong {
  font-size: 17px;
}
#how .step > span:nth-child(2) > span {
  font-size: 13px;
  line-height: 1.85;
}
#how .demo-stage {
  min-height: 0;
  padding: 0;
  border: 1px solid #263756;
  border-radius: 20px;
  overflow: hidden;
  background: #0c172c;
  color: #e9f0ff;
  perspective: none;
  box-shadow:
    0 35px 70px -30px #0b255a55,
    0 1px 0 #ffffff44 inset;
}
.walkthrough-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid #ffffff13;
  font: 9px monospace;
  letter-spacing: 0.12em;
  color: #8fabc9;
}
.walkthrough-top > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c1d4ee;
}
.walkthrough-top i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #80adff;
  box-shadow: 0 0 9px #6b9fff;
}
.walkthrough-viewport {
  position: relative;
  height: 370px;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 48%, #20437588, #0c172c00 66%);
}
.walkthrough-viewport::before {
  content: "";
  position: absolute;
  inset: 50% -25% -40%;
  z-index: -1;
  background-image:
    linear-gradient(#6996e516 1px, transparent 1px),
    linear-gradient(90deg, #6996e516 1px, transparent 1px);
  background-size: 38px 38px;
  transform: perspective(260px) rotateX(58deg);
  mask-image: radial-gradient(ellipse, #000, transparent 65%);
}
.walkthrough-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.walkthrough-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#how .demo-window {
  width: 82%;
  position: absolute;
  left: 8%;
  top: 30px;
  transform: perspective(900px) rotateY(-16deg) rotateX(7deg) rotateZ(-4deg);
  border: 5px solid #b3c3da;
  box-shadow:
    12px 15px 0 -5px #455b7c,
    0 28px 40px #0006;
  color: #182c4c;
  border-radius: 12px;
}
#how .walkthrough-ready .demo-window {
  visibility: hidden;
}
#how .worksheet {
  min-height: 270px;
  padding: 18px 24px;
}
#how .worksheet h3 {
  margin: 10px 0;
}
#how .equation {
  margin: 20px 0;
  font-size: 26px;
}
#how .equation svg {
  stroke: #446aff;
}
#how .demo-cursor {
  color: #446aff;
}
#how .demo-cursor b {
  background: #446aff;
}
#how .factor::before {
  background: #446aff;
}
#how .factor::after {
  color: #446aff;
}
#how .demo-working {
  font-size: 13px;
  color: #53688a;
}
#how .writing-lines {
  display: none;
}
#how .demo-answer {
  bottom: 14px;
  font-size: 18px;
}
.walkthrough-scene-label {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 0 26px 18px;
  color: #9db6db;
  font: 10px monospace;
  letter-spacing: 0.015em;
}
#how .demo-hint {
  position: relative;
  width: auto;
  margin: 0 18px;
  padding: 20px 22px 16px;
  transform: none;
  background: linear-gradient(120deg, #253b60b3, #15243c);
  border: 1px solid #6f98dd38;
  border-radius: 12px;
  box-shadow:
    0 8px 20px #0002,
    0 1px 0 #b8d7ff0d inset;
  color: #e3ecfc;
}
#how .hint-header {
  color: #e3ecfc;
}
#how .hint-header svg {
  color: #80a7ff;
  width: 23px;
  height: 23px;
}
#how .hint-header > span {
  color: #93acd1;
  font: 7px monospace;
  letter-spacing: 0.06em;
}
#how .demo-hint p {
  color: #c0cfe6;
  font-size: 13px;
  line-height: 1.85;
  min-height: 76px;
  margin: 14px 0 18px;
}
#how .hint-asks {
  margin: 0 0 16px;
}
#how .hint-ask {
  border-color: #739bd73d;
  color: #a9c2e8;
  font-size: 11px;
  padding: 8px 14px;
}
#how .hint-ask:hover {
  color: #fff;
  border-color: #80a7ff;
}
#how .hint-ask.active {
  background: #3f6cff;
  border-color: #8fb0ff;
  color: #fff;
}
#how .hint-foot {
  border-color: #739bd726;
  color: #94afd7;
  font-size: 9px;
}
#how .demo-caption {
  padding: 18px 22px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #a0b5d4;
}
#how .demo-caption button {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #a0b5d4;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0;
  cursor: pointer;
}
#how .demo-caption button[hidden] {
  display: none;
}
#how .demo-caption button:hover {
  color: #fff;
}
#how .demo-caption .walkthrough-play {
  color: #e0eaff;
}
#how .demo-caption span {
  margin: 0;
}
.walkthrough-fallback-label {
  font: 9px monospace;
}
.walkthrough-play:not([hidden]) + .walkthrough-fallback-label {
  display: none;
}
#how button:focus-visible {
  outline: 2px solid #6d91ff;
  outline-offset: 5px;
}
@media (min-width: 1500px) {
  .walkthrough-viewport {
    height: 430px;
  }
}
@media (max-width: 1000px) and (min-width: 761px) {
  #how {
    gap: 28px;
    grid-template-columns: 0.9fr 1.1fr;
  }
  .walkthrough-viewport {
    height: 320px;
  }
  #how .step {
    padding: 18px 8px;
    gap: 10px;
  }
  #how .demo-hint {
    margin: 0 12px;
    padding: 16px;
  }
}
@media (max-width: 760px) {
  #how {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 60px;
  }
  #how h2 {
    font-size: clamp(34px, 6.6vw, 48px);
  }
  #how .step {
    padding: 18px 12px;
  }
  .walkthrough-viewport {
    height: clamp(280px, 78vw, 390px);
  }
  #how .demo-hint {
    padding: 18px;
    margin: 0 12px;
  }
  .walkthrough-top {
    margin: 0 20px;
  }
  #how .demo-hint p {
    min-height: 0;
  }
  #how .worksheet {
    padding: 14px;
  }
  #how .equation {
    font-size: 22px;
  }
  #how .hint-header > span {
    font-size: 6px;
  }
  #how .demo-caption {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #how .step,
  #how .demo-window,
  #how .factor::before,
  #how .factor::after {
    transition: none;
  }
}

.walkthrough-description {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Let the fallback document determine its height, including wrapped mobile text. */
#how .demo-stage:not(.walkthrough-ready) .walkthrough-viewport {
  height: auto;
  min-height: 370px;
  padding: 32px 24px 28px;
}
#how .demo-stage:not(.walkthrough-ready) .demo-window {
  position: relative;
  width: 94%;
  left: auto;
  top: auto;
  margin: 0 auto;
  transform: perspective(900px) rotateY(-12deg) rotateX(4deg) rotateZ(-3deg);
}
#how .equation ellipse {
  stroke: #446aff;
}
#how .demo-answer {
  position: static;
  display: none;
  margin-top: 18px;
  transform: none;
}
#how .demo-stage[data-stage="2"] .demo-answer {
  display: block;
}
