/* ===== Case study (/work/<slug>) =====
   Built to the approved prototype (incoming/autonomy-case-study/
   connollys-case-study-prototype.html), re-expressed in the site's tokens:
   night surfaces, ink scale, mono labels, .btn pills, .chip, .reveal.
   The prototype's own hex values are mapped, not copied; its stand-in header,
   footer and yellow review notes are not built. */

/* Mono micro-label, the prototype's .label. ink-500 on light (ink-400 fails
   WCAG contrast at this size), ink-300 on night surfaces. */
.cs-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.cs-hero .cs-label, .cs-band .cs-label, .cs-delivery .cs-label, .cs-next .cs-label { color: var(--ink-300); }

/* The site's .container carries no side padding (sections pad themselves
   elsewhere); here every band shares the same gutter. box-sizing is global. */
.cs .container { padding-left: var(--gutter); padding-right: var(--gutter); }

/* Ghost pill for night surfaces; the stock .btn--ghost is drawn for light. */
.btn.cs-ghost { background: transparent; color: #fff; border-color: var(--line-dark); }
.btn.cs-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); transform: translateY(-1px); }

/* ---- 1. Hero ---- */
.cs-hero {
  background: var(--night-2);
  color: #fff;
  padding: calc(var(--nav-h) + clamp(48px, 8vw, 104px)) 0 0;
  overflow: hidden;
  position: relative;
}
.cs-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 72%, rgba(255,255,255,0.07), rgba(255,255,255,0) 70%);
}
.cs-hero > * { position: relative; }
.cs-crumbs { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.cs-crumbs a { text-decoration: none; color: var(--ink-300); transition: color 200ms var(--ease-out); }
.cs-crumbs a:hover { color: #fff; }
.cs-crumbs span[aria-current] { color: var(--ink-200); }
.cs-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 7.4vw, 104px);
  letter-spacing: -0.045em; line-height: 0.94;
  max-width: 12ch; margin: 0; color: #fff; text-wrap: balance;
}
.cs-client { margin: 0 0 18px; }
.cs-lede {
  font-size: clamp(18px, 1.6vw, 21px); font-weight: 500; line-height: 1.45;
  color: var(--ink-200); max-width: 56ch; margin: 28px 0 0;
}
.cs-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.cs-hero-shot { max-width: 1600px; margin: clamp(32px, 5vw, 64px) auto 0; aspect-ratio: 16 / 7.4; overflow: hidden; }
.cs-hero-shot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; }
@media (max-width: 700px) { .cs-hero-shot { aspect-ratio: 16 / 10; } }

/* Spec bar across the bottom of the hero, like a car's headline spec. */
.cs-specbar { border-top: 1px solid var(--line-dark); background: rgba(8, 9, 12, 0.6); }
.cs-specbar dl { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); margin: 0; }
.cs-specbar dl > div { padding: 22px 0 26px 20px; border-left: 1px solid var(--line-dark); }
.cs-specbar dl > div:first-child { border-left: 0; padding-left: 0; }
.cs-specbar dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-300);
}
.cs-specbar dd {
  margin: 8px 0 0; font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 30px); font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.cs-specbar dd small { font-size: 0.55em; color: var(--ink-300); font-weight: 600; letter-spacing: 0; }
@media (max-width: 900px) {
  .cs-specbar dl { grid-template-columns: repeat(2, 1fr); }
  .cs-specbar dl > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-dark); }
  .cs-specbar dl > div:nth-child(-n+2) { border-top: 0; }
}

/* ---- 2. Story + sticky spec sheet ---- */
.cs-story { padding: clamp(64px, 9vw, 128px) 0; background: var(--paper); }
.cs-story__grid { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.cs-sheet { position: sticky; top: calc(var(--nav-h) + 28px); border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: var(--paper); }
.cs-sheet h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.02; margin: 0 0 6px; }
.cs-sheet dl { margin: 0; }
.cs-sheet dt { margin-top: 18px; }
.cs-sheet dd { margin: 6px 0 0; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--ink-900); }
.cs-sheet dd .chip { font-size: 12px; padding: 4px 10px; margin: 0 6px 6px 0; }
.cs-sheet__visit { margin-top: 22px; width: 100%; justify-content: center; }
.cs-prose section + section { margin-top: clamp(56px, 7vw, 88px); }
.cs-prose h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.028em; line-height: 1.02;
  margin: 10px 0 22px; text-wrap: balance;
}
.cs-big { font-size: clamp(22px, 2.3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink-900); margin: 0; }
.cs-prose p:not(.cs-label):not(.cs-big) { font-size: clamp(17px, 1.4vw, 19px); font-weight: 500; color: var(--ink-700); line-height: 1.6; max-width: 62ch; margin: 0; }
.cs-big + p, .cs-prose p + p { margin-top: 18px !important; }
@media (max-width: 900px) {
  .cs-story__grid { grid-template-columns: 1fr; }
  .cs-sheet { position: static; order: 2; }
}

