/* Kempische Hoeve 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: cuts of the live site captured at 2x and 3x, the logo and
   vegetables as the brand's own vectors, and the style guide's pages. */

:root {
  /* the style guide's palette */
  --blad: #94cb72;
  --klaver: #2e7d4f;
  --spar: #014f33;
  --woud: #013b26;
  --wolk: #f7f5ea;
  --zand: #e6e3d0;
  --zon: #f8c030;
  --aarde: #6f5641;
  --pad: clamp(20px, 5vw, 64px);
}

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

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

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

.stage-spar { background: var(--spar); }
.stage-woud { background: var(--woud); }
.stage-wolk { background: var(--wolk); }
.stage-zand { background: var(--zand); }
.stage-blad { background: var(--blad); }
.stage-zon { background: var(--zon); }
.stage-aarde { background: var(--aarde); }
.stage-wit { background: #fff; }

/* ── 1. The whole homepage ──────────────────────────────── */

/* A browser window hanging off the slide's bottom edge, as in More websites;
   its expand button opens the viewer (the end of this file). The window, the
   button and the viewer are drawn here: this page doesn't load More websites'
   stylesheet. */
.shot-scroll {
  width: 100%;
  aspect-ratio: 5 / 4;
}

.shot-scroll > .stage {
  justify-content: flex-end;
  /* narrow enough that the last stop fits the whole FAQ and the footer */
  padding: clamp(20px, 6%, 64px) clamp(20px, 17%, 290px) 0;
}

.window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* browser chrome: a bar with three dots */
.window::before,
.viewer-window.has-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 26px;
  background:
    radial-gradient(circle at 16px 13px, #d9d6cf 4px, transparent 4.5px),
    radial-gradient(circle at 30px 13px, #d9d6cf 4px, transparent 4.5px),
    radial-gradient(circle at 44px 13px, #d9d6cf 4px, transparent 4.5px),
    #f4f2ee;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* the expand button, in the bar, top right */
.expand {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  color: #8d8a82;
  cursor: pointer;
  transition: color 0.2s;
}

.expand:hover,
.expand:focus-visible {
  color: #23221f;
}

.expand svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the page plays through its window on a timer (hoeve.js) */
.home-sheet {
  position: relative;
  margin-top: 26px;
}

.home-page {
  display: block;
  width: 100%;
  height: auto;
}

/* the page's hero, live: the drone video under a cut of what's above it
   (nav, headline, buttons, scrim and torn edge), 1440 x 900 of the 1440 x 7152 */
.home-hero {
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 1440 / 900;
  overflow: hidden;
}

.home-hero video,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 2. Logo: the sun comes up ─────────────────────────── */

#sun {
  align-items: center;
  justify-content: center;
  padding: clamp(60px, 11vw, 150px) var(--pad);
}

.sun-logo {
  display: block;
  width: min(78%, 720px);
  height: auto;
  overflow: visible;
}

/* ── 2b. Mockups: photos full-bleed, the same shape as the tiles below ── */

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

.shot-photo > img { object-fit: cover; }

/* ── 3. Photo stack ─────────────────────────────────────── */

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

.shots .shot > .stage {
  align-items: center;
  justify-content: center;
}

/* the site's fan: every photo turns round the same point at its bottom edge,
   the front one fully visible, the ones behind fading */
.stack {
  position: relative;
  width: 46%;
  aspect-ratio: 3 / 4;
  margin-top: 4%;
}

.stack-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 100%;
}

.stack-photo[data-pos="0"] { z-index: 5; rotate: -4deg; }
.stack-photo[data-pos="1"] { z-index: 4; rotate: 0.5deg; }
.stack-photo[data-pos="2"] { z-index: 3; rotate: 4.5deg; opacity: 0.7; }
.stack-photo[data-pos="3"] { z-index: 2; rotate: 9deg; opacity: 0.5; }
.stack-photo[data-pos="4"] { z-index: 1; rotate: 13deg; opacity: 0.35; }

/* the site's arrow buttons, placed as on its 368 × 491 stack but larger (60 px, not 44,
   for clarity; their bottom edge stays where the site has it): a white square cut by a
   clip-path, its arrow in the site's dark green; on hover the shape bends (prev: its left
   corners, next: its right corners) and the arrow turns mid green. The shadow sits on the
   wrapper so the clip doesn't cut it. */
.stack-btn {
  position: absolute;
  top: calc(416.3 / 490.7 * 100%);
  z-index: 7;
  width: calc(60 / 368 * 100%);
  aspect-ratio: 1;
  filter: drop-shadow(0 4px 10px rgb(1 59 38 / 0.28));
}

.stack-prev { left: calc(14.4 / 368 * 100%); }
.stack-next { left: calc(77.6 / 368 * 100%); }

.stack-btn .pijl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: #014f33;
  clip-path: polygon(4% 4%, 96% 0%, 100% 95%, 52% 100%, 0% 96%);
}

.stack-next .pijl { clip-path: polygon(0% 4%, 92% 0%, 100% 96%, 46% 100%, 6% 96%); }
.stack-btn svg { width: 58%; height: 58%; }

/* the fingertip, at 32% across the top of the image, is the point */
.stack-cursor {
  position: absolute;
  z-index: 8;
  left: calc(107.6 / 368 * 100%);
  top: calc(446.3 / 490.7 * 100%);
  width: clamp(18px, 2.4vw, 28px);
  height: auto;
  translate: -32% 0;
  opacity: 0;
}

/* ── 3b. Values ─────────────────────────────────────────── */

#values {
  padding: 6%;
}

