/*
 * GLASS DEVICE SYSTEM
 * A single phone size and silhouette for ALL screenshots.
 * Keep screens visible: contain rather than crop. Keep captions in normal flow.
 * All component-specific dimensions belong in this file only.
 */
:root {
  --glass-phone-width: 304px;
  --glass-phone-ratio: 710 / 1432;
  --glass-phone-radius: 34px;
  --glass-phone-border: 7px;
  --glass-phone-edge: #1b2921;
}
@media (max-width: 1090px) { :root { --glass-phone-width: 266px; } }
@media (max-width: 460px) { :root { --glass-phone-width: 262px; } }

/* All phone shells use identical physical dimensions. */
.hero-visual .phone-frame,
.story-stage .thread-phone,
.story-stage .tools-phone,
.story-stage .desktop-shot,
.details-showcase .detail-image,
.process-grid .process-photo,
.switcher .switch-phone {
  box-sizing: border-box;
  width: var(--glass-phone-width);
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: var(--glass-phone-ratio);
  flex: 0 0 auto;
  border: var(--glass-phone-border) solid var(--glass-phone-edge);
  border-radius: var(--glass-phone-radius);
  overflow: hidden;
  background: #f8faf8;
  box-shadow: 0 26px 55px rgba(18, 30, 22, .22);
  transform-origin: center center;
}
/* Never zoom or crop screenshots, even when their intrinsic ratios vary. */
.hero-visual .phone-frame > img,
.story-stage .thread-phone > img,
.story-stage .tools-phone > img,
.story-stage .desktop-shot > img,
.details-showcase .detail-image > img,
.process-grid .process-photo > img,
.switcher .switch-phone > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #f8faf8;
  max-width: none;
  max-height: none;
}
/* Every phone shell is a positioning context for a screenshot. */
.hero-visual .phone-frame,
.story-stage .thread-phone,
.story-stage .tools-phone,
.story-stage .desktop-shot,
.details-showcase .detail-image,
.process-grid .process-photo,
.switcher .switch-phone { position: relative; }

/* Identical three-degree tilt everywhere; floating motion changes Y only. */
.hero-visual .phone-frame { transform: rotate(3deg); }
.hero-visual .hero-front { animation: glass-float-front 6.8s ease-in-out infinite alternate; }
.hero-visual .hero-back { animation: glass-float-back 7.4s ease-in-out infinite alternate; }
@keyframes glass-float-front {
  from { transform: translateY(0) rotate(3deg); }
  to { transform: translateY(-12px) rotate(3deg); }
}
@keyframes glass-float-back {
  from { transform: translateY(-6px) rotate(3deg); }
  to { transform: translateY(6px) rotate(3deg); }
}
/* Two equally-sized hero devices, stacked without touching the hero copy. */
.hero-visual { min-height: 745px; overflow: hidden; }
.hero-visual .phone-frame { position: absolute; }
.hero-visual .hero-front { left: 13%; top: 74px; z-index: 3; }
.hero-visual .hero-back { left: 51%; top: 146px; z-index: 2; }

/* Story screens sit below their titles; a stage owns its own phone and label. */
.story-stage { min-height: 755px; overflow: hidden; }
.story-stage .stage-caption { top: 30px; left: 30px; z-index: 5; }
.story-stage .thread-phone,
.story-stage .tools-phone,
.story-stage .desktop-shot {
  position: absolute;
  top: 105px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate3d(-50%, var(--depth, 0px), 0) rotate(3deg);
  transition: transform .25s linear;
}
.story-stage .desktop-shot { transform: translate3d(-50%, var(--depth, 0px), 0) rotate(3deg); }
.story-stage .tools-phone { transform: translate3d(-50%, var(--depth, 0px), 0) rotate(3deg); }
.story-stage .glass-chip { bottom: 12px; right: 20px; }
.story-stage .remote-label { display: none; }
.story-stage .spring-star { right: 4%; bottom: 5%; font-size: 65px; }