/* ---- 3. Numbers band ---- */
.cs-band { background: var(--night); color: #fff; padding: clamp(56px, 7vw, 96px) 0; }
.cs-band__head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.cs-band h2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.02; margin: 0; }
.cs-nums { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); border-top: 1px solid var(--line-dark); }
.cs-nums > div { padding: 28px 24px 0 0; }
.cs-num {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 112px); font-weight: 700;
  letter-spacing: -0.055em; line-height: 0.9; font-variant-numeric: tabular-nums;
}
.cs-num .u { color: var(--ink-300); font-size: 0.5em; letter-spacing: -0.02em; }
.cs-nums .cs-label { display: block; margin-top: 14px; }
@media (max-width: 760px) {
  .cs-nums { grid-template-columns: repeat(2, 1fr); }
  .cs-nums > div { padding-bottom: 28px; }
}

/* ---- 4. Solution ---- */
.cs-solution { padding: clamp(72px, 10vw, 140px) 0; background: var(--bg-2); }
.cs-solution__intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: end; margin-bottom: clamp(48px, 7vw, 96px); }
.cs-solution__intro h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 5vw, 68px); letter-spacing: -0.045em; line-height: 1.02;
  margin: 12px 0 0; text-wrap: balance;
}
.cs-solution__lede p { font-size: clamp(17px, 1.4vw, 19px); font-weight: 500; color: var(--ink-700); line-height: 1.6; margin: 0; }
.cs-solution__lede p + p { margin-top: 16px; }
@media (max-width: 900px) { .cs-solution__intro { grid-template-columns: 1fr; align-items: start; } }

.cs-feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.cs-feature + .cs-feature { margin-top: clamp(56px, 8vw, 120px); }
.cs-feature--flip { grid-template-columns: 1fr 1.25fr; }
.cs-feature--flip .cs-feature__media { order: 2; }
.cs-feature__media {
  aspect-ratio: 16 / 11; border-radius: clamp(18px, 2vw, 24px); overflow: hidden;
  background: var(--night-2); box-shadow: 0 30px 60px -30px rgba(10, 12, 16, 0.45);
}
.cs-feature__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.32); transform-origin: 50% 62%; }
.cs-idx { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--ink-500); }
.cs-feature h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 3vw, 42px); letter-spacing: -0.028em; line-height: 1.02;
  margin: 12px 0 18px;
}
.cs-feature__body p { font-size: 17px; font-weight: 500; color: var(--ink-700); line-height: 1.6; max-width: 48ch; margin: 0; }
.cs-feature__body p + p { margin-top: 14px; }
.cs-feature__body ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.cs-feature__body li { display: flex; gap: 12px; align-items: baseline; font-weight: 600; font-size: 15px; color: var(--ink-900); }
.cs-feature__body li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-900); transform: translateY(-1px); }
@media (max-width: 900px) {
  .cs-feature, .cs-feature--flip { grid-template-columns: 1fr; }
  .cs-feature--flip .cs-feature__media { order: 0; }
}

/* SEO migration panel: old URL to new URL, the thing the client cares about. */
.cs-migrate {
  background: var(--night-2); color: #fff; border-radius: clamp(18px, 2vw, 24px);
  padding: clamp(22px, 3vw, 36px);
  font-family: var(--font-mono); font-size: 13px;
  box-shadow: 0 30px 60px -30px rgba(10, 12, 16, 0.45);
}
.cs-migrate__cap { display: flex; justify-content: space-between; color: var(--ink-300); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.cs-migrate__row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-dark); }
.cs-migrate__row:first-of-type { border-top: 0; }
.cs-migrate .old { color: var(--ink-300); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); overflow-wrap: anywhere; }
.cs-migrate .new { color: #fff; overflow-wrap: anywhere; }
.cs-migrate .code { border: 1px solid var(--line-dark); border-radius: 999px; padding: 3px 8px; font-size: 11px; color: var(--ink-200); }

/* ---- 5. Journey ---- */
.cs-journey { padding: clamp(72px, 9vw, 128px) 0; background: var(--paper); }
.cs-journey h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.028em; line-height: 1.02;
  margin: 12px 0 0; max-width: 16ch;
}
.cs-journey__sub { font-size: 18px; font-weight: 500; color: var(--ink-700); margin: 18px 0 0; max-width: 58ch; line-height: 1.55; }
.cs-steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); counter-reset: s; position: relative; }
.cs-steps::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 1px; background: var(--line); }
.cs-steps li { position: relative; padding-right: 16px; }
.cs-steps li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--ink-900);
  font-family: var(--font-mono); font-size: 11px; position: relative;
}
.cs-steps b { display: block; margin-top: 18px; font-size: 17px; letter-spacing: -0.015em; font-weight: 700; }
.cs-steps li > span { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-500); line-height: 1.45; }
@media (max-width: 900px) {
  .cs-steps { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .cs-steps::before { display: none; }
}

/* ---- 6. Delivery track ---- */
.cs-delivery { background: var(--night-2); color: #fff; padding: clamp(72px, 9vw, 128px) 0; }
.cs-delivery h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.028em; line-height: 1.02; margin: 12px 0 0;
}
.cs-delivery__sub { color: var(--ink-200); font-size: 18px; font-weight: 500; margin: 16px 0 0; max-width: 56ch; }
.cs-track { margin-top: 52px; display: grid; grid-template-columns: repeat(var(--cols, 7), 1fr); border-top: 1px solid var(--line-dark); }
.cs-track > div { padding: 20px 16px 0 0; position: relative; }
.cs-track > div::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-300); }
.cs-track > div.end::before { background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 0 24px rgba(255, 255, 255, 0.5); }
.cs-track b { display: block; font-size: 16px; letter-spacing: -0.01em; font-weight: 700; }
.cs-track .cs-label { display: block; margin-top: 8px; font-size: 11px; }
@media (max-width: 900px) {
  .cs-track { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-dark); padding-left: 22px; }
  .cs-track > div { padding: 0 0 26px; }
  .cs-track > div::before { left: -27px; top: 6px; }
}

