/* ==========================================================================
   Template: Expertise (Wellness · Experience · Technology)
   Figma frames "Wellness" 230:586, "Experience" 50:69, "Technology" 283:1130
   All sizes: calc(N * var(--k)), N = Figma px at 1440 wide.
   ========================================================================== */

.ex { position: relative; overflow: hidden; }

/* Soft glow at the top (Figma: blurred image, 50px, bleeding in from above) */
.ex__glow-top {
  position: absolute; left: 0; right: 0; top: 0;
  height: calc(233 * var(--k));
  background: url("../img/expertise/glow-top.jpg") center top / 100% 100% no-repeat;
  pointer-events: none;
}

.ex__inner {
  position: relative;
  padding-top: calc(182 * var(--k));
  display: flex; flex-direction: column; align-items: center;
  gap: calc(180 * var(--k));
}

/* ── Heading — Playfair 84 + Apercu Medium 24 uppercase #404040, 20 apart ── */
.ex-head {
  display: flex; flex-direction: column; align-items: center; gap: calc(20 * var(--k));
  text-align: center; padding: 0 16px;
}
.ex-head h1 {
  font-family: var(--serif); font-weight: 400; line-height: 1.1;
  font-size: calc(84 * var(--k));
}
.ex-label {
  font-size: calc(24 * var(--k)); line-height: 1; font-weight: 500;
  text-transform: uppercase; color: var(--muted);
}

/* ── Case caption — Apercu 18 / 140%, project name Medium uppercase #404040 ── */
.case { display: flex; flex-direction: column; gap: calc(20 * var(--k)); text-decoration: none; color: var(--fg); }
.case__media { position: relative; overflow: hidden; background: #151515; }
.case__media picture { display: block; width: 100%; height: 100%; }
.case__media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
a.case:hover .case__media img { transform: scale(1.03); }
.case__caption { font-size: calc(18 * var(--k)); line-height: 1.4; }
.case__name { font-weight: 500; text-transform: uppercase; color: var(--muted); transition: color .3s; }
a.case:hover .case__name { color: var(--hover); }

/* ── Two cases side by side — 1381 wide, two 566 squares ── */
.ex-pair {
  width: calc(1381 * var(--k)); max-width: calc(100% - 32px);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.ex-pair .case { width: min(calc(566 * var(--k)), calc(50% - 10px)); }
.ex-pair .case__media { aspect-ratio: 1; }

/* ── Quote — Playfair 42 / 945 wide; author Apercu 18 ── */
.ex-quote { width: calc(945 * var(--k)); max-width: calc(100% - 32px); margin: 0; text-align: center; }
.ex-quote blockquote {
  margin: 0; padding-top: calc(46 * var(--k));   /* Figma keeps an empty first line */
  font-family: var(--serif); font-size: calc(42 * var(--k)); line-height: 1.1;
}
.ex-quote figcaption {
  margin-top: calc(26 * var(--k)); font-size: calc(18 * var(--k)); line-height: 1.1;
  padding-bottom: calc(40 * var(--k));     /* Figma: two empty lines under the name */
}

/* ── Big case — full width 1440 × 760, caption 30 in from the left ── */
.ex-feature { width: 100%; }
.ex-feature .case__media { aspect-ratio: 1440 / 760; }
.ex-feature .case__caption {
  padding: calc(4 * var(--k)) calc(30 * var(--k));   /* 34 high, one line, text and name flow inline */
}

/* ── Closer: philosophy + client logos, coloured glow along the bottom ── */
/* Exactly one screen, like the case pages: scrolled to the bottom you see only
   the menu, the philosophy CTA (centred between menu and logos), the logo band
   with its rule and the blurred glow — the content above is just out of view. */
/* "More cases" strip (shared, style.css) above the closer; the column gap
   already spaces it, so no extra margin. Full width, edge to edge. */
.ex .cs-more { width: 100%; margin-top: 0; }

.ex-end {
  position: relative; width: 100%;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding-top: var(--header-h, calc(74 * var(--k)));
  padding-bottom: calc(60 * var(--k));    /* page ends 60 below the logo rule */
}
/* Pull the closer up as far as possible while the case strip and the logo
   band are never on screen together: strip → logos must be at least one
   (largest) screen. Space under the strip = logos (90) + padding (60) + 10
   safety = 160, i.e. 20 less than the 180 column gap. 100lvh − 100svh adds
   the height of a collapsing phone address bar (0 on desktop); browsers
   without lvh/svh ignore the rule and keep the plain 180. */
.ex .cs-more + .ex-end { margin-top: calc(100lvh - 100svh - 20 * var(--k)); }
/* Figma "Rectangle 19": an image just below the page (1558 × 760, layer
   blur 200 ≈ CSS 100px). Only the blur that bleeds upwards is visible, as a
   soft coloured band along the bottom edge; .ex clips the rest. */
.ex-end::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: calc(-59 * var(--k)); right: calc(-59 * var(--k)); top: 100%;
  height: calc(760 * var(--k));
  background: var(--glow-fill) center top / var(--glow-size, cover) no-repeat;
  filter: blur(100px);
}
.ex-end > * { position: relative; z-index: 1; }
.ex-end .philosophy { margin: auto; }   /* vertical centre between menu and logos */
.ex-end .clients { width: 100%; }

/* Wellness + Technology: fill cropped to its top (Figma h 136.68%); Experience: cover */
.ex--wellness, .ex--technology { --glow-fill: url("../img/expertise/glow-fill-a.jpg"); --glow-size: 100% 136.68%; }
.ex--experience { --glow-fill: url("../img/expertise/glow-fill-b.jpg"); }

/* Phones: stack the pair, pin readable sizes */
@media (max-width: 900px) {
  .ex__inner { padding-top: 120px; gap: 128px; }
  .ex-head h1 { font-size: 40px; }
  .ex-label { font-size: 15px; }
  /* every case the same: a square photo running to both screen edges */
  .ex-pair { flex-direction: column; gap: 80px; width: 100%; max-width: none; }
  .ex-pair .case { width: 100%; }
  .case__caption { padding: 0 16px; }
  .case__caption { font-size: 15px; }
  .ex-quote blockquote { font-size: 26px; padding-top: 0; }
  .ex-quote figcaption { font-size: 15px; }
  .ex-feature .case__media { aspect-ratio: 1; }   /* square crop via <picture> */
  .ex-feature .case__caption { padding: 0 16px; }
  .case { gap: 12px; }
  .ex-end { --header-h: 64px; padding-bottom: 40px; }
  .ex .cs-more + .ex-end { margin-top: calc(100lvh - 100svh - 14px); }   /* logos 64 + padding 40 + 10 = 114 under the strip */
}
