/* ============================================
   FOLIO — case study template
   ============================================ */

.cs-hero { padding-top: var(--space-2xl); padding-bottom: var(--space-lg); }
.cs-hero h1 { font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: var(--space-md) 0; }
.cs-hero .lead { max-width: 56ch; }

/* TL;DR card */
.tldr {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2xl);
  background: var(--color-bg-subtle); border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl);
  margin: var(--space-lg) 0 var(--space-2xl);
}
.tldr .chip { display: block; margin-bottom: var(--space-sm); }
.tldr p { margin: 0; font-size: 0.875rem; font-weight: 500; line-height: 1.45; }

/* Sections */
.cs-section { padding-top: var(--space-3xl); }
.cs-section > .eyebrow { display: block; margin-bottom: var(--space-sm); }
.cs-section h2 { font-size: var(--text-h2); font-weight: 600; line-height: 1.15; margin: 0 0 var(--space-lg); letter-spacing: -0.01em; }
.cs-section h3 { font-size: var(--text-title); font-weight: 600; margin: var(--space-xl) 0 var(--space-md); }
.cs-section p { max-width: 68ch; line-height: 1.65; margin: 0 0 var(--space-md); }
.cs-section .highlight { font-weight: 600; }

/* Exhibits */
.exhibit {
  background: var(--color-bg-subtle); border-radius: var(--radius-lg);
  padding: var(--space-xl); margin: var(--space-lg) 0;
}
.exhibit .exhibit-caption, .cs-section p.exhibit-caption {
  font-family: var(--font-mono); font-size: var(--text-meta); font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-secondary);
  margin-top: var(--space-2xl);
  margin-bottom: 0;
  text-align: center;
  width: 100%;
  max-width: none;
}
.phone-row { display: flex; gap: var(--space-xl); justify-content: center; flex-wrap: wrap; }
.phone-row img {
  width: min(220px, 42vw); border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}
.phone-row .arrow { align-self: center; font-size: 1.6rem; color: var(--color-text-secondary); }

/* Friction cards (Pebblr s01) */
.friction-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.friction {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-lg);
}
.friction .chip { color: var(--color-accent); display: block; margin-bottom: var(--space-sm); }
.friction h4 { font-size: 1.125rem; font-weight: 600; margin: 0 0 var(--space-sm); line-height: 1.3; }
.friction p { font-size: 0.875rem; color: var(--color-text-secondary); margin: 0; }

/* Stats */
.stats { display: flex; gap: var(--space-3xl); flex-wrap: wrap; margin: var(--space-lg) 0; }
.stat .num { font-size: 3rem; font-weight: 700; line-height: 1; }
.stat .chip { display: block; margin-top: var(--space-sm); }

/* Quote */
.quote {
  border-left: 4px solid; border-image: linear-gradient(180deg, var(--violet-600), var(--sky-400)) 1;
  padding-left: var(--space-xl); margin: var(--space-xl) 0;
}
.quote p { font-size: var(--text-lead); line-height: 1.55; max-width: 52ch; margin: 0 0 var(--space-sm); }
.quote cite { font-style: normal; }

/* Next project */
.next-project {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-4xl);
  padding: var(--space-2xl) 0;
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-lg);
  text-decoration: none; color: inherit; flex-wrap: wrap;
}
.next-project h2 { font-size: var(--text-h3); font-weight: 600; margin: 0; transition: color .25s; }
.next-project:hover h2 { color: var(--color-accent); }

@media (max-width: 900px) {
  .tldr { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
  .friction-grid { grid-template-columns: 1fr; }
  .stats { gap: var(--space-xl); }
}
@media (max-width: 560px) {
  .tldr { grid-template-columns: 1fr; }
}

/* ---------- Diagrams (Breasley IA · HIV pathway · scoreboard · tone) ---------- */
.diagram { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); }
.diagram-row { display: flex; gap: var(--space-lg); flex-wrap: wrap; justify-content: center; align-items: center; }
.node {
  background: var(--color-bg-card); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full); padding: 10px 22px;
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
}
.node.grad { background: var(--grad-brand); border: none; color: #fff; }
.diagram .down { color: var(--color-text-secondary); font-size: 1.1rem; }
.pathway { display: flex; gap: var(--space-md); align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.pathway .step { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); max-width: 170px; text-align: center; }
.pathway .step small { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-secondary); line-height: 1.5; }
.pathway .sep { color: var(--color-text-secondary); font-size: 1.2rem; padding-top: 8px; }

/* Lighthouse scoreboard */
.scoreboard { margin: var(--space-lg) 0; }
.scoreboard .row-label { font-family: var(--font-mono); font-size: var(--text-meta); letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-secondary); margin: var(--space-lg) 0 var(--space-sm); }
.scores { display: flex; gap: var(--space-3xl); flex-wrap: wrap; }
.score .nums { display: flex; align-items: baseline; gap: 10px; }
.score .old { font-size: 1.875rem; color: var(--color-text-secondary); }
.score .arr { color: var(--color-text-secondary); }
.score .new { font-size: 2.75rem; font-weight: 700; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score .chip { display: block; margin-top: 2px; }

/* Proof strip */
.proof-strip { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.proof-strip figure { margin: 0; }
.proof-strip img { border-radius: var(--radius-sm); border: 1px solid var(--color-border); width: 100%; }
.proof-strip figcaption { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-secondary); margin-top: 6px; }

/* Tone side-by-side */
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); align-items: stretch; }
.tone-panel { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-xl); color: var(--color-text-secondary); line-height: 1.7; }
.tone-grid img { border-radius: var(--radius-md); border: 1px solid var(--color-border); width: 100%; max-width: 320px; justify-self: center; box-shadow: 0 10px 28px rgba(0,0,0,.10); }
.tone-labels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); }

/* Card fan gallery */
.fan { display: flex; justify-content: center; align-items: center; }
.fan img {
  width: min(200px, 34vw); border-radius: 10px; border: 2px solid #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); transition: transform .3s ease;
}
.fan img:nth-child(1){ transform: rotate(-6deg) translateX(14px); }
.fan img:nth-child(2){ transform: rotate(2deg); z-index: 1; }
.fan img:nth-child(3){ transform: rotate(-2deg) translateX(-10px); }
.fan img:nth-child(4){ transform: rotate(5deg) translateX(-26px); }
.fan img:hover { transform: rotate(0) translateY(-8px) scale(1.04); z-index: 2; }

/* Split pair (Breasley brand split) */
.split-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.split-pair figure { margin: 0; }
.split-pair img { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.split-pair figcaption { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-secondary); margin-top: var(--space-sm); }

@media (max-width: 760px) {
  .tone-grid, .split-pair, .proof-strip { grid-template-columns: 1fr; }
  .scores { gap: var(--space-xl); }
  .pathway .sep { display: none; }
}

/* Before/After badges — inline with caption */
.ba-badge {
  display: inline-block; vertical-align: middle; margin-right: 10px;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--color-bg-inverse); color: var(--color-text-inverse);
  padding: 5px 14px; border-radius: var(--radius-full);
}
.ba-badge.ba-after { background: var(--grad-brand); color: #fff; }
.split-pair figcaption { display: flex; align-items: center; gap: 4px; }

/* Tall scrollable artifact */
.tall-scroll {
  max-height: 560px; overflow-y: auto; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: #fff;
}
.tall-scroll img { width: 100%; display: block; }
.tall-scroll:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* Lighthouse dial strip */
.dial-strip img { background: #1f1f22; }
.dial-strip figcaption { display: flex; align-items: center; gap: 4px; margin-top: var(--space-sm); }
