/* ============================================================
   Case Studies Page — Component Styles
   Loaded on testimonials.html only.
   Base design system (fonts, nav, footer, reset) from style.css.
   ============================================================ */

/* --- Page-level overrides & local tokens --- */
body.page--case-studies {
  background: var(--warm-bg);
  padding-bottom: 0;
}

:root {
  /* Brighter teal for dark backgrounds (hero stats, metric highlights) */
  --cs-teal-accent: #5eead4;
  --cs-teal-muted: var(--teal-light);
  /* Section colors — timeline & diagnosis accents */
  --cs-red: #dc2626;
  --cs-amber: #d97706;
  --cs-green: #16a34a;
  /* Map to site's warm palette instead of cold slate grays */
  --cs-gray-50: var(--gray-50);
  --cs-gray-100: var(--gray-100);
  --cs-gray-200: var(--gray-200);
  --cs-gray-300: var(--gray-300);
  --cs-gray-400: var(--gray-400);
  --cs-gray-500: var(--gray-500);
  --cs-gray-600: var(--gray-600);
  --cs-gray-700: var(--gray-700);
  --cs-text: var(--text-primary);
  --cs-text-secondary: var(--text-secondary);
  --cs-text-light: var(--text-light);
}

/* --- Skip link --- */
a.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--navy);
  color: var(--white);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 4px;
  z-index: 1000;
  font-size: var(--fs-sm);
}
a.skip-link:focus { top: var(--sp-4); }

/* ============================================================
   HERO
============================================================ */
.cs-hero {
  background: var(--navy);
  color: var(--white);
  padding: calc(var(--nav-height) + var(--sp-16)) var(--sp-6) var(--sp-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.cs-hero__inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

.cs-hero__label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cs-teal-accent);
  margin-bottom: var(--sp-4);
  opacity: 0;
  animation: csFadeUp 600ms cubic-bezier(0.16,1,0.3,1) forwards;
}

.cs-hero h1,
.cs-bottom-cta h2 {
  color: var(--white);
}

.cs-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-6);
  opacity: 0;
  animation: csFadeUp 600ms cubic-bezier(0.16,1,0.3,1) 80ms forwards;
}

.cs-hero__subtitle {
  font-size: var(--fs-md);
  color: var(--cs-gray-300);
  max-width: 600px;
  margin: 0 auto var(--sp-8);
  opacity: 0;
  animation: csFadeUp 600ms cubic-bezier(0.16,1,0.3,1) 160ms forwards;
}

/* Hero stat bar */
.cs-stat-bar {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
  padding-top: var(--sp-8);
  border-top: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
  animation: csFadeUp 600ms cubic-bezier(0.16,1,0.3,1) 280ms forwards;
}

.cs-stat-item { text-align: center; }

.cs-stat-number {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--cs-teal-accent);
  display: block;
  line-height: 1.1;
}

.cs-stat-label {
  font-size: var(--fs-xs);
  color: var(--cs-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--sp-1);
}

/* Hero Topmate badge */
.cs-hero__badge-wrap {
  opacity: 0;
  animation: csFadeUp 600ms cubic-bezier(0.16,1,0.3,1) 360ms forwards;
  margin-top: var(--sp-6);
}

.cs-topmate-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 16px;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background 250ms, border-color 250ms;
}

.cs-topmate-badge:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
  text-decoration: none;
}

.cs-topmate-badge .badge-text { line-height: 1.3; }
.cs-topmate-badge .badge-label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

.cs-topmate-shield { width: 18px; height: 18px; flex-shrink: 0; }

@keyframes csFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FRAMEWORK SECTION
============================================================ */
.cs-framework {
  background: var(--warm-bg-alt);
  border-bottom: 1px solid var(--cs-gray-200);
  padding: var(--sp-12) var(--sp-6);
}

.cs-framework__inner {
  max-width: 860px;
  margin: 0 auto;
}

.cs-section-label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: var(--sp-3);
}

.cs-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--sp-4);
  line-height: 1.25;
}

.cs-section-text {
  color: var(--cs-text-secondary);
  max-width: 640px;
  margin-bottom: var(--sp-8);
}

.cs-fw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}

.cs-fw-step {
  background: var(--warm-bg);
  border: 1px solid var(--cs-gray-200);
  border-radius: 8px;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  transition: transform 250ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 250ms cubic-bezier(0.16,1,0.3,1);
}

.cs-fw-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.1);
}

.cs-fw-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--cs-teal-muted);
  color: var(--teal);
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: 50%;
  margin-bottom: var(--sp-3);
}

.cs-fw-step__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.cs-fw-step__desc {
  font-size: var(--fs-sm);
  color: var(--cs-text-light);
  line-height: 1.5;
}

/* ============================================================
   CASE STUDY SELECTOR — 3 clickable preview cards
============================================================ */
.cs-cases {
  padding: var(--sp-16) var(--sp-6);
  max-width: 920px;
  margin: 0 auto;
}

