/* ============================================================
   Case study (v3) — extends style.css
   ============================================================ */

.cs { max-width: 900px; margin: 0 auto; padding: 3rem var(--pad) 4rem; }

/* ============ Dot nav ============ */

.dotnav {
  position: fixed;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dotnav a { position: relative; display: block; padding: 4px; }

.dotnav a span {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.25s ease, transform 0.25s ease;
}

.dotnav a:hover span { background: var(--muted); }
.dotnav a.active span { background: var(--accent); transform: scale(1.35); }

.dotnav a::after {
  content: attr(data-label);
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dotnav a:hover::after, .dotnav a.active::after { opacity: 1; transform: translateY(-50%) translateX(0); }

@media (max-width: 1180px) { .dotnav { display: none; } }

/* ============ Title ============ */

.cs-head { padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }

.cs-h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}

.cs-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.4;
  color: var(--muted);
  max-width: 30em;
  margin-top: 1.1rem;
}

.cs-sub em { font-style: normal; color: var(--accent); }

.cs-facts {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  font-size: 0.92rem;
}

.fact-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}

/* ============ Sections ============ */

.cs-sec { padding: 4rem 0; border-bottom: 1px solid var(--line); }

.cs-h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-top: 0.9rem;
  max-width: 18em;
}

.cs-lead { margin-top: 1.15rem; font-size: 1.02rem; color: var(--muted); max-width: 60ch; }
.cs-lead em { font-style: normal; color: var(--ink); }
.cs-lead strong { color: var(--ink); }

/* ============ Challenge cards ============ */

.cs-cards {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.cs-card { background: var(--panel); padding: 1.75rem; }

.cs-card-no { font-family: var(--display); font-style: italic; font-size: 1.4rem; color: var(--accent); }

.cs-card h3 { font-family: var(--display); font-weight: 500; font-size: 1.25rem; margin-top: 0.4rem; }
.cs-card p { margin-top: 0.5rem; font-size: 0.92rem; color: var(--muted); }

/* ============ Figures ============ */

.cs-fig,
.cs-duo {
  width: min(80vw, 1400px);
  margin-left: calc((100% - min(80vw, 1400px)) / 2);
  margin-right: calc((100% - min(80vw, 1400px)) / 2);
}

.cs-fig { margin-top: 2.75rem; }

.cs-fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.cs-fig figcaption {
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
}

.cs-duo {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cs-duo .cs-fig { margin-top: 0; width: auto; margin-left: 0; margin-right: 0; }

/* ============ Breadcrumb + foot ============ */

.cs-crumb {
  margin-top: 3rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.cs-crumb a:hover { color: var(--accent); }
.cs-crumb .here { color: var(--ink); }

.cs-foot {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.94rem;
  color: var(--muted);
}

.cs-next { font-weight: 600; color: var(--ink); transition: color 0.2s ease; }
.cs-next:hover { color: var(--accent); }
.cs-foot a[href^="mailto"] { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.cs-foot a[href^="mailto"]:hover { color: var(--accent); border-color: var(--accent); }

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

@media (max-width: 640px) {
  .cs-facts { grid-template-columns: 1fr 1fr; }
  .cs-cards { grid-template-columns: 1fr; }
  .cs-duo { grid-template-columns: 1fr; gap: 2.25rem; }
}
