/* Cyberwolf case study. The layout (sidebar, slides, grid) is shared: case.css and
   case.js. This file holds each slide's backdrop (.stage) and the pieces of the
   site laid out on it: 2x captures of the live site (pages, the section
   workbench, sections in their states) and the site's own mesh gradient running
   live. Backdrops are flat, each the ground of the capture it holds, except the
   hero's, which is the brand's own yellow mesh. */

:root {
  --sentinel: #133630; /* the brand's dark green, and the hero cards' ground */
  --sentinel-deep: #0b211d;
  --signal: #56dfc1;
  --volt: #fefcb3;
  --mist: #f6f4ed; /* the site's light sections: the pricing capture blends into it */
  --pad: clamp(20px, 5vw, 64px);
}

img,
video {
  -webkit-user-drag: none;
}

/* ── Stages ─────────────────────────────────────────────── */

.stage {
  position: relative;
  overflow: hidden;
  padding: var(--pad);
}

.stage-gradient { background: #b9e9a8 url("assets/gradient-sixth-sense.webp") center / cover; } /* the brand's yellow mesh, as on the site */
.stage-mesh { background: var(--sentinel) url("assets/mesh-sentinel.webp") center / cover; } /* the hero's own mesh, stilled */
.stage-sentinel { background: var(--sentinel); }
.stage-mist { background: var(--mist); }
.stage-paper { background: #e9e7e0; }
.stage-mesh-live { background: #b9e9a8; } /* until the shader draws */

/* slides with a fixed shape: on the slide, not the stretched stage (Firefox), with width (Chrome) */
.shot-wide {
  width: 100%;
  aspect-ratio: 16 / 10;
}

/* ── 1. Homepage ────────────────────────────────────────── */

.shot > .stage.hero {
  justify-content: flex-end;
  padding-bottom: 0;
  padding-top: clamp(48px, 8vw, 110px);
  perspective: 1400px;
}

.hero-screen {
  position: relative;
  width: 88%;
  margin: 0 auto;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 6px 18px rgba(0, 0, 0, 0.25);
  transform-origin: 50% 0;
}

/* a hairline, as on the site's own surfaces, so the dark screen reads on the dark ground */
.hero-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(246, 244, 237, 0.16);
  pointer-events: none;
}

.hero-screen img {
  width: 100%;
}

/* ── 3. The hero's card pile ────────────────────────────── */

/* The arrangement is the site's own (style.css, set by hand in its arrange
   mode), in cqw of the column, so it holds its shape at any size. --t runs
   from 0 (a plain column) to 1 (the pile). */
#pile {
  align-items: center;
  justify-content: center;
}

.pile {
  position: relative;
  container-type: inline-size;
  display: grid;
  justify-items: center;
  width: min(54%, 560px);
  translate: 6% 0;
}

.card {
  --t: 1;
  position: relative;
  width: var(--cw);
  translate: calc(var(--tx) * var(--t)) calc(var(--ty) * var(--t));
  rotate: calc(var(--r) * var(--t));
  margin-bottom: calc(var(--mb) * var(--t));
  z-index: var(--z);
}

/* each capture carries its shadow: 40 px either side, 24 above, 64 below (at 1x),
   taken back here so only the card takes up room */
.card img {
  width: calc((var(--w) + 80) / var(--w) * 100%);
  max-width: none;
  margin: calc(-24 / var(--w) * 100%) 0 calc(-64 / var(--w) * 100%) calc(-40 / var(--w) * 100%);
}

.card-a { --w: 262.875; --cw: 46.1cqw; --r: -4.6deg; --tx: -23.5cqw; --ty: 2.3cqw; --mb: -8.2cqw; --z: 3; }
.card-b { --w: 241.766; --cw: 42.4cqw; --r: 3.8deg; --tx: 9.7cqw; --ty: -17.1cqw; --mb: -5.3cqw; --z: 5; }
.card-d { --w: 290.234; --cw: 50.9cqw; --r: 4.7deg; --tx: 8.8cqw; --ty: -3.3cqw; --mb: -10.7cqw; --z: 6; }
.card-e { --w: 255.453; --cw: 44.8cqw; --r: -3.2deg; --tx: -29.4cqw; --ty: 5.3cqw; --mb: 0cqw; --z: 4; }
.card-c { --w: 283.406; --cw: 49.7cqw; --r: 0.4deg; --tx: 16.4cqw; --ty: 2.4cqw; --mb: -9.2cqw; --z: 2; }

.card.is-hovered {
  z-index: 20;
}

.pointer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  width: clamp(16px, 2vw, 24px);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transform-origin: 20% 10%;
}

/* ── 4. Pricing ─────────────────────────────────────────── */

.pricing {
  position: relative;
  display: grid;
  width: 94%;
  margin: 0 auto;
}

.pricing > img {
  grid-area: 1 / 1;
  width: 100%;
}

.pricing > .on {
  opacity: 0;
}

/* ── 6. Mesh gradient ───────────────────────────────────── */

#mesh {
  align-items: center;
}

.mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.closing {
  position: relative;
  width: min(62%, 832px);
}

/* ── 2. Section carousel ─────────────────────────────────── */

/* The sections are cut without their ground (transparent), so the slide's
   backdrop can take each one's ground as it arrives. Contained, so the grid's
   rounding adds ground rather than cropping. Without script only the first
   shows; cyberwolf.js slides them through. */
#carousel {
  padding: 0;
}

.cslide {
  position: absolute;
  inset: 0;
  display: grid;
}

.cslide:not(:first-child) {
  visibility: hidden;
}

.cslide > img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The CTA card alone, as a video: the capture with the first half of the site's
   glass loop (the mark turning away, sped up) baked in with the same lighten
   blend. Corners rounded here as on the site (28 px on a 1313 × 480 card). */
.cta-card {
  display: block;
  place-self: center;
  width: 88%;
  height: auto;
  border-radius: 2.132% / 5.833%;
  box-shadow: 0 30px 60px -20px rgba(11, 33, 29, 0.35);
}

/* ── Films that fill their slide ──────────────────────────── */

/* Video green and CSS green never meet: browsers colour-manage video
   differently from page colours, so the films (Protection suite, audience
   cards) carry their own ground to the slide's edges. */
.film-fill {
  position: absolute;
  inset: 0;
}

.film-fill video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 7. Phones ──────────────────────────────────────────── */

/* two large phones, staggered, sized by the slide's height so both sit
   inside the frame whatever its shape */
.shot.shot-wide.shot-phones:has(#phones) {
  aspect-ratio: 4 / 3;
}

#phones.stage {
  justify-content: center;
  padding: 0;
  container-type: size;
}

#phones .phones {
  align-items: flex-start;
  gap: 6cqw;
}

#phones .phone {
  width: auto;
  height: 80cqh;
  margin-top: 0;
}

#phones .phone + .phone {
  margin-top: 8cqh;
}

#phones {
  align-items: center;
  padding: 0;
}

.phones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5%;
  width: 100%;
}

.phone {
  display: block;
  width: 31%;
  height: auto;
  aspect-ratio: 780 / 1688;
  border-radius: 9% / 4.2%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(246, 244, 237, 0.08);
  will-change: transform;
}

@media (max-width: 699px) {
  .shot-wide:not(:has(#carousel)) {
    aspect-ratio: 4 / 5;
  }

  .pile {
    width: 82%;
  }

  .closing {
    width: 86%;
  }

  .shot.shot-wide.shot-phones:has(#phones) {
    aspect-ratio: 1;
  }



  .phone {
    width: 40%;
  }
}
