/* =========================================================================
   Case study — one template for every project. Values measured from the
   PASHA Insurance App frames (Desktop 1440 / Tablet 768 / Mobile 390).
   ========================================================================= */

.page--case-pasha-insurance-web { background-color: var(--ink-950); }

.case { padding: 0 var(--layout-margin); }

/* --- Header ------------------------------------------------------------- */
.case-header { padding-top: 33px; }

.case-header__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-h2);
  line-height: var(--display-h2-lh);
}

.case-header__subtitle {
  margin-top: 6px;
  color: var(--grey-500);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.case-header__jumps { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.jump-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink-850);
  color: var(--grey-400);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}

.jump-link:hover { color: var(--white); }

/* Below desktop, section intros use text/body (#D5D3D3) as designed. */
@media (max-width: 1199px) {
  .case .section-header__text { color: var(--grey-200); }
}

@media (min-width: 1200px) {
  .case-header { padding-top: 68px; }
  .case-header__subtitle { margin-top: 4px; }
  .case-header__jumps { gap: 42px; margin-top: 29px; }
  .jump-link { padding: 0; gap: 10px; background: none; color: var(--grey-450); }
}

/* --- Hero ---------------------------------------------------------------- */
.case-hero { display: grid; gap: 32px; margin-top: 37px; }

.case-hero__device { display: flex; justify-content: center; margin: 0; }
.case-hero__device img { max-width: 100%; height: auto; }

.case-hero__intro { display: grid; gap: 22px; }
/* Tablet and mobile show only the first intro block (Overview), as designed. */
@media (max-width: 1199px) { .intro-block:not(:first-child) { display: none; } }

.intro-block__heading {
  color: var(--grey-300);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}

.intro-block__text {
  margin-top: 4px;
  color: var(--grey-450);
  font-size: var(--text-body-m);
  line-height: var(--text-body-m-lh);
}

@media (min-width: 1200px) {
  .case-hero {
    grid-template-columns: minmax(0, 760px) minmax(0, 463px);
    justify-content: space-between;
    align-items: start;
    gap: 24px;
    margin-top: 56px;
  }
  .case-hero__intro { gap: 24px; }
  .intro-block__heading { font-size: 24px; line-height: 32px; }
  .case-hero__device { margin-top: var(--device-offset, 107px); }
  .case-hero__device--laptop { justify-content: flex-start; }
  .case-hero__device--laptop img { max-width: none; }
  /* Per-project art direction measured from each Desktop frame. */
  .page--case-pasha-insurance-web .case-hero { --device-offset: 80px; }
  /* The hero is a fixed-height band in every frame: the Snapshots heading always lands at the same y,
     and longer intro copy simply runs into the gap below. */
  .case-hero { height: 527px; }
  .page--case-mento .case-hero,
  .page--case-paysmile .case-hero,
  .page--case-fasteer .case-hero { height: 547px; margin-top: 36px; }
  .page--case-mento .case-hero { --device-offset: 85px; }
  .page--case-paysmile .case-hero,
  .page--case-fasteer .case-hero { --device-offset: 151px; }
}

/* --- Project Snapshots --------------------------------------------------- */
.case-snapshots { margin-top: 74px; }
.case-snapshots .section-header { gap: 12px; }
.case-snapshots .section-header__text { max-width: 640px; color: var(--grey-450); }
.case-snapshots__intro--wide { display: none; }

.snapshot-board { display: none; }

.stat-cards { display: grid; gap: 20px; margin: 24px 0 0; padding: 0; }

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
}

.stat-card__figure {
  color: var(--blue-600);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 44px;
  text-align: right;
}

.stat-card__caption {
  margin-top: 9px;
  color: var(--grey-400);
  font-size: 18px;
  line-height: 20px;
  font-weight: 700;
  text-align: right;
}

.stat-card__summary {
  margin-top: 7.5px;
  color: var(--grey-200);
  font-size: 16px;
  line-height: 22px;
}

