/* ============================================
   CASE STUDY DETAIL - PREMIUM EDITION v2
   Refined • Premium • Polished
   ============================================ */

/* ============================================
   CSS VARIABLES - REFINED PALETTE
   ============================================ */
:root {
  --cs-black: #0a0a0a;
  --cs-dark: #141414;
  --cs-charcoal: #1c1c1c;
  --cs-gray-900: #222222;
  --cs-gray-800: #333333;
  --cs-gray-700: #4a4a4a;
  --cs-gray-600: #666666;
  --cs-gray-500: #737373;
  --cs-gray-400: #999999;
  --cs-gray-300: #a3a3a3;
  --cs-gray-200: #d1d1d1;
  --cs-gray-100: #e5e5e5;
  --cs-gray-50: #fafafa;
  --cs-white: #ffffff;
  
  --cs-red: #E53935;
  --cs-red-dark: #C62828;
  --cs-red-light: #FF5252;
  --cs-red-subtle: rgba(229, 57, 53, 0.08);
  
  --cs-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --cs-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --cs-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --cs-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --cs-shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.12);
  
  --cs-radius-sm: 12px;
  --cs-radius: 16px;
  --cs-radius-lg: 20px;
  --cs-radius-xl: 24px;
  
  --cs-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --cs-ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --cs-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
body.case-study-page {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cs-white);
  color: var(--cs-gray-800);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes cs-fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cs-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cs-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   REVEAL UTILITY CLASSES
   ============================================ */
.study-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--cs-ease-out-expo), transform 0.6s var(--cs-ease-out-expo);
}

.study-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.study-reveal-delay-1 { transition-delay: 100ms; }
.study-reveal-delay-2 { transition-delay: 200ms; }
.study-reveal-delay-3 { transition-delay: 300ms; }
.study-reveal-delay-4 { transition-delay: 400ms; }

/* ============================================
   HERO SECTION - REFINED
   ============================================ */
.study-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 3rem;
  background: linear-gradient(135deg, var(--cs-black) 0%, var(--cs-charcoal) 50%, var(--cs-gray-900) 100%);
  overflow: hidden;
}

.study-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(229, 57, 53, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(229, 57, 53, 0.05) 0%, transparent 40%);
}

.study-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
}

.study-hero-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.study-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.study-hero-content {
  animation: cs-fadeInUp 0.8s var(--cs-ease-out-expo) 0.2s both;
}

.study-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cs-red);
  margin-bottom: 1.5rem;
}

.study-hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--cs-red);
}

.study-hero-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.study-hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--cs-radius);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  padding: 0.875rem;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--cs-shadow-lg);
  animation: cs-float 5s ease-in-out infinite;
}

.study-hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--cs-white);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.study-hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--cs-gray-300);
  margin-bottom: 2rem;
  max-width: 95%;
}

.study-hero-stats {
  display: flex;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.study-hero-stat {
  text-align: left;
}

.study-hero-stat-value {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--cs-white);
  line-height: 1;
  margin-bottom: 0.375rem;
}

.study-hero-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-gray-400);
}

/* Hero Image */
.study-hero-visual {
  position: relative;
  animation: cs-fadeInUp 0.8s var(--cs-ease-out-expo) 0.4s both;
}

.study-hero-image-wrapper {
  position: relative;
  border-radius: var(--cs-radius-xl);
  overflow: hidden;
  box-shadow: var(--cs-shadow-xl);
  transform: perspective(1000px) rotateY(-2deg);
  transition: transform 0.5s var(--cs-ease-out-expo);
}

.study-hero-visual:hover .study-hero-image-wrapper {
  transform: perspective(1000px) rotateY(0deg);
}

.study-hero-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  transition: transform 0.6s var(--cs-ease-out-expo);
}

.study-hero-visual:hover .study-hero-image {
  transform: scale(1.03);
}

.study-hero-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10,10,10,0.25) 100%);
  pointer-events: none;
}

/* ============================================
   CONTENT SECTIONS - REFINED
   ============================================ */
