/* ==========================================================================
   Showcase — real device frames, 3D scroll/tilt animation, case-study layout.
   Devices use the frames in assets/img (MacBook Pro 16, iPhone 14 Pro); the
   screens sit behind each frame's transparent opening, so nothing is painted
   on top of a screenshot except the hardware itself.
   ========================================================================== */

:root {
   --sc-stage: #141517;
   --sc-stage-2: #1C1D20;
   --sc-line: rgba(255, 255, 255, 0.12);
   --sc-radius: clamp(.6em, 1vw, 1em);
   --sc-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- devices ---------- */

.sc-3d {
   perspective: 1800px;
   perspective-origin: 50% 30%;
}

.sc-laptop,
.sc-phone {
   position: relative;
   transform-style: preserve-3d;
   will-change: transform;
}

/* MacBook Pro 16: frame 2400x1370, screen opening x260 y30, 1880x1183 */
.sc-laptop {
   width: 100%;
   aspect-ratio: 2400 / 1370;
}

.sc-laptop::after,
.sc-phone::after {
   content: "";
   position: absolute;
   inset: 0;
   z-index: 2;
   pointer-events: none;
   background-position: center;
   background-repeat: no-repeat;
   background-size: 100% 100%;
}

.sc-laptop::after {
   background-image: url("../img/device-mbp-16-lower-nonotch.webp");
}

.sc-laptop .sc-screen {
   position: absolute;
   left: 10.83%;
   top: 2.19%;
   width: 78.34%;
   height: 86.35%;
   overflow: hidden;
   background: #000;
}

/* iPhone 14 Pro: frame 750x1514, screen opening x42 y36, 669x1442; the frame brings its own Dynamic Island */
.sc-phone {
   width: var(--w, 16em);
   flex: none;
   aspect-ratio: 750 / 1514;
}

.sc-phone::after {
   background-image: url("../img/device-iphone14.webp");
}

.sc-phone .sc-screen {
   position: absolute;
   left: 5.47%;
   top: 2.31%;
   width: 89.33%;
   height: 95.38%;
   overflow: hidden;
   background: #000;
}

.sc-screen img,
.sc-screen video {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
   object-position: top center;
   display: block;
}

.sc-screen.left img,
.sc-screen.left video {
   object-position: left top;
}

/* screen recordings that include Chrome's own toolbar (104 of 830px): push it out of view */
.sc-screen.no-chrome video {
   height: 114.3%;
   top: -14.3%;
}

/* soft contact shadow under each device */
.sc-laptop::before,
.sc-phone::before {
   content: "";
   position: absolute;
   z-index: -1;
   left: 8%;
   right: 8%;
   bottom: -3%;
   height: 10%;
   border-radius: 50%;
   background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 70%);
   filter: blur(8px);
   pointer-events: none;
}

.sc-phone::before {
   left: 4%;
   right: 4%;
   bottom: -2%;
   height: 6%;
}