@media (min-width: 768px) {
  .stat-cards { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 14px; }
  .stat-card__summary { font-size: 18px; line-height: 24px; }
}

@media (min-width: 1200px) {
  .case-snapshots { margin-top: 121px; min-height: 771px; } /* fixed band: Detailed Work always starts at the same y */
  .case-snapshots__intro--wide { display: inline; }
  .case-snapshots__intro--compact { display: none; }
  .stat-cards { display: none; }

  .snapshot-board {
    --line: 2px;
    display: grid;
    grid-template-columns: 149fr 330fr 330fr 330fr 149fr;
    grid-template-rows: 190.5px 194px 172.5px;
    column-gap: var(--line);
    row-gap: var(--line);
    margin-top: 39px;
    padding: 19.5px 0 31px;
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--ink-700);
  }

  .snapshot-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15.5px 15px 15px;
  }

  /* Grid lines are drawn per cell so they can animate in (brief §14). */
  .snapshot-cell:not([style*="--col: 1;"])::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--line));
    width: var(--line);
    background: var(--ink-600);
    transform-origin: bottom;
  }
  .snapshot-cell[style*="--row: 1;"]::before { top: 0; }
  .snapshot-cell:not([style*="--row: 1;"])::after {
    content: "";
    position: absolute;
    left: calc(-1 * var(--line));
    right: 0;
    top: calc(-1 * var(--line));
    height: var(--line);
    background: var(--ink-600);
    transform-origin: left;
  }
  .snapshot-cell[style*="--col: 1;"]::after { left: 0; }
  .snapshot-cell:not([style*="--row: 1;"])[style*="--col: 1;"]::after { left: -1px; }

  .snapshot-cell__text {
    font-size: 16px;
    line-height: 18px;
    font-weight: 500;
  }

  .snapshot-cell__text--bottom { margin-top: auto; font-weight: 600; }

  .snapshot-cell__figure {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: auto;
    color: var(--blue-600);
    text-align: right;
  }

  .snapshot-cell__number {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 40px;
    line-height: 36px;
  }

  .snapshot-cell__caption {
    margin-top: 4px;
    font-size: 18px;
    line-height: 20px;
    font-weight: 700;
  }

  .snapshot-cell .accent { color: var(--blue-600); }
}

/* Snapshot entrance: empty board → lines draw → figures → captions → text (~2.7s). */
@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
  .snapshot-board.is-pending .snapshot-cell::before { transform: scaleY(0); }
  .snapshot-board.is-pending .snapshot-cell::after { transform: scaleX(0); }
  .snapshot-board.is-pending .snapshot-cell__number,
  .snapshot-board.is-pending .snapshot-cell__caption,
  .snapshot-board.is-pending .snapshot-cell__text { opacity: 0; transform: translateY(6px); }

  .snapshot-board.is-revealing .snapshot-cell::after { transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1); }
  .snapshot-board.is-revealing .snapshot-cell::before {
    transition: transform 450ms cubic-bezier(0.65, 0, 0.35, 1);
    transition-delay: calc(300ms + (3 - var(--row)) * 150ms); /* bottom row first: lines grow upward */
  }
  .snapshot-board.is-revealing .snapshot-cell__number,
  .snapshot-board.is-revealing .snapshot-cell__caption,
  .snapshot-board.is-revealing .snapshot-cell__text {
    transition: opacity 450ms ease-out, transform 450ms ease-out;
  }
  .snapshot-board.is-revealing .snapshot-cell__number { transition-delay: 900ms; }
  .snapshot-board.is-revealing .snapshot-cell__caption { transition-delay: 1000ms; }
  .snapshot-board.is-revealing .snapshot-cell__text { transition-delay: 1100ms; }

  /* The figure cells are bricks: their content travels as one block and lands with a thud (see brick-in). */
  .snapshot-board.is-pending .is-brick > * { opacity: 0; }
  .snapshot-board.is-pending .is-brick .snapshot-cell__number,
  .snapshot-board.is-pending .is-brick .snapshot-cell__caption,
  .snapshot-board.is-pending .is-brick .snapshot-cell__text { opacity: 1; transform: none; }
  .snapshot-board.is-revealing .is-brick .snapshot-cell__number,
  .snapshot-board.is-revealing .is-brick .snapshot-cell__caption,
  .snapshot-board.is-revealing .is-brick .snapshot-cell__text { transition: none; }
  .snapshot-board.is-revealing .is-brick > * {
    animation: brick-in 900ms both;
    animation-delay: calc(500ms + var(--brick-i) * 180ms);
  }
}

