/* ============================================
   CASE STUDY PAGE — Desktop (1440px+)
   ============================================ */

.cs {
  padding-top: 86px; /* navbar height */
  position: relative;
  z-index: 1;
}

.cs-container {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

/* --- Back link --- */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 50px;
  font-size: 15px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.cs-back:hover {
  color: var(--white);
}

.cs-back svg {
  width: 10px;
  height: 9px;
  flex-shrink: 0;
}

/* --- Tags row --- */
.cs-tags {
  display: flex;
  gap: 10px;
  margin-top: 50px;
}

/* --- Title row --- */
.cs-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 30px;
}

.cs-title {
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.cs-year {
  font-size: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* --- Hero image --- */
.cs-hero-image {
  margin-top: 30px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
  position: relative;
}

/* No glass overlay on hero image — clean display */

.cs-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* --- Carousel --- */
.cs-carousel {
  position: relative;
}

.cs-carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.cs-carousel .cs-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.cs-carousel .cs-carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.cs-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.cs-carousel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.cs-carousel-prev {
  left: 16px;
}

.cs-carousel-next {
  right: 16px;
}

.cs-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.cs-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.cs-carousel-dot.active {
  background: white;
  border-color: white;
}

/* --- Approach bullet list --- */
.cs-approach-list {
  list-style: none;
  padding-left: 0;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.5;
}

.cs-approach-list strong {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Content: text + results --- */
.cs-content {
  display: flex;
  gap: 40px;
  margin-top: 50px;
  align-items: flex-start;
}

.cs-text {
  flex: 1;
  max-width: 693px;
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.cs-text-block h2 {
  font-size: clamp(18px, 1.3vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.cs-text-block p {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 600px;
}

/* --- Results card --- */
.cs-results {
  flex-shrink: 0;
  width: 357px;
  margin-left: auto;
}

.cs-results-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  padding: 40px 38px;
}

.cs-results-card::before {
  content: '';
  position: absolute;
  inset: -4px -63px;
  background: var(--glass-bg);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.cs-results-card h3 {
  font-size: clamp(18px, 1.3vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
}

.cs-results-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.cs-results-card li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.35;
}

.cs-results-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  position: relative;
  top: 2px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 5.5C11 2.46354 8.53646 0 5.5 0C2.46354 0 0 2.46354 0 5.5C0 8.53646 2.46354 11 5.5 11C8.53646 11 11 8.53646 11 5.5Z' fill='white' fill-opacity='0.15'/%3E%3Cpath d='M7.63348 3.80827L4.65212 7.35752L3.37439 5.93782' stroke='white' stroke-opacity='0.5' stroke-width='0.709849' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* --- Divider --- */
.cs-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin-top: 80px;
  margin-bottom: 50px;
}

/* --- Other projects --- */
.cs-other-title {
  font-size: clamp(18px, 1.35vw, 26px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 56px;
}

.cs-other-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: var(--space-section);
}

/* Reuse work-card styles from styles.css — override image height for case study */
.cs-other-grid .work-card {
  display: block;
  transition: opacity 0.2s;
}

.cs-other-grid .work-card:hover {
  opacity: 0.85;
}

.cs-other-grid .work-card-image {
  aspect-ratio: 16 / 9;
}

.cs-other-grid .work-card-info {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.cs-other-grid .work-card-name {
  white-space: nowrap;
}

.cs-other-grid .work-card-tags {
  flex-shrink: 0;
}

/* ============================================
   RESPONSIVE — Tablet (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
  .cs-content {
    flex-direction: column;
  }

  .cs-results {
    width: 100%;
    margin-left: 0;
  }

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

/* ============================================
   RESPONSIVE — Mobile (≤768px)
   ============================================ */

@media (max-width: 768px) {

  .cs {
    padding-top: 56px;
  }

  .cs-container {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
  }

  /* Back link */
  .cs-back {
    margin-top: 24px;
    font-size: 13px;
    gap: 6px;
  }

  .cs-back svg {
    width: 8px;
    height: 7px;
  }

  /* Reorder: title before tags on mobile */
  .cs-tags {
    order: 2;
    margin-top: 8px;
    gap: 8px;
  }

  .cs-back {
    order: 0;
  }

  .cs-title-row {
    order: 1;
  }

  .cs-hero-image {
    order: 3;
  }

  .cs-content {
    order: 4;
  }

  .cs-divider {
    order: 5;
  }

  .cs-other-title {
    order: 6;
  }

  .cs-other-grid {
    order: 7;
  }

  .cs-tags .tag {
    height: 25px;
    font-size: 13px;
    padding: 0 8px;
    border-radius: 41px;
  }

  /* Title */
  .cs-title-row {
    margin-top: 10px;
    flex-direction: column;
    gap: 4px;
  }

  .cs-title {
    font-size: clamp(22px, 6.67vw, 26px);
  }

  .cs-year {
    display: none;
  }

  /* Hero image */
  .cs-hero-image {
    margin-top: 16px;
    aspect-ratio: 16 / 9;
  }

  /* Content */
  .cs-content {
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
  }

  .cs-text {
    max-width: 100%;
    gap: 24px;
  }

  .cs-text-block h2 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .cs-text-block p {
    font-size: 13px;
    line-height: 1.4;
  }

  /* Results */
  .cs-results {
    width: 100%;
    margin-left: 0;
  }

  .cs-results-card {
    padding: 30px 24px;
  }

  .cs-results-card::before {
    inset: -4px -24px;
  }

  .cs-results-card h3 {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .cs-results-card li {
    font-size: 13px;
    gap: 10px;
  }

  .cs-results-dot {
    margin-top: 5px;
  }

  /* Divider */
  .cs-divider {
    margin-top: 50px;
    margin-bottom: 30px;
  }

  /* Other projects */
  .cs-other-title {
    font-size: 18px;
    margin-bottom: 24px;
  }

  .cs-other-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 60px;
  }

  .cs-other-grid .work-card-image {
    aspect-ratio: 16 / 9;
  }

  .cs-other-grid .work-card-info {
    padding: 15px 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cs-other-grid .work-card-name {
    font-size: 13px;
  }

  .cs-other-grid .work-card-tags .tag {
    height: 25px;
    font-size: 14px;
    padding: 0 8px;
    border-radius: 41px;
  }

  .cs-carousel-btn {
    width: 32px;
    height: 32px;
  }

  .cs-carousel-prev {
    left: 8px;
  }

  .cs-carousel-next {
    right: 8px;
  }

  .cs-carousel-dots {
    bottom: 10px;
    gap: 6px;
  }

  .cs-carousel-dot {
    width: 6px;
    height: 6px;
  }
}
