/* ── CASE PAGE LAYOUT OVERRIDES ────────────────────────────── */
/* Scoped to case elements only — header stays at 1100px */
.case-hero,
.case-content,
.case-meta {
  --cw: 900px;
}

/* ── WIP BADGE ─────────────────────────────────────────────── */
.case-wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 3px 10px;
  margin-top: 4px;
}
.case-wip-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

/* ── CASE META ──────────────────────────────────────────────── */
.case-meta {
  width: 100%;
  max-width: var(--cw);
  display: flex;
}

.case-meta__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 16px;
  background: var(--c-white);
  border-right: 1px solid var(--c-border);
}

.case-meta__item:first-child { border-radius: 20px 0 0 20px; }
.case-meta__item:last-child  { border-radius: 0 20px 20px 0; border-right: none; }

.case-meta__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-t1);
}

.case-meta__value {
  font-size: 14px;
  font-weight: 400;
  color: var(--c-t1);
}

/* ── CASE LAYOUT ────────────────────────────────────────────── */
.case-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px var(--px) 0;
}

.case-row {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.case-row--last {
  padding-bottom: 32px;
}

.case-block {
  background: var(--c-white);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: var(--cw);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── CASE HERO ──────────────────────────────────────────────── */
.case-hero {
  background: var(--c-white);
  padding: 42px var(--px);
  border-radius: 0 0 var(--r-hero) var(--r-hero);
}

.case-hero__inner {
  max-width: var(--cw);
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: center;
}

.case-hero__logo {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
}

.case-hero__logo-bg {
  width: 132px;
  height: 132px;
  border-radius: 24px;
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-hero__logo-bg--light {
  background: transparent;
  border: none;
  overflow: visible;
  border-radius: 0;
}

.case-hero__logo-bg--white {
  background: #fff;
  border: 2px solid var(--c-border);
  border-radius: 24px;
  overflow: hidden;
}


.case-hero__logo-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-hero__logo-img {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  display: block;
  object-fit: cover;
  border: 2px solid var(--c-border);
}

.case-hero__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-hero__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.16;
  color: var(--c-t1);
}

/* ── CASE HEADER LAYOUT ─────────────────────────────────────── */
.header .header__inner {
  max-width: 900px;
}

/* ── CASE HEADER TITLE ──────────────────────────────────────── */
.header__case-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
  line-height: 1;
}

.case-hero__subtitle {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-t3);
}

/* ── SECTION HEAD ───────────────────────────────────────────── */
.case-block__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 34px;
  border: 2px solid #dadada;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-t1);
  flex-shrink: 0;
}

.case-badge--context {
  width: auto;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-t3);
  border-color: var(--c-border);
}

.case-block__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

/* ── TEXT ───────────────────────────────────────────────────── */
.case-text {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-t1);
}

.case-text strong {
  font-weight: 600;
}

/* ── IMAGES ─────────────────────────────────────────────────── */
.case-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  display: block;
}

.case-img--no-border {
  border: none;
}

@media (min-width: 641px) {
  .case-img--laptop {
    width: 116%;
    max-width: none;
    margin-left: -8%;
    margin-right: -8%;
    margin-top: -10%;
    margin-bottom: -7%;
  }
}