/* --- Detailed Work (light band) ------------------------------------------ */
.case-work {
  margin: var(--layout-section-gap) calc(-1 * var(--layout-margin)) 0;
  padding: 0 var(--layout-margin);
}

.case-work .section-header__text { max-width: 615px; color: var(--grey-200); }

.work { margin-top: 24px; }

.work__tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.work__tabs::-webkit-scrollbar { display: none; }

.work__tab {
  flex: none;
  padding: 10px 16px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--grey-450);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
}

.work__tab.is-active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

.work__tab:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

/* Without JS every panel shows, each with its own title; with JS only the active one does. */
.work__panel { margin-top: 32px; }
.work__panel:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 4px; }
.work__panel-title { margin-bottom: 16px; font-size: 20px; line-height: 24px; font-weight: 700; }
.work__tabs { display: none; }
.work.is-enhanced .work__tabs { display: flex; }
.work.is-enhanced .work__panel { display: none; margin-top: 24px; }
.work.is-enhanced .work__panel.is-active { display: block; }
.work.is-enhanced .work__panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.work__canvas { display: none; }

/* Tablet and mobile: the tab's screens sit on one light panel, echoing the desktop Figma canvas.
   Justified rows: each tile grows in proportion to its aspect ratio, so every row shares one height
   and fills the full width; the trailing spacer stops the last row from being stretched. */
.work__stage {
  --row: 180px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--grey-50);
}

.work__screens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work__screens::after { content: ""; flex: 1000 1 0; }

.work__screens li { flex: var(--ar) 1 calc(var(--ar) * var(--row)); min-width: 0; }

.work__zoom {
  display: block;
  border-radius: var(--radius-sm);
  outline-offset: 2px;
  cursor: zoom-in;
}

.work__zoom:focus-visible { outline: 2px solid var(--blue-600); }

.work__screens img,
.work__screens-fallback {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: 0 0 0 1px rgb(2 19 113 / 0.06), 0 2px 8px rgb(2 19 113 / 0.06);
  transition: transform 200ms var(--ease-standard), box-shadow 200ms var(--ease-standard);
}

@media (hover: hover) {
  .work__zoom:hover img { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(2 19 113 / 0.08), 0 8px 20px rgb(2 19 113 / 0.12); }
}

.work__hint {
  margin-top: 10px;
  color: var(--grey-500);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}
.work__hint--mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .work__hint--touch { display: none; }
  .work__hint--mouse { display: inline; }
}

/* Scrollable tab row: fade the edge that still has pills beyond it (classes set by case-study.js). */
@media (max-width: 1199px) {
  .work__tabs.has-more-end { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  .work__tabs.has-more-start { mask-image: linear-gradient(to right, transparent, #000 48px); }
  .work__tabs.has-more-start.has-more-end { mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
}

/* --- Lightbox (tap a screen) --------------------------------------------- */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ink-950);
  color: var(--white);
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.6); }

.lightbox__bar,
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--layout-margin);
}

.lightbox__count { color: var(--grey-350); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }

