/* ─── Page: Case studies index ─── */

/* Page-unique nav active state (this page's nav item is highlighted) */
.nav-links a.active { color: #fff; font-weight: 600; }
nav#mainNav.scrolled .nav-links a.active { color: var(--black); }

/* ─── HERO ─── */
.cs-hero {
  position: relative;
  height: 60vh; min-height: 420px;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: #060610;
}
.cs-hero-bg {
  position: absolute; inset: 0;
  background-image: url('/assets/images/three_trucks-scaled.jpg');
  background-size: cover; background-position: center;
  opacity: 0.5;
}
.cs-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,6,16,0.9) 0%, rgba(6,6,16,0.35) 55%, transparent 100%);
}
.cs-hero-content {
  position: relative; z-index: 2;
  padding: 0 var(--px) 72px;
  max-width: calc(var(--w) + var(--px) * 2);
  width: 100%;
}
.cs-hero-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 16px;
}
.cs-hero h1 {
  font-size: clamp(38px, 5.5vw, 64px);
  font-weight: 800; color: #fff;
  letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 18px;
}
.cs-hero p {
  font-size: 17px; color: rgba(255,255,255,0.6);
  max-width: 540px; line-height: 1.65;
}

/* ─── GRID ─── */
.cs-section {
  padding: 80px var(--px);
}
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.cs-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .22s, transform .22s;
  background: var(--white);
}
.cs-card:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}
.cs-card-img {
  width: 100%; aspect-ratio: 4/3;
  overflow: hidden; background: #e8e8e8;
  flex-shrink: 0;
}
.cs-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.6) brightness(0.9);
  transition: transform .5s cubic-bezier(0.16,1,0.3,1);
}
.cs-card:hover .cs-card-img img { transform: scale(1.04); }
.cs-card-body {
  padding: 26px 26px 30px;
  display: flex; flex-direction: column; flex: 1; gap: 10px;
}
.cs-card-cat {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blue);
}
.cs-card-title {
  font-size: 21px; font-weight: 700; color: var(--black);
  letter-spacing: -0.4px; line-height: 1.2;
  margin: 0;
}
.cs-card-desc {
  font-size: 14px; color: var(--muted); line-height: 1.7;
  flex: 1;
}
.cs-card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--black);
  margin-top: 6px;
  transition: gap .18s;
}
.cs-card:hover .cs-card-link { gap: 10px; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-panel {
  position: relative;
  width: min(680px, 95vw);
  height: 100vh;
  background: var(--white);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}
.modal-overlay.open .modal-panel { transform: translateX(0); }

.modal-hero-img {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: #111; position: relative;
  flex-shrink: 0;
}
.modal-hero-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: rgba(0,0,0,0.75); }

.modal-content { padding: 40px 48px 72px; }
.modal-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.modal-company { font-size: 30px; font-weight: 800; color: var(--black); letter-spacing: -0.5px; margin-bottom: 8px; }
.modal-headline { font-size: 16px; font-weight: 400; color: var(--muted); line-height: 1.55; margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 32px; }

.modal-article h3 {
  font-size: 15px; font-weight: 700; color: var(--black);
  margin: 32px 0 10px; letter-spacing: -0.2px;
}
.modal-article h3:first-child { margin-top: 0; }
.modal-article p {
  font-size: 14px; color: var(--muted); line-height: 1.8;
  margin-bottom: 14px;
}
.modal-article ul {
  margin: 0 0 16px 0;
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-article ul li {
  font-size: 14px; color: var(--muted); line-height: 1.7;
  padding-left: 18px; position: relative;
}
.modal-article ul li::before {
  content: ''; position: absolute; left: 0;
  color: var(--blue); font-weight: 700;
}

.modal-quote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-alt);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
}
.modal-quote p {
  font-size: 15px; font-style: italic; color: var(--black);
  line-height: 1.7; margin-bottom: 12px;
}
.modal-quote cite { font-size: 13px; font-style: normal; color: var(--muted); font-weight: 600; }

.modal-stat {
  display: inline-flex; flex-direction: column;
  padding: 22px 30px; background: var(--black); border-radius: 10px;
  margin: 4px 0 32px;
}
.modal-stat-val { font-size: 32px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; }
.modal-stat-label { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 3px; }

.modal-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  font-size: 14px; font-weight: 600; color: var(--blue);
  transition: gap .18s;
}
.modal-cta:hover { gap: 12px; }

/* ─── CTA BAND ─── */
.cs-cta {
  background: var(--black);
  border-top: 1px solid #1a1a1a;
  padding: 80px var(--px);
  text-align: center;
}
.cs-cta h2 { font-size: clamp(28px, 3.5vw, 44px); font-weight: 800; color: #fff; letter-spacing: -0.03em; margin-bottom: 14px; }
.cs-cta p { font-size: 16px; color: rgba(255,255,255,0.45); margin-bottom: 36px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .cs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .cs-hero { height: 55vh; min-height: 380px; }
  .cs-hero-content { padding: 0 var(--px) 56px; }
  .cs-section { padding: 64px var(--px); }
  .cs-cta { padding: 64px var(--px); }
}
@media (max-width: 640px) {
  .cs-grid { grid-template-columns: 1fr; gap: 18px; }
  .cs-section { padding: 48px var(--px); }
  .modal-content { padding: 28px 24px 56px; }
  .cs-hero h1 br { display: none; }
  .cs-hero p { font-size: 15px; }
  .modal-company { font-size: 26px; }
  .modal-headline { font-size: 15px; padding-bottom: 24px; margin-bottom: 28px; }
  .cs-card-body { padding: 22px 22px 26px; }
  .cs-card-title { font-size: 19px; }
}
@media (max-width: 360px) {
  .cs-hero-content { padding: 0 var(--px) 40px; }
  .cs-hero h1 { font-size: 30px; }
  .modal-content { padding: 22px 18px 48px; }
  .modal-company { font-size: 22px; }
  .modal-stat { padding: 18px 22px; }
  .modal-stat-val { font-size: 26px; }
}