.study-content {
  padding: 4rem 0;
  background: linear-gradient(180deg, var(--cs-gray-50) 0%, var(--cs-white) 100px);
}

.study-content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.study-section {
  margin-bottom: 3.5rem;
}

.study-section:last-child {
  margin-bottom: 0;
}

.study-section-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.study-section-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cs-red-subtle);
  border-radius: var(--cs-radius-sm);
  color: var(--cs-red);
  font-size: 1.125rem;
}

.study-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-red);
}

.study-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  color: var(--cs-black);
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.study-section-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--cs-gray-700);
}

.study-section-text p + p {
  margin-top: 1.25rem;
}

/* Quote Block - Refined */
.study-quote {
  margin: 3rem 0;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--cs-dark) 0%, var(--cs-charcoal) 100%);
  border-radius: var(--cs-radius-xl);
  position: relative;
  overflow: hidden;
}

.study-quote::before {
  content: '"';
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 8rem;
  color: rgba(229, 57, 53, 0.12);
  line-height: 1;
  pointer-events: none;
}

.study-quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  color: var(--cs-white);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.study-quote-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cs-red-light);
  letter-spacing: 0.03em;
}

/* Key Results - Refined */
.study-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.study-result-card {
  padding: 1.5rem;
  background: var(--cs-white);
  border: 1px solid var(--cs-gray-100);
  border-radius: var(--cs-radius-lg);
  text-align: center;
  transition: all 0.3s var(--cs-ease-out-quart);
}

.study-result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cs-shadow-lg);
  border-color: rgba(229, 57, 53, 0.15);
}

.study-result-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.875rem;
  color: var(--cs-red);
}

.study-result-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--cs-black);
  line-height: 1;
  margin-bottom: 0.375rem;
}

.study-result-label {
  font-size: 0.8rem;
  color: var(--cs-gray-500);
}

/* ============================================
   IMAGE SHOWCASE - REFINED
   ============================================ */
.study-showcase {
  padding: 3rem 0;
  background: var(--cs-white);
}

.study-showcase-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.study-showcase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.study-showcase-item {
  border-radius: var(--cs-radius-xl);
  overflow: hidden;
  box-shadow: var(--cs-shadow);
  transition: all 0.4s var(--cs-ease-out-expo);
}

.study-showcase-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--cs-shadow-xl);
}

.study-showcase-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  transition: transform 0.5s var(--cs-ease-out-expo);
}

.study-showcase-item:hover .study-showcase-image {
  transform: scale(1.02);
}

.study-showcase-caption {
  padding: 1.25rem 1.5rem;
  background: var(--cs-white);
  font-size: 0.9rem;
  color: var(--cs-gray-600);
  border-top: 1px solid var(--cs-gray-100);
}

/* ============================================
   NAVIGATION BAR - REFINED
   ============================================ */
.study-nav {
  padding: 2rem 0;
  background: var(--cs-white);
  border-top: 1px solid var(--cs-gray-100);
}

.study-nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.study-nav-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: var(--cs-gray-600);
  transition: color 0.3s var(--cs-ease-smooth);
}

.study-nav-link:hover {
  color: var(--cs-red);
}

.study-nav-link.prev {
  flex-direction: row;
}

.study-nav-link.next {
  flex-direction: row-reverse;
  text-align: right;
}

.study-nav-arrow {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cs-gray-50);
  border-radius: 50%;
  transition: all 0.3s var(--cs-ease-out-quart);
}

.study-nav-link:hover .study-nav-arrow {
  background: var(--cs-red);
  color: var(--cs-white);
  transform: scale(1.05);
}

.study-nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-gray-400);
  margin-bottom: 0.2rem;
}

.study-nav-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--cs-black);
}

/* ============================================
   CTA SECTION - REFINED
   ============================================ */
.study-cta {
  padding: 4rem 0;
  background: var(--cs-black);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.study-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(229, 57, 53, 0.08) 0%, transparent 50%);
}

.study-cta-container {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.study-cta-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: var(--cs-white);
  margin-bottom: 0.875rem;
  line-height: 1.15;
}