.lightbox__close,
.lightbox__step {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 50%;
  background: none;
  color: var(--white);
  cursor: pointer;
}
.lightbox__close:focus-visible,
.lightbox__step:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 2px; }
.lightbox__step:disabled { opacity: 0.3; cursor: default; }
.lightbox__step .icon { width: 14px; height: auto; transform: rotate(90deg); }
.lightbox__step--next .icon { transform: rotate(-90deg); }

/* Tall screens scroll inside the viewer rather than shrinking to an unreadable size. */
.lightbox__body {
  flex: 1;
  display: grid;
  place-items: start center;
  min-height: 0;
  padding: 0 var(--layout-margin);
  overflow: auto;
  overscroll-behavior: contain;
}
.lightbox__image {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--white);
}
.lightbox__image.is-short { align-self: center; }

.findings { display: grid; gap: 32px; margin-top: 40px; }

.findings__heading {
  color: var(--blue-300);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}

.findings__list {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
  padding-left: 27px;
  color: var(--grey-200);
  font-size: var(--text-body-m);
  line-height: 26px;
}

/* The design's short blue strokes between bullets: decorative dividers at fixed places. */
.findings__list li + li { position: relative; }
.findings__list li + li::before,
.findings__list li + li::after {
  content: "";
  position: absolute;
  top: -9px;
  height: 2px;
  background: var(--blue-500);
  pointer-events: none;
}
.findings__list li + li::after { display: none; }
.findings__list li + li::before,
.findings__list li + li::after { left: 0; width: 40px; }

@media (min-width: 768px) {
  .findings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .work__stage { --row: 210px; padding: 16px; }
  .work__screens { gap: 12px; }
}

@media (min-width: 1200px) {
  /* Desktop only: Detailed Work sits on a white band (tablet and mobile stay dark). */
  .case-work { min-height: 1620px; padding: 61.5px var(--layout-margin) 58px; background: var(--white); color: var(--ink-900); }
  .page--case-mento .case-work .section-header__text { max-width: 640px; }
  .case-work .section-header__title { color: var(--ink-900); }
  .case-work .section-header__text { color: var(--ink-700); }
  .case-work .findings__heading { color: var(--blue-600); }
  .case-work .findings__list { color: var(--ink-700); }
  .case .section-header { gap: 16px; }
  /* The tab row and the canvas read as one white panel; their shadows are clipped at the seam. */
  .work { margin-top: 37px; }
  .work__tabs {
    gap: 24px;
    margin: 0;
    padding: 30px 28px 10px;
    scroll-padding-inline: 28px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--white);
    box-shadow: 0 4px 24px rgb(2 19 113 / 0.08);
    clip-path: inset(-40px -40px 0 -40px);
  }
  .work__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--grey-350);
    font-size: 16px;
    line-height: 24px;
  }
  .work__tab.is-active { background: none; color: var(--blue-600); }
  .work__tab.is-active::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
  }
  .work.is-enhanced .work__panel { margin-top: 0; }
  .work__canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 4px 24px rgb(2 19 113 / 0.08);
    clip-path: inset(0 -40px -40px -40px);
  }
  .work__stage { display: none; }
  .findings { margin-top: 55px; }
  .findings__column--pain .findings__list li + li::before,
  .findings__column--pain .findings__list li + li::after { left: auto; right: 0; width: min(297px, 48%); }
  .findings__column--pain .findings__list li + li + li::before,
  .findings__column--pain .findings__list li + li + li::after { width: min(449px, 73%); }
  .findings__column--changed .findings__list li + li::before,
  .findings__column--changed .findings__list li + li::after { left: -28px; width: min(458px, 75%); }
  .findings__column--changed .findings__list li + li + li::before,
  .findings__column--changed .findings__list li + li + li::after { width: min(306px, 50%); }
  /* Right-anchored strokes draw from the right. */
  .findings__column--pain .findings__list li + li { --line-origin: right; }
}

/* --- Design System ------------------------------------------------------- */
.case-ds { margin-top: 62px; }
.case-ds .section-header__text { max-width: 600px; color: var(--grey-450); }
.case-ds__image { width: 100%; height: auto; margin-top: 36px; border-radius: var(--radius-lg); }

