/* ==========================================================================
   case-study.css — shared styles for all case study pages (rhythm, future CS2, etc.)
   ========================================================================== */

/* ==========================================================================
   Case study header
   ========================================================================== */

.case-header {
  padding-top: var(--space-24);
  padding-bottom: var(--space-16);
}

.case-header__eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-5);
}

.case-header__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
}

.case-header__subtitle {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 640px;
  font-weight: 300;
}

.case-header__meta {
  display: flex;
  gap: var(--space-10);
  margin-top: var(--space-10);
  font-size: 14px;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.case-header__meta-label {
  font-weight: 500;
  color: var(--color-text-primary);
  display: block;
  margin-bottom: var(--space-1);
}

/* ==========================================================================
   Case study sections
   ========================================================================== */

.case-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.case-section__heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-5);
}

.case-section__subheading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.case-section__body {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-secondary);
  font-weight: 300;
  max-width: 680px;
  margin-bottom: var(--space-7);
}

/* ==========================================================================
   Insight grid (3-col problem cards)
   ========================================================================== */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.insight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-7);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.insight-card__icon {
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.insight-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.insight-card__body {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Quote blocks
   ========================================================================== */

.quote-block {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-6) var(--space-7);
  margin: var(--space-8) 0;
}

.quote-block__text {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-text-primary);
  font-style: italic;
}

.quote-block__author {
  font-size: 14px;
  color: var(--color-accent);
  margin-top: var(--space-3);
  font-weight: 500;
}

/* ==========================================================================
   Phone mockup grid
   ========================================================================== */

.phone-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: center;
  margin: var(--space-10) 0;
}

.phone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.phone-wrapper__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

.phone-frame {
  width: 200px;
  height: 420px;
  border-radius: 32px;
  background: #1A1D23;
  padding: var(--space-2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 26px;
  background: #FDFBF8;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.phone-screen__content {
  padding: var(--space-4);
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.phone-screen__content::-webkit-scrollbar {
  display: none;
}

/* Phone screen UI atoms */
.phone-pulse {
  background: #0A0F1A;
  border-radius: var(--radius-lg);
  padding: 14px;
  color: white;
  margin-bottom: var(--space-3);
}

.phone-pulse__label {
  font-size: 8px;
  text-transform: uppercase;
  color: #94A3B8;
}

.phone-pulse__amount {
  font-size: 24px;
  font-weight: 800;
}

.phone-pulse__bar-track {
  height: 4px;
  background: #1E293B;
  border-radius: 2px;
  margin-top: var(--space-2);
}

.phone-pulse__bar-fill {
  height: 100%;
  border-radius: 2px;
}

.phone-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  margin-bottom: var(--space-3);
  cursor: pointer;
  background: #7B9B8A;
  color: white;
}

.phone-forecast-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: white;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 10px;
  color: #0A0F1A;
}

.phone-forecast-row__badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   Interactive demo
   ========================================================================== */

.demo {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  margin-top: var(--space-10);
}

.demo__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
}

.demo__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.demo__slider-group {
  margin-bottom: var(--space-7);
}

.demo__slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.demo__slider-value {
  font-weight: 700;
  color: var(--color-text-primary);
}

.demo__formula {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
}

.demo__formula-result {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-sage);
  margin-top: var(--space-2);
  transition: color var(--transition-base);
}

.demo__formula-result--negative {
  color: #EF4444;
}

.demo__hint {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
  text-align: center;
}

/* Range input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--color-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--color-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
}

/* Keyboard focus ring for the slider */
input[type="range"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

  .phone-frame {
    width: 160px;
    height: 340px;
  }

  .demo__layout {
    grid-template-columns: 1fr;
  }

  .case-header__meta {
    gap: var(--space-5);
  }
}

/* ==========================================================================
   Research build-out: findings, personas, job stories, tables, decisions
   ========================================================================== */

/* Findings grid (2-col, reuses .insight-card) */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}

/* Personas */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.persona-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-7);
}

.persona-card__tag {
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.persona-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.persona-card dl { margin: 0; }

.persona-card dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-top: var(--space-4);
}

.persona-card dd {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: var(--space-1) 0 0;
}

/* Job stories */
.jtbd-list {
  list-style: none;
  counter-reset: jtbd;
  margin-top: var(--space-8);
  display: grid;
  gap: var(--space-4);
  padding: 0;
}

.jtbd-list li {
  counter-increment: jtbd;
  position: relative;
  padding: var(--space-5) var(--space-6) var(--space-5) var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.jtbd-list li::before {
  content: counter(jtbd);
  position: absolute;
  left: var(--space-6);
  top: var(--space-5);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-accent);
  font-size: var(--text-lg);
  line-height: 1.4;
}

.jtbd-list em {
  color: var(--color-text-primary);
  font-style: normal;
}

/* Case-study tables (journey map, feature mapping) */
.cs-table-wrap {
  margin-top: var(--space-8);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}

.cs-table th,
.cs-table td {
  text-align: left;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  line-height: 1.6;
  vertical-align: top;
}

.cs-table th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs-table tbody tr:last-child td {
  border-bottom: none;
}

.cs-table td strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.cs-table__feature {
  color: var(--color-accent);
  font-weight: 600;
}

/* Highlight the emotional low in the journey map */
.cs-table__row--low td {
  background: rgba(239, 68, 68, 0.07);
}

/* Design decisions (stacked) */
.decision-grid {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.decision-item {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-5);
}

.decision-item__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.decision-item__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

.decision-item__body {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .findings-grid,
  .persona-grid {
    grid-template-columns: 1fr;
  }
}
