:root {
  --red-brand-color: #ce032c;

  --mt-color-bg: #000000;
  --mt-color-bg-soft: #050505;
  --mt-color-surface-1: rgba(255, 255, 255, 0.03);
  --mt-color-surface-2: rgba(255, 255, 255, 0.06);
  --mt-color-surface-3: rgba(255, 255, 255, 0.08);

  --mt-color-border-1: rgba(255, 255, 255, 0.10);
  --mt-color-border-2: rgba(255, 255, 255, 0.16);
  --mt-color-border-strong: rgba(255, 255, 255, 0.22);

  --mt-color-text-1: rgba(255, 255, 255, 0.94);
  --mt-color-text-2: rgba(255, 255, 255, 0.74);
  --mt-color-text-3: rgba(255, 255, 255, 0.58);
  --mt-color-accent: var(--red-brand-color);

  --mt-font-main: "Poppins", sans-serif;

  --mt-text-eyebrow: 0.82rem;
  --mt-text-small: 0.9rem;
  --mt-text-body: 1rem;
  --mt-text-body-lg: 1.12rem;
  --mt-text-h3: clamp(1.25rem, 1.6vw, 1.5rem);
  --mt-text-h2: clamp(2rem, 3.35vw, 3.2rem);
  --mt-text-page-title: clamp(2.8rem, 5vw, 5rem);

  --mt-space-8: 8px;
  --mt-space-12: 12px;
  --mt-space-16: 16px;
  --mt-space-20: 20px;
  --mt-space-24: 24px;
  --mt-space-32: 32px;
  --mt-space-40: 40px;
  --mt-space-48: 48px;
  --mt-space-64: 64px;
  --mt-space-80: 80px;
  --mt-space-96: 96px;

  --mt-container-sm: 920px;
  --mt-container-lg: 1240px;
  --mt-radius-sm: 12px;
  --mt-radius-md: 16px;
  --mt-radius-lg: 24px;
  --mt-radius-pill: 999px;
  --mt-transition-fast: 160ms ease;
  --mt-transition-base: 220ms ease;
  --mt-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --mt-focus-ring: 0 0 0 3px rgba(206, 3, 44, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--mt-color-bg);
}

.cs-skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: var(--mt-radius-pill);
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--mt-transition-fast);
}

.cs-skip-link:focus {
  transform: translateY(0);
}

.case-studies-page {
  width: 100%;
  overflow: hidden;
  color: var(--mt-color-text-1);
  background:
    radial-gradient(circle at 16% 8%, rgba(206, 3, 44, 0.20), transparent 24rem),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.08), transparent 30rem),
    var(--mt-color-bg);
}

.mt-container {
  width: min(calc(100% - 40px), var(--mt-container-lg));
  margin-inline: auto;
}

.mt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--mt-space-16);
  color: var(--mt-color-text-3);
  font-size: var(--mt-text-eyebrow);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mt-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--mt-radius-pill);
  background: var(--mt-color-accent);
  box-shadow: 0 0 22px rgba(206, 3, 44, 0.45);
}

.cs-page-title,
.mt-section-title,
.cs-final-cta h2 {
  margin: 0;
  color: var(--mt-color-text-1);
  font-weight: 700;
}

.cs-page-title {
  max-width: 970px;
  font-size: var(--mt-text-page-title);
  line-height: 1;
  letter-spacing: -0.045em;
}

.cs-page-subtitle,
.mt-section-subtitle {
  max-width: 62ch;
  margin: var(--mt-space-20) 0 0;
  color: var(--mt-color-text-2);
  font-size: var(--mt-text-body-lg);
  line-height: 1.65;
}

.mt-section-title {
  font-size: var(--mt-text-h2);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.mt-section-head {
  max-width: var(--mt-container-sm);
  margin-bottom: var(--mt-space-48);
}

.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--mt-radius-pill);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--mt-transition-fast), background-color var(--mt-transition-fast), border-color var(--mt-transition-fast);
}

.mt-btn:hover {
  transform: translateY(-1px);
}

.mt-btn--primary {
  color: #ffffff;
  background: var(--mt-color-accent);
  border: 1px solid transparent;
}

.mt-btn--secondary {
  color: var(--mt-color-text-1);
  background: var(--mt-color-surface-1);
  border: 1px solid var(--mt-color-border-1);
}

.mt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: var(--mt-radius-pill);
  border: 1px solid var(--mt-color-border-1);
  background: var(--mt-color-surface-1);
  color: var(--mt-color-text-2);
  font-size: var(--mt-text-small);
  font-weight: 600;
}

.cs-hero {
  padding: clamp(136px, 16vw, 184px) 0 var(--mt-space-96);
  position: relative;
}

