/* ════════════════════════════════════════════════════════════
   CASE BASE — reglas idénticas en los tres case studies
   ════════════════════════════════════════════════════════════
   Extraído de los <style> inline de kivo/prestio/pivot, donde estaba
   triplicado (73 reglas x 3 = 219 duplicadas).

   ORDEN DE CARGA — IMPORTANTE
   Esta hoja debe ir SIEMPRE la primera, antes de case-theme.css. En el
   markup original estas reglas vivían en un <style> que precedía a los
   <link> de shared/, así que perdían frente a ellas a igualdad de
   especificidad. Cargarla después invertiría ese comportamiento y
   rompería el sitio de formas difíciles de rastrear.

   Lo que NO va aquí: lo propio de cada case (tablas de roles de Kivo,
   barra de proporción de Pivot, acentos de marca) sigue en su <style>
   inline, que se carga después y por tanto puede sobrescribir.
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-body);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(224, 74, 30, 0.14); color: var(--color-ink); }

.case-nav {
  padding: 20px 0 8px;
}

.case-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-ink);
  transition: color 150ms ease;
  text-decoration: none;
}

.case-nav a:hover { color: var(--color-accent-ink); }

/* ── Hero ── */
.story-hero {
  display: grid;
  column-gap: 0;
  row-gap: 0;
  align-items: start;
}

.story-hero-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.story-hero-line {
  background: var(--color-border);
  align-self: stretch;
  min-height: 100%;
}

.story-hero-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-eyebrow {
  font: 400 var(--text-eyebrow)/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-caption);
  margin-bottom: 16px;
}

.story-brand {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1.2;
  color: var(--color-ink);
  margin-bottom: 0;
  text-transform: uppercase;
}

.story-deck {
  color: var(--color-ink);
  font-weight: 700;
}

.story-lede {
  line-height: 1.6;
  color: var(--color-body);
  text-wrap: pretty;
}

.role-meta {
  display: grid;
  gap: 12px;
  margin-top: 0;
  padding: 0;
  font-size: 15px;
}

.role-meta div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.role-meta dt {
  font-weight: 600;
  color: var(--color-ink);
  font-size: var(--text-caption);
  letter-spacing: 0.02em;
  margin: 0;
}

.role-meta dd {
  margin: 0;
  color: var(--color-body);
  line-height: 1.5;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.tag {
  display: inline-flex;
  border: 1px solid var(--color-border-strong);
  padding: 4px 8px;
  border-radius: 4px;
  background: transparent;
  font-family: var(--font);
  font-size: var(--text-caption);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-body);
}

.story-hero-stats-slot {
  margin-top: 1.25rem;
  min-width: 0;
}

.story-stats {
  margin-left: 0;
  display: grid;
  gap: clamp(12px, 2vw, 20px);
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.stat {
  background: none;
  padding: 0;
}

.stat b {
  font-family: var(--font);
  display: block;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 6px;
  font-size: var(--text-caption);
  line-height: 1.4;
  color: var(--color-ink);
}

/* ── Figures ── */
.figure-frame {
  border-radius: 16px;
  overflow: hidden;
}

.figure-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-grid {
  display: grid;
  gap: 10px;
}

.figure-caption {
  margin-top: 14px;
}

.figure-caption__title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.figure-caption__role {
  display: block;
  font-size: var(--text-small);
  line-height: 1.5;
  color: var(--color-body);
}

.figure-caption__role strong {
  color: var(--color-accent-ink);
  font-weight: 600;
}



/* ── Story body ── */
.story-body {
  padding-bottom: clamp(64px, 10vh, 100px);
}

.story-section {
  border-top: 1px solid var(--color-border);
}

.story-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.story-section h2 {
  font-family: var(--font-display);
  font-weight: 550;
  letter-spacing: -0.012em;
  line-height: 1.15;
  color: var(--color-ink);
}

.story-section p {
  margin-bottom: 18px;
  text-wrap: pretty;
}

.story-section p:last-child { margin-bottom: 0; }
.story-section strong { color: var(--color-ink); font-weight: 600; }

.story-section h3 {
  font-family: var(--font-display);
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

.story-section h3:first-of-type { margin-top: 28px; }

.surface-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.surface-list li {
  display: grid;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  line-height: 1.5;
}

.surface-list .label {
  font-weight: 600;
  color: var(--color-ink);
  font-size: var(--text-small);
}

.data-table-wrap {
  margin: 20px 0 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table small { display: block; font-size: var(--text-eyebrow); color: var(--color-caption); font-weight: 400; }
.deny { color: var(--color-caption); }

/* ── Impact · composición ── */
.impact {
  --impact-card-bg: var(--color-surface);
  --impact-card-edge: var(--color-border);
}

.impact-head {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(28px, 4vw, 40px);
  max-width: 40rem;
}

/* Clase duplicada: ".story-section p" (0,1,1) le ganaba a
   ".impact-head__eyebrow" (0,1,0) y salía a tamaño de cuerpo. */
.impact-head .impact-head__eyebrow {
  font: 400 var(--text-eyebrow)/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-caption);
  margin: 0;
}

.impact-head h2 {
  margin: 0;
}

.impact-head__lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-body);
  max-width: 46ch;
}

.impact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .impact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

.impact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  margin: 0;
  padding: clamp(18px, 2.5vw, 22px);
  background: var(--impact-card-bg);
  border: 1px solid var(--impact-card-edge);
  border-radius: 14px;
}

.impact-card__title {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(16px, 1.8vw, 18px);
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-ink);
}

.impact-card__body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--color-body);
}

.impact-takeaway blockquote {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(18px, 2.6vw, 23px);
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--color-ink);
  max-width: 36rem;
}

.impact-takeaway blockquote em {
  font-style: normal;
  color: var(--color-accent-ink);
}

.impact-takeaway figcaption {
  margin-top: 16px;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-caption);
}

.story-footer {
  border-top: 1px solid var(--color-border);
  padding: clamp(48px, 8vh, 72px) 0;
}

.story-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.story-footer h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

.story-footer-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: var(--text-small);
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn--primary { background: var(--color-ink); color: #fff; }
.btn--primary:hover { background: #000; transform: translateY(-1px); }
.btn--secondary { background: var(--color-surface); color: var(--color-ink); border: 1px solid var(--color-border); }
.btn--secondary:hover { border-color: var(--color-ink); }
