.chapter--gyro { --base: #161918; --haze: #303a35; }

.gyro-layout {
  width: min(100%, 87rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(16rem, .73fr) minmax(0, 1.6fr);
  align-items: center;
  gap: clamp(1.6rem, 4vw, 4.6rem);
}

.gyro-name { color: #bcebd6; font-size: .875rem; font-weight: 700; margin-bottom: .7rem; }
.gyro-copy h2 {
  font-size: clamp(2.65rem, 5.3vw, 5.5rem);
  font-weight: 750;
  line-height: .98;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.gyro-intro {
  margin-top: .9rem;
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(.95rem, 1.3vw, 1.2rem);
  line-height: 1.45;
}

.gyro-copy .scope-guide { margin-top: clamp(1rem, 2.6svh, 1.65rem); }
.gyro-stage { gap: .72rem; }

.gyro-phone {
  width: min(100%, 52rem, max(27rem, (100svh - 15rem) * 1.68));
  padding: clamp(.34rem, .75vw, .62rem);
  border-radius: clamp(1rem, 2.6vw, 2.15rem);
  box-shadow: 0 1.5rem 3.5rem #090b097f, 0 0 0 1px #0b0e0c;
}

.gyro-frame {
  overflow: hidden;
  border-radius: clamp(.68rem, 2vw, 1.56rem);
  background: #151918;
}

.gyro-look {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  perspective: var(--gyro-focal, 660px);
  background: #232820;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}

.gyro-look[data-dragging] { cursor: grabbing; }

/* Crop the controls out of the existing capture, then project it about the eye. */
.gyro-plate {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 218%;
  aspect-ratio: 1168 / 630;
  overflow: hidden;
  transform: translate(-50%, -50%) translateZ(var(--gyro-focal, 660px))
    rotateX(var(--gyro-pitch, 0deg)) rotateY(var(--gyro-yaw, 0deg))
    translateZ(calc(-1 * var(--gyro-focal, 660px)));
  pointer-events: none;
}

.gyro-plate img {
  position: absolute;
  top: -9.21%;
  left: -4.79%;
  display: block;
  width: 109.59%;
  height: auto;
}

.gyro-tools {
  display: grid;
  grid-template-columns: auto minmax(2.5rem, 1fr);
  align-items: center;
  gap: .8rem;
  padding: .38rem clamp(.6rem, 1.3vw, 1.2rem);
}

.gyro-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .37rem;
  min-height: 2.75rem;
  padding: .25rem .75rem;
  border: 1px solid #5a6862;
  border-radius: .8rem;
  background: #262f2b;
  color: #edf5f0;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.gyro-toggle svg { width: 1.23rem; }
.gyro-toggle:hover { background: #34413b; }
.gyro-toggle[aria-pressed="true"] { border-color: #8de2be; background: #244938; color: #dcfde9; }

.gyro-range {
  appearance: none;
  width: 100%;
  margin: 0;
  min-height: 2.75rem;
  padding: 0 .18rem;
  background: transparent;
  touch-action: none;
  cursor: ew-resize;
}

.gyro-range::-webkit-slider-runnable-track { height: .22rem; border-radius: 1rem; background: #53605a; }
.gyro-range::-moz-range-track { height: .22rem; border-radius: 1rem; background: #53605a; }
.gyro-range::-webkit-slider-thumb {
  appearance: none;
  width: .95rem;
  height: .95rem;
  margin-top: -.365rem;
  border: 1.5px solid #e3f9eb;
  border-radius: 50%;
  background: #8de2be;
}
.gyro-range::-moz-range-thumb { width: .82rem; height: .82rem; border: 1.5px solid #e3f9eb; border-radius: 50%; background: #8de2be; }

.gyro-status {
  max-width: 42ch;
  min-height: 2.15em;
  color: #c4ccc6;
  text-align: center;
  font-size: .82rem;
  line-height: 1.4;
}

.orb-fan a:nth-child(1) { --fan-x: 120%; animation-delay: .2s; }
.orb-fan a:nth-child(2) { --fan-x: 72%; animation-delay: .12s; }
.orb-fan a:nth-child(3) { --fan-x: 24%; animation-delay: .04s; }
.orb-fan a:nth-child(4) { --fan-x: -24%; animation-delay: .04s; }
.orb-fan a:nth-child(5) { --fan-x: -72%; animation-delay: .12s; }
.orb-fan a:nth-child(6) { --fan-x: -120%; animation-delay: .2s; }

@media (max-width: 49rem) {
  .gyro-layout { grid-template-columns: minmax(0, 1fr); gap: clamp(1.04rem, 2.6svh, 1.65rem); }
  .gyro-copy h2 { font-size: clamp(2.35rem, 9vw, 3.6rem); text-wrap: wrap; }
  .gyro-name { margin-bottom: .45rem; }
  .gyro-intro { margin-top: .65rem; }
  .gyro-phone { width: min(100%, 35rem); }
  .orb-fan a { padding-inline: clamp(.32rem, 1.4vw, .65rem); }
}
