/* ═══════════════════════════════════════════════════════════════════
   Case study theme. Restyles the existing case study class vocabulary
   into the elegant system. Loaded after /assets/fc.css.
   Markup and copy are untouched: this file only changes how it looks.

   Same subtraction as the homepage: serif display at 400, hairlines
   instead of keylines, no offset shadows, grounds that alternate in
   warmth rather than in hue.
   ═══════════════════════════════════════════════════════════════════ */

/* ── chrome ───────────────────────────────────────────────────────── */
.topbar {
  background: var(--cream);
  border-bottom: 1px solid var(--hair);
  padding: var(--s2) 0;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.nav-logo { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.nav-logo-mark, .nav-logo-sub {
  font-family: var(--sans); font-weight: 500;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
}
.nav-logo-sub { color: var(--ink-3); }
.back {
  font-family: var(--sans); font-size: 14px; color: var(--ink-2);
  text-decoration: none; border-bottom: 1px solid var(--hair);
  display: inline-flex; align-items: center; min-height: 44px;
}
.back:hover { color: var(--ink); }

/* ── grounds alternate in warmth, not in hue ──────────────────────── */
body { background: var(--cream); }
.hero { background: var(--cream); padding: var(--s6) 0 var(--pad-y); }
main > section, body > section { padding: var(--pad-y) 0; }
main > section:nth-of-type(2n), body > section:nth-of-type(2n) { background: var(--cream-2); }

/* sections that carry their own identity */
.testimonial { background: var(--ink) !important; color: var(--on-dark); }
.testimonial h2, .testimonial h3 { color: var(--cream); }
.product, .stats { background: var(--paper) !important; }

/* ── type ─────────────────────────────────────────────────────────── */
.kicker { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
}
.eyebrow.dim { color: var(--ink-3); }
.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }

.deck, .sub { font-size: var(--t-lead); color: var(--ink-2); max-width: 52ch; margin-top: var(--s3); }
.deck b, .sub b { font-weight: 600; color: var(--ink); }
.sec-head { margin-bottom: var(--s4); }
.sec-head h2 { margin-top: var(--s2); }
.proof-line {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3.4vw, 36px); line-height: 1.22;
  letter-spacing: -0.015em; max-width: 26ch;
}
.proof-line b { font-weight: 400; font-style: italic; }
.thesis, .loop-mantra, .closer p {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3.2vw, 34px); line-height: 1.24;
  letter-spacing: -0.015em; max-width: 28ch; color: var(--ink);
}
.narrow { max-width: 900px; margin-inline: auto; }
.mono, .cap, .url, .lbl, .ti, .o-e { font-family: var(--sans); }
.lbl {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--ink-3);
}

/* ── lists: hairline rows, not stickers ───────────────────────────── */
.pain, .lc-list { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: 0; }
.pain li, .lc-list li {
  background: transparent; border: 0; border-top: 1px solid var(--hair);
  border-radius: 0; padding: var(--s3) 0;
  font-weight: 400; color: var(--ink-2);
}
.pain li:last-child, .lc-list li:last-child { border-bottom: 1px solid var(--hair); }

/* ── stats: the number is the design ──────────────────────────────── */
.stats .grid, .stats > .wrap > .grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.stat {
  background: transparent; border: 0; border-top: 1px solid var(--hair);
  border-radius: 0; padding: var(--s4) 0;
}
.stat .n {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6vw, 66px); letter-spacing: -0.02em;
  line-height: 1; color: var(--ink);
}
.stat .n .u { font-size: 0.55em; }
.stat .l {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); margin-top: var(--s2);
}
.stats p { font-size: 13px !important; margin-top: var(--s3) !important; padding-top: 0 !important; color: var(--ink-3) !important; }

