/* ═══════════════════════════════════════════════════════════
   Case Studies Page
   ═══════════════════════════════════════════════════════════ */

/* ── Hero ── */
.cs-hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 24px;
  align-items: start;
  animation: fadeInUp 0.8s var(--ease-out-expo);
}

.cs-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.cs-hero h1 span { color: var(--blue); }

.cs-hero .hero-text {
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.cs-buttons {
  display: flex;
  gap: 12px;
  margin: 22px 0 20px;
}

/* ── Hero Proof ── */
.hero-proof {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.hero-stars {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-stars span { color: #f8b432; letter-spacing: 1px; }

.hero-avatars {
  display: flex;
  margin-left: 6px;
}

.hero-avatars span {
  width: 24px;
  height: 24px;
  margin-left: -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #f8dbc6 0 24%, transparent 25%),
    radial-gradient(circle at 50% 72%, #7e5030 0 17%, transparent 18%),
    linear-gradient(180deg, #4f617f, #2e3a55);
}

/* ── Performance Card ── */
.perf-card {
  padding: 18px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.perf-head {
  margin-bottom: 10px;
}

.perf-head > strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 10px;
}

.metric-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.metric-row article {
  display: grid;
  gap: 4px;
}

.metric-row b {
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.metric-row span {
  color: var(--text-secondary);
  font-size: 11px;
}

/* ── Chart ── */
.chart-wrap {
  display: grid;
  grid-template-columns: 30px 1fr 120px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.chart-axis {
  display: grid;
  justify-items: end;
  gap: 19px;
  color: var(--muted);
  font-size: 10px;
}

.chart-area { position: relative; padding-top: 10px; }

.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 10px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.dot.gray { background: #c0c8d9; }
.dot.blue { background: var(--blue); }

.chart-area svg { width: 100%; height: auto; }

.line { fill: none; stroke-width: 3; stroke-linecap: round; }
.line-gray { stroke: #c5cbd8; }
.line-blue { stroke: var(--blue); }
.chart-area circle { fill: var(--blue); }

.chart-months {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.chart-callout {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f0faf5, #e6f7ef);
  color: #169568;
}

.chart-callout b { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.chart-callout span { font-size: 12px; }

/* ── Story Card ── */
.story-section { margin-top: 32px; }

.story-card {
  display: grid;
  grid-template-columns: 240px 1.1fr 0.95fr;
  gap: 20px;
  padding: 14px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.story-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.95), transparent 16%),
    linear-gradient(135deg, #eef2f8, #dbe4f1 52%, #f7f9fc);
}

.room { position: relative; width: 100%; height: 100%; min-height: 200px; }
.room .lamp, .room .screen, .room .chair, .room .cabinet { position: absolute; }

.room .lamp {
  top: 20px; left: 18px; width: 10px; height: 54px;
  border-radius: 10px;
  background: linear-gradient(180deg, #6c7d97, #9cacbe);
}

.room .screen {
  top: 28px; right: 62px; width: 74px; height: 48px;
  padding-top: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #283449, #142034);
  color: #dce8ff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.room .chair {
  left: 40px; bottom: 12px; width: 110px; height: 70px;
  border-radius: 30px 30px 26px 26px;
  background: linear-gradient(135deg, #4b79ad, #11335e);
  transform: rotate(-16deg);
}

.room .cabinet {
  right: 16px; bottom: 16px; width: 72px; height: 112px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(216,224,236,0.9));
}

/* ── Story Copy ── */
.story-copy { padding: 6px 0; }

.story-chip {
  display: inline-flex;
  min-height: 24px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.story-copy h2 {
  margin: 12px 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.story-loc {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.story-copy > p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-tags span {
  min-height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
}

/* ── Results Panel ── */
.results-panel { padding-top: 4px; }
.results-panel > strong { font-family: var(--font-display); font-size: 14px; }

.result-boxes {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.result-boxes article {
  flex: 1;
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
}

.result-boxes b {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--mint);
}

.result-boxes article:nth-child(2) b { color: var(--amber); }
.result-boxes article:nth-child(3) b { color: var(--violet); }

.result-boxes span {
  color: var(--text-secondary);
  font-size: 12px;
}

.quote-box {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f6f9ff, #fff);
  border: 1px solid var(--line);
}

.quote-box p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.quote-box footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #f2cfb6 0 22%, transparent 23%),
    radial-gradient(circle at 50% 72%, #80522f 0 16%, transparent 17%),
    linear-gradient(180deg, #7d8ea7, #3b4d6b);
  flex-shrink: 0;
}

.quote-box small { color: var(--muted); font-size: 11px; }

/* ── Insight Grid ── */
.insight-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr 0.85fr;
  gap: 14px;
  margin-top: 24px;
}

.panel {
  padding: 16px 18px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.panel > strong, .panel-head strong {
  font-family: var(--font-display);
  font-size: 14px;
}

.panel table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
}

.panel th, .panel td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.panel th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.panel tbody td:last-child {
  color: var(--mint);
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-head a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

/* ── Mini Stories ── */
.mini-stories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mini-stories article {
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
}

.mini-stories h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.mini-stories > article > p {
  min-height: 48px;
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

.mini-stories .mini-metrics {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 4px 8px;
  align-items: end;
}

.mini-metric-val {
  font-family: var(--font-display);
  color: var(--mint);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.mini-metric-label {
  color: var(--muted);
  font-size: 10px;
}

.mini-stories article:nth-child(3) .mini-metric-val:first-child,
.mini-stories article:nth-child(4) .mini-metric-val:first-child {
  color: var(--blue);
}

/* ── ROI Panel ── */
.roi-panel p {
  margin: 8px 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.roi-list { display: grid; gap: 8px; }

.roi-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.roi-list span { color: var(--text-secondary); font-size: 12px; }
.roi-list b { font-size: 13px; }

.roi-total {
  margin-top: 14px;
  display: grid;
  gap: 4px;
}

.roi-total span { color: var(--text-secondary); font-size: 12px; }

.roi-total b {
  color: var(--mint);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

/* ── Testimonials ── */
.testimonial-section {
  margin-top: 28px;
}

.testimonial-section > strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 12px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.testimonial {
  min-height: 100px;
  padding: 16px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out-expo);
}

.testimonial:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quote-face {
  float: left;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #f2cfb6 0 22%, transparent 23%),
    radial-gradient(circle at 50% 72%, #80522f 0 16%, transparent 17%),
    linear-gradient(180deg, #7d8ea7, #3b4d6b);
}

.quote-face.female {
  background:
    radial-gradient(circle at 50% 36%, #f5d3bf 0 22%, transparent 23%),
    radial-gradient(circle at 50% 72%, #8d5c38 0 16%, transparent 17%),
    linear-gradient(180deg, #7c5d51, #3d2f2d);
}

.testimonial p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.testimonial small {
  color: var(--muted);
  font-size: 11px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.slider-dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--line);
  cursor: pointer;
  transition: all 0.3s;
}

.slider-dots span:hover { background: var(--muted); }

.slider-dots .active {
  width: 20px;
  background: var(--blue);
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .cs-hero, .story-card, .insight-grid, .testimonial-grid, .mini-stories {
    grid-template-columns: 1fr;
  }
  .chart-wrap { grid-template-columns: 24px 1fr; }
  .chart-callout { grid-column: 2; width: 180px; justify-self: end; }
}

@media (max-width: 900px) {
  .metric-row, .result-boxes, .cs-buttons, .hero-proof { flex-direction: column; }
  .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { grid-template-columns: 1fr; }
  .chart-axis { display: none; }
  .chart-callout { grid-column: auto; width: 100%; }
}

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