/* ============================================================
   CASE STUDY DOCUMENT TEMPLATE
   Shared by every case study and project. One column, one
   measure, one image treatment, one outcome-numeral device.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dt, dd { margin: 0; }
h1, h2, p { margin: 0; }

.doc {
  display: flex;
  align-items: flex-start;
  min-height: 100dvh;
  background: var(--paper);
}

.doc-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-8) var(--space-6) var(--space-9);
}

.doc-col {
  max-width: var(--col-width);
  margin: 0 auto;
}

.doc-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--ink-muted);
  margin-bottom: var(--space-6);
}
.doc-back:hover { color: var(--accent); }

.err-back-row { margin-top: var(--space-6); }

/* ---- Header ---- */
.cs2-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}

.cs2-title {
  font-family: var(--font-sans);
  font-size: clamp(28px, 4vw, var(--text-h2));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 18ch;
}
.cs2-title em { font-style: normal; font-weight: 400; }

.cs2-subtitle {
  font-size: var(--text-sub);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: var(--measure);
  margin-top: var(--space-4);
}

/* ---- Spec block: real structured fields only ---- */
.cs2-spec {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
}

.cs2-spec-field dt {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.cs2-spec-field dd {
  margin-top: var(--space-2);
  font-size: var(--text-body);
  color: var(--ink);
  line-height: 1.5;
}
.cs2-spec-field dd span { display: block; }

/* The one reserved bold move — an outcome number, real data only */
.cs2-numeral-wrap {
  margin-top: var(--space-2);
}
.cs2-numeral {
  font-family: var(--font-sans);
  font-size: var(--text-numeral);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.cs2-numeral-caption {
  font-size: var(--text-meta);
  color: var(--ink-muted);
  margin-top: var(--space-2);
}

/* ---- Hero + section images: one treatment, everywhere ---- */
.cs2-hero,
.cs2-image {
  margin-top: var(--space-7);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cs2-hero img,
.cs2-image img {
  display: block;
  width: 100%;
  height: auto;
}
.cs2-image-caption {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--ink-muted);
  text-align: left;
}

/* ---- Sections ---- */
.cs2-section {
  margin-top: var(--space-9);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  scroll-margin-top: 64px;
}

.cs2-section-title {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.cs2-body {
  max-width: var(--measure);
}
.cs2-body p {
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink);
}
.cs2-body p + p { margin-top: var(--space-4); }
.cs2-image + .cs2-body { margin-top: var(--space-6); }

.cs2-body ul {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cs2-body li {
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink);
  padding-left: var(--space-4);
  position: relative;
}
.cs2-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 1px;
  background: var(--ink-muted);
}
.cs2-body strong { font-weight: 600; }

.cs2-body a { color: var(--accent); text-underline-offset: 3px; }
.cs2-body a:hover { text-decoration: underline; }

/* ---- Sub-heading inside a section (e.g. "Before & After") ---- */
.cs2-subheading {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
}

/* ---- Before/After comparison — same image treatment, two up ---- */
.cs2-compare {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.cs2-compare-side { display: flex; flex-direction: column; }
.cs2-compare-label {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}
.cs2-compare-img {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (max-width: 600px) {
  .cs2-compare { grid-template-columns: 1fr; }
}

/* ---- Placeholder image — for the 3 project pages, no real
   screenshots yet. Same box, same position as a real .cs2-image,
   so the layout is genuinely tested against real dimensions. ---- */
.cs2-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: repeating-linear-gradient(
    -45deg,
    var(--surface),
    var(--surface) 18px,
    var(--paper) 18px,
    var(--paper) 19px
  );
}
.cs2-placeholder span {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--ink-muted);
  background: var(--paper);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
}

/* ---- Placeholder text — visually distinct so it can never be
   mistaken for finished copy. ---- */
.cs2-body em.ph {
  font-style: normal;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0 4px;
}

/* ---- Focus — every interactive element, not just inside .doc ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .doc { flex-direction: column; align-items: stretch; }
  .doc-main { padding: var(--space-6) var(--space-5) var(--space-8); }
  .cs2-spec { grid-template-columns: 1fr; }
  .cs2-numeral { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