.cs-cases__header {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.cs-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

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

.cs-card {
  background: var(--warm-bg);
  border: 2px solid var(--cs-gray-200);
  border-radius: 12px;
  padding: var(--sp-6);
  cursor: pointer;
  transition: border-color 250ms, box-shadow 250ms, transform 150ms, opacity 250ms;
  position: relative;
  overflow: hidden;
}

.cs-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px -8px rgba(13,148,136,0.2);
}

.cs-card:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.cs-card.active {
  border-color: var(--teal);
  box-shadow: 0 8px 28px -8px rgba(13,148,136,0.25);
  background: var(--cream);
}

.cs-card.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal);
}

.cs-selector.has-active .cs-card:not(.active) { opacity: 0.6; }
.cs-selector.has-active .cs-card:not(.active):hover { opacity: 1; }

.cs-card__num {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cs-text-light);
  margin-bottom: var(--sp-2);
}

.cs-card__segment {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}

.cs-card__segment--documents  { background: #fef3c7; color: #92400e; }
.cs-card__segment--interviews { background: #ede9fe; color: #5b21b6; }
.cs-card__segment--strategy   { background: #dbeafe; color: #1e40af; }

.cs-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: var(--sp-3);
}

.cs-card__result {
  font-size: var(--fs-sm);
  color: var(--teal-dark);
  font-weight: 600;
}

.cs-card__prompt {
  font-size: var(--fs-xs);
  color: var(--cs-text-light);
  margin-top: var(--sp-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cs-card__prompt svg {
  width: 14px;
  height: 14px;
  transition: transform 250ms cubic-bezier(0.16,1,0.3,1);
}

.cs-card.active .cs-card__prompt svg { transform: rotate(90deg); }

/* ============================================================
   EXPANDED CASE STUDY PANEL
============================================================ */
.cs-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1),
              opacity 0.4s ease;
}

.cs-panel.open {
  max-height: 4000px;
  opacity: 1;
}

.cs-expanded { padding: var(--sp-8) 0; }

.cs-exp__header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 2px solid var(--cs-gray-200);
}

.cs-exp__headline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cs-exp__sub {
  font-size: var(--fs-sm);
  color: var(--cs-text-light);
  margin-top: var(--sp-2);
}

/* Metrics strip */
.cs-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4);
  background: var(--warm-bg-alt);
  border: 1px solid var(--cs-gray-200);
  border-radius: 8px;
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.cs-metric { text-align: center; }

.cs-metric__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--navy);
  display: block;
  line-height: 1.1;
}

.cs-metric__value--highlight { color: var(--teal); }

.cs-metric__label {
  font-size: var(--fs-xs);
  color: var(--cs-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--sp-1);
}

/* Timeline visualization */
.cs-timeline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-6) 0;
  padding: var(--sp-4) 0;
}

.cs-timeline__point { text-align: center; flex-shrink: 0; }

.cs-timeline__point .day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--navy);
}

.cs-timeline__point .event {
  font-size: var(--fs-xs);
  color: var(--cs-text-light);
  margin-top: var(--sp-1);
  max-width: 100px;
}

.cs-timeline__line {
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, var(--cs-red), var(--cs-amber), var(--cs-green));
  border-radius: 2px;
  position: relative;
  min-width: 40px;
}

.cs-timeline__line::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--cs-green);
}

/* Case body sections */
.cs-body { display: grid; gap: var(--sp-8); }

.cs-section {
  padding-left: var(--sp-6);
  border-left: 3px solid var(--cs-gray-200);
}

.cs-section--situation  { border-left-color: var(--cs-gray-300); }
.cs-section--diagnosis  { border-left-color: var(--cs-red); }
.cs-section--method     { border-left-color: var(--teal); }
.cs-section--outcome    { border-left-color: var(--cs-green); }

.cs-section__label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-2);
}

.cs-section--situation .cs-section__label  { color: var(--cs-text-light); }
.cs-section--diagnosis .cs-section__label  { color: var(--cs-red); }
.cs-section--method .cs-section__label     { color: var(--teal); }
.cs-section--outcome .cs-section__label    { color: var(--cs-green); }

.cs-section p {
  color: var(--cs-text-secondary);
  line-height: 1.7;
}

.cs-section p + p { margin-top: var(--sp-4); }

/* Method steps */
.cs-method-steps {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
}

.cs-method-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--sp-3);
  align-items: start;
  color: var(--cs-text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.cs-method-steps .sn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--cs-teal-muted);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: var(--fs-xs);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Quote */
.cs-quote {
  background: var(--warm-bg-alt);
  border-radius: 8px;
  padding: var(--sp-6);
  margin-top: var(--sp-6);
  position: relative;
}

.cs-quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--teal);
  opacity: 0.2;
  position: absolute;
  top: 0;
  left: var(--sp-4);
  line-height: 1;
}

.cs-quote p {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--navy);
  line-height: 1.6;
  padding-left: var(--sp-8);
}

.cs-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--cs-text-light);
  padding-left: var(--sp-8);
  margin-top: var(--sp-3);
}