/* iOS status strip for phone captures taken in a browser (they have no system bar of their own) */
.sc-status {
   position: absolute;
   left: 0;
   right: 0;
   top: 0;
   height: 6.9%;
   z-index: 1;
   font-weight: 500;
   font-size: calc(var(--w, 16em) * 0.04);
   line-height: 1;
   letter-spacing: -.01em;
   background: var(--sbbg, #fff);
   color: var(--sbfg, #000);
}

.sc-status span:first-child {
   position: absolute;
   left: 11%;
   top: 50%;
   transform: translateY(-50%);
}

.sc-status .ic {
   position: absolute;
   right: 7.6%;
   top: 50%;
   transform: translateY(-50%);
   display: flex;
   align-items: center;
   gap: calc(var(--w, 16em) * 0.015);
}

.sc-status svg {
   height: calc(var(--w, 16em) * 0.0286);
   width: auto;
   fill: currentColor;
}

.sc-status svg:last-child {
   height: calc(var(--w, 16em) * 0.0325);
}

.sc-screen img.below {
   top: 6.9%;
   height: 93.1%;
}

/* browser frame for gallery screens */
.sc-browser {
   position: relative;
   border-radius: var(--sc-radius);
   overflow: hidden;
   background: #1C1D20;
   box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 3em 6em -3em rgba(0, 0, 0, .8);
}

.sc-browser .sc-bar {
   height: 2.1em;
   display: flex;
   align-items: center;
   gap: .4em;
   padding: 0 .9em;
   background: #202124;
   border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sc-browser .sc-bar i {
   width: .6em;
   height: .6em;
   border-radius: 50%;
   background: #3A3B3F;
}

.sc-browser .sc-bar span {
   margin: 0 auto;
   transform: translateX(-1.5em);
   font-size: .72em;
   color: #8E9095;
   background: #2B2C30;
   border-radius: 2em;
   padding: .25em 2.6em;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 70%;
}

.sc-browser .sc-shot {
   position: relative;
   aspect-ratio: 16 / 10;
   overflow: hidden;
}

.sc-browser .sc-shot img {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
   object-position: top center;
}

/* ---------- case study sections ---------- */

.sc-intro {
   padding-top: 0;
}

.sc-intro .row {
   display: flex;
   flex-wrap: nowrap;
   gap: calc(var(--gap-padding) * 2);
}

.sc-intro .flex-col:first-child {
   flex: 1.2 1 0;
   width: auto;
}

.sc-intro .flex-col:last-child {
   flex: 1 1 0;
   width: auto;
   padding-top: .35em;
}

.sc-intro h3.sc-lede {
   font-size: calc(clamp(1.55em, 2.3vw, 2.5em) * .875);
   line-height: 1.3;
   font-weight: 450;
   letter-spacing: -.01em;
}

.sc-intro p {
   color: rgba(255, 255, 255, .62);
   line-height: 1.65;
}

.sc-tags {
   display: flex;
   flex-wrap: wrap;
   gap: .5em;
   margin-top: 1.6em;
}

.sc-tags span {
   font-size: .82em;
   padding: .45em 1.05em;
   border-radius: 2em;
   border: 1px solid rgba(255, 255, 255, .18);
   color: rgba(255, 255, 255, .78);
}

.sc-live {
   margin-top: 2.2em;
}

/* dark device stage */
.sc-stage {
   position: relative;
   background: var(--sc-stage);
   color: #fff;
   overflow: hidden;
   padding-top: calc(var(--section-padding) * .8);
   padding-bottom: calc(var(--section-padding) * .9);
}

.sc-stage::before {
   content: "";
   position: absolute;
   inset: 0;
   background: radial-gradient(60% 55% at 50% 42%, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 70%);
   pointer-events: none;
}

.sc-stage .sc-label {
   display: flex;
   justify-content: space-between;
   align-items: baseline;
   gap: 2em;
   margin-bottom: clamp(2.5em, 6vw, 5em);
   padding-bottom: 1.2em;
   border-bottom: 1px solid var(--sc-line);
}

.sc-stage .sc-label h5,
.sc-gallery .sc-label h5 {
   margin: 0;
   font-size: .8em;
   letter-spacing: .08em;
   text-transform: uppercase;
   opacity: .55;
}

.sc-stage .sc-label p {
   margin: 0;
   max-width: 36em;
   color: rgba(255, 255, 255, .65);
   text-align: right;
}

.sc-hero {
   position: relative;
   max-width: 72em;
   margin: 0 auto;
}

.sc-hero .sc-laptop {
   width: 100%;
}

.sc-hero .sc-phone.float {
   position: absolute;
   right: -1%;
   bottom: -6%;
   --w: clamp(7em, 17vw, 15em);
   z-index: 3;
}

.sc-hero.phones-only {
   display: flex;
   justify-content: center;
   align-items: center;
   gap: clamp(1.5em, 4vw, 4.5em);
   max-width: 60em;
}

.sc-hero.phones-only .sc-phone {
   --w: clamp(8.5em, 21vw, 17.5em);
}

.sc-hero.phones-only .sc-phone.lift {
   --w: clamp(9.5em, 23vw, 19.5em);
}

.sc-caption {
   margin-top: 1.2em;
   font-size: .85em;
   line-height: 1.45;
   color: rgba(255, 255, 255, .5);
}

.sc-stage .sc-caption {
   color: rgba(255, 255, 255, .55);
   text-align: center;
}

.sc-caption b {
   display: block;
   font-weight: 450;
   color: #fff;
   margin-bottom: .15em;
}


.sc-stage + .sc-stage {
   padding-top: 0;
}

.sc-stage + .sc-stage::before {
   display: none;
}

/* phone row */
.sc-phones-row {
   display: flex;
   justify-content: center;
   gap: clamp(.9em, 2.2vw, 2.4em);
   flex-wrap: nowrap;
}

.sc-phones-row figure {
   margin: 0;
   flex: 1 1 0;
   max-width: 15em;
   display: flex;
   flex-direction: column;
   align-items: center;
}

.sc-phones-row .sc-phone {
   --w: 100%;
   width: 100%;
}

/* light gallery */
.sc-gallery {
   padding-top: calc(var(--section-padding) * .85);
   padding-bottom: calc(var(--section-padding) * .85);
}

.sc-gallery .sc-label {
   display: flex;
   justify-content: space-between;
   align-items: baseline;
   margin-bottom: clamp(2em, 5vw, 4em);
   padding-bottom: 1.2em;
   border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sc-grid {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: clamp(2em, 4vw, 4em) clamp(1.5em, 3vw, 3em);
}

.sc-grid figure {
   margin: 0;
}

.sc-grid figure.wide {
   grid-column: 1 / -1;
}

.sc-grid figure.wide .sc-shot {
   aspect-ratio: 16 / 9;
}

/* laptops side by side */
.sc-duo {
   display: grid;
   grid-template-columns: 1.35fr 1fr;
   gap: clamp(2em, 4vw, 4em);
   align-items: center;
}

.sc-duo .sc-col {
   display: flex;
   flex-direction: column;
   gap: clamp(2em, 4vw, 3.5em);
}

.sc-note {
   margin-top: clamp(2em, 4vw, 3em);
   font-size: .82em;
   opacity: .5;
}

.sc-stage .sc-note {
   text-align: center;
}

/* reveal state (JS animates these in; without JS they stay visible) */
.sc-reveal {
   will-change: clip-path, transform;
}

/* ---------- listings: tiles, hover image, next case ---------- */

/* covers are transparent device renders: give them a calm neutral stage, never artwork */
.tile-image .overlay-image.sc-cover,
.mouse-pos-list-image-inner .overlay-image.sc-cover,
.next-case-btn .tile-image .overlay-image.sc-cover {
   background-color: var(--sc-stage-2) !important;
   background-size: 82% auto !important;
   background-position: center 58% !important;
   background-repeat: no-repeat !important;
}

.mouse-pos-list-image-inner .overlay-image.sc-cover {
   background-size: 86% auto !important;
}

.single-tile-wrap .tile-image {
   overflow: hidden;
}

.single-tile-wrap .tile-image .overlay-image.sc-cover {
   transition: transform 1.1s var(--sc-ease), background-size 1.1s var(--sc-ease);
}

.single-tile-wrap a:hover .tile-image .overlay-image.sc-cover {
   background-size: 88% auto !important;
}

/* home: horizontal strip of real screens */
.horizontal-single-item .overlay.sc-screen-card {
   background-color: var(--sc-stage-2);
   background-size: cover !important;
   background-position: top center !important;
}

/* ---------- responsive ---------- */

@media screen and (max-width: 900px) {
   .sc-intro .row {
      flex-direction: column;
      gap: 1.5em;
   }

   .sc-intro .flex-col:first-child,
   .sc-intro .flex-col:last-child {
      flex: none;
      width: 100%;
   }

   .sc-stage .sc-label {
      flex-direction: column;
      gap: .6em;
   }

   .sc-stage .sc-label p {
      text-align: left;
   }

   .sc-duo {
      grid-template-columns: 1fr;
   }

   .sc-phones-row {
      flex-wrap: wrap;
      row-gap: 2.5em;
   }

   .sc-phones-row figure {
      flex: 0 0 calc(50% - 1em);
      max-width: none;
   }
}

@media screen and (max-width: 540px) {
   .sc-grid {
      grid-template-columns: 1fr;
   }

   .sc-hero .sc-phone.float {
      --w: 26vw;
      right: -2%;
   }

   .sc-hero.phones-only {
      gap: 3vw;
   }

   .sc-hero.phones-only .sc-phone {
      --w: 28vw;
   }

   .sc-hero.phones-only .sc-phone.lift {
      --w: 31vw;
   }

   .sc-browser .sc-bar {
      height: 1.6em;
   }

   .sc-browser .sc-bar span {
      font-size: .6em;
   }
}

@media (prefers-reduced-motion: reduce) {
   .sc-laptop,
   .sc-phone,
   .sc-reveal {
      transform: none !important;
      clip-path: none !important;
   }
}
