/* ---------- Case study page (BNY Studio) ---------- */
:root {
  --case-hero: #097681;
  --case-hero-fg: #ffffff;
  --cream: #fdf5dd;
}
:root[data-theme="dark"] {
  --case-hero: #0b4a52;
}

.case-page { padding: 64px 0 120px; display: flex; flex-direction: column; gap: 40px; }
.case-page > * { margin: 0; }
.cs { display: flex; flex-direction: column; gap: 16px; }
.cs > * { margin: 0; }
.cs h2 { font-size: 28px; font-weight: 500; line-height: normal; }
.cs h3 { font-size: 20px; font-weight: 500; line-height: 1.3; }
.cs p, .cs li { font-size: 18px; line-height: 28px; color: var(--muted); }
.cs .cs__lead { font-size: 20px; font-weight: 500; line-height: 1.5; color: var(--fg); }
.cs ul { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.cs--gap { gap: 24px; }
.cs__sub { display: flex; flex-direction: column; gap: 16px; }
.cs__sub > * { margin: 0; }
.cs figcaption, .cs__caption { font-size: 15px; line-height: 22px; color: var(--muted); }

/* Title + tags */
.case-hero { display: flex; flex-direction: column; gap: 16px; }
.case-hero > * { margin: 0; }
.case-hero__title { font-size: 56px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.04; }
.case-hero__tags { font-size: 16px; color: var(--tags); }

/* Teal intro card with the laptop overlapping it */
.case-intro-wrap { container-type: inline-size; position: relative; z-index: 0; }
.case-intro-wrap + .cols-card { position: relative; z-index: 1; }
.case-intro {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 28.8cqw;
  padding: 6.7cqw 11.25cqw;
  border-radius: 24px;
  background: var(--case-hero);
  color: var(--case-hero-fg);
  transition: background-color .2s;
}
.case-intro p { margin: 0; max-width: 36cqw; font-size: 22px; line-height: 1.45; font-weight: 500; font-style: italic; }
.case-intro__laptop { position: absolute; top: -2.5cqw; left: 54.25cqw; width: 34.5cqw; height: auto; pointer-events: none; }

/* Gray multi-column cards */
.cols-card {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  padding: 36px 40px;
  border-radius: 32px;
  background: var(--card);
}
.cols-card__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cols-card__item > * { margin: 0; }
.cols-card__label, .cs .cols-card__label { font-size: 14px; font-weight: 500; line-height: normal; color: var(--tags); }
.cs .cols-card__item p { font-size: 16px; line-height: 24px; color: var(--fg); }
.cols-card__item p { font-size: 16px; line-height: 24px; color: var(--fg); }

/* Images */
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 16px; }
.shot--r24 img { border-radius: 24px; }
.shot--old img { width: min(494px, 100%); border-radius: 0; }   /* the PNG already has its own rounded corners */
.shot--cover { flex: none; width: 30.3%; }
.shot--cover img { border-radius: 16px; border: 1px solid #e1e1e1; box-sizing: border-box; }
:root[data-theme="dark"] .shot--cover img { border-color: var(--border); }
.ds-intro { display: flex; align-items: center; gap: 24px; }
.ds-intro p { flex: 1; min-width: 0; margin: 0; }

/* Connecting models: two screens overlapping, like in the Figma layout */
.collage { position: relative; aspect-ratio: 1042 / 574; }
.collage .shot { position: absolute; width: 63.92%; }
.collage .shot img { border-radius: 8px; }
.collage__a { left: 0; top: 0; }
.collage__b { left: 31.96%; top: 41.81%; }
.collage__b img { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16); }
.shot-row { display: flex; align-items: flex-start; gap: 24px; }
.shot-row > .shot { min-width: 0; }
.shot-row--2 > .shot { flex: 1 1 0; }
.shot-row--asym > .shot:first-child { flex: 388 1 0; }
.shot-row--asym > .shot:last-child { flex: 629 1 0; }

/* Persona cards */
.persona { display: flex; flex-direction: column; gap: 16px; padding: 32px; border-radius: 32px; background: var(--card); }
.persona > * { margin: 0; }
.persona__name { font-size: 24px; font-weight: 500; }
.persona__quote { font-size: 18px; line-height: 28px; font-style: italic; color: var(--fg); }
.persona__boards { display: flex; align-items: flex-start; background: var(--cream); border-radius: 4px; overflow: hidden; }
.persona__boards img { display: block; height: auto; border-radius: 0; }
.persona__boards--f img:first-child, .persona__boards--f img:last-child { width: 50%; }
.persona__boards--e img:first-child { width: 53%; }
.persona__boards--e img:last-child { width: 47%; }


/* Governance */
.gov { align-items: stretch; }

