/* AirSync four-piece story, shared by the why-AI page.
   Motion and geometry match the landing-page §05 implementation. */

.four-pieces {
  --piece-1: #4F8EF7;
  --piece-2: #6BC9E8;
  --piece-3: #59B36A;
  --piece-4: #C8F53C;
  background: var(--bg);
  overflow: hidden;
}

.four-pieces-head {
  max-width: 960px;
  margin: 0 auto 56px;
  text-align: center;
}

.four-pieces-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.4;
  text-wrap: balance;
}

.four-pieces-head p {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .035em;
}

.pieces-wrap {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.pieces-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.piece {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 320px;
  padding: 30px 30px 28px;
  column-gap: 20px;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 6px 16px -10px rgba(26, 23, 21, .22);
  content-visibility: auto;
  contain-intrinsic-size: 560px 380px;
  transition: transform 280ms var(--ease-emphasized),
              opacity 240ms var(--ease-standard),
              filter 240ms var(--ease-standard),
              box-shadow 240ms var(--ease-standard);
}

.piece.p1 { background: var(--piece-1); color: var(--ink); }
.piece.p2 { background: var(--piece-2); color: var(--ink); }
.piece.p3 { background: var(--piece-3); color: var(--ink); }
.piece.p4 { background: var(--piece-4); color: var(--ink); }

@media (hover: hover) {
  .pieces-grid:has(.piece:hover) .piece:not(:hover) {
    opacity: .42;
    filter: saturate(.5);
  }
  .pieces-grid .piece:hover {
    z-index: 3;
    opacity: 1;
    filter: none;
    transform: translateY(-6px);
    box-shadow: 0 14px 28px -10px rgba(0, 0, 0, .34);
  }
}

.piece-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.piece-num {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(48px, 5.6vw, 78px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  opacity: .8;
}

.piece-name {
  margin: 14px 0 10px;
  font-family: var(--font-jp);
  font-size: clamp(27px, 3.2vw, 42px);
  font-weight: 700;
  letter-spacing: .005em;
  line-height: 1.3;
  text-wrap: balance;
}

.piece-copy {
  max-width: 25ch;
  margin: 0;
  font-family: var(--font-jp);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 700;
  line-height: 1.75;
}

.piece-desc {
  max-width: 34ch;
  margin: 11px 0 0;
  font-family: var(--font-jp);
  font-size: clamp(13px, 1.05vw, 14.5px);
  font-weight: 400;
  line-height: 1.85;
  opacity: 1;
  text-wrap: pretty;
}

.piece-stage {
  position: relative;
  align-self: stretch;
  min-height: 250px;
  overflow: hidden;
  contain: layout paint;
}

.pplat {
  display: block;
  width: clamp(120px, 11vw, 170px);
  height: auto;
  overflow: visible;
  will-change: transform;
}
.pplat .top { fill: color-mix(in srgb, var(--c) 82%, #fff); }
.pplat .side { fill: var(--c); }
.pplat path {
  stroke: color-mix(in srgb, var(--c), #000 46%);
  stroke-width: 4;
  stroke-linejoin: round;
}

.pplat-airsync .tq.tq-blue { fill: color-mix(in srgb, #4F8EF7 82%, #fff); }
.pplat-airsync .tq.tq-sky { fill: color-mix(in srgb, #6BC9E8 82%, #fff); }
.pplat-airsync .tq.tq-green { fill: color-mix(in srgb, #59B36A 82%, #fff); }
.pplat-airsync .tq.tq-lime { fill: color-mix(in srgb, #C8F53C 82%, #fff); }
.pplat-airsync .sd.sd-green { fill: #59B36A; }
.pplat-airsync .sd.sd-sky { fill: #6BC9E8; }
.pplat-airsync .sd.sd-lime-l,
.pplat-airsync .sd.sd-lime-r { fill: #C8F53C; }
.pplat-airsync .tq.tq-blue,
.pplat-airsync .sd.sd-blue { stroke: color-mix(in srgb, #4F8EF7, #000 46%); }
.pplat-airsync .tq.tq-sky,
.pplat-airsync .sd.sd-sky { stroke: color-mix(in srgb, #6BC9E8, #000 46%); }
.pplat-airsync .tq.tq-green,
.pplat-airsync .sd.sd-green { stroke: color-mix(in srgb, #59B36A, #000 46%); }
.pplat-airsync .tq.tq-lime,
.pplat-airsync .sd.sd-lime-l,
.pplat-airsync .sd.sd-lime-r { stroke: color-mix(in srgb, #C8F53C, #000 46%); }

.piece-stage .pplat { filter: none; }
.piece-stage .pplat-mini { display: block; overflow: visible; }
.piece-stage .anchor {
  position: absolute;
  left: 50%;
  will-change: transform, opacity;
}

.piece-stage .pile {
  position: absolute;
  bottom: 0;
  width: 84px;
  height: 100%;
  margin-left: -42px;
  transform-origin: 50% 100%;
  will-change: transform;
}
.piece-stage .pile-1 { left: 28%; }
.piece-stage .pile-2 { left: 72%; }
.piece-stage .pile .anchor[data-i="0"] { bottom: 12px; }
.piece-stage .pile .anchor[data-i="1"] { bottom: 26px; }
.piece-stage .pile .anchor[data-i="2"] { bottom: 40px; }
.piece-stage .pile .anchor[data-i="3"] { bottom: 54px; }
.piece-stage .pile .anchor[data-i="4"] { bottom: 68px; }
.piece-stage .pile .anchor[data-i="5"] { bottom: 82px; }
.piece-stage .pile .anchor[data-i="6"] { bottom: 96px; }

.piece-stage .morph-wrap {
  position: relative;
  width: 110px;
  height: 49.5px;
}
.piece-stage .morph-wrap > .pplat {
  position: absolute;
  top: 0;
  left: 0;
}

.piece-stage .batch-area {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  transform-origin: bottom center;
  will-change: transform;
}
.piece-stage .batch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 5px;
  padding: 6px 10px;
  border: 1.6px dashed rgba(26, 26, 26, .42);
  border-radius: 10px;
  background: rgba(26, 26, 26, .04);
  opacity: 0;
}

.how-paused .piece-stage .bob,
.how-paused .piece-stage .led { animation-play-state: paused; }

@media (max-width: 720px) {
  .four-pieces-head { margin-bottom: 38px; }
  .four-pieces-head h2 { font-size: 31px; line-height: 1.5; }
  .four-pieces-head p { font-size: 11.5px; line-height: 1.8; }
  .pieces-grid { grid-template-columns: 1fr; gap: 16px; }
  .piece {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    align-items: start;
    min-height: 0;
    padding: 22px 18px 20px;
    column-gap: 10px;
    border-radius: 12px;
  }
  .piece-stage { min-height: 200px; zoom: .55; }
  .piece-num { font-size: 30px; }
  .piece-name { margin: 6px 0 4px; font-size: 21px; }
  .piece-copy { max-width: none; font-size: 14px; line-height: 1.65; }
  .piece-desc { max-width: none; font-size: 12.5px; line-height: 1.75; }
}

@media (prefers-reduced-motion: reduce) {
  .piece { grid-template-columns: 1fr; transition: none; }
  .piece-stage { display: none; min-height: 0; }
}
