/* ============================================
   CASE STUDY — Back link
   ============================================ */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink-70);
  margin-bottom: 56px;
  transition: color var(--transition), gap var(--transition);
}

.cs-back:hover {
  color: var(--color-ink);
  gap: 10px;
}

.cs-back i {
  width: 15px;
  height: 15px;
  transition: transform var(--transition);
}

.cs-back:hover i {
  transform: translateX(-3px);
}


/* ============================================
   CASE STUDY — Hero
   ============================================ */
.cs-hero {
  padding: calc(var(--nav-h) + 32px) 0 80px;
}

.cs-hero__header {
  max-width: 820px;
  margin-bottom: 52px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
  animation-delay: 0.1s;
}

.cs-hero__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cs-hero__tag {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-ink-70);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: 5px 12px;
  border-radius: 100px;
}

.cs-hero__year {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-ink-40);
  margin-left: 4px;
}

.cs-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 24px;
}

.cs-hero__tagline {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 400;
  color: var(--color-ink-70);
  line-height: 1.6;
  max-width: 640px;
}

/* Cover image */
.cs-hero__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-bg-card);
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
  animation-delay: 0.28s;
}

.cs-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
}

.cs-hero__cover--stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-hero__cover--stage .cs-hero__img {
  position: relative;
  inset: auto;
  width: auto;
  height: 75%;
  max-width: 80%;
  object-fit: contain;
  border-radius: 8px;
}

.cs-hero__cover-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
}


/* ============================================
   CASE STUDY — Info strip
   ============================================ */
.cs-info {
  padding: 0 0 48px;
}

.cs-info__card {
  background: #f7f7f4;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0 8px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.cs-info__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.cs-info__item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 28px 32px;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
}

.cs-info__item:last-child {
  border-right: none;
}

.cs-info__label {
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-40);
}

.cs-info__value {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  line-height: 1.3;
}


/* ============================================
   CASE STUDY — Content body
   ============================================ */
.cs-body {
  padding: 56px 0 80px;
}

.cs-content {
  max-width: 850px;
  margin: 0 auto;
}

.cs-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-block__label {
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-40);
}

.cs-block__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-top: 4px;
}

.cs-block__text {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink-70);
  line-height: 1.75;
}

.cs-block__text + .cs-block__text {
  margin-top: -4px;
}

.cs-block__list {
  margin-top: 16px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-block__list li {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink-70);
  line-height: 1.7;
}

/* ============================================
   IMAGE SHOWCASE MOSAIC
   ============================================ */
.cs-img-showcase {
  padding: 80px 0 0;
}

.cs-img-mosaic {
  columns: 3;
  column-gap: 12px;
}

.cs-img-mosaic__item {
  break-inside: avoid;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: 12px;
}

.cs-img-mosaic__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Scroll reveal for showcase images */
.cs-img-reveal {
  opacity: 0;
  transform: translateY(52px);
  transition: opacity 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--reveal-delay, 0s);
}

.cs-img-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .cs-img-mosaic {
    columns: 2;
  }
}

.cs-divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 64px 0;
}

/* TLDR — problem + outcome two-column */
.cs-tldr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 48px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.cs-tldr__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px;
  background: var(--color-bg-card);
}

.cs-tldr__col:first-child {
  border-right: 1px solid var(--color-border);
}

.cs-tldr__label {
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-40);
}

.cs-tldr__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-ink);
}

.cs-tldr__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-ink-70);
  line-height: 1.7;
}

@media (max-width: 600px) {
  .cs-tldr {
    grid-template-columns: 1fr;
  }

  .cs-tldr__col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

/* Key constraints — 2x2 grid */
.cs-constraints-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.cs-constraint {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 24px 24px 24px 0;
  border-top: 1px solid var(--color-border);
}

.cs-constraint:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--color-border);
}

.cs-constraint__num {
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-ink-40);
  padding-top: 3px;
}

.cs-constraint__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color-ink);
  margin-bottom: 6px;
}

.cs-constraint__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-ink-70);
  line-height: 1.65;
}

@media (max-width: 600px) {
  .cs-constraints-grid {
    grid-template-columns: 1fr;
  }

  .cs-constraint:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
}

/* Final design — bento grid */
.cs-showcase {
  padding: 80px 0;
}

.cs-showcase > .container {
  margin-bottom: 24px;
}

.cs-grid {
  display: grid;
  grid-template-columns: 3fr 2fr 4fr;
  grid-template-rows: auto auto;
  gap: 10px;
  padding: 0 clamp(20px, 2vw, 80px);
}

.cs-grid__item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-grid__item.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Row 1: designer_main full width */
.cs-grid__item:nth-child(1) {
  grid-column: 1 / -1;
}

/* Row 2: wide left, narrow right */
.cs-grid__item:nth-child(2) {
  grid-column: 1 / 3;
}

.cs-grid__item:nth-child(3) {
  grid-column: 3 / 4;
}

/* Row 3: narrow left, wide right */
.cs-grid__item:nth-child(4) {
  grid-column: 1 / 2;
}

.cs-grid__item:nth-child(5) {
  grid-column: 2 / 4;
}

/* Row 4: userstep left, machinesteps right */
.cs-grid__item:nth-child(6) {
  grid-column: 1 / 3;
}

.cs-grid__item:nth-child(7) {
  grid-column: 3 / 4;
}

.cs-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-grid__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.75);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cs-grid__item:hover .cs-grid__caption {
  opacity: 1;
}