/* ── framed product shots: the evidence stays literal ─────────────── */
.frame, .intel:not(section), .layer, .loop-card, .callout, .vision > .wrap > div {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
}
.frame .bar {
  display: flex; align-items: center; gap: 7px;
  background: var(--cream-2); padding: 11px var(--s2);
  border-bottom: 1px solid var(--hair);
}
.frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.frame .bar .chan { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.frame .live { display: block; background: var(--paper); position: relative; overflow: hidden; }
.cap { font-size: var(--t-small); color: var(--ink-2); margin-top: var(--s2); }
.pwrap { width: min(1180px, calc(100% - (var(--gutter) * 2))); margin-inline: auto; }

/* ── marquees: the page script duplicates each track so -50% loops ── */
.marquee, .logos { overflow: hidden; }
.marquee { width: 100%; }
.track {
  display: flex; align-items: center; gap: var(--s4);
  flex-wrap: nowrap; width: max-content;
  animation: cs-roll 60s linear infinite;
}
.logos .track { animation-duration: 50s; animation-direction: reverse; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes cs-roll { to { transform: translateX(-50%); } }

/* the reel is their real work, so it needs a real size */
.reel { padding: var(--s5) 0; }
.reel .lbl, .logos .lbl { width: min(1240px, calc(100% - var(--gutter) * 2)); margin: 0 auto var(--s3); }
.logos { padding-bottom: var(--s5); }
.shotcard {
  flex: 0 0 auto; width: clamp(150px, 15vw, 210px); aspect-ratio: 4 / 5;
  background-size: cover; background-position: center;
}

/* the transform animation renders broken on iOS Safari; the script turns
   these into native scrollers there instead. */
@media (max-width: 680px) {
  .marquee { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .marquee::-webkit-scrollbar { display: none; }
  .track { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .track { animation: none; flex-wrap: wrap; width: auto; gap: var(--s3); }
}

/* ── logo strips: white marks, so they still need a dark chip ─────── */
.logos img, .track img {
  height: 22px; width: auto; max-width: none;
  flex: 0 0 auto; min-width: 0;   /* never let flex squash the aspect ratio */
  object-fit: contain; opacity: 0.86;
  background: var(--ink); border: 0;
  border-radius: 8px; padding: 9px 13px; box-sizing: content-box;
}

/* the bridge line is emphasis, not a card */
.bridge {
  max-width: 52ch; margin-top: var(--s4);
  padding-left: var(--s3); border-left: 1px solid var(--hair);
  color: var(--ink-2); font-size: var(--t-body);
}
.bridge b { font-weight: 600; color: var(--ink); }

/* ── testimonial ──────────────────────────────────────────────────── */
.testimonial .quote-reveal {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3.4vw, 40px); line-height: 1.3;
  letter-spacing: -0.015em; color: var(--cream);
  max-width: 26ch; margin-inline: auto; text-align: center;
  opacity: 1 !important; transform: none !important;
}
.testimonial .attr {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s2); margin-top: var(--s4);
}
.testimonial .attr .mono {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink-deep); border: 1px solid var(--hair-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; overflow: hidden; flex: 0 0 auto; color: var(--cream);
}
.testimonial .attr .mono img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.testimonial .who { display: flex; flex-direction: column; text-align: left; }
.testimonial .nm { font-weight: 500; color: var(--cream); }
.testimonial .ti { font-size: var(--t-small); color: var(--on-dark-2); }

/* ── grids ────────────────────────────────────────────────────────── */
.grid, .trio, .layers, .loop-steps, .orders .grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3);
}
.loop-card, .layer, .intel, .callout { padding: var(--s4) var(--s3); }
.ls-n, .lc-h { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.ls-t { font-family: var(--serif); font-size: var(--t-h3); font-weight: 400; letter-spacing: -0.015em; margin: var(--s1) 0; }

/* ── calls to action ──────────────────────────────────────────────── */
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; background: transparent; color: var(--ink);
  font-weight: 500; text-decoration: none; padding: 13px 28px;
  border: 1px solid var(--ink); border-radius: 999px;
  transition: background .3s ease, color .3s ease;
}
.btn:hover { background: var(--ink); color: var(--cream); }

/* ── footer ───────────────────────────────────────────────────────── */
footer {
  background: var(--cream); padding: var(--s6) 0;
  border-top: 1px solid var(--hair);
}
footer .wrap {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
  align-items: center; justify-content: space-between;
  font-size: var(--t-small); color: var(--ink-2);
}
footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; border-bottom: 1px solid var(--hair); }

/* nothing animates itself into invisibility on these pages */
.mo, .quote-reveal { opacity: 1 !important; transform: none !important; }

