/* ============ Case study page (/work/<slug>) ============ */

.nav-links .nav-active {
  border-bottom: 2px solid var(--lime);
  padding-bottom: 2px;
}

.case {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
}

/* ============ Hero ============ */
.case-hero {
  padding: clamp(28px, 4vw, 52px) clamp(20px, 5vw, 64px) clamp(28px, 3.5vw, 44px);
}
.case-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(22px, 3vw, 34px);
}
.case-crumb a {
  border-bottom: 1.5px solid var(--lime);
  padding-bottom: 2px;
  color: var(--ink);
  transition: color .2s;
}
.case-crumb a:hover { color: var(--muted); }
.case-crumb-current { color: var(--muted); }

.case-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.case-hero-main { min-width: 0; }

.case-kickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(18px, 2.4vw, 26px);
}

.case-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(38px, 6.4vw, 84px);
  line-height: .95;
  letter-spacing: -.045em;
  overflow-wrap: break-word;
}
.case-title em {
  font-style: italic;
  color: var(--muted);
}

.case-summary {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--body);
  max-width: 58ch;
  margin-top: clamp(18px, 2.4vw, 28px);
}

.case-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  background: var(--ink);
  color: var(--lime-bright);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 13px 22px;
  border-radius: 999px;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 6px 18px rgba(20, 21, 13, .16);
}
.case-live:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 21, 13, .26);
}

/* Meta panel */
.case-meta {
  border-radius: 20px;
  padding: clamp(20px, 2.4vw, 30px);
  display: grid;
  gap: 18px;
  min-width: 0;
}
.case-meta-item { min-width: 0; }
.case-meta-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.case-meta-value {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: break-word;
}

/* ============ Stats ============ */
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
  border-top: 1px solid rgba(20, 21, 13, .3);
  border-bottom: 1px solid rgba(20, 21, 13, .3);
  padding: clamp(24px, 3vw, 38px) clamp(20px, 5vw, 64px);
  margin: 0 0 clamp(28px, 4vw, 52px);
}
.case-stat { min-width: 0; }
.case-stat-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
}
.case-stat-label {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 10px;
  max-width: 26ch;
}

/* ============ Body ============ */
.case-body { padding: 0 clamp(20px, 5vw, 64px); }

.case-section {
  padding-bottom: clamp(40px, 5.5vw, 76px);
}
.case-section + .case-section { border-top: 1px solid rgba(20, 21, 13, .16); padding-top: clamp(36px, 5vw, 64px); }

.case-section-head {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 2vw, 22px);
  margin-bottom: clamp(20px, 2.6vw, 32px);
}
.case-section-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--lime);
  background: var(--ink);
  border-radius: 6px;
  padding: 4px 9px;
  flex: none;
}
.case-section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: -.03em;
  line-height: 1.05;
  overflow-wrap: break-word;
}

/* Two-column prose */
.case-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}
.case-cols.single { grid-template-columns: minmax(0, 1fr); }
.case-cols.single .case-col > p { max-width: 74ch; }
.case-col { min-width: 0; }
.case-col > p {
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.62;
  color: var(--body);
}
.case-col > p + p { margin-top: 14px; }

.case-quote {
  margin-top: 22px;
  padding: clamp(18px, 2vw, 24px);
  border-left: 3px solid var(--lime);
  background: rgba(255, 255, 255, .55);
  border-radius: 0 16px 16px 0;
}
.case-quote p {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.4;
  letter-spacing: -.015em;
}
.case-quote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

/* ============ Points: cards / steps / learnings ============ */
.case-points { margin-top: clamp(24px, 3vw, 36px); }
.case-point-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 20px);
  letter-spacing: -.02em;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.case-point-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin-top: 8px;
}
.case-point-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.case-point-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid rgba(20, 21, 13, .18);
  border-radius: 999px;
  padding: 5px 11px;
}
.case-point-body { min-width: 0; }

/* cards */
.case-points-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(14px, 1.8vw, 22px);
}
.case-points-cards .case-point {
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(20, 21, 13, .14);
  border-radius: 18px;
  padding: clamp(20px, 2.2vw, 26px);
  transition: transform .25s, box-shadow .25s;
}
.case-points-cards .case-point:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(20, 21, 13, .1);
}

/* steps */
.case-points-steps { display: grid; gap: 0; }
.case-points-steps .case-point {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(14px, 2vw, 26px);
  border-top: 1px solid rgba(20, 21, 13, .16);
  padding: clamp(20px, 2.4vw, 30px) 0;
}
.case-points-steps .case-point:last-child { border-bottom: 1px solid rgba(20, 21, 13, .16); }
.case-points-steps .case-point-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  color: var(--faint);
  letter-spacing: -.03em;
}