/* --- Role and Working Context ------------------------------------------- */
.case-role { margin-top: var(--layout-section-gap); }
.case-role .section-header__text { max-width: 600px; color: var(--grey-450); }
.case-role__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 40px; }
.case-role__folder { width: 100%; max-width: 526px; height: auto; }

.process {
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--layout-margin));
  padding: 0 var(--layout-margin);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--layout-margin);
  scrollbar-width: none;
  list-style: none;
}

.process::-webkit-scrollbar { display: none; }

.process-card {
  flex: none;
  width: 288px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink-700);
  scroll-snap-align: start;
}

.process-card__stage { color: var(--ink-900); font-size: 22px; line-height: 28px; font-weight: 700; }
.process-card__text { margin-top: 12px; font-size: 16px; line-height: 22px; font-weight: 700; }
.process-card__text--full { display: none; }

@media (min-width: 768px) {
  .process { flex-direction: column; gap: 16px; margin: 0; padding: 0; overflow: visible; }
  .process-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 92px;
    width: auto;
  }
  .process-card__text { margin-top: 0; font-size: 16px; line-height: 24px; }
  .process-card__text--full { display: block; }
  .process-card__text--short { display: none; }
}

@media (min-width: 1200px) {
  .case-role { margin-top: 104px; }
  .case-work + .case-role { margin-top: 62px; } /* no Design System section: Role takes its place */
  /* The process stack sits at a fixed offset under the heading; the folder follows the intro copy,
     which is one line shorter on these two pages. */
  .case-role .section-header { min-height: 120px; }
  .page--case-fasteer .case-role__folder { margin-top: -25px; }
  .page--case-pasha-insurance-web .process { margin-top: 19px; }
  .case-role__body { margin-top: 59px; }
  .case-role__body { grid-template-columns: 526px minmax(0, 1fr); gap: 24px; align-items: start; }
  /* The folder is cropped at the bottom in the design. */
  .case-role__folder { height: 348px; object-fit: cover; object-position: top; }
  /* Cascading stack: each card's top sits 54px below the previous card's, like a shuffled deck. */
  .process { position: relative; display: block; }
  .process-card {
    position: absolute;
    top: calc(var(--i) * 54px);
    left: 0;
    right: 0;
    grid-template-columns: 107px 1fr;
    gap: 92px;
  }
  .process-card:last-child { position: relative; top: 0; margin-top: calc(3 * 54px); }
  .process-card__stage { font-size: 24px; line-height: 32px; }
}

/* Desktop deck (case-study.js): each card sits in a slot 54px apart; the chosen one moves to the front slot.
   Slots use the independent `translate` property so they compose with the entrance animation's `transform`. */
@media (min-width: 1200px) {
  .process.is-deck .process-card,
  .process.is-deck .process-card:last-child {
    position: absolute;
    top: 0;
    margin-top: 0;
    translate: 0 calc(var(--slot, 0) * 54px);
  }
  .process.is-deck .process-card:not(.is-front) { cursor: pointer; }
  .process-card__toggle {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .process-card__toggle::after { content: ""; position: absolute; inset: 0; } /* the whole strip is the target */
  .process-card.is-front .process-card__toggle { cursor: default; }
  .process-card.is-front .process-card__toggle::after { display: none; }
  .process-card__toggle:focus-visible { outline: none; }
  .process-card:has(.process-card__toggle:focus-visible) { outline: 2px solid var(--blue-600); outline-offset: 2px; }
}

@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
  .process.is-deck { transition: height 450ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .process.is-deck .process-card { transition: translate 550ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 250ms ease; }
  .process.is-deck .process-card:not(.is-front):hover {
    translate: 0 calc(var(--slot, 0) * 54px - 4px);
    box-shadow: 0 -6px 16px rgb(0 0 0 / 0.18);
  }
}

/* --- The Next One ------------------------------------------------------- */
.case-next { margin-top: var(--layout-section-gap); }

.case-next__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-section);
  line-height: var(--display-section-lh);
}