.cs-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.cs-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.55fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
}

.cs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-12);
  margin-top: var(--mt-space-32);
}

.cs-proof-card {
  padding: var(--mt-space-24);
  border: 1px solid var(--mt-color-border-1);
  border-radius: var(--mt-radius-lg);
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
}

.cs-proof-card__label {
  display: block;
  margin-bottom: var(--mt-space-20);
  color: var(--mt-color-text-3);
  font-size: var(--mt-text-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cs-proof-list {
  display: grid;
  gap: var(--mt-space-20);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-proof-list li {
  display: grid;
  gap: var(--mt-space-8);
  padding-top: var(--mt-space-20);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.cs-proof-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.cs-proof-list strong {
  color: var(--mt-color-text-1);
  font-size: 1rem;
}

.cs-proof-list span {
  color: var(--mt-color-text-2);
  line-height: 1.55;
}

.cs-section {
  padding: var(--mt-space-96) 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cs-selected-cases {
  overflow-x: clip;
}

/* Keep the heading inside the normal container while visually centering this section intro. */
.cs-selected-head {
  display: flex;
  justify-content: center;
  text-align: center;
}

.cs-selected-head .mt-section-head {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.cs-selected-head .mt-eyebrow {
  justify-content: center;
}

.cs-selected-head .mt-section-subtitle {
  margin-right: auto;
  margin-left: auto;
}

/* Full-bleed grid: only the case cards break out to 100vw. */
.cs-selected-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.cs-selected-card,
.cs-project-card,
.cs-final-cta__box {
  position: relative;
  border: 1px solid var(--mt-color-border-1);
  border-radius: var(--mt-radius-lg);
  background: var(--mt-color-surface-1);
  overflow: hidden;
}

.cs-selected-card {
  --cs-selected-overlay: rgba(59, 86, 72, 0.9);

  min-height: 0;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
  background: #050505;
  transition:
    transform var(--mt-transition-fast),
    filter var(--mt-transition-fast);
}

.cs-selected-card--sage {
  --cs-selected-overlay: rgba(58, 88, 74, 0.9);
}

.cs-selected-card--amber {
  --cs-selected-overlay: rgba(145, 106, 42, 0.9);
}

.cs-selected-card--olive {
  --cs-selected-overlay: rgba(83, 96, 54, 0.9);
}

.cs-selected-card--violet {
  --cs-selected-overlay: rgba(86, 63, 121, 0.9);
}

.cs-selected-card--blue {
  --cs-selected-overlay: rgba(46, 78, 112, 0.9);
}

.cs-selected-card--terracotta {
  --cs-selected-overlay: rgba(143, 75, 52, 0.9);
}

.cs-selected-card--wine {
  --cs-selected-overlay: rgba(112, 45, 70, 0.9);
}

.cs-selected-card--slate {
  --cs-selected-overlay: rgba(57, 70, 82, 0.9);
}

.cs-selected-card:hover,
.cs-selected-card:focus-within {
  transform: none;
  filter: saturate(1.04) contrast(1.02);
}

.cs-selected-card[hidden] {
  display: none;
}

.cs-selected-card__link,
.cs-project-card__link {
  display: grid;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.cs-selected-card__link {
  position: relative;
  min-height: 0;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
}

.cs-selected-card__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition:
    transform var(--mt-transition-base),
    filter var(--mt-transition-base);
}

.cs-selected-card__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42)),
    rgba(0, 0, 0, 0.16);
  transition: opacity var(--mt-transition-base);
}

.cs-selected-card__brand {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 3vw, 40px);
  pointer-events: none;
}

.cs-selected-card__brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 16px);
  width: auto;
  min-height: clamp(58px, 8vw, 92px);
  padding: clamp(12px, 1.8vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--mt-radius-lg);
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.cs-selected-card__brand-badge--text {
  max-width: clamp(150px, 48%, 280px);
  text-align: center;
}

.cs-selected-card__brand-img {
  display: block;
  width: 100%;
  max-height: clamp(46px, 7vw, 76px);
  object-fit: contain;
}

.cs-selected-card__brand-icon {
  flex: 0 0 auto;
  width: clamp(34px, 5.5vw, 58px);
  height: clamp(34px, 5.5vw, 58px);
  object-fit: contain;
}

.cs-selected-card__brand-text {
  display: block;
  color: #ffffff;
  font-size: clamp(1.05rem, 1.9vw, 2.15rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.cs-selected-card__brand-text--spaced {
  letter-spacing: 0.08em;
}

.cs-selected-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--mt-space-24);
  width: 100%;
  height: 100%;
  padding: clamp(24px, 3vw, 44px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.08)),
    var(--cs-selected-overlay);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition:
    opacity 180ms ease,
    transform 420ms var(--mt-ease-out),
    background-color var(--mt-transition-base);
}

