/* VICO 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 laid out
   on it: images cut from 2x exports of the Figma file, and the wordmark's own
   vector paths. */

:root {
  --vico-orange: #ff4200;
  --vico-orange-raster: #ff7030;
  --vico-black: #000;
  --vico-black-raster: #1c1c1c;
  --vico-beige: #f5ebe5;
  --vico-beige-raster: #f3d3c3;
  --pad: clamp(20px, 5vw, 64px);
}

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

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

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

.stage-orange { background: var(--vico-orange); }
.stage-black { background: var(--vico-black); }
.stage-beige { background: var(--vico-beige); }
.stage-white { background: #fff; }

/* ── Wordmark ───────────────────────────────────────────── */

.mark-stage {
  padding: clamp(40px, 9vw, 120px) clamp(28px, 7vw, 96px);
}

.mark {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.mark path {
  fill: none;
  stroke-width: var(--line, 2.5); /* the script keeps this at 2 screen px */
}

.mark-raster path {
  stroke: var(--vico-beige-raster);
}

.mark-letters path {
  stroke: var(--vico-orange);
  fill: none;
}

/* the reverse colourway: white lines on orange, with the orange raster colour */
.mark-reverse .mark-raster path {
  stroke: var(--vico-orange-raster);
}

.mark-reverse .mark-letters path {
  stroke: #fff;
}

/* ── Project card on hover ───────────────────────────── */

#map {
  align-items: center;
}

.map-card {
  position: relative;
  display: grid;
  width: min(100%, 640px);
}

.map-card > img:not(.map-cursor) {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
}

/* the hover state; the script shows it while the pointer's tip is on the photo */
.map-colour {
  opacity: 0;
}

/* raster lines along the card's four sides, just outside the photo and caption,
   running off the slide. The photo is 694 × 465 at (5, 7) of the 704 × 585 card;
   the caption ends at 573. */
.map-grid::before,
.map-grid::after {
  content: "";
  position: absolute;
  background: var(--vico-orange-raster);
  pointer-events: none;
}

.map-grid-h::before,
.map-grid-h::after {
  left: -300vw;
  right: -300vw;
  height: 1px;
}

.map-grid-h::before { top: calc(6 / 585 * 100%); }
.map-grid-h::after { top: calc(580 / 585 * 100%); }

.map-grid-v::before,
.map-grid-v::after {
  top: -300vh;
  bottom: -300vh;
  width: 1px;
}

.map-grid-v::before { left: calc(4 / 704 * 100%); }
.map-grid-v::after { left: calc(700 / 704 * 100%); }

.map-grid {
  position: absolute;
  inset: 0;
}

/* the pointer lives on the slide, so it can come in from outside the frame; the script moves it */
.map-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: clamp(22px, 2.6vw, 30px);
  height: auto;
  pointer-events: none;
  will-change: transform;
}

/* ── Project page and phone ─────────────────────────────── */

.pages {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24%;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

.pages-desktop {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(255, 66, 0, 0.16);
}

/* on beige, a soft warm shadow instead of the orange glow */
#project .pages-desktop {
  box-shadow: 0 30px 70px rgba(120, 40, 0, 0.18), 0 6px 16px rgba(120, 40, 0, 0.08);
}

/* an iPhone-shaped frame around the phone recording */
.phone {
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border: 4px solid #222;
  border-radius: clamp(18px, 2.6vw, 34px);
  background: var(--vico-orange);
}

/* the homepage recordings sit on the brand's black hatching (the guide's tile,
   with the line toned down so the recording stays in front) */
#pages {
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-1 1L1 -1M0 8L8 0M7 9L9 7' stroke='%232e2e2e' stroke-width='1'/%3E%3C/svg%3E") repeat;
}

/* the homepage recordings on their own slides */
/* the project recording, with a still of its sidebar laid over the left column
   (507 of the page's 1440 px) */
.project-film {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1440 / 900;
  background: var(--vico-orange); /* no sub-pixel sliver of the slide showing at the edges */
}

.project-film video,
.film-still {
  position: absolute;
  top: 0;
  height: 100%;
  object-fit: cover;
}

/* the video bleeds 1 px past every edge: it is drawn in its own layer, and at
   fractional sizes that layer can stop a hair short of the frame's edge */
.project-film video {
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
}

/* the sidebar still: 507 of the page's 1440 px, pinned top left */
.film-still {
  left: 0;
  width: calc(507 / 1440 * 100%);
  object-position: left top;
}

.home-film {
  width: 88%;
  margin: 0 auto;
}

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

/* ── Business cards ─────────────────────────────────────── */

/* ── Fence banners ──────────────────────────────────────── */

.shot-fence {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.shot > .sweep {
  position: relative;
  flex: 1;
  min-height: 0;
}

.sweep img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the black banner, revealed by a hard wipe: it is clipped between --from and --to
   (shares of the width), and a white line rides the moving edge. The script
   sweeps --to across to show it, then --from across to hide it again, so the wipe
   always travels left to right */
.sweep-top {
  --from: 0%;
  --to: 0%;
  clip-path: inset(0 calc(100% - var(--to)) 0 var(--from));
}

.sweep-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--edge, 0%);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* ── Colours and hatching ───────────────────────────────── */

.palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.6vw, 20px);
}

.swatch {
  display: block;
  width: 100%;
  height: auto;
}

/* the hatches are drawn, not images: 1 px lines, 8 px apart along the edge, as in
   the guide, so they stay crisp at any size (a scaled-down image beat into moiré) */
/* the hatches are drawn, not images: an 8 px SVG tile with one 1 px diagonal,
   repeated, as in the guide. Crisp at any size, and unlike a repeating gradient
   it leaves no odd stripe in the corner */
.hatch {
  aspect-ratio: 1;
  background: var(--paper) var(--tile) repeat;
}

.hatch-beige { --paper: #f5ebe5; --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-1 1L1 -1M0 8L8 0M7 9L9 7' stroke='%23c4bcb7' stroke-width='1'/%3E%3C/svg%3E"); }
.hatch-black { --paper: #000; --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-1 1L1 -1M0 8L8 0M7 9L9 7' stroke='%23808080' stroke-width='1'/%3E%3C/svg%3E"); }
.hatch-orange { --paper: #ff4200; --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-1 1L1 -1M0 8L8 0M7 9L9 7' stroke='%23ffa180' stroke-width='1'/%3E%3C/svg%3E"); }

/* ── Typography ─────────────────────────────────────────── */

/* the page keeps its 16:9 shape; any extra height the grid adds is black, like the page */
.type-stage {
  padding: 0;
}

.type {
  position: relative;
}

.type > img {
  display: block;
  width: 100%;
  height: auto;
}

/* each line of the specimen in its own mask, placed in design px of the 1920 × 1080 page */
.type-line {
  position: absolute;
  left: calc(var(--x) / 1920 * 100%);
  top: calc(var(--y) / 1080 * 100%);
  width: calc(var(--w) / 1920 * 100%);
  height: calc(var(--h) / 1080 * 100%);
  overflow: hidden;
}

.type-line img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Small screens ──────────────────────────────────────── */

@media (max-width: 699px) {
  .palette { gap: 8px; }
  .pages { grid-template-columns: minmax(0, 1fr) 30%; gap: 12px; }
  .phone { border-width: 3px; }
  .home-film { width: 100%; }
}
