/* ============================================================
   CASE STUDY PAGES
   ============================================================ */

/* === READING PROGRESS BAR === */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  z-index: 1001;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* === HERO === */
.cs-hero {
  position: relative;
  padding: calc(var(--nav-h) + 60px) 0 80px;
  overflow: hidden;
}
.cs-hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, color-mix(in srgb, var(--cs-color) 20%, transparent), transparent 60%);
  pointer-events: none;
}
.cs-hero__back {
  margin-bottom: 40px;
}
.cs-hero__back a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 0;
}
.cs-hero__back a:hover { color: var(--text); }

.cs-hero__content { max-width: 760px; }
.cs-hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.cs-hero__tags {
  display: flex;
  gap: 8px;
}
.cs-hero__tags span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  border: 1px solid var(--border-w);
  padding: 4px 10px;
  border-radius: 100px;
}
.cs-hero__glyph { font-size: 4rem; margin-bottom: 16px; line-height: 1; }
.cs-hero__title {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text) 30%, color-mix(in srgb, var(--cs-color) 80%, var(--text)));
  -webkit-background-clip: text;
  color: var(--text);
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cs-hero__sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 620px;
  margin-bottom: 48px;
}
.cs-hero__stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--border-w);
}
.cs-stat span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.cs-stat strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

/* === SCREENS SECTION === */
.cs-screens { background: var(--bg-2); }
.cs-screens__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.cs-screen {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-w);
}
.cs-screen--main { grid-row: span 1; aspect-ratio: 9/16; max-height: 520px; }
.cs-screen--sm { aspect-ratio: 9/16; }
.cs-screen__ph {
  width: 100%; height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-2));
}
.cs-screens__note {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 8px;
}
.cs-screens__note code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* === SINGLE SCREENSHOT === */
.cs-screens__single {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-w);
  background: var(--bg-card);
}
.cs-screens__img {
  display: block;
  width: 100%;
  height: auto;
}

/* === CONTENT SECTIONS === */
.cs-section { background: var(--bg); }
.cs-section--alt { background: var(--bg-2); }

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.cs-two-col .section-label { margin-bottom: 12px; }
.cs-h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}
.cs-two-col p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 16px;
}
.cs-two-col p strong { color: var(--text); }

/* === PROCESS STEPS === */
.cs-process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.cs-process__step {
  background: var(--bg-card);
  border: 1px solid var(--border-w);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  transition: border-color 0.4s, transform 0.4s var(--ease);
}
.cs-process__step:hover { border-color: var(--border); transform: translateY(-4px); }
.cs-process__num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--purple);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 16px;
}
.cs-process__step h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.cs-process__step p {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* === OUTCOMES === */
.cs-outcomes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 24px;
}
.cs-outcome {
  background: var(--bg-card);
  border: 1px solid var(--border-w);
  border-radius: 16px;
  padding: 32px 28px;
  transition: border-color 0.4s, transform 0.4s var(--ease);
}
.cs-outcome:hover { border-color: var(--border); transform: translateY(-4px); }
.cs-outcome__icon { font-size: 2.5rem; margin-bottom: 16px; }
.cs-outcome h4 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.cs-outcome p { font-size: 0.875rem; color: var(--text-dim); line-height: 1.7; }

/* === NEXT PROJECT NAV === */
.cs-next {
  background: var(--bg-2);
  padding: 60px 0;
  border-top: 1px solid var(--border-w);
}
.cs-next__grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cs-next__back {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s;
}
.cs-next__back:hover { color: var(--text); }
.cs-next__back-center {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  transition: color 0.3s;
}
.cs-next__card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--cs-color) 15%, var(--bg-card)), var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--cs-color) 30%, transparent);
  border-radius: 16px;
  padding: 24px 32px;
  min-width: 240px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.cs-next__card:hover { transform: translateY(-4px); border-color: var(--cs-color); }
.cs-next__card span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.cs-next__card strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.cs-next__card p {
  font-size: 13px;
  color: var(--text-dim);
}

/* === IMAGE GALLERY === */
.cs-gallery { background: var(--bg-2); }
.cs-gallery__grid {
  display: grid;
  gap: 16px;
}
.cs-gallery__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cs-gallery__item {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-w);
  background: var(--bg-card);
}
.cs-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease);
}
.cs-gallery__item:hover img { transform: scale(1.02); }

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

/* === HERO SPLIT (app case studies) === */
.cs-hero--split .cs-hero__split {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 60px;
  align-items: center;
}
.cs-hero--split .cs-hero__content { max-width: none; }
.cs-hero__app-logo {
  margin-bottom: 16px;
}
.cs-hero__app-logo img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: block;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.cs-hero__phone {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-hero__phone img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 60px rgba(196,160,0,0.25));
}

/* === PHONES FAN GALLERY === */
.cs-phones-fan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 60px 16px 60px;
  overflow: hidden;
}
.cs-fan-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 190px;
  flex-shrink: 0;
  margin: 0 -18px;
  position: relative;
  transition: transform 0.4s var(--ease), z-index 0s;
}
.cs-fan-item:nth-child(1) { transform: rotate(-14deg) translateY(50px); z-index: 1; }
.cs-fan-item:nth-child(2) { transform: rotate(-7deg) translateY(25px); z-index: 2; }
.cs-fan-item:nth-child(3) { transform: rotate(0deg) translateY(0); z-index: 5; }
.cs-fan-item:nth-child(4) { transform: rotate(7deg) translateY(25px); z-index: 2; }
.cs-fan-item:nth-child(5) { transform: rotate(14deg) translateY(50px); z-index: 1; }
.cs-fan-item:hover { z-index: 10; transform: translateY(-16px) scale(1.06) !important; }
.cs-fan-item:hover .cs-phone-screen { box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.cs-phone-screen {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-w);
  background: var(--bg-card);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  width: 100%;
  transition: box-shadow 0.4s;
}
.cs-phone-screen img { display: block; width: 100%; height: auto; }
.cs-fan-label {
  margin-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .cs-hero--split .cs-hero__split { grid-template-columns: 1fr 300px; gap: 40px; }
  .cs-fan-item { width: 140px; margin: 0 -14px; }
}
@media (max-width: 768px) {
  .cs-hero--split .cs-hero__split { grid-template-columns: 1fr; }
  .cs-hero__phone { display: none; }
  .cs-fan-item { width: 110px; margin: 0 -12px; }
  .cs-fan-item:nth-child(4),
  .cs-fan-item:nth-child(5) { display: none; }
}

/* === WORK WITH ME CTA === */
.cs-work-cta {
  padding: 80px 0;
  background: color-mix(in srgb, var(--purple) 8%, var(--bg));
  border-top: 1px solid var(--border);
  text-align: center;
}
.cs-work-cta__inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cs-work-cta h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}
.cs-work-cta p {
  color: var(--text-dim);
  font-size: 1.0625rem;
  max-width: 480px;
  margin: 0;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .cs-screens__grid { grid-template-columns: 1fr repeat(3, 1fr); }
  .cs-process { grid-template-columns: repeat(2, 1fr); }
  .cs-outcomes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .cs-two-col { grid-template-columns: 1fr; gap: 40px; }
  .cs-screens__grid { grid-template-columns: repeat(2, 1fr); }
  .cs-screen--main { grid-column: span 2; aspect-ratio: 16/9; }
  .cs-process { grid-template-columns: 1fr; }
  .cs-outcomes { grid-template-columns: 1fr; }
  .cs-hero__stats { gap: 20px; }
  .cs-next__grid { flex-direction: column; align-items: flex-start; }
}