.study-cta-text {
  font-size: 1rem;
  color: var(--cs-gray-400);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.study-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 2rem;
  background: var(--cs-red);
  color: var(--cs-white);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 100px;
  transition: all 0.3s var(--cs-ease-out-quart);
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.25);
}

.study-cta-button:hover {
  background: var(--cs-red-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(229, 57, 53, 0.35);
}

/* ============================================
   MOBILE RESPONSIVE - REFINED
   ============================================ */
@media (max-width: 1024px) {
  .study-hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .study-hero-visual {
    order: -1;
  }
  
  .study-hero-image {
    height: 320px;
  }
  
  .study-results {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .study-hero {
    padding: 5rem 0 2.5rem;
    min-height: auto;
  }
  
  .study-hero-logo {
    width: 56px;
    height: 56px;
    padding: 0.625rem;
    border-radius: var(--cs-radius-sm);
  }
  
  .study-hero-title {
    font-size: 1.875rem;
    line-height: 1.1;
  }
  
  .study-hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.65;
  }
  
  .study-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    padding-top: 1.25rem;
  }
  
  .study-hero-stat {
    min-width: 0;
  }

  .study-hero-stat-value {
    font-size: 1.22rem;
    line-height: 1.05;
  }

  .study-hero-stat-label {
    font-size: 0.7rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
  }
  
  .study-hero-image {
    height: 260px;
    border-radius: var(--cs-radius-lg);
  }
  
  .study-content {
    padding: 2.5rem 0;
  }
  
  .study-section {
    margin-bottom: 2.5rem;
  }
  
  .study-section-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .study-quote {
    padding: 1.75rem;
    margin: 2rem 0;
    border-radius: var(--cs-radius-lg);
  }
  
  .study-quote::before {
    font-size: 5rem;
    right: 1rem;
  }
  
  .study-quote-text {
    font-size: 1.125rem;
  }
  
  .study-results {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  .study-result-card {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 1rem;
  }
  
  .study-result-icon {
    margin: 0;
    width: 36px;
    height: 36px;
  }
  
  .study-showcase-image {
    height: 220px;
  }
  
  .study-nav-container {
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .study-nav-link.next {
    text-align: left;
    flex-direction: row;
  }
  
  .study-cta {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .study-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .study-hero-stat-value {
    font-size: 1.08rem;
  }

  .study-hero-stat-label {
    font-size: 0.64rem;
  }
}

/* ============================================
   NEW STYLES FOR CASE STUDY REFRESH
   ============================================ */

/* Subsection Title (What We Did) */
.study-subsection-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cs-gray-800);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cs-red-subtle);
}

/* Study List (What We Did items) */
.study-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.study-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.875rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cs-gray-700);
}

.study-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  background: var(--cs-red);
  border-radius: 50%;
}

/* Impact Summary Section */
.study-impact {
  background: linear-gradient(135deg, var(--cs-gray-50) 0%, rgba(229, 57, 53, 0.03) 100%);
  padding: 2rem;
  border-radius: var(--cs-radius-xl);
  border: 1px solid var(--cs-gray-100);
}

.study-impact .study-section-icon {
  background: var(--cs-red);
  color: var(--cs-white);
}

/* Result Card Icon Wrapper */
.study-result-icon-wrap {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cs-red-subtle);
  border-radius: var(--cs-radius);
  color: var(--cs-red);
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .study-result-icon-wrap {
    margin: 0;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .study-subsection-title {
    font-size: 1rem;
    margin-top: 1.25rem;
  }
  
  .study-list li {
    font-size: 0.95rem;
    padding-left: 1.25rem;
  }
  
  .study-impact {
    padding: 1.5rem;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .study-reveal,
  .study-hero-logo,
  .study-result-card,
  .study-showcase-item,
  .study-nav-arrow,
  .study-cta-button {
    transition: none;
    animation: none;
  }
  
  .study-reveal {
    opacity: 1;
    transform: none;
  }
}