/* the stack as on the site, 410 × 281; each strip is placed in those px, by
   its cut (which includes 12 px around it, where the tilt reaches) */
.values {
  --sw: 410;
  --sh: 281;
  position: relative;
  width: 74%;
  aspect-ratio: 410 / 281;
  /* the strips reach from -13 to 313 of the 410: centre that, not the box */
  translate: 13% 0;
}

.value {
  position: absolute;
  left: calc(var(--x) / var(--sw) * 100%);
  top: calc(var(--y) / var(--sh) * 100%);
  width: calc(var(--w) / var(--sw) * 100%);
  height: auto;
  max-width: none;
}

/* ── 5. Quotes ──────────────────────────────────────────── */

#quotes {
  justify-content: center;
  gap: clamp(14px, 2vw, 26px);
  padding: clamp(40px, 6vw, 80px) 0;
}

/* each card's cut has 14 px around its 352 × 259 card; the margins take that back */
.quote-row {
  --h: clamp(150px, 20vw, 260px);
  display: flex;
  gap: clamp(10px, 1.6vw, 22px);
  width: max-content;
  will-change: transform;
}

.quote-row img {
  height: calc(var(--h) * 572 / 518);
  width: auto;
  margin: calc(var(--h) * -14 / 518);
}


/* ── 6. Price ───────────────────────────────────────────── */

#price {
  align-items: center;
  justify-content: center;
  padding: clamp(60px, 9vw, 120px) var(--pad);
}

.veg-field {
  position: absolute;
  inset: 0;
}

.veg {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 0.13%);
  height: auto;
  rotate: var(--r);
  translate: -50% 0;
  will-change: transform;
}

/* the card as cut, 410 × 379; the price is live text in its place */
.price-card {
  position: relative;
  width: min(40%, 410px);
  container-type: inline-size;
}

.price-card > img:first-child {
  width: 100%;
}

.price-value {
  position: absolute;
  left: calc(32 / 410 * 100%);
  top: calc(79.1 / 379 * 100%);
  width: calc(345.6 / 410 * 100%);
  margin: 0;
  color: var(--zon);
  font: 400 calc(72 / 410 * 100cqw) / 1 "Passion One", "Arial Narrow", sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.price-euro {
  margin-right: calc(4 / 410 * 100cqw);
  font-size: calc(40 / 72 * 1em);
  vertical-align: calc(8 / 72 * 1em);
}

/* ── 6. Style guide ──────────────────────────────────── */

#guide {
  align-items: center;
  padding: clamp(40px, 7vw, 90px) var(--pad);
}

.guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.6vw, 20px);
  width: 100%;
  max-width: 900px;
}

.guide img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(30, 18, 8, 0.35), 0 3px 8px rgba(30, 18, 8, 0.22);
}

/* ── The viewer: the whole homepage in a large window, scrolled by hand
   (hoeve.js opens it from the expand button) ── */

.viewer {
  --dim: 1;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px clamp(16px, 5vw, 64px) 0;
  border: 0;
  background: none;
  overflow: hidden;
}

.viewer[open] {
  display: flex;
  justify-content: center;
}

.viewer::backdrop {
  background: none;
}

/* the dim behind the window is a layer of the dialog rather than its ::backdrop, so it can fade (--dim) */
.viewer::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(20, 19, 17, calc(0.72 * var(--dim)));
}

.viewer-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1200px);
  height: 100%;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  transform-origin: 0 0;
}

.viewer-window.has-bar .viewer-scroll {
  margin-top: 26px;
}

.viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}

.viewer-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.viewer-close {
  position: absolute;
  top: 24px;
  right: clamp(16px, 2vw, 24px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #23221f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.viewer-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* the page behind stays put while the viewer is open */
.is-viewing,
.is-viewing body {
  overflow: hidden;
}

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

@media (max-width: 699px) {
  /* the homepage's window: taller, with a smaller bar */
  .shot-scroll { aspect-ratio: 2 / 3; }
  .shot-scroll > .stage { padding: 24px 20px 0; }

  .window::before {
    height: 18px;
    background:
      radial-gradient(circle at 11px 9px, #d9d6cf 3px, transparent 3.5px),
      radial-gradient(circle at 21px 9px, #d9d6cf 3px, transparent 3.5px),
      radial-gradient(circle at 31px 9px, #d9d6cf 3px, transparent 3.5px),
      #f4f2ee;
  }

  .home-sheet { margin-top: 18px; }
  .expand { width: 30px; height: 18px; }
  .expand svg { width: 12px; height: 12px; }
  .viewer { padding: 64px 12px 0; }
  .viewer-close { top: 12px; right: 12px; }

  .guide { grid-template-columns: repeat(2, 1fr); }
  .sun-logo { width: 92%; }
  .values { width: 86%; }
  .price-card { width: 62%; }
  .veg { width: calc(var(--w) * 0.18%); }
  .veg-in { display: none; }
}