/* Content cards: image, then title. No absolute screenshots over text. */
.details-showcase .detail-card,
.process-grid .process-card {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 30px;
  overflow: hidden;
}
.details-showcase .detail-image,
.process-grid .process-photo {
  position: relative;
  inset: auto;
  display: block;
  align-self: center;
  margin: 38px 0 44px;
  transform: rotate(3deg);
  transition: transform .6s var(--spring);
}
.details-showcase .detail-violet .detail-image,
.process-grid .process-card-blue .process-photo { transform: rotate(3deg); }
.details-showcase .detail-card .detail-number,
.process-grid .process-card .detail-number { position: relative; z-index: 2; }
.details-showcase .detail-card h3,
.process-grid .process-card .process-card-foot {
  position: relative;
  z-index: 2;
  margin-top: auto;
  flex: 0 0 auto;
}
.details-showcase .detail-card:hover .detail-image,
.process-grid .process-card:hover .process-photo {
  transform: translateY(-7px) rotate(3deg);
}

/* Gallery: fixed device shell regardless of selected image. 02/08 reference. */
.switcher .switch-display {
  position: relative;
  min-height: 770px;
  padding: 43px 20px 100px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}
.switcher .switch-phone {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  transform: rotate(3deg);
  transition: transform .7s var(--spring);
}
.switcher .switch-display:hover .switch-phone { transform: translateY(-5px) rotate(3deg); }
.switcher .switch-nav { bottom: 25px; left: 25px; z-index: 5; }
.switcher .switch-number { bottom: 36px; right: 27px; z-index: 5; }
.switcher .switch-phone img.is-changing { opacity: 0; transform: translateY(9px); }

/* Breakpoints affect the shared variable, not each component independently. */
@media (max-width: 1090px) {
  .hero-visual { min-height: 670px; }
  .hero-visual .hero-front { left: 11%; top: 75px; }
  .hero-visual .hero-back { left: 48%; top: 135px; }
  .story-stage { min-height: 700px; }
  .switcher .switch-display { min-height: 690px; }
}
@media (max-width: 760px) {
  .hero-visual { min-height: 595px; }
  .hero-visual .hero-front { left: 4%; top: 40px; }
  .hero-visual .hero-back { left: 47%; top: 100px; }
  .story-stage { min-height: 685px; }
  .story-stage .stage-caption { top: 26px; left: 23px; }
  .story-stage .thread-phone,
  .story-stage .tools-phone,
  .story-stage .desktop-shot { top: 100px; }
  .details-showcase .detail-card,
  .process-grid .process-card { padding: 27px; }
  .details-showcase .detail-image,
  .process-grid .process-photo { margin: 30px 0 39px; }
  .switcher .switch-display { min-height: 695px; padding: 34px 16px 88px; }
}
@media (max-width: 460px) {
  .hero-visual { min-height: 595px; }
  .hero-visual .hero-front { left: 2%; top: 35px; }
  .hero-visual .hero-back { left: 44%; top: 98px; }
  .story-stage { min-height: 680px; }
  .story-stage .thread-phone,
  .story-stage .tools-phone,
  .story-stage .desktop-shot { top: 96px; }
  .details-showcase .detail-card,
  .process-grid .process-card { padding: 24px; }
  .switcher .switch-display { min-height: 687px; padding: 33px 15px 93px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual .hero-front { animation: none !important; transform: rotate(3deg); }
  .hero-visual .hero-back { animation: none !important; transform: rotate(3deg); }
  .story-stage .thread-phone,
  .story-stage .tools-phone,
  .story-stage .desktop-shot { transform: translateX(-50%) rotate(3deg) !important; }
  .details-showcase .detail-image,
  .process-grid .process-photo { transform: rotate(3deg) !important; }
  .switcher .switch-phone { transform: rotate(3deg) !important; }
}
/* The hero artwork must not clip its primary phone against an oval edge. */
@media (max-width: 760px) {
  .hero-visual {
    width: 100%;
    margin: 25px 0 58px;
    border-radius: 38px;
  }
  .hero-visual .hero-front { left: 7%; }
  .hero-visual .hero-back { left: 27%; }
}
