/*
 * 07 Case studies — folder line component (from hero-prototype/cases/),
 * with the header and case panel styled as in the Figma landing page.
 */

.cases {
  --c-bg: #dfe4dd;
  --c-ink: #363e32;
  --c-dim: #6c7d64;
  --c-sage: #8a9b82;
  --c-slot: #d3d9d0;
  position: relative;
  padding: 107px var(--pad) 52px;
  overflow: hidden;
  background: var(--c-bg);
}

.cases__inner {
  position: relative;
  width: 100%;
  max-width: 1328px;
  margin: 0 auto;
}

/* Header + panel float over the empty corners the diagonal line leaves */
.cases__head {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  pointer-events: none;
}
.cases__title {
  font: 400 40px/1.05 var(--f-jost);
  letter-spacing: -1.2px;
  white-space: nowrap;
  color: var(--c-ink);
}
.cases__title span { color: var(--c-sage); }

/* ---------- Folder line ---------- */

/* Full-bleed: the line runs past both edges of the page */
.cases__stage {
  position: relative;
  z-index: 1;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  touch-action: pan-y;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.cases__stage:focus-visible { outline: 1px solid var(--c-dim); outline-offset: -10px; }
@media (min-width: 1100px) {
  .cases__stage { margin-top: 65px; } /* clears the header, as in Figma */
}
.cases.is-dragging .cases__stage { cursor: grabbing; }

.folder {
  --r: 0;     /* open: the folder has become its photo */
  --draw: 0;  /* line draw-in */
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  opacity: var(--fade, 1);
  will-change: transform;
  pointer-events: none;
}

.folder__lines {
  position: absolute;
  left: 0;
  overflow: visible;
}
.folder__line {
  fill: var(--c-bg);
  fill-opacity: var(--draw);
  stroke: var(--c-ink);
  stroke-width: var(--sw, .5);
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--draw));
}
/* An open folder is just its photo — the outline steps aside */
.folder__back { opacity: calc(1 - var(--r)); }
.folder__flap { stroke-opacity: calc(1 - var(--r)); }

.folder__photo {
  position: absolute;
  overflow: hidden;
  background: var(--c-slot);
  opacity: var(--r);
}
.folder__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.14 - .14 * var(--r)));
}

/* ---------- Case panel ---------- */

.cases__info {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 520px;
}

.info__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cases__tag {
  padding: 7px 12px;
  border: 1px solid var(--c-sage);
  border-radius: 7px;
  font: 400 12px/1.45 var(--f-jost);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-ink);
}

.info__title {
  width: 450px;
  max-width: 100%;
  min-height: 2.3em;
  margin-top: 24px;
  font: 400 28px/1.15 var(--f-alpino);
  letter-spacing: -.56px;
  color: var(--c-ink);
}
.info__quote {
  min-height: 3.9em;
  margin-top: 24px;
  font: 400 20px/1.3 var(--f-alpino);
  letter-spacing: -.2px;
  color: var(--c-dim);
}
.info__author {
  margin-top: 88px;
  font: 400 10px/normal var(--f-alpino);
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-ink);
}

/* ---------- Responsive ---------- */

/* Too narrow for the corners to hold the header and panel — they stack around it */
@media (max-width: 1099px) {
  .cases__head { position: static; gap: 16px; margin-bottom: 24px; }
  .cases__info { position: static; width: auto; max-width: 560px; margin: 36px 0 0 auto; }
  .info__author { margin-top: 32px; }
}

@media (max-width: 759px) {
  .cases { padding: 96px var(--pad) 72px; }
  .cases__title { white-space: normal; font-size: clamp(28px, 8.4vw, 36px); letter-spacing: -1px; }
  .cases__info { max-width: none; margin: 28px 0 0; }
  .info__title { font-size: 22px; }
  .info__quote { font-size: 17px; }
}
