.crankshaft-showcase {
  position: relative;
  height: 1220vh;
  min-height: 7400px;
  margin-top: clamp(80px, 10vw, 180px);
  background: #020c14;
  isolation: isolate;
}

.crankshaft-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #020c14;
}

.crankshaft-js .crankshaft-sticky {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
}

.crankshaft-js.crankshaft-is-pinned .crankshaft-sticky {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  width: 100vw;
}

.crankshaft-js.crankshaft-is-complete .crankshaft-sticky {
  position: absolute;
  top: auto;
  bottom: 0;
}

.crankshaft-sticky::before,
.crankshaft-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crankshaft-sticky::before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(0, 139, 213, .13) 0, rgba(0, 81, 128, .045) 34%, transparent 68%),
    linear-gradient(180deg, #020c14 0%, #03111b 48%, #020c14 100%);
}

.crankshaft-sticky::after {
  z-index: 20;
  background: linear-gradient(90deg, rgba(2, 12, 20, .82) 0%, transparent 24%, transparent 76%, rgba(2, 12, 20, .82) 100%);
}

.crankshaft-intro {
  position: absolute;
  z-index: 30;
  top: clamp(34px, 5vw, 76px);
  left: clamp(24px, 6vw, 112px);
  width: min(560px, calc(100% - 48px));
  isolation: isolate;
  pointer-events: none;
}

/* Local readability scrim: static, no blur or extra animation loop. */
.crankshaft-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -24px auto -32px -24px;
  width: min(calc(100% + 88px), calc(100vw - 48px));
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 12, 20, .78) 0%, rgba(2, 12, 20, .66) 45%, rgba(2, 12, 20, .25) 75%, rgba(2, 12, 20, 0) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
}

.crankshaft-kicker {
  margin: 0 0 12px;
  color: #28b9ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .23em;
  text-transform: uppercase;
}

.crankshaft-intro h2 {
  max-width: 100%;
  margin: 0;
  color: #eef7fc;
  font-size: clamp(34px, 4vw, 68px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .96;
  text-transform: uppercase;
  white-space: nowrap;
}

.crankshaft-intro h2 span {
  display: block;
  color: #168fd1;
}

.crankshaft-intro > p:last-child {
  max-width: 380px;
  margin: 20px 0 0;
  color: #8da4b3;
  font-size: 14px;
  line-height: 1.65;
}

.crankshaft-canvas {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .7s ease;
}

.crankshaft-webgl-ready .crankshaft-canvas { opacity: .94; }

/* One decorative layer behind the mechanism and focused screenshot. */
.crankshaft-satellites {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.crankshaft-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.crankshaft-card-stage {
  position: absolute;
  z-index: 10;
  inset: 0;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  pointer-events: none;
}

.crankshaft-card {
  --crank-frame-scale: 1;
  position: absolute;
  top: 51%;
  left: 50%;
  width: min(62vw, 900px);
  margin: 0;
  overflow: hidden;
  border: calc(1px * var(--crank-frame-scale)) solid rgba(91, 191, 236, .3);
  border-radius: calc(13px * var(--crank-frame-scale));
  background: #071623;
  box-shadow: none;
  opacity: 0;
  backface-visibility: hidden;
  contain: layout paint style;
}

.crankshaft-frame-bar {
  display: flex;
  align-items: center;
  height: calc(31px * var(--crank-frame-scale));
  padding: 0 calc(14px * var(--crank-frame-scale));
  border-bottom: calc(1px * var(--crank-frame-scale)) solid rgba(95, 170, 205, .2);
  background: #091a27;
}

.crankshaft-frame-bar b {
  color: #a9c1cf;
  font-size: calc(10px * var(--crank-frame-scale));
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.crankshaft-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
  object-position: top left;
}

.crankshaft-webgl-fallback .crankshaft-canvas { display: none; }

.crankshaft-script-fallback {
  height: auto;
  min-height: 0;
  padding: 80px 20px;
}

.crankshaft-script-fallback .crankshaft-sticky {
  position: relative;
  height: auto;
  overflow: visible;
}

.crankshaft-script-fallback .crankshaft-intro {
  position: relative;
  top: auto;
  left: auto;
  margin: 0 auto 42px;
}

.crankshaft-script-fallback .crankshaft-canvas { display: none; }

.crankshaft-script-fallback .crankshaft-card-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  perspective: none;
}

.crankshaft-script-fallback .crankshaft-card {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  opacity: 1;
  transform: none !important;
}

@media (max-width: 760px) {
  .crankshaft-showcase {
    height: 1050vh;
    min-height: 6400px;
  }

  .crankshaft-sticky::after {
    background: linear-gradient(90deg, rgba(2, 12, 20, .58), transparent 15%, transparent 85%, rgba(2, 12, 20, .58));
  }

  .crankshaft-intro {
    top: 24px;
    left: 20px;
  }

  .crankshaft-intro h2 { font-size: clamp(26px, 8.5vw, 46px); }
  .crankshaft-intro > p:last-child { display: none; }
  .crankshaft-card { width: 91vw; top: 56%; }
}

@media (prefers-reduced-motion: reduce) {
  .crankshaft-showcase,
  .crankshaft-reduced-motion {
    height: auto;
    min-height: 0;
    padding: 80px 20px;
  }

  .crankshaft-sticky {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .crankshaft-intro {
    position: relative;
    top: auto;
    left: auto;
    margin: 0 auto 42px;
  }

  .crankshaft-canvas, .crankshaft-satellites { display: none; }

  .crankshaft-card-stage {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    perspective: none;
  }

  .crankshaft-card {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    opacity: 1;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .crankshaft-card-stage { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .crankshaft-script-fallback .crankshaft-card-stage { grid-template-columns: 1fr; }
}
