/* Frako 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
   platform laid out on it: images cut from 2x exports of the Figma file, placed
   in % of the design so the script can point at them. */

:root {
  --brand: #391d22;     /* the header's aubergine */
  --peach: #efe0d2;     /* secondary buttons, table headers */
  --screen-bg: #f6f6f6; /* the product page's panel: the price table sits on it */
  --pad: clamp(20px, 5vw, 64px);
  /* soft shadows tinted with the backdrop they fall on, so they read as natural shade */
  --shadow-on-brand: 0 24px 60px rgba(22, 7, 10, 0.34), 0 4px 14px rgba(22, 7, 10, 0.18);
  --shadow-on-peach: 0 22px 50px rgba(120, 78, 50, 0.18), 0 4px 12px rgba(120, 78, 50, 0.10);
  --shadow-on-grey: 0 18px 40px rgba(96, 74, 62, 0.14), 0 3px 10px rgba(96, 74, 62, 0.08);
}

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

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

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

.stage-brand { background: var(--brand); }
.stage-peach { background: var(--peach); }
.stage-screen { background: var(--screen-bg); }
.stage-dark { background: #171012; }
.stage-grey { background: #e8e5e3; }

/* ── 1. Home ────────────────────────────────────────────── */

/* the page hangs off the bottom edge, so extra height goes above it */
.shot > .stage.hero {
  justify-content: flex-end;
  padding-bottom: 0;
  perspective: 1400px;
}

/* The screen takes whatever height the grid rounding adds (flex-grow), so the
   space above it stays the stage's padding and the screenshot just runs a
   little further: from about halfway down the room photos (1150 of the page's
   1420) to near their bottom, depending on the window. */
.hero-screen {
  flex: 1 0 auto;
  width: 92%;
  aspect-ratio: 1440 / 1150;
  margin: 0 auto;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: var(--brand); /* the header's colour, so the rounded corners' edge pixels don't show white */
  box-shadow: var(--shadow-on-brand);
  transform-origin: 50% 0;
}

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

/* ── 2. Mobile ──────────────────────────────────────────── */

.shot-phones {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.phones {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 4vw, 56px);
}

.phone {
  width: 25%;
  min-width: 0;
  border-radius: 6px; /* a little, not a device's curve */
  box-shadow: var(--shadow-on-peach);
  will-change: transform;
}


/* ── 3. Four screens ────────────────────────────────────── */

.shot > .stage.screens {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: center;
  gap: clamp(12px, 2.4vw, 32px);
}

.screens img {
  display: block;
  width: 100%;
  border-radius: 5px;
  box-shadow: var(--shadow-on-grey);
}

/* ── 4. Admin (every view 1440 × 989) ───────────────────── */

.admin {
  display: grid;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow-on-brand);
}

.admin > img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
}

/* the project, the articles table and the article: stacked over the projects, shown in turn */
.admin-view {
  opacity: 0;
}

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

@media (max-width: 699px) {
  .shot-phones { aspect-ratio: 4 / 5; }
  .phone { width: 30%; }
}