/* Full-width 5th cell spanning all columns */
.cs-grid__item--full {
  grid-column: 1 / -1;
  grid-row: auto;
}

/* Stage treatment — grey-blue background with centred image */
.cs-grid__item--stage {
  background: #dde4ed;
  border: none;
  border-radius: 14px;
  padding: 48px 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cs-grid__item--stage .cs-grid__stage-img {
  width: auto;
  height: auto;
  max-width: 420px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.14);
}

/* Placeholder — removed once real images are added */
.cs-grid__placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-card);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--color-ink-40);
}

@media (max-width: 768px) {
  .cs-grid {
    grid-template-columns: 1fr;
  }

  .cs-grid__item {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

/* Feature stage — image on coloured background */
.cs-feature-stage {
  margin-top: 40px;
  border-radius: 20px;
  background: #dde4ed;
  padding: 48px 72px 48px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cs-feature-stage__img {
  width: 85%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
  will-change: transform;
}

/* Case study inline image */
.cs-case-image {
  margin-top: 40px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.cs-case-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Key stats / highlights row */
.cs-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 8px;
}

.cs-highlight {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  background: var(--color-bg-card);
}

.cs-highlight__stat {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cs-highlight__label {
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--color-ink-40);
  line-height: 1.4;
}

/* Image placeholders for content */
.cs-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-card);
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.cs-image-placeholder--tall {
  aspect-ratio: 4 / 3;
}

.cs-image-placeholder span {
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--color-ink-40);
}


/* Bullet list */
.cs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.cs-list li {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink-70);
  line-height: 1.75;
  padding-left: 20px;
  position: relative;
}

.cs-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-ink-40);
}

/* Research phases */
.cs-research-phases {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 8px;
}

.cs-phase {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  border-left: 2px solid var(--color-border);
}

.cs-phase__number {
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-40);
}

.cs-phase__title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--color-ink);
}

/* Learnings — Apple-style card grid */
.cs-learnings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.cs-learning {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  transition: box-shadow 0.2s ease;
}


.cs-learning__num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-ink-40);
  line-height: 1;
}

.cs-learning__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color-ink);
}

.cs-learning__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-ink-70);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .cs-learnings {
    grid-template-columns: 1fr;
  }
}

/* Design decisions — number anchor + content layout */
.cs-decisions {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.cs-decision {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 32px;
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
  align-items: start;
}

.cs-decision__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-ink-40);
  line-height: 1;
  padding-top: 4px;
}

.cs-decision__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-decision__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--color-ink);
}

/* Callout / "why this mattered" */
.cs-callout {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 4px;
}

.cs-callout__label {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-40);
  margin-bottom: 8px;
}

.cs-callout__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-ink-70);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 600px) {
  .cs-decision {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cs-decision__number {
    font-size: 1.75rem;
  }
}


/* Remove bottom padding from dark section when it ends with the research image */
.cs-dark-section:has(.cs-research-image) {
  padding-bottom: 0;
}

/* Research section image */
.cs-research-image {
  margin-top: 64px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.cs-research-image img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
}

.cs-research-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(to bottom, transparent 0%, #1c1c1a 100%);
  pointer-events: none;
}

/* ============================================
   DARK SECTION
   ============================================ */
.cs-dark-section {
  background: #1c1c1a;
  padding: 96px 0;
  margin: 0;
}

.cs-dark-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: 850px;
  margin: 0 auto;
}

.cs-dark-section .cs-block__label {
  color: rgba(255, 255, 255, 0.3);
}

.cs-dark-section .cs-block__title {
  color: #ffffff;
}

.cs-dark-section .cs-block__text {
  color: rgba(255, 255, 255, 0.6);
}

/* Highlights inside dark section — stacked vertically */
.cs-highlights--dark {
  grid-template-columns: 1fr;
  margin-top: 40px;
  gap: 0;
  background: transparent;
  border: none;
}

.cs-highlights--dark .cs-highlight {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cs-highlights--dark .cs-highlight__stat {
  font-size: 2.25rem;
  color: #ffffff;
  min-width: 56px;
}

.cs-highlights--dark .cs-highlight__label {
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

/* Numbered list — right column */
.cs-numbered-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.cs-numbered-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
}

.cs-numbered-item__number {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.25);
  padding-top: 3px;
}

.cs-numbered-item__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cs-numbered-item__title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.3;
}

.cs-numbered-item__stat {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-numbered-item__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .cs-hero {
    padding: calc(var(--nav-h) + 48px) 0 56px;
  }

  .cs-back {
    margin-bottom: 36px;
  }

  .cs-hero__title {
    letter-spacing: -0.025em;
  }

  .cs-info {
    padding: 0 0 48px;
  }

  .cs-info__card {
    border-radius: 16px;
    padding: 0 4px;
  }

  .cs-info__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-info__item {
    padding: 20px 20px;
    border-right: 1px solid rgba(0, 0, 0, 0.07);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }

  .cs-info__item:nth-child(even) {
    border-right: none;
  }

  .cs-info__item:nth-child(3),
  .cs-info__item:nth-child(4) {
    border-bottom: none;
  }

  .cs-highlights {
    grid-template-columns: 1fr;
  }

  .cs-dark-section {
    padding: 64px 0;
  }

  .cs-dark-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .cs-content {
    max-width: 100%;
  }

  .cs-divider {
    margin: 48px 0;
  }
}