.cs-selected-card__metric,
.cs-selected-card__type,
.cs-selected-card__name {
  width: 100%;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.cs-selected-card__metric {
  position: relative;
  width: 100%;
  max-width: none;
  padding-bottom: var(--mt-space-20);
  font-size: clamp(1.55rem, 2.25vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.cs-selected-card__metric::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(148px, 42%);
  height: 2px;
  border-radius: var(--mt-radius-pill);
  background: rgba(255, 255, 255, 0.72);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--mt-ease-out);
}

.cs-selected-card__footer {
  display: grid;
  gap: var(--mt-space-8);
  width: 100%;
  align-self: stretch;
}

.cs-selected-card__type {
  max-width: none;
  font-size: clamp(0.72rem, 0.82vw, 0.84rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.cs-selected-card__name {
  max-width: none;
  font-size: clamp(1.4rem, 2.15vw, 2.65rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.055em;
  color: #ffffff;
}

.cs-selected-card__metric,
.cs-selected-card__type,
.cs-selected-card__name {
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity 260ms ease,
    transform 420ms var(--mt-ease-out);
}

.cs-selected-card__metric {
  transition-delay: 90ms;
}

.cs-selected-card__type {
  transition-delay: 170ms;
}

.cs-selected-card__name {
  transition-delay: 230ms;
}

.cs-selected-card:hover .cs-selected-card__overlay,
.cs-selected-card:focus-within .cs-selected-card__overlay {
  opacity: 1;
  transform: scaleX(1);
}

.cs-selected-card:hover .cs-selected-card__metric,
.cs-selected-card:focus-within .cs-selected-card__metric,
.cs-selected-card:hover .cs-selected-card__type,
.cs-selected-card:focus-within .cs-selected-card__type,
.cs-selected-card:hover .cs-selected-card__name,
.cs-selected-card:focus-within .cs-selected-card__name {
  opacity: 1;
  transform: translateX(0);
}

.cs-selected-card:hover .cs-selected-card__metric::after,
.cs-selected-card:focus-within .cs-selected-card__metric::after {
  transform: scaleX(1);
  transition-delay: 220ms;
}

.cs-selected-card:hover .cs-selected-card__bg,
.cs-selected-card:focus-within .cs-selected-card__bg {
  transform: scale(1.035);
  filter: saturate(1.04) contrast(1.04);
}

.cs-selected-card:hover .cs-selected-card__shade,
.cs-selected-card:focus-within .cs-selected-card__shade {
  opacity: 0.75;
}

.cs-selected-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--mt-space-40);
}

.cs-selected-more {
  min-width: 156px;
}

.cs-project-card__type {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid var(--mt-color-border-1);
  border-radius: var(--mt-radius-pill);
  color: var(--mt-color-text-3);
  background: rgba(255,255,255,0.025);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cs-project-card p,
.cs-method-list p,
.cs-final-cta p {
  color: var(--mt-color-text-2);
  line-height: 1.65;
}

.cs-project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-project-card:hover img {
  transform: scale(1.02);
}

.cs-index-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--mt-space-32);
  margin-bottom: var(--mt-space-48);
}

.cs-index-head .mt-section-subtitle {
  margin-bottom: 0;
}

.cs-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--mt-space-24);
}

.cs-project-card {
  transition: opacity var(--mt-transition-base), transform var(--mt-transition-fast), border-color var(--mt-transition-fast), background-color var(--mt-transition-fast);
}

.cs-project-card__link {
  grid-template-rows: auto 1fr;
}

.cs-project-card > .cs-project-card__link > img,
.cs-project-card__placeholder {
  aspect-ratio: 1.45 / 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  overflow: hidden;
}

.cs-project-card__placeholder {
  display: grid;
  place-items: center;
  padding: var(--mt-space-32);
}

.cs-project-card__placeholder img {
  object-fit: contain;
  max-width: 76%;
  max-height: 76%;
  filter: grayscale(1);
  opacity: 0.86;
}

.cs-project-card__body {
  display: grid;
  gap: var(--mt-space-12);
  align-content: start;
  padding: var(--mt-space-24);
}

.cs-project-card h3 {
  margin: 0;
  color: var(--mt-color-text-1);
  font-size: var(--mt-text-h3);
  line-height: 1.18;
}

.cs-project-card p {
  margin: 0;
  font-size: 0.98rem;
}

.cs-method__grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.cs-method__grid .mt-section-head {
  margin-bottom: 0;
}