/* ── HYPOTHESES ─────────────────────────────────────────────── */
.case-hypotheses {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hypothesis {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hypothesis__label {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

.hypothesis__text {
  font-size: 18px;
  font-weight: 400;
  color: #6f6f6f;
  line-height: 1.4;
}

/* ── METRICS ────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.metric {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric__value {
  font-size: 32px;
  font-weight: 600;
  color: #0d0d17;
  line-height: 1.2;
}

.metric__label {
  font-size: 18px;
  font-weight: 400;
  color: #737385;
  line-height: 1.3;
}

/* ── ARTIFACT (questions / captions) ───────────────────────── */
.artifact {
  background: #f0f0f0;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.artifact__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

.artifact__desc {
  font-size: 18px;
  font-weight: 400;
  color: var(--c-t1);
  line-height: 1.5;
}

.interview-questions {
  list-style: none;
  counter-reset: q-counter;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.interview-questions li {
  counter-increment: q-counter;
  display: grid;
  grid-template-columns: 1.5em 1fr;
  gap: 0 2px;
  font-size: 18px;
  font-weight: 400;
  color: var(--c-t1);
  line-height: 1.5;
}

.interview-questions li::before {
  content: counter(q-counter) ".";
  font-weight: 400;
  color: var(--c-t1);
  line-height: 1.5;
}

.interview-questions__followup {
  display: block;
  grid-column: 2;
  margin-top: 4px;
  font-size: 16px;
  color: #6f6f6f;
}

/* ── VALIDATION TABLE ───────────────────────────────────────── */
.validation-table {
  border-radius: 12px;
  overflow: hidden;
  font-size: 18px;
}

.validation-table__head {
  background: #f0f0f0;
  padding: 12px 16px;
  display: flex;
  font-weight: 600;
  color: var(--c-t3);
}

.validation-table__row {
  background: #f8f8f8;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-top: 1px solid #ebebeb;
  min-height: 52px;
}

.validation-table__row--last {
  border-radius: 0 0 12px 12px;
}

.validation-table__col-main {
  flex: 1;
  font-weight: 500;
  color: #1a1a26;
  line-height: 1.3;
}

.validation-table__col-result {
  width: 160px;
  flex-shrink: 0;
  font-weight: 500;
}

.validation-table__col-result--ok      { color: #148547; }
.validation-table__col-result--partial  { color: #b8610d; }
.validation-table__col-result--no      { color: #b8610d; }

/* ── UX TEST GROUPS ─────────────────────────────────────────── */
.ux-test-groups {
  display: flex;
  flex-direction: column;
  gap: 42px;
}

/* ── MEDIA BLOCKS — grey container, text above, image below ──── */
.mockup-unit,
.case-pair,
.case-mockup-item {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  background: #f0f0f0;
  border-radius: var(--r-card);
  padding: 24px;
  overflow: hidden;
}


.mockup-unit .mockup-unit__img-wrap { order: 2; }

.case-pair .case-img,
.case-pair .phones-row {
  order: 2;
  border-radius: 8px;
}

.mockup-unit .artifact,
.case-pair .artifact {
  order: 1;
  background: none;
  padding: 0;
  border-radius: 0;
}

.mockup-unit__img-wrap {
  width: 100%;
  aspect-ratio: 1036 / 585;
  position: relative;
  overflow: hidden;
}

.mockup-unit__img {
  position: absolute;
  top: -14.5%;
  left: 0;
  width: 100%;
  height: 133%;
  object-fit: cover;
  object-position: top;
}


/* ── PHONES ROW ─────────────────────────────────────────────── */
.phones-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.phones-row__item {
  flex: 1 1 0;
  min-width: 0;
}
.phones-row__item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ── BLOCK MODIFIERS ────────────────────────────────────────── */
.case-block--gap-lg {
  gap: 42px;
}

.case-block--bench {
  padding-left: 24px;
  padding-right: 24px;
}


/* ── HEADER BACK BUTTON ─────────────────────────────────────── */
.header .btn svg {
  flex-shrink: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .case-hero__title { font-size: 32px; }
  .case-hero__subtitle { font-size: 20px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header__case-title { font-size: 15px; }
  .header .btn svg { width: 16px; height: 12px; }
  .case-hero__subtitle br { display: none; }

  .case-hero { padding: 24px var(--px) 32px; }
  .case-hero__inner { gap: 16px; align-items: flex-start; }
  .case-hero__logo,
  .case-hero__logo-bg { width: 96px; height: 96px; border-radius: 20px; }
  .case-hero__logo-img { border-radius: 20px; }

  .case-hero__title { font-size: 20px; }
  .case-hero__subtitle { font-size: 15px; }
  .case-hero__text { padding-top: 0; gap: 4px; }

  .case-content { padding: 12px var(--px) 0; }
  .case-block { padding: 24px 16px; gap: 20px; }
  .artifact { padding: 20px; }
  .case-block__title { font-size: 18px; }
  .case-badge { width: 36px; height: 28px; font-size: 14px; border-radius: 8px; }
  .case-text { font-size: 14px; }
  .step__title, .decision__title, .artifact__title,
  .hypothesis__label, .case-caption__title { font-size: 16px; }
  .step__desc, .decision__desc, .artifact__desc,
  .hypothesis__text, .case-caption__desc,
  .interview-questions li, .metric__label { font-size: 14px; }
  .metric__value { font-size: 20px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .interview-questions__followup { font-size: 12px; }
  .validation-table { font-size: 15px; }
  .validation-table__col-result { width: 110px; }

  .case-img { border-radius: 6px; }
  .case-pair .case-img,
  .case-pair .phones-row { border-radius: 6px; }
}

/* ── LIGHTBOX ───────────────────────────────────────────────── */
.lb-trigger {
  cursor: zoom-in;
  display: block;
}

dialog.lb {
  padding: 0;
  background: transparent;
  border: none;
  overflow: hidden;
  overscroll-behavior: contain;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

html.lightbox-open,
html.lightbox-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog.lb[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.lb:not([open]) {
  display: none;
}

dialog.lb::backdrop {
  background: rgba(17,17,17,0.82);
  opacity: 1;
}

dialog.lb img {
  max-width: min(92vw, 1200px);
  max-height: 88dvh;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-out;
  pointer-events: none;
}

dialog.lb.lb--laptop img {
  clip-path: inset(3% 1% 10% 1%);
  max-width: min(98vw, 1600px);
  max-height: 94dvh;
  transform: scale(1.38);
  border-radius: 0;
  box-shadow: none;
}

.lb__close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  outline: none;
  box-shadow: none;
  color: #fff;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
  .lb__close:hover {
    transform: scale(0.86);
  }
}

.lb__close:active {
  transform: scale(0.9);
}

@media (hover: none) {
  .lb__close {
    transition-duration: 0.18s;
  }

  .lb__close:active {
    transform: scale(0.88);
  }
}

.lb__close svg {
  display: block;
  flex-shrink: 0;
}

dialog.lb[open] {
  animation: lb-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── HERO: hackathon variant (no logo, column layout) ──────── */
.case-hero__inner--col {
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.case-hero__badge {
  display: inline-block;
  align-self: flex-start;
  background: #fff7e0;
  color: #7a5500;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 8px;
}

.case-hero__meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.case-hero__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.case-hero__meta-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-t3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-hero__meta-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-t1);
}

/* ── STEPS (4-column scenario row) ─────────────────────────── */
.case-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step__num {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-t3);
}

.step__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

.step__desc {
  font-size: 18px;
  font-weight: 400;
  color: #4b4b4b;
  line-height: 1.4;
}

/* ── DECISIONS (2x2 grid) ───────────────────────────────────── */
.case-decisions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.decision {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.decision__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

.decision__desc {
  font-size: 18px;
  font-weight: 400;
  color: #4b4b4b;
  line-height: 1.4;
}

/* ── WIN CARD ───────────────────────────────────────────────── */
.case-win {
  background: var(--c-t1);
  border-radius: 20px;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-win__title {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.case-win__sub {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
}

/* ── RESPONSIVE: enginear additions ────────────────────────── */
@media (max-width: 900px) {
  .case-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .case-hero__meta { gap: 16px; }
  .case-hero__meta-value { font-size: 14px; }
  .case-steps { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .step { padding: 16px; }
  .case-decisions { grid-template-columns: 1fr; gap: 16px; }
  .decision { padding: 16px; }
  .metric { padding: 14px; }
  .case-win { padding: 28px 24px; }
  .case-win__title { font-size: 32px; }
  .case-win__sub { font-size: 15px; }
}

@media (max-width: 400px) {
  .case-hero { padding-left: 16px; padding-right: 16px; }
  .case-hero__inner { flex-direction: row; gap: 12px; align-items: flex-start; }
  .case-hero__logo,
  .case-hero__logo-bg { width: 80px; height: 80px; border-radius: 16px; }
  .case-hero__title { font-size: 20px; }
  .case-steps { grid-template-columns: 1fr; gap: 16px; }
  .step { padding: 16px; }
  .step__title { font-size: 16px; }
  .decision { padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric { padding: 12px; }
  .metric__value { font-size: 20px; }
}

/* ── EnginEar: img slot ─────────────────────────────────────── */
.case-img-slot {
  width: 100%;
  height: 480px;
  background: #f0f0f0;
  border-radius: 12px;
}

.case-img-slot--sm {
  height: 300px;
}

.case-mockup {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* ── MOCKUP GROUP (multiple mockups with captions) ──────────── */
.case-mockup-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* .case-mockup-item: styles from grouped rule above */

.case-mockup-item .case-mockup {
  width: 100%;
  margin: 0;
  border-radius: 8px;
}

.case-caption {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-caption__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-t1);
}

.case-caption__desc {
  font-size: 18px;
  font-weight: 400;
  color: var(--c-t1);
  line-height: 1.5;
}

/* ── CASE PHOTO ─────────────────────────────────────────────── */
.case-photo {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  object-fit: cover;
}

@media (max-width: 640px) {
  .case-mockup-item { padding: 16px; border-radius: 12px; }

  .lb__close {
    top: 12px;
    right: 12px;
  }

  .case-pair .case-img--laptop {
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
    max-width: none;
  }

  .case-pair:has(.case-img--laptop) {
    padding-top: 16px;
    padding-bottom: 12px;
    gap: 16px;
  }

  dialog.lb.lb--laptop img {
    clip-path: none;
    transform: scale(1.18);
    max-width: 96vw;
    max-height: 80dvh;
    border-radius: 8px;
  }
}

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--c-t1);
  z-index: 200;
  pointer-events: none;
  transition: width 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── MOBILE TYPOGRAPHY OVERRIDES (must come last — desktop rules above override earlier @media) ── */
@media (max-width: 640px) {
  .case-block__title { font-size: 18px; }
  .case-text { font-size: 14px; }
  .step__title, .decision__title, .artifact__title,
  .hypothesis__label, .case-caption__title { font-size: 16px; }
  .step__desc, .decision__desc, .artifact__desc,
  .hypothesis__text, .case-caption__desc,
  .interview-questions li, .metric__label { font-size: 14px; }

}