.next-cards {
  display: grid;
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.next-card { display: block; }

.next-card__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--ink-700);
  color: var(--white);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}

.next-card__dots { position: absolute; left: 10px; display: flex; gap: 4px; }
.next-card__dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-600); }
.next-card .icon--chevron { color: var(--grey-500); }

.next-card__body {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 32px 12px;
}

.next-card__image { width: auto; max-width: 100%; height: auto; max-height: 180px; }
.next-card__soon { color: var(--grey-500); font-size: 18px; line-height: 24px; font-weight: 700; }

.next-card:hover .next-card__bar { background: var(--ink-600); }
.next-card:hover .next-card__image { transform: translateY(-4px); }
.next-card__image { transition: transform 450ms var(--ease-standard); }

@media (min-width: 768px) {
  .next-cards {
    grid-auto-flow: column;
    grid-auto-columns: 300px;
    gap: 16px;
    margin: 32px calc(-1 * var(--layout-margin)) 0;
    padding: 0 var(--layout-margin);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .next-cards > li { scroll-snap-align: start; }
  .next-card__dots { display: none; }
  .next-card__bar { background: var(--grey-500); }
}

@media (min-width: 1200px) {
  .case-next { margin-top: 101px; }
  .page--case-pasha-insurance-web .case-next { margin-top: 59px; } /* tighter in the PASHA Web frame */
  .next-cards {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 39px 0 0;
    padding: 0;
    overflow: visible;
  }
  .next-card__dots { display: flex; }
  .next-card__bar { background: var(--ink-700); }
}

/* --- Contact spacing ----------------------------------------------------- */
.page--case .contact { padding-top: 148px; padding-bottom: 180px; }
/* The case-study frames place the contact copy 9px higher than Home does. */
@media (min-width: 1200px) { .page--case .contact__intro { position: relative; top: -9px; } }

@media (max-width: 1199px) {
  .page--case .contact { padding-top: 80px; padding-bottom: 80px; }
}

/* --- Tablet-only values (kept last so they win over the base rules) ------ */
@media (min-width: 768px) and (max-width: 1199px) {
  .case-header { padding-top: 44px; }
  .case-header__subtitle { margin-top: 8px; }
  .case-header__jumps { margin-top: 21.5px; }
  .jump-link { padding: 10px 16px; font-size: 16px; line-height: 20px; }
  .case-hero { gap: 48px; margin-top: 58.5px; }
  .intro-block__heading { font-size: 22px; line-height: 30px; }
  .case-snapshots { margin-top: 82px; }
  .case-snapshots .section-header { gap: 12px; }
  .case-snapshots .section-header__text { max-width: none; }
  .case-work .section-header { gap: 15.5px; }
  .case-role__folder { max-width: 300px; height: 196px; object-fit: cover; object-position: top; }
}

/* Phones: long findings lists open on demand (case-study.js adds the button). */
@media (max-width: 767px) {
  .findings__column.is-collapsible .findings__list { overflow: hidden; }
  .findings__column.is-collapsed .findings__list {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
  }
  .findings__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--blue-300);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
  }
  .findings__more:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 4px; border-radius: 4px; }
  .findings__more-icon {
    width: 8px;
    height: 8px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 300ms ease;
  }
  .findings__more[aria-expanded="true"] .findings__more-icon { margin-top: 3px; transform: rotate(-135deg); }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .findings__column.is-collapsible .findings__list { transition: height 450ms cubic-bezier(0.2, 0.8, 0.2, 1); }
}

/* --- Scroll entrances (played once, see case-study.js) ------------------ */
/* Only transform and opacity move, so layout never shifts; every end state is the static design. */
.case-snapshots { overflow-x: clip; } /* bricks start just off to the side without adding a horizontal scroll */