/* ---- 7. Proof: quote, results, or the Since-launch tracking panel ---- */
.cs-proof { padding: clamp(72px, 9vw, 128px) 0; background: var(--paper); }
.cs-proof__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 56px); }
.cs-proof__grid--single { grid-template-columns: 1fr; max-width: 640px; }
.cs-slot { border: 1px solid var(--line); border-radius: clamp(18px, 2vw, 24px); padding: clamp(28px, 4vw, 48px); position: relative; margin: 0; }
.cs-slot .tag { position: absolute; top: -9px; left: 24px; background: var(--paper); padding: 0 8px; }
.cs-quote q {
  display: block; font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15;
  color: var(--ink-900); quotes: "\201C" "\201D";
}
.cs-quote cite { display: block; margin-top: 22px; font-style: normal; font-weight: 600; color: var(--ink-500); }
.cs-since h3 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; margin: 10px 0 14px; }
.cs-since > p { color: var(--ink-700); font-weight: 500; margin: 0; }
.cs-since ul { list-style: none; padding: 0; margin: 20px 0 0; }
.cs-since li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.cs-since li span { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); letter-spacing: 0.06em; text-transform: uppercase; }
.cs-results { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 10px; display: grid; grid-template-columns: repeat(var(--stats, 3), 1fr); gap: 24px; }
.cs-results .num { font-size: clamp(38px, 4.2vw, 60px); }
.cs-results .tiny { color: var(--ink-500); margin-top: 8px; display: block; }
.cs-results-note { margin-top: 20px; font-size: 13px; color: var(--ink-500); }
@media (max-width: 900px) { .cs-proof__grid { grid-template-columns: 1fr; } }

/* ---- 8. See it live ---- */
.cs-live { background: var(--bg-2); padding: clamp(56px, 7vw, 96px) 0; }
.cs-live__card {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 4vw, 64px); align-items: center;
  background: var(--paper); border-radius: clamp(18px, 2vw, 28px);
  padding: clamp(20px, 3vw, 32px); box-shadow: 0 30px 60px -40px rgba(10, 12, 16, 0.35);
}
.cs-live h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -0.028em; line-height: 1.02; margin: 12px 0 0;
}
.cs-live__card > div > p:not(.cs-label) { color: var(--ink-700); font-weight: 500; margin: 16px 0 26px; font-size: 17px; max-width: 48ch; }
.cs-live__card img { border-radius: 16px; width: 100%; height: auto; }
@media (max-width: 900px) { .cs-live__card { grid-template-columns: 1fr; } }

/* ---- 9. Next case study ---- */
.cs-next { padding: clamp(56px, 7vw, 96px) 0; background: var(--paper); }
.cs-next a {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end;
  text-decoration: none; background: var(--night); color: #fff;
  border-radius: clamp(18px, 2vw, 28px); padding: clamp(28px, 4vw, 56px);
  transition: transform 240ms var(--ease-out);
}
.cs-next a:hover { transform: translateY(-3px); }
.cs-next h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 5vw, 72px); letter-spacing: -0.045em; line-height: 0.98; margin: 12px 0 0;
}
.cs-next__stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.cs-next__stats b { display: block; font-family: var(--font-display); font-size: 34px; letter-spacing: -0.04em; font-weight: 700; }
.cs-next__arrow { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--ink-900); display: grid; place-items: center; font-size: 24px; }
@media (prefers-reduced-motion: reduce) { .cs-next a { transition: none; } }
@media (max-width: 700px) { .cs-next a { grid-template-columns: 1fr; } .cs-next__arrow { display: none; } }