.cs-method-list {
  display: grid;
  gap: var(--mt-space-16);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-method-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px var(--mt-space-16);
  padding: var(--mt-space-24);
  border: 1px solid var(--mt-color-border-1);
  border-radius: var(--mt-radius-lg);
  background: var(--mt-color-surface-1);
}

.cs-method-list span {
  grid-row: span 2;
  color: var(--mt-color-accent);
  font-weight: 700;
}

.cs-method-list strong {
  color: var(--mt-color-text-1);
  font-size: 1.05rem;
}

.cs-method-list p {
  margin: 0;
}

.cs-final-cta {
  padding-bottom: var(--mt-space-96);
}

.cs-final-cta__box {
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(135deg, rgba(206,3,44,0.17), transparent 44%),
    var(--mt-color-surface-1);
}

.cs-final-cta h2 {
  max-width: 820px;
  font-size: var(--mt-text-h2);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.cs-final-cta p {
  max-width: 68ch;
  margin: var(--mt-space-16) 0 var(--mt-space-32);
  font-size: var(--mt-text-body-lg);
}

.case-studies-page a:focus-visible,
.case-studies-page button:focus-visible,
.cs-skip-link:focus-visible,
.contact-section input:focus-visible,
.contact-section textarea:focus-visible {
  outline: none;
  box-shadow: var(--mt-focus-ring);
}

/* Prevents hover transforms from fighting ScrollReveal inline transforms during entrance animations. */
.no-hover,
.no-hover * {
  pointer-events: none;
}

@media (max-width: 992px) {
  .cs-hero__grid,
  .cs-method__grid {
    grid-template-columns: 1fr;
  }

  .cs-index-head {
    display: block;
    max-width: var(--mt-container-sm);
    margin-bottom: var(--mt-space-48);
  }

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

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

@media (max-width: 768px) {
  .cs-hero {
    padding: 120px 0 var(--mt-space-64);
  }

  .cs-section {
    padding: var(--mt-space-64) 0;
  }

  .mt-section-head,
  .cs-index-head {
    margin-bottom: var(--mt-space-32);
  }

  .cs-project-card__body,
  .cs-proof-card,
  .cs-method-list li {
    padding: var(--mt-space-20);
  }

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

  .cs-selected-card {
    aspect-ratio: 1 / 1;
  }

  .cs-selected-card__overlay {
    opacity: 1;
    transform: scaleX(1);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.12)),
      var(--cs-selected-overlay);
  }

  .cs-selected-card__metric,
  .cs-selected-card__type,
  .cs-selected-card__name {
    opacity: 1;
    transform: none;
  }

  .cs-selected-card__metric::after {
    transform: scaleX(1);
  }

  .cs-selected-card__metric {
    font-size: clamp(1.75rem, 8vw, 2.7rem);
  }

  .cs-selected-card__name {
    font-size: clamp(1.75rem, 9vw, 3rem);
  }
}

@media (max-width: 576px) {
  .mt-container {
    width: min(calc(100% - 32px), var(--mt-container-lg));
  }

  .cs-page-title {
    font-size: clamp(2.35rem, 13vw, 3.4rem);
  }

  .cs-page-subtitle,
  .mt-section-subtitle,
  .cs-feature-card p,
  .cs-final-cta p {
    font-size: 1rem;
  }

  .cs-hero__actions,
  .mt-btn {
    width: 100%;
  }

  .cs-selected-grid,
  .cs-project-grid {
    grid-template-columns: 1fr;
  }

  .cs-selected-card__overlay {
    padding: clamp(22px, 7vw, 32px);
  }

  .cs-selected-card__metric {
    max-width: none;
    font-size: clamp(1.65rem, 8.8vw, 2.65rem);
  }

  .cs-selected-card__type {
    font-size: 0.72rem;
  }

  .cs-selected-card__name {
    max-width: none;
    font-size: clamp(1.75rem, 10vw, 3rem);
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .case-studies-page *,
  .cs-skip-link {
    transition: none !important;
    animation: none !important;
  }

  .mt-btn:hover,
  .cs-selected-card:hover,
  .cs-selected-card:focus-within,
  .cs-project-card:hover,
  .cs-selected-card:hover .cs-selected-card__bg,
  .cs-selected-card:focus-within .cs-selected-card__bg,
  .cs-project-card:hover img {
    transform: none !important;
    filter: none !important;
  }

  .cs-selected-card:hover .cs-selected-card__overlay,
  .cs-selected-card:focus-within .cs-selected-card__overlay,
  .cs-selected-card__overlay {
    opacity: 1;
    transform: none !important;
  }

  .cs-selected-card__metric,
  .cs-selected-card__type,
  .cs-selected-card__name,
  .cs-selected-card__metric::after {
    opacity: 1;
    transform: none !important;
  }
}
