/* FERAL Case Study Pages */

:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --surface: #111111;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --accent: #b8a9c9;
  --accent-dim: rgba(184, 169, 201, 0.35);
  --pearl-pink: rgba(212, 184, 196, 0.5);
  --pearl-lavender: rgba(184, 169, 201, 0.45);
  --border-pearl: rgba(184, 169, 201, 0.12);
  --banner-text-gradient: linear-gradient(120deg, #7d6b9a 0%, #9d8fb5 22%, #b8a9c9 40%, #e8b4c4 60%, #e2d9dc 78%, #c9a0b0 92%, #9d8fb5 100%);
  --stat-card-gradient: linear-gradient(135deg, rgba(125, 107, 154, 0.22) 0%, rgba(184, 169, 201, 0.18) 35%, rgba(232, 180, 196, 0.2) 65%, rgba(184, 169, 201, 0.18) 100%);
  --font-heading: "DM Sans", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.cs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-pearl);
}

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

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease-out);
}

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

.cs-back-arrow {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.cs-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.cs-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.cs-hero {
  margin-bottom: 3rem;
}

.cs-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  background: var(--stat-card-gradient);
  border: 1px solid var(--border-pearl);
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.cs-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.cs-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  background: var(--banner-text-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.cs-timeline-tag {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cs-before-after {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-pearl);
  margin-bottom: 3rem;
}

.cs-ba-block {
  text-align: center;
}

.cs-ba-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.cs-ba-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
}

.cs-ba-before { color: var(--text-muted); }
.cs-ba-after { color: var(--accent); }

.cs-ba-arrow {
  width: 40px;
  height: 2px;
  background: var(--border-pearl);
  position: relative;
}

.cs-ba-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--accent);
}

.cs-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.cs-stat-card {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-pearl);
  background: var(--bg-elevated);
}

.cs-stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.cs-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.cs-section {
  margin-bottom: 3rem;
}

.cs-section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.cs-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.7;
}

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

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

.cs-screenshot {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-pearl);
  background: var(--bg-elevated);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.cs-screenshot:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(184, 169, 201, 0.08);
}

.cs-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-screenshot-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  padding: 0;
  letter-spacing: 0.01em;
}
.cs-ig-before-after {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 2rem;
  row-gap: 0.75rem;
  margin-top: 1.5rem;
  width: 100vw;
  max-width: 1400px;
  margin-left: calc(-50vw + 50%);
  padding: 0 2rem;
  box-sizing: border-box;
}
.cs-ig-label {
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-pearl);
  line-height: 1.3;
  min-height: 1.3em;
}
.cs-ig-label-spacer {
  display: block;
}
.cs-ig-panel {
  min-width: 0;
}
.cs-ig-panel img {
  width: 100%;
  height: auto;
}
.cs-ig-arrow {
  align-self: center;
  color: var(--accent-pearl);
  opacity: 0.7;
}
@media (max-width: 640px) {
  .cs-ig-before-after {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
  }
  .cs-ig-label-spacer {
    display: none;
  }
  .cs-ig-label-before {
    order: 1;
  }
  .cs-ig-panel:first-of-type {
    order: 2;
  }
  .cs-ig-arrow {
    order: 3;
    justify-self: center;
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
  .cs-ig-label-after {
    order: 4;
  }
  .cs-ig-panel:last-of-type {
    order: 5;
  }
}
.cs-screenshot-caption {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-pearl);
}

.cs-screenshot-single {
  max-width: 100%;
  margin-top: 1.5rem;
}

.cs-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cs-timeline-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid rgba(184, 169, 201, 0.06);
}

.cs-timeline-period {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cs-timeline-value {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.cs-timeline-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

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

.cs-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.cs-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cs-quote {
  font-style: italic;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-left: 3px solid var(--accent-dim);
  background: var(--bg-elevated);
  border-radius: 0 8px 8px 0;
}

.cs-quote footer {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.cs-cta {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-pearl);
}

.cs-cta-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.cs-cta-text {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.cs-btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--border-pearl);
  background: linear-gradient(135deg, rgba(184, 169, 201, 0.95) 0%, rgba(212, 184, 196, 0.9) 50%, rgba(200, 190, 210, 0.95) 100%);
  color: #0a0a0a;
  transition: transform 0.2s var(--ease-out), background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.cs-btn:hover {
  transform: translateY(-2px);
  background: #1a1520;
  color: #e8dcee;
  border-color: rgba(184, 169, 201, 0.4);
}

.cs-divider {
  height: 1px;
  background: var(--border-pearl);
  margin: 3rem 0;
}

/* Full-width screenshot grid for detailed analytics */
.cs-screenshot-grid-wide {
  grid-template-columns: 1fr;
}

.cs-screenshot-full {
  max-width: 100%;
  grid-column: 1 / -1;
}

/* Clickable screenshot cursor hint */
.cs-screenshot {
  cursor: zoom-in;
}

/* Lightbox overlay */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s;
  cursor: zoom-out;
  padding: 2rem;
}

.cs-lightbox.cs-lightbox-open {
  opacity: 1;
  visibility: visible;
}

.cs-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  transform: scale(0.92);
  transition: transform 0.35s var(--ease-out);
  object-fit: contain;
}

.cs-lightbox.cs-lightbox-open img {
  transform: scale(1);
}

.cs-lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 600px;
  pointer-events: none;
}

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

.cs-lightbox-close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .cs-before-after {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    text-align: center;
  }

  .cs-ba-arrow {
    width: 2px;
    height: 24px;
    margin: 0 auto;
  }

  .cs-ba-arrow::after {
    right: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(50%);
    border-top: 8px solid var(--accent);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: none;
  }

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

  .cs-timeline-row {
    grid-template-columns: 80px 1fr;
  }

  .cs-timeline-note {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 80px;
  }

  .cs-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