/* learnings */
.case-points-learnings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(14px, 1.8vw, 22px);
  align-items: start;
}
.case-points-learnings .case-point {
  border-top: 2px solid var(--lime);
  padding-top: 18px;
}
.case-points-learnings .case-point-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ============ Figures ============ */
.case-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: clamp(16px, 2vw, 26px);
  margin-top: clamp(26px, 3.2vw, 40px);
  /* equal-height cards per row; images sit in uniform matted frames */
  align-items: stretch;
}
.case-figures.single { grid-template-columns: minmax(0, 1fr); }
/* Phone screenshots — narrow, fixed-width tracks so tall portraits stay readable */
.case-figures.portrait {
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  justify-content: center;
}
.case-figure {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(20, 21, 13, .14);
  border-radius: 18px;
  overflow: hidden;
}
.case-figure img,
.case-figure video {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid rgba(20, 21, 13, .1);
  background: #e9e8dd;
}
/* Multi-image grids: uniform 16:10 matted frames so rows align exactly.
   Mixed aspect ratios letterbox onto the matte instead of ragging the row. */
.case-figures:not(.single):not(.portrait) .case-figure > img,
.case-figures:not(.single):not(.portrait) .case-figure > video {
  aspect-ratio: 16 / 10;
  object-fit: contain;
}
/* Captions bottom-align across the row */
.case-figure figcaption { margin-top: auto; }
.case-figure figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  padding: 14px clamp(14px, 1.6vw, 20px);
}
.case-figure figcaption strong { color: var(--ink); }

/* Very tall shots (full-page screenshots) — cap the height and scroll inside the card */
.case-figure-scroll {
  max-height: 720px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #e9e8dd;
  border-bottom: 1px solid rgba(20, 21, 13, .1);
  scrollbar-width: thin;
}
.case-figure-scroll img { border-bottom: 0; }

/* ============ Results ============ */
.case-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: clamp(14px, 1.8vw, 22px);
  margin-top: clamp(26px, 3.2vw, 40px);
}
.case-result {
  min-width: 0;
  border-radius: 20px;
  padding: clamp(20px, 2.4vw, 30px);
}
.case-result-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
}
.case-result-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}
.case-result-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  margin-top: 10px;
}

/* ============ CTA band ============ */
.case-cta-wrap { padding: 0 clamp(20px, 5vw, 64px) clamp(24px, 3vw, 40px); }
.case-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--footer-bg);
  color: var(--bg);
  border-radius: 26px;
  padding: clamp(28px, 4vw, 52px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 36px);
}
.case-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(620px 400px at 88% 0%, rgba(203, 232, 0, .16), transparent 65%);
}
.case-cta-copy { min-width: 0; max-width: 56ch; }
.case-cta-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
}
.case-cta-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-top: 12px;
}
.case-cta-sub {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(242, 241, 234, .72);
  margin-top: 12px;
}
.case-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============ Next case ============ */
.case-next {
  display: block;
  margin: 0 clamp(20px, 5vw, 64px) clamp(40px, 5vw, 72px);
  border-top: 1px solid rgba(20, 21, 13, .3);
  border-bottom: 1px solid rgba(20, 21, 13, .3);
  padding: clamp(24px, 3vw, 38px) 0;
  transition: padding-left .3s cubic-bezier(.16, 1, .3, 1);
}
.case-next:hover { padding-left: 14px; }
.case-next-dir {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-next-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 56px);
  letter-spacing: -.035em;
  line-height: 1.02;
  margin-top: 10px;
  overflow-wrap: break-word;
}
.case-next-summary {
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
  max-width: 62ch;
  margin-top: 12px;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .case-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .case-meta { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .case-cols { grid-template-columns: minmax(0, 1fr); }
  .case-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .case-figures,
  .case-results,
  .case-points-cards,
  .case-points-learnings { grid-template-columns: minmax(0, 1fr); }
  /* portrait screenshots keep their multi-up rhythm on small screens */
  .case-figures.portrait { grid-template-columns: repeat(auto-fit, minmax(110px, 150px)); }
  .case-figure-scroll { max-height: 520px; }
  .case-meta { grid-template-columns: minmax(0, 1fr); }
  .case-points-steps .case-point { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .case-cta-actions { width: 100%; }
  .case-cta-actions > a { flex: 1 1 180px; text-align: center; }
}

@media (max-width: 420px) {
  .case-stats { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .case-stat-label { max-width: none; }
  .case-section-head { flex-wrap: wrap; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-live,
  .case-next,
  .case-points-cards .case-point { transition: none; }
}
