/* ══════════════════════════════════════════════════════
   case-study.css — Light-themed case study template
   Uses the same warm palette from styles.css
   ══════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ── Main Container ── */

.cs-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ══════════════════════════════════════
   1. Hero Section
   ══════════════════════════════════════ */

.cs-hero {
  padding-top: 8rem;
  padding-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.cs-hero-inner {
  flex: 1;
  min-width: 0;
}

.cs-hero-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 1rem;
}

.cs-hero-title {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  color: var(--text);
}

.cs-hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 640px;
}

/* Hero Meta Grid */
.cs-hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cs-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.cs-meta-value {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Hero Phone Image (right-aligned) */
.cs-hero-phone {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-hero-phone-wide {
  width: 380px;
}

.cs-hero-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.15));
}

/* Table of Contents */
.cs-toc {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.cs-toc-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.cs-toc-link:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--text);
}

/* ══════════════════════════════════════
   2–7. Content Sections
   ══════════════════════════════════════ */

.cs-section {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
}

.cs-section-inner {
  max-width: 680px;
}

.cs-section-number {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-family: "Inter", sans-serif;
}

.cs-section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0 0 1.2rem;
  color: var(--text);
}

.cs-section p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0 0 1rem;
}

.cs-section p:last-child {
  margin-bottom: 0;
}

/* ══════════════════════════════════════
   Process Grid
   ══════════════════════════════════════ */

.cs-process-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.cs-process-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s ease;
}

.cs-process-step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent-light);
}

.cs-step-image {
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.cs-step-icon {
  width: 52px;
  height: 52px;
  color: rgba(0, 0, 0, 0.45);
}

.cs-step-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
}

.cs-process-step h3 {
  margin: 0;
  padding: 1.25rem 1.25rem 0.4rem;
  font-size: 1.1rem;
  color: var(--text);
}

.cs-process-step p {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   Solution Grid
   ══════════════════════════════════════ */

.cs-solution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.cs-solution-image {
  height: 420px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s ease;
  cursor: pointer;
}

.cs-solution-image img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cs-solution-image:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* Carousel Gallery */
.cs-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cs-carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
}

.cs-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.cs-carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.cs-carousel-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.cs-carousel-btn:hover {
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cs-carousel-dots {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.cs-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.cs-carousel-dot.active {
  background: var(--text);
}

/* Current Design Side-by-Side Layout */
.cs-design-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.cs-design-text {
  flex: 1;
  min-width: 0;
}

.cs-design-carousel {
  flex: 0 0 380px;
  position: sticky;
  top: 6rem;
}

.cs-design-carousel .cs-carousel {
  max-width: 100%;
}

.cs-figma-link {
  display: inline-block;
  margin: 1.25rem 0;
  padding: 0.6rem 1.4rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cs-figma-link:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .cs-design-layout {
    flex-direction: column;
    padding: 0 1.25rem;
  }
  .cs-design-carousel {
    flex: none;
    width: 100%;
    position: static;
  }
}

.cs-carousel-track {
  cursor: pointer;
}

/* Prototype Gallery */
.cs-proto-gallery {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cs-proto-gallery.cs-proto-row {
  flex-direction: row;
  max-width: 100%;
  gap: 1.25rem;
}

.cs-proto-row .cs-proto-figure {
  flex: 1;
  min-width: 0;
}

.cs-proto-figure {
  margin: 0;
  text-align: center;
}

.cs-proto-figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cs-proto-figure img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.cs-proto-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

/* Lightbox Modal */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cs-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.cs-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.cs-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cs-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Video / Prototype Preview */
.cs-video-container {
  margin-top: 2rem;
}

.cs-prototype-link {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s ease;
}

.cs-prototype-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.cs-prototype-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.cs-prototype-cta {
  display: block;
  text-align: center;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  background: var(--surface);
  border-top: 1px solid var(--line);
  transition: background 0.2s ease, color 0.2s ease;
}

.cs-prototype-link:hover .cs-prototype-cta {
  background: var(--accent-deep);
  color: #fff;
}

.cs-video-placeholder {
  height: 360px;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════
   Impact List
   ══════════════════════════════════════ */

.cs-impact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.cs-impact-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.8rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.cs-impact-list li:last-child {
  border-bottom: none;
}

.cs-impact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cs-impact-list strong {
  color: var(--text);
  font-weight: 700;
}

/* ══════════════════════════════════════
   Case Study Footer
   ══════════════════════════════════════ */

.cs-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.5rem;
}

.cs-footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-footer-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.cs-footer-link:hover {
  color: var(--accent-deep);
}

.cs-footer-next {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cs-footer-next-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.cs-footer-next-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.cs-footer-bottom {
  max-width: 1000px;
  margin: 2rem auto 0;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.cs-footer-bottom p {
  margin: 0;
}

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  .cs-hero {
    padding-top: 6rem;
    flex-direction: column;
    text-align: center;
  }

  .cs-hero-phone {
    width: 180px;
    order: -1;
  }

  .cs-hero-subtitle {
    max-width: 100%;
  }

  .cs-hero-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

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

  .cs-solution-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .cs-solution-image {
    height: 360px;
  }

  .cs-video-placeholder {
    height: 240px;
  }

  .cs-footer-inner {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .cs-footer-next {
    text-align: center;
  }
}
