.district-pinwheel {
  --pinwheel-accent: #5f89ab;
  position: relative;
  min-height: 6800px;
  padding: 0;
  overflow: clip;
  color: #07315c;
  background: #fff;
}

.district-pinwheel-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background:
    linear-gradient(rgba(13, 69, 109, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 69, 109, 0.045) 1px, transparent 1px), #fff;
  background-size: 48px 48px;
}

.district-pinwheel-head {
  position: absolute;
  z-index: 5;
  top: clamp(92px, 13vh, 136px);
  left: max(48px, calc((100vw - 1180px) / 2));
  width: min(30vw, 360px);
  pointer-events: none;
}

.district-pinwheel-head h2 {
  max-width: 340px;
  margin-top: 12px;
  font-size: clamp(38px, 3.7vw, 56px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.district-pinwheel-head > p:last-child {
  max-width: 290px;
  margin-top: 18px;
  color: rgba(7, 49, 92, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.district-pinwheel-stage {
  display: grid;
  grid-template-columns: 56% 44%;
  height: 100%;
}

.pinwheel-visual {
  position: relative;
  min-width: 0;
}

.pinwheel-section-nav {
  position: absolute;
  z-index: 7;
  bottom: clamp(38px, 7vh, 66px);
  left: max(48px, calc((100vw - 1180px) / 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pinwheel-section-nav a {
  display: grid;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(7, 49, 92, 0.26);
  border-radius: 50%;
  color: #07315c;
  background: rgba(255, 255, 255, 0.82);
  place-items: center;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition:
    color 240ms ease,
    background 240ms ease,
    transform 240ms ease;
}

.pinwheel-section-nav a:hover,
.pinwheel-section-nav a:focus-visible {
  color: #fff;
  background: #07315c;
  transform: scale(1.06);
}

.pinwheel-section-nav a:focus-visible {
  outline: 2px solid #d1302e;
  outline-offset: 3px;
}

.pinwheel-section-nav a span {
  font-size: 17px;
  font-weight: 300;
  line-height: 1;
}

.pinwheel-section-nav i {
  display: block;
  width: 1px;
  height: 30px;
  background: rgba(7, 49, 92, 0.28);
}

.pinwheel-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.pinwheel-canvas {
  z-index: 4;
}

.pinwheel-rotor-dom {
  position: absolute;
  z-index: 3;
  top: 61%;
  left: 70%;
  width: min(36vw, 430px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) perspective(1000px) rotateX(-4deg)
    rotateY(5deg) rotateZ(var(--pinwheel-rotation));
  transform-origin: center;
  filter: drop-shadow(0 22px 24px rgba(7, 49, 92, 0.12));
  will-change: transform;
}

.pinwheel-rotor-dom img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pinwheel-fallback-stick {
  position: absolute;
  z-index: 1;
  top: 61%;
  left: 70%;
  width: 7px;
  height: 39%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9e0e4, #fff 50%, #abb9c1);
  box-shadow: 12px 14px 30px rgba(7, 49, 92, 0.13);
  transform: translateX(-50%);
}

.pinwheel-selector {
  position: relative;
  z-index: 3;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 14vh max(48px, calc((100vw - 1180px) / 2)) 10vh 7vw;
  overflow: hidden;
  color: #fff;
  background: #0d456d;
  isolation: isolate;
  perspective: 900px;
}

.pinwheel-wash {
  position: absolute;
  z-index: -2;
  inset: 0;
  transition: none;
  will-change: clip-path;
}

.pinwheel-selector::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 22, 39, 0.18), transparent 28%),
    radial-gradient(
      circle at 72% 48%,
      rgba(255, 255, 255, 0.13),
      transparent 48%
    );
  content: "";
}

.pinwheel-selector-meta {
  position: absolute;
  top: clamp(104px, 14vh, 142px);
  right: max(48px, calc((100vw - 1180px) / 2));
  left: 7vw;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.district-wheel {
  position: relative;
  height: 390px;
  transform-style: preserve-3d;
  mask-image: linear-gradient(
    transparent 0%,
    #000 24%,
    #000 76%,
    transparent 100%
  );
}

.district-wheel::before,
.district-wheel::after {
  display: none;
}

.district-wheel-item {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto auto;
  min-height: 94px;
  padding: 12px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
  transform-origin: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.district-wheel-item small {
  grid-row: 1 / 3;
  padding-top: 7px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.district-wheel-item strong {
  grid-column: 2;
  overflow: hidden;
  font-size: clamp(25px, 2.5vw, 41px);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.district-wheel-item span {
  grid-column: 2;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.district-wheel-item i {
  grid-column: 2;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.1em;
  opacity: 0;
  text-transform: uppercase;
  transition:
    max-height 0.35s ease,
    margin 0.35s ease,
    opacity 0.35s ease;
}

.district-pinwheel.is-settled .district-wheel-item.is-active {
  pointer-events: auto;
}

.district-pinwheel.is-settled .district-wheel-item.is-active i {
  max-height: 18px;
  margin-top: 10px;
  opacity: 0.78;
}

.district-wheel-item.is-active:hover i,
.district-wheel-item.is-active:focus-visible i {
  opacity: 1;
  transform: translateX(5px);
}

.district-wheel-item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 8px;
}

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

.pinwheel-progress {
  position: absolute;
  right: max(48px, calc((100vw - 1180px) / 2));
  bottom: clamp(46px, 7vh, 72px);
  left: 7vw;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.pinwheel-progress i {
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.pinwheel-progress b {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.district-pinwheel.is-light-panel .pinwheel-selector {
  color: #07315c;
}

.district-pinwheel.is-light-panel .pinwheel-selector::before {
  background:
    linear-gradient(90deg, rgba(7, 49, 92, 0.08), transparent 28%),
    radial-gradient(circle at 72% 48%, rgba(95, 137, 171, 0.1), transparent 48%);
}

.district-pinwheel.is-light-panel .pinwheel-selector-meta,
.district-pinwheel.is-light-panel .district-wheel-item small,
.district-pinwheel.is-light-panel .district-wheel-item span {
  color: rgba(7, 49, 92, 0.68);
}

.district-pinwheel.is-light-panel .district-wheel-item {
  border-color: rgba(7, 49, 92, 0.16);
  color: #07315c;
}

.district-pinwheel.is-light-panel .district-wheel-item:focus-visible {
  outline-color: #07315c;
}

.district-pinwheel.is-light-panel .pinwheel-progress i {
  background: rgba(7, 49, 92, 0.2);
}

.district-pinwheel.is-light-panel .pinwheel-progress b {
  background: #07315c;
}

.district-pinwheel.is-webgl-fallback .pinwheel-canvas {
  display: none;
}

.district-pinwheel:not(.is-webgl-fallback) .pinwheel-fallback-stick {
  display: none;
}

.district-pinwheel.is-webgl-fallback .pinwheel-rotor-dom::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid rgba(7, 49, 92, 0.14);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #dce4e9 70%, #8799a4);
  box-shadow: 0 8px 18px rgba(7, 49, 92, 0.18);
  content: "";
  transform: translate(-50%, -50%);
}

@media (max-width: 720px) {
  .district-pinwheel {
    min-height: 6400px;
  }

  .district-pinwheel-sticky {
    min-height: 680px;
  }

  .district-pinwheel-head {
    top: 76px;
    right: 24px;
    left: 24px;
    width: auto;
  }

  .district-pinwheel-head h2 {
    max-width: 330px;
    margin-top: 8px;
    font-size: clamp(34px, 10vw, 45px);
  }

  .district-pinwheel-head > p:last-child {
    display: none;
  }

  .district-pinwheel-stage {
    grid-template-columns: 1fr;
    grid-template-rows: 56% 44%;
  }

  .pinwheel-visual {
    grid-row: 1;
  }

  .pinwheel-section-nav {
    bottom: 24px;
    left: 24px;
  }

  .pinwheel-section-nav a {
    width: 38px;
    height: 38px;
  }

  .pinwheel-section-nav i {
    height: 22px;
  }

  .pinwheel-rotor-dom {
    top: 69%;
    left: 50%;
    width: min(82vw, 350px);
  }

  .pinwheel-selector {
    grid-row: 2;
    padding: 32px 24px 42px;
  }

  .pinwheel-selector-meta {
    top: 18px;
    right: 24px;
    left: 24px;
  }

  .district-wheel {
    height: 245px;
  }

  .district-wheel-item {
    grid-template-columns: 34px 1fr;
    min-height: 80px;
  }

  .district-wheel-item strong {
    max-width: calc(100vw - 90px);
    font-size: clamp(24px, 7.4vw, 31px);
  }

  .pinwheel-progress {
    right: 24px;
    bottom: 18px;
    left: 24px;
  }

  .pinwheel-fallback-stick {
    top: 69%;
    left: 50%;
    height: 31%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .district-wheel-item {
    transition: none;
  }
}