@media (prefers-reduced-motion: no-preference) {
  /* Bricks (tablet/mobile stat cards): right, left, right, each landing with a small squash. */
  .stat-cards.is-armed .stat-card { opacity: 0; transform: translateX(calc(var(--brick-dir, 1) * 140px)); }
  .stat-cards.is-built .stat-card {
    animation: brick-in 900ms both;
    animation-delay: calc(var(--brick-i) * 170ms);
  }

  /* Divider lines: draw from their anchored end with a soft glow, then a highlight sweeps along them. */
  .findings__list li.is-undrawn::before { transform: scaleX(0); }
  .findings__list li.is-drawn::before {
    transform-origin: var(--line-origin, left);
    animation: line-draw 900ms cubic-bezier(0.7, 0, 0.2, 1) var(--draw-delay, 0ms) both;
  }
  .findings__list li.is-drawn::after {
    display: block;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.95), transparent) no-repeat;
    background-size: 44px 100%;
    animation: line-sweep 750ms ease-in-out calc(650ms + var(--draw-delay, 0ms)) both;
  }

  /* Folder: it tips open and the four cards come out of it one by one (positions measured in case-study.js). */
  .case-role { overflow-x: clip; } /* on phones the cards travel outside their swipe row for a moment */
  .case-role__folder { position: relative; z-index: 2; transform-origin: 50% 100%; }
  .case-role__body .process { position: relative; z-index: 1; }
  .case-role__body.is-closed .process-card { opacity: 0; }
  .case-role__body.is-opening .process { overflow: visible; }
  .case-role__body.is-opening .case-role__folder { animation: folder-open 1900ms ease-in-out both; }
  .case-role__body.is-opening .process-card {
    transform-origin: 50% 50%;
    animation: card-emerge 1250ms both;
    animation-delay: calc(250ms + var(--i) * 260ms);
  }
}

@media (max-width: 1199px) and (prefers-reduced-motion: no-preference) {
  /* Tablet and phone: each card starts tiny just above the folder and travels over it (in front) to its place. */
  .case-role__body.is-opening .process { z-index: 3; }
  .case-role__body.is-opening .process-card { animation-name: card-drop; animation-duration: 1050ms; }
}

@keyframes brick-in {
  /* Glides in and stops dead on its spot: one long ease-out, no overshoot or settle afterwards. */
  0% { opacity: 0; transform: translateX(calc(var(--brick-dir, 1) * 140px)); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  30% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
}

@keyframes line-draw {
  0% { transform: scaleX(0); box-shadow: 0 0 0 0 transparent; }
  55% { box-shadow: 0 0 10px 1px rgb(58 92 255 / 0.75); }
  100% { transform: scaleX(1); box-shadow: 0 0 0 0 transparent; }
}

@keyframes line-sweep {
  0% { opacity: 1; background-position: -44px 0; }
  85% { opacity: 1; }
  100% { opacity: 0; background-position: calc(100% + 44px) 0; }
}

@keyframes folder-open {
  0% { transform: none; }
  16% { transform: perspective(900px) rotateX(11deg) translateY(-3px); }
  78% { transform: perspective(900px) rotateX(7deg) translateY(-1px); }
  100% { transform: none; }
}

@keyframes card-emerge {
  /* Small and hidden inside the folder → rises out of the opening → travels to its place growing to full size. */
  0% { transform: translate(var(--from-x), var(--inside-y)) scale(0.3); animation-timing-function: cubic-bezier(0.3, 0, 0.4, 1); }
  30% { transform: translate(var(--from-x), var(--above-y)) scale(0.4); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
  100% { transform: none; }
}

@keyframes card-drop {
  0% { opacity: 0; transform: translate(var(--from-x), var(--above-y)) scale(0.12); animation-timing-function: cubic-bezier(0.3, 0.7, 0.2, 1); }
  12% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