/* Per-case CTA block */
.cs-case-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #243044 100%);
  border-radius: 12px;
  padding: var(--sp-6);
  margin-top: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.cs-case-cta__text {
  color: var(--cs-gray-300);
  font-size: var(--fs-sm);
  max-width: 420px;
}

.cs-case-cta__text strong {
  color: var(--white);
  font-weight: 600;
  display: block;
  margin-bottom: var(--sp-1);
}

/* Shared CTA button */
.cs-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--teal);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: var(--sp-3) var(--sp-6);
  border-radius: 8px;
  text-decoration: none;
  transition: background 250ms, transform 150ms, box-shadow 250ms;
  white-space: nowrap;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.cs-cta-btn:hover {
  background: var(--teal-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -4px rgba(13,148,136,0.4);
}

.cs-cta-btn:active { transform: translateY(0); box-shadow: none; }

.cs-cta-btn:focus-visible {
  outline: 3px solid var(--cs-teal-accent);
  outline-offset: 3px;
}

.cs-cta-btn svg { width: 16px; height: 16px; }

/* ============================================================
   FIND YOUR PATTERN — Self-identification cards
============================================================ */
.cs-identify {
  background: var(--warm-bg-alt);
  padding: var(--sp-16) var(--sp-6);
  border-top: 1px solid var(--cs-gray-200);
}

.cs-identify__inner {
  max-width: 860px;
  margin: 0 auto;
}

.cs-identify__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-8);
}

.cs-identify__card {
  background: var(--warm-bg);
  border: 1px solid var(--cs-gray-200);
  border-radius: 8px;
  padding: var(--sp-6);
  transition: border-color 250ms, box-shadow 250ms;
}

.cs-identify__card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px -4px rgba(13,148,136,0.15);
}

.cs-identify__card h3 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-3);
}

.cs-identify__card p {
  font-size: var(--fs-sm);
  color: var(--cs-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-4);
}

.cs-identify__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 250ms cubic-bezier(0.16,1,0.3,1);
}

.cs-identify__link:hover { gap: 8px; }

.cs-identify__link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   NOW IT'S YOUR TURN
============================================================ */
.cs-your-turn {
  padding: var(--sp-16) var(--sp-6);
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.cs-your-turn .cs-section-title { margin-bottom: var(--sp-4); }

.cs-your-turn__text {
  color: var(--cs-text-secondary);
  font-size: var(--fs-md);
  max-width: 600px;
  margin: 0 auto var(--sp-8);
  line-height: 1.7;
}

.cs-your-turn__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  text-align: center;
}

@media (max-width: 600px) {
  .cs-your-turn__steps { grid-template-columns: 1fr; }
}

.cs-yt-step { padding: var(--sp-6) var(--sp-4); }

.cs-yt-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  border-radius: 50%;
  margin-bottom: var(--sp-3);
}

.cs-yt-step h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.cs-yt-step p {
  font-size: var(--fs-sm);
  color: var(--cs-text-light);
  line-height: 1.5;
}

/* Connector lines between steps */
@media (min-width: 601px) {
  .cs-yt-step + .cs-yt-step {
    position: relative;
  }
  .cs-yt-step + .cs-yt-step::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: var(--cs-gray-200);
  }
}

.cs-your-turn__note {
  font-size: var(--fs-sm);
  color: var(--cs-text-light);
  margin-top: var(--sp-3);
}

/* ============================================================
   BOTTOM CTA
============================================================ */
.cs-bottom-cta {
  background: var(--navy);
  color: var(--white);
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
}

.cs-bottom-cta__inner {
  max-width: 600px;
  margin: 0 auto;
}

.cs-bottom-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: var(--sp-4);
  line-height: 1.2;
}

.cs-bottom-cta p {
  color: var(--cs-gray-300);
  margin-bottom: var(--sp-8);
  font-size: var(--fs-md);
}

.cs-bottom-cta .cs-cta-btn {
  font-size: var(--fs-base);
  padding: var(--sp-4) var(--sp-8);
}

.cs-bottom-cta__sub {
  font-size: var(--fs-sm);
  color: var(--cs-gray-400);
  margin-top: var(--sp-4);
}

/* ============================================================
   FOOTER TOPMATE BADGE (supplements style.css footer)
============================================================ */
.cs-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--gray-400);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color 250ms, background 250ms;
  margin-bottom: var(--sp-4);
}

.cs-footer-badge:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: var(--gray-300);
  text-decoration: none;
}

.cs-footer-badge .badge-label {
  display: block;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .cs-stat-bar { gap: var(--sp-6); }
  .cs-stat-number { font-size: var(--fs-xl); }
  .cs-metrics { grid-template-columns: repeat(2, 1fr); }
  .cs-case-cta { flex-direction: column; text-align: center; }
  .cs-case-cta__text { max-width: 100%; }
  .cs-timeline { flex-wrap: wrap; gap: var(--sp-4); justify-content: center; }
  .cs-timeline__line { display: none; }
  .cs-fw-grid { grid-template-columns: 1fr 1fr; }
}
