/* Case study pages (/work/*). Builds on home.css + lab.css tokens. */

.cs-stats { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.cs-stat {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 1rem; min-width: 10rem; flex: 1 1 10rem;
  background: var(--paper-2); border: 1px solid var(--hairline-soft); border-radius: 12px;
}
.cs-stat-n { font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.cs-stat-l { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }

.cs-body { max-width: 900px; padding-bottom: 4rem; }
.cs-section { padding-block: 2rem 1rem; border-top: 1px solid var(--hairline-soft); }
.cs-section .kicker { margin: 0 0 0.4rem; }
.cs-section h2 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 0.9rem;
}
.cs-section h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 0 0 0.4rem; }
.cs-section p { max-width: 68ch; }
.cs-list { padding-left: 1.2rem; display: grid; gap: 0.5rem; max-width: 68ch; }
.cs-list li::marker { color: var(--rust); }
.cs-note { font-size: 0.88rem; color: var(--muted); font-style: italic; }

.cs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.6rem 0 1.2rem; }
.cs-card { background: var(--paper-2); border: 1px solid var(--hairline-soft); border-radius: 14px; padding: 1.1rem 1.25rem; }
.cs-card p { margin: 0; font-size: 0.95rem; }

/* flow diagram */
.cs-figure { margin: 0; }
.cs-figure figcaption, .cs-chart figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; max-width: 68ch; }
.cs-flow {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.7rem; align-items: center;
  background: var(--paper-3); border-radius: 14px; padding: 1.1rem;
}
.cs-flow-col { display: grid; gap: 0.6rem; }
.cs-node {
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 0.65rem 0.8rem;
  font-weight: 600; font-size: 0.92rem; color: var(--ink);
}
.cs-node small { display: block; font-weight: 400; font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.cs-node-main { border-color: var(--rust); box-shadow: inset 3px 0 0 var(--rust); }
.cs-node-agent { border-style: dashed; border-color: var(--rust); }
.cs-arrow { font-size: 1.4rem; color: var(--rust); }

/* views */
.cs-view { margin: 2rem 0; }
.cs-view-text p { font-size: 0.95rem; }

/* real screenshots, private text blurred at capture */
.cs-shot { margin: 1rem 0 0.4rem; }
.cs-shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--hairline); box-shadow: var(--shadow-soft); background: #f6f6f8; }
.cs-shot figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; max-width: 68ch; }
.cs-shot-pair { display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.cs-shot-pair figcaption { grid-column: 1 / -1; margin-top: 0; }
.cs-shot-pair img:last-of-type { max-height: 520px; object-fit: cover; object-position: top; }

/* chart */
.cs-chart { margin: 1rem 0 0; max-width: 560px; background: var(--paper-2); border: 1px solid var(--hairline-soft); border-radius: 12px; padding: 0.9rem 0.9rem 0.8rem; }
.cs-chart svg { width: 100%; height: auto; display: block; }
.c-grid line { stroke: var(--hairline); }
.c-bars rect { fill: #e7c9b2; }
.c-bars text, .c-ptl text, .c-x text { font-family: var(--font-mono); font-size: 10px; text-anchor: middle; }
.c-bars text { fill: var(--muted); }
.c-ptl text { fill: var(--ink); font-weight: 700; }
.c-x text { fill: var(--faint); }
.c-line { fill: none; stroke: var(--rust-deep); stroke-width: 2.5; }
.c-pts circle { fill: var(--rust-deep); stroke: var(--paper-2); stroke-width: 2; }
.c-key { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; vertical-align: -0.1rem; margin: 0 0.2rem 0 0.1rem; }
.c-key-bar { background: #e7c9b2; }
.c-key-line { height: 3px; border-radius: 2px; vertical-align: 0.2rem; background: var(--rust-deep); margin-left: 0.5rem; }

/* rules */
.cs-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.cs-rule { background: var(--paper-2); border: 1px solid var(--hairline-soft); border-left: 3px solid var(--rust); border-radius: 0 12px 12px 0; padding: 0.9rem 1.1rem; }
.cs-rule h3 { font-size: 1rem; }
.cs-rule p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.cs-cta a { font-weight: 600; color: var(--rust-deep); border-bottom: 1px solid rgba(180, 73, 15, 0.35); }
.cs-cta a:hover { color: var(--rust); border-color: var(--rust); }

@media (max-width: 760px) {
  .cs-two, .cs-rules { grid-template-columns: 1fr; }
  .cs-shot-pair { grid-template-columns: 1fr; }
  .cs-shot-pair img:first-of-type { display: none; }
  .cs-shot-pair img:last-of-type { max-width: 300px; max-height: none; }
  .cs-flow { grid-template-columns: 1fr; }
  .cs-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
  .cs-stat { min-width: 0; flex: 1 1 40%; }
}
