/* Case studies and engineering notes.

   Loaded after site.css and built entirely from its tokens, so the two stay in
   step and no colour is defined twice. This is a reading page rather than a
   landing page, so the job here is a comfortable measure, a clear hierarchy and
   nothing competing with the prose. Same hairlines, same mono labels, no cards.
*/

/* The homepage shell is a full-height grid that centres a wordmark. A document
   is not that: it starts at the top and runs down. */
.shell.doc {
  min-height: 0;
  display: block;
  max-width: 46rem;
  margin: 0 auto;
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.cs { padding-top: clamp(2.6rem, 7vw, 4.5rem); }

/* ── hero ─────────────────────────────────────────────────────────────────── */
.cs .label { margin: 0 0 1.1rem; }
.cs .label a { color: var(--faint); }
.cs .label a:hover { color: var(--dim); }

/* A note that came out of a system links back to it. Sits under the section
   label, in the same register: this is navigation, not a claim. */
.cs-partof {
  margin: -.7rem 0 1.1rem;
  font-size: .9rem;
  color: var(--faint);
}
.cs-partof a { color: var(--dim); }
.cs-partof a:hover { color: var(--ink); }

.cs-title {
  font-weight: 200;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.cs-lede {
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--dim);
  max-width: 38ch;
  margin: 0 0 1.6rem;
  text-wrap: pretty;
}
.cs-stack { margin-bottom: 0; }

/* ── sections ─────────────────────────────────────────────────────────────── */
.cs-sec {
  border-top: 1px solid var(--line);
  margin-top: clamp(2.6rem, 6vw, 3.8rem);
  padding-top: clamp(1.6rem, 4vw, 2.2rem);
}
.cs-sec h2 {
  font-weight: 300;
  font-size: clamp(1.25rem, 3.4vw, 1.6rem);
  letter-spacing: .01em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}
.cs-sec h3 {
  font-family: var(--mono);
  font-size: .68rem; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
  margin: 2rem 0 .6rem;
}
.cs-sec p { margin: 0 0 1rem; max-width: 66ch; text-wrap: pretty; }
.cs-sec p:last-child { margin-bottom: 0; }

/* The question the section exists to answer, set apart from the prose. */
.cs-q {
  font-size: 1.1rem;
  border-left: 2px solid var(--line);
  padding-left: 1rem;
  margin-bottom: 1.4rem !important;
}

.cs-cap {
  font-size: .87rem;
  color: var(--dim);
  max-width: 62ch;
  margin-top: 1.4rem !important;
}

.cs-list { margin: 0; padding-left: 1.1rem; max-width: 64ch; }
.cs-list li { margin-bottom: .55rem; }
.cs-list li::marker { color: var(--faint); }

/* ── options considered ───────────────────────────────────────────────────── */
.cs-opts { list-style: none; margin: 0; padding: 0; }
.cs-opts li {
  display: flex; flex-direction: column; gap: .3rem;
  padding: .85rem 0 .85rem 1rem;
  border-left: 2px solid var(--line);
  margin-bottom: .5rem;
}
/* The chosen option is the last one listed and gets the only emphasis in the
   block -- an ink rule against the hairlines of the rejected ones. */
.cs-opts li.chosen { border-left-color: var(--ink); }
.o-n { font-size: 1rem; }
.o-w { font-size: .89rem; color: var(--dim); max-width: 60ch; }

/* ── architecture flow ────────────────────────────────────────────────────── */
/* An ordered list, not a picture: it reads correctly to a screen reader, wraps
   on a phone, and needs no SVG that would have to be drawn twice for two
   themes. The connector is a pseudo-element so it never becomes content. */
.flow { list-style: none; margin: 0; padding: 0; }
.flow li {
  display: flex; flex-direction: column; align-items: flex-start;
}
.flow li + li::before {
  content: "";
  width: 1px; height: 1.15rem;
  background: var(--line);
  margin-left: 1.15rem;
}
.f-node {
  display: inline-block;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: .55rem .9rem;
  background: var(--bg);
}
/* Parallel inputs feeding one step. */
.f-par { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ── evidence figures ─────────────────────────────────────────────────────── */
.figs {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.4rem;
}
.figs li { display: flex; flex-direction: column; gap: .15rem; }
.fig-v {
  font-weight: 200;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fig-l { font-size: .95rem; }
.fig-n { font-size: .82rem; color: var(--dim); }

/* ── footer nav ───────────────────────────────────────────────────────────── */
.cs-nav {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid var(--line);
  margin-top: clamp(2.6rem, 6vw, 3.8rem);
  padding-top: 1.4rem;
}
.cs-nav a {
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim);
}
.cs-nav a:hover { color: var(--ink); }

@media (max-width: 620px) {
  .cs-q { padding-left: .8rem; }
  .figs { gap: 1.1rem; }
}
