/* ==========================================================================
   Next — Platforms & Device Showcase (100% FLAT, ZERO SKEW, ZERO 3D ROTATION)
   ========================================================================== */

/* Hero Cross Platform: 2-column layout matching user spec */
.hero-cross-platform {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.platform-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  perspective: none !important;
  transform: none !important;
}

/* Mac: 100% FLAT, Square, Apple-grade elevation — NO SKEW */
.platform-hero-mac {
  position: relative;
  width: min(100%, 720px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px -10px rgba(44, 42, 41, 0.22), 0 2px 8px rgba(44, 42, 41, 0.08);
  background: var(--surface);
  transform: none !important;
  cursor: zoom-in;
}

.platform-hero-mac img {
  display: block;
  width: 100%;
  height: auto;
  transform: none !important;
}

/* iPhone: 100% FLAT, Upright, Standing at bottom right — NO SKEW */
.platform-hero-phone {
  position: absolute;
  right: -10px;
  bottom: -20px;
  width: clamp(140px, 16vw, 175px);
  z-index: 2;
  filter: drop-shadow(0 20px 35px rgba(44, 42, 41, 0.3));
  transform: none !important;
  cursor: zoom-in;
}

.platform-hero-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  transform: none !important;
}

/* Hide the overlay dynamic-island pill to keep screenshots 100% clean */
.dynamic-island {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Platform Stage (#platforms): Interactive device switcher (100% FLAT)
   -------------------------------------------------------------------------- */
.platform-stage {
  position: relative;
}

.platform-stage > input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.platform-switch {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: min(100%, 330px);
  margin: 0 auto 1.75rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(250 248 245 / 0.85);
  box-shadow: 0 2px 8px rgba(44, 42, 41, 0.06);
}

.platform-switch label {
  position: relative;
  z-index: 1;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease;
}

.active-indicator-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(59, 95, 58, 0.25);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#select-ios:checked ~ .platform-switch .active-indicator-glider,
.platform-stage:has(#select-ios:checked) .active-indicator-glider {
  transform: translateX(100%);
}

#select-mac:checked ~ .platform-switch label[for="select-mac"],
#select-ios:checked ~ .platform-switch label[for="select-ios"],
.platform-stage:has(#select-mac:checked) label[for="select-mac"],
.platform-stage:has(#select-ios:checked) label[for="select-ios"] {
  color: #fff;
}

.platform-canvas {
  position: relative;
  min-height: 580px;
  height: clamp(520px, 56vw, 620px);
  padding: 1.5rem 0 2rem;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.device-stage {
  position: absolute;
  margin: 0;
  perspective: none !important;
  -webkit-perspective: none !important;
  transform-origin: center center;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s ease,
              filter 0.45s ease;
}

.device-stage figcaption {
  display: none !important;
}

/* Mac Stage: Completely FLAT, Expansive, Desk Anchor */
.stage-mac {
  top: 1rem;
  left: 50%;
  width: min(88%, 860px);
  transform: translateX(-54%) scale(1);
  opacity: 1;
  z-index: 1;
}

.framed-mac-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(44, 42, 41, 0.15);
  box-shadow: 0 24px 60px -12px rgba(44, 42, 41, 0.22), 0 2px 8px rgba(44, 42, 41, 0.08);
  cursor: zoom-in;
}

/* iPhone Stage: Completely FLAT, Upright, Tactile Companion */
.stage-phone {
  bottom: 2rem;
  left: 50%;
  width: clamp(165px, 17vw, 195px);
  transform-origin: center bottom;
  transform: translateX(clamp(160px, 26vw, 320px)) scale(1);
  opacity: 0.96;
  z-index: 2;
}

.framed-phone-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  filter: drop-shadow(0 20px 38px rgba(44, 42, 41, 0.28));
  cursor: zoom-in;
}

/* Platform Switch transitions:
   When "Mac workspace" is active: Mac is prominent, iPhone sits as companion at right.
   When "iPhone companion" is active: iPhone smoothly glides forward into spotlight center; Mac recedes gracefully.
*/
#select-mac:checked ~ .platform-canvas .stage-mac,
.platform-stage:has(#select-mac:checked) .stage-mac {
  opacity: 1;
  transform: translateX(-54%) scale(1);
  filter: none;
  z-index: 1;
}

#select-mac:checked ~ .platform-canvas .stage-phone,
.platform-stage:has(#select-mac:checked) .stage-phone {
  opacity: 0.96;
  transform: translateX(clamp(160px, 26vw, 320px)) scale(1);
  filter: drop-shadow(0 20px 38px rgba(44, 42, 41, 0.28));
  z-index: 2;
}

#select-ios:checked ~ .platform-canvas .stage-mac,
.platform-stage:has(#select-ios:checked) .stage-mac {
  opacity: 0.32;
  transform: translateX(-58%) scale(0.95);
  filter: blur(1.5px);
  z-index: 1;
}

#select-ios:checked ~ .platform-canvas .stage-phone,
.platform-stage:has(#select-ios:checked) .stage-phone {
  opacity: 1;
  transform: translateX(-50%) scale(1.42);
  filter: drop-shadow(0 30px 60px rgba(44, 42, 41, 0.38));
  z-index: 3;
}

/* Responsive */
@media (max-width: 980px) {
  .hero-cross-platform {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .platform-hero {
    min-height: 400px;
    justify-content: center;
  }
  .platform-hero-mac {
    width: 100%;
  }
  .platform-canvas {
    min-height: 500px;
    height: 500px;
    padding: 1rem 0;
  }
  .stage-mac {
    width: 92%;
    transform: translateX(-52%) scale(1);
  }
  .stage-phone {
    width: 155px;
    bottom: 1.5rem;
  }
  #select-mac:checked ~ .platform-canvas .stage-mac,
  .platform-stage:has(#select-mac:checked) .stage-mac {
    transform: translateX(-52%) scale(1);
  }
  #select-mac:checked ~ .platform-canvas .stage-phone,
  .platform-stage:has(#select-mac:checked) .stage-phone {
    transform: translateX(clamp(130px, 28vw, 240px)) scale(1);
  }
  #select-ios:checked ~ .platform-canvas .stage-mac,
  .platform-stage:has(#select-ios:checked) .stage-mac {
    transform: translateX(-54%) scale(0.93);
    opacity: 0.28;
  }
  #select-ios:checked ~ .platform-canvas .stage-phone,
  .platform-stage:has(#select-ios:checked) .stage-phone {
    transform: translateX(-50%) scale(1.36);
  }
}

@media (max-width: 600px) {
  .platform-hero {
    min-height: 280px;
  }
  .platform-hero-phone {
    width: 110px;
    right: 0;
    bottom: -10px;
  }
  .platform-canvas {
    min-height: 380px;
    height: 380px;
    padding: 0.5rem 0;
  }
  .stage-mac {
    width: 98%;
    transform: translateX(-50%) scale(1);
    top: 0.5rem;
  }
  .stage-phone {
    width: 115px;
    bottom: 0.75rem;
  }
  #select-mac:checked ~ .platform-canvas .stage-mac,
  .platform-stage:has(#select-mac:checked) .stage-mac {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  #select-mac:checked ~ .platform-canvas .stage-phone,
  .platform-stage:has(#select-mac:checked) .stage-phone {
    transform: translateX(clamp(70px, 24vw, 115px)) scale(0.9);
    opacity: 0.92;
  }
  #select-ios:checked ~ .platform-canvas .stage-mac,
  .platform-stage:has(#select-ios:checked) .stage-mac {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.15;
  }
  #select-ios:checked ~ .platform-canvas .stage-phone,
  .platform-stage:has(#select-ios:checked) .stage-phone {
    transform: translateX(-50%) scale(1.32);
    opacity: 1;
  }
}