@media (min-width: 760px) {
  .stats .grid, .stats > .wrap > .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
  .grid, .trio, .layers, .loop-steps, .orders .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pain, .lc-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
  .loop-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── embeds outside .frame, and the badge that shares the .live name ── */
.ba-visual, .proof-shot .frame, .product .frame {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
}
/* the page's own script sizes these to their natural width and scales them
   down with a transform. It needs a positioned, clipped box with a top-left
   origin, which is what the old stylesheet provided. */
[data-embed] { position: relative; overflow: hidden; display: block; width: 100%; }
[data-embed] > iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }

/* .live inside a layer card is a status badge, not an embed */
.layer .live, .lc-p .live {
  display: block; margin-top: var(--s2); padding: var(--s2);
  background: var(--cream-2); border: 1px solid var(--hair);
  border-radius: 8px; font-size: 13px; color: var(--ink-2);
}
.layer .live b, .lc-p .live b { font-weight: 600; color: var(--ink); }

/* remaining blocks that had no home */
.econ, .changed .c, .ba .col, .trio .t, .orders > div {
  background: var(--paper); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: var(--s4) var(--s3);
}

/* prose rhythm: p has no margin by default, so headings and stacked
   paragraphs collided into each other */
section p + p, .vision p + p { margin-top: var(--s3); }
section h1 + p, section h2 + p, section h3 + p { margin-top: var(--s3); }
.eyebrow + h2, .eyebrow + h1 { display: block; margin-top: var(--s2); }
.vision p, .intel p, section > .wrap > p { max-width: 58ch; }
.vision p b, .intel p b { font-weight: 600; color: var(--ink); }

/* .closer is the last line of the argument, so it lands as one */
p.closer {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(22px, 2.8vw, 30px); line-height: 1.26;
  letter-spacing: -0.015em; color: var(--ink); max-width: 30ch;
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--hair);
}
.econ { margin-top: var(--s4); }
.econ .big { font-family: var(--serif); font-size: var(--t-h3); font-weight: 400; letter-spacing: -0.015em; }
.econ p { margin-top: var(--s2); color: var(--ink-2); }
.layer h3 { margin-bottom: var(--s2); }

/* the old dark theme left inline colour on a few nodes */
[style*="--text-on-dark"], [style*="text-on-dark"] { color: var(--ink) !important; }

/* ── mobile QA fixes ───────────────────────────────────────────────── */
/* long urls must wrap rather than push the page sideways */
.url, .te-url, .o-e { overflow-wrap: anywhere; word-break: break-word; }

/* every standalone link is a real tap target */
.cta a, .btn, footer a, .back, .nav-logo, .lc-list a, .closer a { min-height: 44px; }
.cta a:not(.btn) { display: inline-flex; align-items: center; }

/* the stats footnote was 10px */
.stats p, .stats .wrap > p { font-size: 13px !important; }

/* ── figures pulled out of paragraphs ──────────────────────────────── */
.figrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: var(--s5); }
.figrow .fig { border-top: 1px solid var(--hair); padding: var(--s3) 0; }
.intel .figrow .fig { border-top-color: var(--hair); }
.figrow .fig b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.5vw, 62px); letter-spacing: -0.02em; line-height: 1; color: var(--ink);
}
.figrow .fig span {
  display: block; font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: var(--s2);
}

/* ── the artifacts get to be moments, not thumbnails ───────────────── */
.bleed { margin: 0; padding: var(--s6) 0; background: var(--ink); }
.bleed img {
  display: block; width: min(1240px, calc(100% - var(--gutter) * 2));
  height: auto; margin-inline: auto; border-radius: var(--radius);
}
.bleed figcaption {
  width: min(1240px, calc(100% - var(--gutter) * 2)); margin: var(--s3) auto 0;
  font-family: var(--sans); font-size: var(--t-small); color: var(--on-dark-2);
}

@media (min-width: 760px) {
  .figrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
}

/* ── the stack: one line each, no cards, nothing to decode ─────────── */
.stack { margin-top: var(--s5); }
.s-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); padding: var(--s3) 0; border-top: 1px solid var(--hair); }
.s-row:last-child { border-bottom: 1px solid var(--hair); }
.s-row h3 { font-family: var(--serif); font-weight: 400; font-size: var(--t-h3); letter-spacing: -0.015em; }
.s-row p { color: var(--ink-2); max-width: 62ch; }
@media (min-width: 760px) {
  .s-row { grid-template-columns: 200px minmax(0, 1fr); gap: var(--s4); align-items: baseline; }
}
