.mech-intro {
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.mech-intro .mech-page-title {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.15;
}

.mech-intro .hs-subtitle {
  margin-top: .25rem;
  padding: 4px 5px;
  font-size: .7rem;
}

.mech-intro .hs-blurb {
  font-size: .85rem;
}

@media (min-width: 768px) {
  .mech-intro {
    padding-top: .65rem;
    padding-bottom: .65rem;
  }
}

.mech-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 2.5rem;
}

.mech-stage {
  position: relative;
  width: min(92vw, 780px);
  aspect-ratio: 1710 / 2054;
  margin: 0 auto;
}

.mech-glow {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background: radial-gradient(closest-side, var(--glow-in, rgba(146, 218, 239, .35)), var(--glow-out, rgba(26, 92, 191, .16)) 55%, rgba(5, 25, 55, 0) 75%);
  filter: blur(6px);
  animation: mech-glow-pulse 4.2s ease-in-out infinite;
  pointer-events: none;
}

.mech-rig {
  position: absolute;
  inset: 0;
  z-index: 1;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .25));
}

.mech-part {
  position: absolute;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
  --mech-ease: cubic-bezier(.65, 0, .35, 1);
}

.mech-caption {
  width: 100%;
  max-width: 520px;
  margin-top: 1.5rem;
  padding: 0 1rem;
  text-align: center;
  box-sizing: border-box;
}

.mech-name {
  margin: 0;
  margin-inline: auto;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Carousel: full-bleed track of mech-section slides, one visible at a time. */

.mech-carousel-wrap {
  width: 100%;
}

.mech-carousel {
  position: relative;
  width: 100%;
}

.mech-carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.mech-carousel-track {
  display: flex;
  width: 100%;
  transition: transform .5s cubic-bezier(.65, 0, .35, 1);
}

.mech-carousel-slide {
  flex: 0 0 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mech-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(5, 25, 55, .78);
  color: #f2f2f2;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transform: translateY(-50%);
  transition: background-color .2s ease, border-color .2s ease;
}

.mech-carousel-btn:hover {
  background: #0a2a55;
}

.mech-carousel-btn:focus-visible {
  outline: 3px solid #ffcd29;
  outline-offset: 2px;
}

.mech-carousel-btn[hidden] {
  display: none;
}

.mech-carousel-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.mech-carousel-prev { left: 1rem; }
.mech-carousel-next { right: 1rem; }

@media (max-width: 575.98px) {
  .mech-carousel-btn { width: 40px; height: 40px; }
  .mech-carousel-btn svg { width: 18px; height: 18px; }
  .mech-carousel-prev { left: .5rem; }
  .mech-carousel-next { right: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mech-carousel-track {
    transition: none;
  }
}

/* Shared motion. Parts opt into one of these via animation-name and set
   --breathe-y/--breathe-scale or --sway-y/--sway-rot for their own amplitude.
   Sway (limbs, head) uses --mech-ease, a snappier curve than breathing's
   ease-in-out, so joints read a little more mechanical than the torso. */

@keyframes mech-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(var(--breathe-y, 0)) scaleY(var(--breathe-scale, 1)); }
}

@keyframes mech-sway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(var(--sway-y, 0)) rotate(var(--sway-rot, 0deg)); }
}

@keyframes mech-glow-pulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .85; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .mech-part,
  .mech-glow {
    animation: none;
  }
}

/* Cidermayer: layout offsets are unique to this cut of the art; motion
   direction/amplitude is mirrored left/right via the custom properties. */

.cider-mech {
  --glow-in: rgba(146, 218, 239, .35);
  --glow-out: rgba(26, 92, 191, .16);
}

.cider-mech .mech-part-l-leg-2 {
  left: 29.9415%; top: 34.2746%; width: 19.3567%; height: 26.7770%; z-index: 1;
  transform-origin: 96% 6%;
  animation: mech-sway 5.2s var(--mech-ease) infinite .2s;
  --sway-y: -.4%; --sway-rot: .7deg;
}

.cider-mech .mech-part-r-leg-2 {
  left: 50%; top: 34.6154%; width: 19.0643%; height: 26.2902%; z-index: 2;
  transform-origin: 4% 6%;
  animation: mech-sway 5.2s var(--mech-ease) infinite .2s;
  --sway-y: -.4%; --sway-rot: -.7deg;
}

.cider-mech .mech-part-l-arm-2 {
  left: 55.2047%; top: 2.5316%; width: 29.7076%; height: 36.8549%; z-index: 3;
  transform-origin: 6% 18%;
  animation: mech-sway 4.8s var(--mech-ease) infinite .1s;
  --sway-y: -.5%; --sway-rot: -.9deg;
}

.cider-mech .mech-part-r-arm-2 {
  left: 14.7953%; top: 2.5316%; width: 29.0643%; height: 37.4878%; z-index: 4;
  transform-origin: 94% 18%;
  animation: mech-sway 4.8s var(--mech-ease) infinite .1s;
  --sway-y: -.5%; --sway-rot: .9deg;
}

.cider-mech .mech-part-waist {
  left: 36.8421%; top: 27.702%; width: 26.3743%; height: 18.3057%; z-index: 5;
  transform-origin: 50% 0%;
  animation: mech-breathe 4.2s ease-in-out infinite .18s;
  --breathe-y: .4%; --breathe-scale: .98;
}

.cider-mech .mech-part-l-leg-1 {
  left: 12.3392%; top: 53.0185%; width: 36.5497%; height: 44.6446%; z-index: 6;
  transform-origin: 88% 4%;
  animation: mech-sway 4.4s var(--mech-ease) infinite .55s;
  --sway-y: .5%; --sway-rot: .9deg;
}

.cider-mech .mech-part-r-leg-1 {
  left: 50.4678%; top: 53.4567%; width: 36.4912%; height: 44.2551%; z-index: 7;
  transform-origin: 12% 4%;
  animation: mech-sway 4.4s var(--mech-ease) infinite .55s;
  --sway-y: .5%; --sway-rot: -.9deg;
}

.cider-mech .mech-part-l-arm-1 {
  left: 66.4912%; top: 28.3836%; width: 30.0585%; height: 28.7244%; z-index: 8;
  transform-origin: 16% 5%;
  animation: mech-sway 3.9s var(--mech-ease) infinite .5s;
  --sway-y: .6%; --sway-rot: -1.1deg;
}

.cider-mech .mech-part-r-arm-1 {
  left: 2.9825%; top: 28.1402%; width: 30.4094%; height: 28.7244%; z-index: 9;
  transform-origin: 84% 5%;
  animation: mech-sway 3.9s var(--mech-ease) infinite .5s;
  --sway-y: .6%; --sway-rot: 1.1deg;
}

.cider-mech .mech-part-chest {
  left: 30.2924%; top: 6.9133%; width: 40.4678%; height: 22.3953%; z-index: 10;
  transform-origin: 50% 100%;
  animation: mech-breathe 4.2s ease-in-out infinite;
  --breathe-y: -.8%; --breathe-scale: 1.028;
}

.cider-mech .mech-part-head {
  left: 39.9415%; top: .6816%; width: 20.117%; height: 13.5833%; z-index: 11;
  transform-origin: 50% 100%;
  animation: mech-sway 5.6s var(--mech-ease) infinite .35s;
  --sway-y: -2.2%; --sway-rot: 2deg;
}