/* ---------- Discovery: scroll-stacked screens ---------- */
.stack { position: relative; --top: 96px; --step: 14px; }
.stack__card {
  --p: 0;
  position: sticky;
  top: calc(var(--top) + var(--i) * var(--step));
  margin: 0 0 26vh;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--border);
  transform-origin: 50% 0;
  transform: scale(calc(1 - 0.04 * var(--p)));
  will-change: transform;
}
.stack__card:last-child { margin-bottom: 0; }
.stack__card img { display: block; width: 100%; height: auto; }
.stack__card::after { content: ""; position: absolute; inset: 0; background: #000; opacity: calc(var(--p) * 0.28); pointer-events: none; }
.stack__count {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
  .stack__card { position: relative; top: auto; margin-bottom: 24px; transform: none; }
  .stack__card::after { display: none; }
}

@media (max-width: 860px) {
  .case-hero__title { font-size: 40px; }
  .cols-card { flex-direction: column; gap: 24px; padding: 28px; border-radius: 24px; }
  .shot-row { flex-direction: column; }
  .shot-row--2 > .shot, .shot-row--asym > .shot { flex: none; width: 100%; }
  .persona { padding: 24px; border-radius: 24px; }
  /* Boards stay readable on phones: swipe sideways instead of shrinking the text */
  .persona__boards { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .persona__boards img { flex: none; width: 640px !important; scroll-snap-align: start; }
  .ds-intro { flex-direction: column; align-items: stretch; }
  .shot--cover { width: min(316px, 100%); }
  .stack { --top: 76px; --step: 10px; }
  .stack__card { border-radius: 16px; margin-bottom: 18vh; }
  /* Intro card: text first, laptop below it */
  .case-intro-wrap { padding-bottom: 0; }
  .case-intro { display: block; min-height: 0; padding: 28px 24px 0; overflow: visible; }
  .case-intro p { max-width: none; font-size: 19px; }
  .case-intro__laptop { position: relative; top: auto; left: auto; display: block; width: min(420px, 100%); margin: 8px auto -28px; }
  .case-intro-wrap { padding-bottom: 28px; }
}
@media (max-width: 560px) {
  .case-page { padding: 40px 0 80px; gap: 32px; }
  .case-hero__title { font-size: 34px; }
  .cs h2 { font-size: 24px; }
  .cs p, .cs li { font-size: 17px; line-height: 26px; }
}

/* ---------- Click-to-enlarge lightbox ---------- */
.case-page img[data-zoom] { cursor: zoom-in; }
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: rgba(10, 10, 12, 0.92);
  color: #fff;
}
.lightbox::backdrop { background: transparent; }
.lightbox__scroller { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 64px 24px 40px; }
.lightbox__img { display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 104px); width: auto; height: auto; object-fit: contain; border-radius: 8px; cursor: zoom-in; background: #fff; }
.lightbox.is-actual .lightbox__scroller { place-items: start center; }
.lightbox.is-actual .lightbox__img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox__close, .lightbox__hint { position: fixed; top: 14px; z-index: 2; }
.lightbox__close { right: 16px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer; }
.lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__hint { left: 20px; top: 24px; font-size: 13px; color: rgba(255, 255, 255, 0.7); }

/* Updated visual direction: magazine image + text */
.brand-block { display: flex; align-items: center; gap: 24px; }
.brand-block__img { flex: 0 0 36.84%; }
.brand-block__img img { aspect-ratio: 383.8 / 373.5; object-fit: cover; }
.brand-block__text { flex: 1; min-width: 0; align-items: flex-start; }
@media (max-width: 860px) {
  .brand-block { flex-direction: column; align-items: stretch; gap: 24px; }
  .brand-block__img { flex: none; }
}

/* Keywords highlighted in the case text (green, bold) */
.cs .kw { color: var(--tags); font-weight: 700; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn--secondary { background: #ffffff; box-shadow: inset 0 0 0 1px #d4d4d8; }
.btn--secondary:hover { background: #f6f6f7; }
:root[data-theme="dark"] .btn--secondary { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
:root[data-theme="dark"] .btn--secondary:hover { background: var(--pill-hover); }

/* ---------- Ework case ---------- */
.theme-ework { --case-hero: #df9b37; --tags: #c7821e; }
:root[data-theme="dark"] .theme-ework { --case-hero: #8a5d17; --tags: #e8a845; }
.cs h4 { font-size: 18px; font-weight: 500; line-height: 1.3; }
.shot-row--3 > .shot { flex: 1 1 0; }
.shot--center { width: 68%; margin: 0 auto; }
.split { display: flex; align-items: flex-start; gap: 16px; }
.split__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split__text > * { margin: 0; }
.split > .shot { flex: 0 0 36.9%; }
.cs strong { font-weight: 500; color: var(--fg); }
@media (max-width: 860px) {
  .shot-row--3 > .shot { flex: none; width: 100%; }
  .shot--center { width: 100%; }
  .split { flex-direction: column; }
  .split > .shot { flex: none; width: min(385px, 100%); }
}
/* Ework intro: mockup on the left, text on the right (mirror of BNY). The laptop only rises a little above the card so it never touches the tags. */
.theme-ework .case-intro { display: flex; align-items: center; justify-content: flex-end; }
.theme-ework .case-intro p { text-align: right; }
.theme-ework .case-intro__laptop { left: 11.25cqw; }
/* Ework screens: same 16px rounding and 1px stroke as the BNY screens */
.theme-ework .shot img { border-radius: 16px; box-shadow: 0 0 0 1px var(--border); }
.theme-ework .brand-block__img img { box-shadow: none; }
@media (max-width: 860px) {
  .theme-ework .case-intro { display: block; min-height: 0; }
  .theme-ework .case-intro p { text-align: left; }
  .theme-ework .case-intro__laptop { top: auto; left: auto; width: min(420px, 100%); }
}
