/* ============================================================
   CASE STUDIES PAGE (/case-studies/)
   Builds on main.css tokens. Each case sets --accent / --accent-soft
   inline in the client's own brand colour, the same way the reports do.

   Scroll animations are armed by case-studies.js on the visitor's first
   scroll (it adds .cs-anim to <html>). Crawlers never scroll, so they
   never see a hidden state and every line of copy stays visible text.
   ============================================================ */

.cs {
  --cs-navy:      #0B1020;
  --cs-navy-2:    #151b35;
  --cs-lilac:     #b9a6ff;
  --cs-blue:      #2F6BFF;
  --cs-ok:        #1f8a52;
  --cs-ok-soft:   #e6f4ec;
  --cs-bad:       #d64545;
  --cs-warn:      #b86e00;
  --cs-warn-soft: #fdf2e1;
  --cs-sticky:    calc(var(--navbar-height) + 58px);
}

.cs [data-chapter],
.cs .cs-divider { scroll-margin-top: var(--cs-sticky); }

/* ---------- Scroll animation (armed on first scroll) ---------- */
[data-anim] {
  transition: opacity 0.7s ease, translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}
.cs-anim [data-anim]:not(.is-in) {
  opacity: 0;
  translate: 0 28px;
}

/* ============================================================
   1. HERO
   ============================================================ */
.cs-hero {
  position: relative;
  background:
    radial-gradient(55% 70% at 85% 25%, rgba(108, 59, 255, 0.38), transparent 62%),
    radial-gradient(45% 55% at 5% 100%, rgba(47, 107, 255, 0.2), transparent 70%),
    var(--cs-navy);
  color: #fff;
  padding: calc(var(--navbar-height) + var(--space-12)) 0 var(--space-12);
  overflow: hidden;
}
.cs-hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  align-items: center;
}
.cs-hero__crumbs a,
.cs-hero__crumbs [aria-current="page"] { color: rgba(255, 255, 255, 0.72); }
.cs-hero__crumbs a:hover { color: #fff; }

.cs-kicker {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-lilac);
  border: 1px solid rgba(185, 166, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.85rem;
  margin-bottom: var(--space-5);
}
.cs-hero__title {
  color: #fff;
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-5);
}
.cs-hero__hl {
  background: linear-gradient(90deg, var(--cs-lilac), var(--color-purple) 55%, var(--cs-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cs-hero__lede {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.78);
  max-width: 34rem;
  margin-bottom: var(--space-8);
}
.cs-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cs-btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.cs-btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Fanned stack of real report covers */
.cs-stack {
  --k: 1;
  --w: 200px;
  position: relative;
  height: 420px;
}
.cs-stack__page {
  --x: 0; --y: 0; --r: 0;
  position: absolute;
  left: calc(50% - var(--w) / 2);
  top: calc(50% - var(--w) * 0.7);
  width: var(--w);
  height: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  rotate: calc(var(--i) * 1.5deg - 3deg);
  transition: translate 1.1s cubic-bezier(0.2, 0.8, 0.2, 1), rotate 1.1s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.3s ease;
}
.cs-stack__page:nth-child(1) { --x: -130; --y: 34; --r: -14; z-index: 1; }
.cs-stack__page:nth-child(2) { --x:  130; --y: 34; --r:  14; z-index: 1; }
.cs-stack__page:nth-child(3) { --x:  -66; --y: 12; --r:  -7; z-index: 2; }
.cs-stack__page:nth-child(4) { --x:   66; --y: 12; --r:   7; z-index: 2; }
.cs-stack__page:nth-child(5) { --x:    0; --y: -6; --r:   0; z-index: 3; }
.cs-stack.is-fanned .cs-stack__page {
  translate: calc(var(--x) * var(--k) * 1px) calc(var(--y) * var(--k) * 1px);
  rotate: calc(var(--r) * 1deg);
}
.cs-stack.is-fanned .cs-stack__page:hover { scale: 1.06; z-index: 5; }

.cs-tally {
  list-style: none;
  margin: var(--space-12) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.cs-tally li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.cs-tally strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-2);
}
.cs-tally span { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.7); }

/* ============================================================
   2. CHAPTER BAR (sticky) + reading progress
   ============================================================ */
.cs-chapters {
  position: sticky;
  top: var(--navbar-height);
  z-index: 900;
  background: rgba(250, 250, 250, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.cs-chapters__track {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.55rem max(var(--space-6), calc((100vw - var(--container-max)) / 2 + var(--space-6)));
}
.cs-chapters__track::-webkit-scrollbar { display: none; }
.cs-chapters a {
  flex: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.cs-chapters a:hover { color: var(--color-dark); background: var(--color-border-light); }
.cs-chapters a.is-active { background: var(--color-purple); color: #fff; }
.cs-chapters__group {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-purple);
  margin-left: var(--space-3);
  padding-left: var(--space-3);
  border-left: 1px solid var(--color-border);
}
.cs-chapters__progress { height: 3px; }
.cs-chapters__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-purple), var(--cs-blue));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

/* ============================================================
   3. HOW I WORK
   ============================================================ */
.cs-process { background: var(--color-white); }
.cs-intro {
  max-width: 46rem;
  color: var(--color-muted);
  font-size: var(--text-lg);
  margin-bottom: var(--space-12);
}
.cs-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-5);
  position: relative;
}
.cs-steps::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 21px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-purple), var(--cs-blue));
  transform-origin: left;
  transition: transform 1.6s ease;
}
.cs-anim .cs-steps:not(.is-in)::before { transform: scaleX(0); }
.cs-step:nth-child(1) { --d: 0; }
.cs-step:nth-child(2) { --d: 1; }
.cs-step:nth-child(3) { --d: 2; }
.cs-step:nth-child(4) { --d: 3; }
.cs-step:nth-child(5) { --d: 4; }
.cs-step__n {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-purple);
  border: 2px solid var(--color-purple);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  margin-bottom: var(--space-4);
  transition: background 0.4s ease, color 0.4s ease, scale 0.4s ease;
  transition-delay: calc(var(--d) * 0.3s);
}
.cs-anim .cs-steps:not(.is-in) .cs-step__n { background: var(--color-white); color: var(--color-purple); scale: 0.85; }
.cs-step h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.cs-step p { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }

/* ============================================================
   4. SECTION DIVIDERS
   ============================================================ */
.cs-divider {
  background: var(--cs-navy);
  color: #fff;
  padding: var(--space-16) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}
.cs-divider__label {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.cs-divider p { color: rgba(255, 255, 255, 0.72); max-width: 40rem; margin: var(--space-4) 0 0; font-size: var(--text-lg); }

/* ============================================================
   5. A CASE
   ============================================================ */
.cs-case {
  --card-bg: var(--color-white);
  padding: var(--space-20) 0;
  border-bottom: 1px solid var(--color-border);
}
.cs-case:nth-of-type(even) { background: var(--color-white); --card-bg: var(--color-bg); }

.cs-case__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
}
.cs-case__num {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent, var(--color-purple));
}
.cs-case__client {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.cs-case__meta { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }

.cs-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
}
.cs-status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cs-status--done  { background: var(--cs-ok-soft);   color: var(--cs-ok); }
.cs-status--wip   { background: var(--cs-warn-soft); color: var(--cs-warn); }
.cs-status--audit { background: #ecebff;              color: #4b2fd6; }
.cs-status--live  { background: var(--color-purple-light); color: var(--color-purple); }
.cs-status--live i { animation: cs-pulse 1.4s ease-in-out infinite; }

.cs-case__title {
  font-size: clamp(1.9rem, 4.2vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 920px;
  margin-bottom: var(--space-6);
}
.cs-case__title span { color: var(--accent, var(--color-purple)); }
.cs-case__lede {
  font-size: var(--text-lg);
  color: #3d3d3d;
  max-width: 46rem;
  margin-bottom: var(--space-10);
}

/* At a glance */
.cs-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.cs-glance > div {
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.cs-glance h3 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.cs-glance p { margin: 0; font-size: 0.95rem; color: #333; }

/* Before -> after numbers */
.cs-deltas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.cs-deltas li {
  background: var(--cs-navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.6rem;
}
.cs-deltas__from {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
}
.cs-deltas__from::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.5);
}
.cs-deltas__to {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}
.cs-deltas__label {
  flex-basis: 100%;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--space-3);
}

/* Numbered parts of a case study */
.cs-part { margin-top: var(--space-16); }
.cs-part__h {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
}
.cs-part__h span {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
}

.cs-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-10);
  align-items: start;
}
.cs-split--even { grid-template-columns: 1fr 1fr; }
.cs-split > * { min-width: 0; }

.cs-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.cs-findings li {
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-4) 3.1rem;
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}
.cs-findings li::before {
  content: "\2715";
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.cs-ranks {
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.cs-ranks__cap {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}
.cs-ranks table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cs-ranks th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.cs-ranks th,
.cs-ranks td { padding: 0.5rem 0; border-bottom: 1px solid var(--color-border-light); }
.cs-ranks th:last-child,
.cs-ranks td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.cs-ranks--wrap td:last-child { white-space: normal; }
.cs-ranks .is-good { color: var(--cs-ok); }
.cs-ranks .is-bad  { color: var(--cs-bad); font-weight: 600; }
.cs-ranks__note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-4) 0 0; }

.cs-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  border-left: 2px dashed var(--accent);
  display: grid;
  gap: var(--space-6);
  max-width: 50rem;
}
.cs-timeline li { position: relative; }
.cs-timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 8px);
  top: 0.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.cs-timeline b { font-family: var(--font-heading); font-size: var(--text-lg); }
.cs-timeline p { margin: 0.25rem 0 0; color: #333; }

/* ---------- Before / after card ---------- */
.cs-hint { color: var(--color-muted); font-size: var(--text-sm); margin: calc(var(--space-3) * -1) 0 var(--space-5); }
.cs-ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-10);
}
.ba {
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ba--wide { grid-column: 1 / -1; }
.ba__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.65rem 0.8rem 0.65rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
}
.ba__title { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; }
.ba__switch {
  display: inline-flex;
  flex: none;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  padding: 3px;
}
html:not(.js) .ba__switch { display: none; }
.ba__switch button {
  border: 0;
  background: transparent;
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.ba__switch button[data-show="before"][aria-pressed="true"] { background: var(--cs-bad); color: #fff; }
.ba__switch button[data-show="after"][aria-pressed="true"]  { background: var(--cs-ok);  color: #fff; }
.ba__switch button:focus-visible { outline: 2px solid var(--color-purple); outline-offset: 2px; }

.ba__stage {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  background: #f4f4f7;
}
.ba__pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  transition: opacity 0.45s ease, scale 0.45s ease, visibility 0s;
}
.js .ba__pane { grid-area: 1 / 1; }
.js .ba__stage[data-state="before"] .ba__pane--after,
.js .ba__stage[data-state="after"] .ba__pane--before {
  opacity: 0;
  scale: 0.98;
  visibility: hidden;
  transition: opacity 0.45s ease, scale 0.45s ease, visibility 0s 0.45s;
}
/* Screenshots never upscale past their real size, so small crops stay sharp */
.ba__pane img {
  width: auto;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
}
.ba--wide .ba__pane img { max-height: 460px; }
.ba__pane p { align-self: stretch; margin: 0; font-size: var(--text-sm); color: #444; }
.ba--wide .ba__pane p { text-align: center; }
.ba__pane--before p::before { content: "Before: "; color: var(--cs-bad); font-weight: 700; }
.ba__pane--after  p::before { content: "After: ";  color: var(--cs-ok);  font-weight: 700; }
.ba__empty {
  flex: 1;
  align-self: stretch;
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  border: 2px dashed #e7b4b4;
  background: #fdf1f1;
  color: #b32d2d;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  padding: var(--space-6);
}
.ba__empty::before {
  content: "";
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  border: 4px solid currentColor;
  background: linear-gradient(135deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%);
  opacity: 0.55;
}
.ba__empty small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

/* ---------- Honest results + next ---------- */
.cs-honest { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.cs-honest p {
  margin: 0;
  background: var(--cs-warn-soft);
  border-left: 4px solid var(--cs-warn);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5);
  font-size: 0.95rem;
}
.cs-next {
  margin-top: var(--space-6);
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.cs-next h4 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.cs-next ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cs-next li {
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.95rem;
  font-size: var(--text-sm);
  font-weight: 500;
}
.cs-next li::before { content: "\25CB\00a0"; color: var(--accent); font-weight: 700; }

/* ---------- Report pages: full-bleed horizontal shelf ---------- */
.cs-pages {
  list-style: none;
  --edge: max(var(--space-6), calc((100vw - var(--container-max)) / 2 + var(--space-6)));
  margin: var(--space-6) calc(50% - 50vw) 0;
  padding: var(--space-3) var(--edge) var(--space-5);
  scroll-padding-inline: var(--edge);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 196px;
  gap: var(--space-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.cs-pages li { scroll-snap-align: start; }
.cs-pages a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(17, 17, 17, 0.1);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: zoom-in;
}
.cs-pages a:hover,
.cs-pages a:focus-visible {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 20px 40px rgba(17, 17, 17, 0.18);
}
.cs-pages img { display: block; width: 100%; height: auto; }
.cs-pages span {
  display: block;
  margin-top: 0.6rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.cs-links { margin: var(--space-2) 0 0; }
.cs-links a { font-weight: 600; color: var(--accent); border-bottom: 2px solid currentColor; }

/* ---------- Audit cards ---------- */
.cs-facts {
  list-style: none;
  margin: 0 0 var(--space-10);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.cs-facts li {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.cs-facts li::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.cs-facts strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.cs-facts span { font-size: var(--text-sm); color: #444; }

.cs-built h3,
.cs-selfaudit h3 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.cs-built ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.cs-built li { position: relative; padding-left: 1.75rem; }
.cs-built li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--cs-ok); font-weight: 800; }

.cs-selfaudit {
  background: var(--cs-navy);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.cs-selfaudit h3 { color: #fff; }
.cs-selfaudit p { color: rgba(255, 255, 255, 0.75); margin: 0; }
.cs-minis {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.cs-minis li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.cs-minis strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}
.cs-minis span { font-size: 13px; color: rgba(255, 255, 255, 0.7); }

.cs-stand {
  margin: var(--space-10) 0 var(--space-4);
  padding: var(--space-5) var(--space-6);
  max-width: 52rem;
  background: var(--accent-soft, var(--color-purple-light));
  border-left: 4px solid var(--accent, var(--color-purple));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95rem;
}

/* Booking journey */
.cs-journey__cap { font-family: var(--font-heading); font-weight: 700; margin-bottom: var(--space-4); }
.cs-journey ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  counter-reset: j;
}
.cs-journey li {
  counter-increment: j;
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--st);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.cs-journey li b { display: block; font-family: var(--font-heading); }
.cs-journey li b::before { content: counter(j) "\00a0\00b7\00a0"; color: var(--color-muted); }
.cs-journey em {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st);
  margin: 0.25rem 0 0.5rem;
}
.cs-journey span { display: block; font-size: 13px; color: #444; }
.cs-journey .is-broken  { --st: var(--cs-bad); }
.cs-journey .is-partial { --st: #c77700; }
.cs-journey .is-strong  { --st: var(--cs-ok); }
.cs-journey__note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-3) 0 0; }

/* Brand search results + Google profile panel (The Nest) */
.cs-nest-clues { margin-bottom: var(--space-10); }
.cs-serp,
.cs-gcard,
.cs-feed {
  background: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.cs-serp__cap {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}
.cs-serp__q {
  margin: 0 0 var(--space-4);
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  border: 1px solid #dfe1e5;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") no-repeat 0.95rem 50% / 16px;
  font-weight: 500;
}
.cs-serp ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  counter-reset: s;
}
.cs-serp li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 1.4rem 7.5rem 1fr auto;
  align-items: center;
  gap: 0.15rem 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: opacity 0.45s ease, translate 0.45s ease;
  transition-delay: calc(var(--i, 0) * 70ms + 0.25s);
}
.cs-anim .cs-serp:not(.is-in) li { opacity: 0; translate: -10px 0; }
.cs-serp li::before { content: counter(s); font-size: 12px; font-weight: 600; color: var(--color-muted); }
.cs-serp li b { font-size: 13px; font-weight: 600; color: #555; }
.cs-serp li span { min-width: 0; color: #777; }
.cs-serp li em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-muted);
}
.cs-serp li.is-ours { background: var(--cs-ok-soft); }
.cs-serp li.is-ours span { color: #1d1d1d; font-weight: 600; }
.cs-serp li.is-ours em { color: var(--cs-ok); }
.cs-serp__note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-4) 0 0; }

.cs-gcard__panel {
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  color: #4d5156;
  font-size: 0.9rem;
}
.cs-gcard__panel p { margin: 0 0 0.35rem; }
.cs-gcard__panel p:last-child { margin: 0; }
.cs-gcard__name { font-size: 1.5rem; color: #1f1f1f; }
.cs-gcard__rating span { color: #fbbc04; letter-spacing: 1px; }
.cs-gcard__hours .is-open { color: #188038; font-weight: 600; }
.cs-gcard mark {
  display: inline-block;
  white-space: nowrap;
  padding: 0 0.3rem;
  background: transparent;
  color: inherit;
  border: 2px solid var(--cs-bad);
  border-radius: 6px;
  transition: border-color 0.4s ease 0.7s;
}
.cs-anim .cs-gcard:not(.is-in) mark { border-color: transparent; }
.cs-gcard__notes {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.cs-gcard__notes li {
  padding: 0.3rem 0.8rem;
  background: #fdecec;
  color: #a32727;
  border-radius: 999px;
  font-size: 13px;
}
.cs-gcard > p:not(.cs-serp__cap) { font-size: 0.95rem; color: #333; margin: 0 0 var(--space-3); }
.cs-gcard > p:last-child { margin: 0; }

/* What a visitor sees vs what the server sends (Trevio) */
.cs-views { margin-bottom: var(--space-10); }
.cs-views__pane { margin: 0; }
.cs-views__pane img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.cs-views__note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-3) 0 0; }
.cs-term__body .dim { color: #8b949e; }
.cs-term__body .bad { color: #f85149; }

/* Instagram feed breakdown (Trevio) */
.cs-feed__grid {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.cs-feed__grid li {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: opacity 0.4s ease, scale 0.4s ease;
  transition-delay: calc(var(--i, 0) * 60ms + 0.2s);
}
.cs-anim .cs-feed:not(.is-in) .cs-feed__grid li { opacity: 0; scale: 0.85; }
.cs-feed__grid b { font-size: 11px; line-height: 1.2; font-weight: 700; hyphens: manual; }
.cs-feed__grid span { font-size: 10px; opacity: 0.75; }
.cs-feed__grid .is-greet { background: #eceef2; color: #555; }
.cs-feed__grid .is-dest { background: linear-gradient(160deg, #10a0ac, var(--accent)); color: #fff; }
.cs-feed__key {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: #444;
}
.cs-feed__key li { display: flex; align-items: baseline; gap: 0.5rem; }
.cs-feed__key b {
  min-width: 1.6rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cs-bad);
}
.cs-feed__key .is-greet b { color: #6b7280; }
.cs-feed__key .is-dest b { color: var(--accent); }

/* ============================================================
   6. INSIDE A REPORT
   ============================================================ */
.cs-anatomy { background: var(--cs-navy); color: #fff; }
.cs-anatomy .eyebrow,
.cs-anatomy .highlight { color: var(--cs-lilac); }
.cs-anatomy .section-heading { color: #fff; }
.cs-anatomy .cs-intro { color: rgba(255, 255, 255, 0.72); }
.cs-anatomy__grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) 1fr;
  gap: var(--space-12);
  align-items: start;
}
.cs-anatomy__page {
  position: relative;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
@media (min-height: 820px) and (min-width: 1025px) {
  .cs-anatomy__page { position: sticky; top: calc(var(--cs-sticky) + var(--space-4)); }
}
.cs-anatomy__page img { display: block; width: 100%; height: auto; border-radius: 8px; }
.cs-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  font: 800 13px/30px var(--font-heading);
  text-align: center;
  translate: -50% -50%;
  box-shadow: 0 0 0 4px rgba(108, 59, 255, 0.3);
  transition: scale 0.45s cubic-bezier(0.3, 1.6, 0.5, 1), background var(--transition-fast), box-shadow var(--transition-fast);
}
.cs-pin:nth-of-type(2) { transition-delay: 0.1s; }
.cs-pin:nth-of-type(3) { transition-delay: 0.2s; }
.cs-pin:nth-of-type(4) { transition-delay: 0.3s; }
.cs-pin:nth-of-type(5) { transition-delay: 0.4s; }
.cs-pin:nth-of-type(6) { transition-delay: 0.5s; }
.cs-pin:nth-of-type(7) { transition-delay: 0.6s; }
.cs-anim .cs-anatomy__page:not(.is-in) .cs-pin { scale: 0; }
.cs-pin.is-active {
  background: #ff8a2a;
  box-shadow: 0 0 0 8px rgba(255, 138, 42, 0.35);
  scale: 1.25;
  transition-delay: 0s;
}
.cs-anatomy__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.cs-anatomy__list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--transition-base), border-color var(--transition-base), translate var(--transition-base);
}
.cs-anatomy__list li.is-active {
  background: rgba(108, 59, 255, 0.2);
  border-color: rgba(185, 166, 255, 0.5);
  translate: 6px 0;
}
.cs-anatomy__list b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-purple);
  font-family: var(--font-heading);
}
.cs-anatomy__list li.is-active b { background: #ff8a2a; }
.cs-anatomy__list h3 { color: #fff; font-size: var(--text-lg); margin-bottom: 0.2rem; }
.cs-anatomy__list p { margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; }

/* ============================================================
   7. IN PROGRESS (terminal)
   ============================================================ */
.cs-case--wip { background: linear-gradient(180deg, var(--color-bg), #f1edff); }
.cs-term {
  background: #0d1117;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.cs-term__bar { display: flex; align-items: center; gap: 6px; padding: 0.7rem 0.9rem; background: #161b22; }
.cs-term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.cs-term__bar i:nth-child(2) { background: #febc2e; }
.cs-term__bar i:nth-child(3) { background: #28c840; }
.cs-term__bar span { margin-left: 0.6rem; color: #8b949e; font-size: 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.cs-term__body {
  margin: 0;
  padding: 1.1rem 1.2rem 1.4rem;
  color: #c9d1d9;
  font: 13.5px/1.8 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cs-term__body .ok  { color: #3fb950; }
.cs-term__body .run { color: #d29922; }
.cs-term__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -3px;
  background: #c9d1d9;
  animation: cs-blink 1s steps(1) infinite;
}
.cs-anim [data-typed]:not(.is-done) > span:not(.cs-term__cursor):not(.is-shown) { opacity: 0; }

/* ============================================================
   8. RULES
   ============================================================ */
.cs-rules { background: var(--color-white); }
.cs-rules__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.cs-rules__grid li { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); }
.cs-rules__grid h3 { display: flex; align-items: center; gap: 0.6rem; font-size: var(--text-xl); margin-bottom: var(--space-2); }
.cs-rules__grid h3::before {
  content: "\2715";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fdecec;
  color: var(--cs-bad);
  font-size: 12px;
}
.cs-rules__grid p { margin: 0; color: var(--color-muted); }

/* ============================================================
   9. REPORT PAGE VIEWER
   ============================================================ */
.cs-lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: transparent;
}
.cs-lightbox::backdrop { background: rgba(8, 10, 20, 0.9); }
.cs-lightbox__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.5rem 4.5rem 1.5rem;
}
.cs-lightbox img {
  width: auto;
  height: auto;
  max-width: min(100%, 900px);
  max-height: calc(100vh - 7.5rem);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.cs-lightbox__cap { margin: 0; max-width: 46rem; color: #fff; font-size: var(--text-sm); text-align: center; }
.cs-lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.cs-lightbox__btn:hover { background: rgba(255, 255, 255, 0.18); }
.cs-lightbox__close { top: 1rem; right: 1rem; }
.cs-lightbox__prev,
.cs-lightbox__next { top: 50%; translate: 0 -50%; }
.cs-lightbox__prev { left: 1rem; }
.cs-lightbox__next { right: 1rem; }

/* ============================================================
   10. MOTION
   ============================================================ */
@keyframes cs-pulse { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: 0.4; scale: 1.5; } }
@keyframes cs-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cs *,
  .cs *::before { transition: none !important; animation: none !important; }
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cs-hero__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .cs-stack { --k: 0.7; --w: 150px; height: 300px; }
  .cs-tally { grid-template-columns: repeat(2, 1fr); }

  .cs-steps { grid-template-columns: 1fr; gap: var(--space-6); padding-left: 0; }
  .cs-steps::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto; transform-origin: top; background: linear-gradient(180deg, var(--color-purple), var(--cs-blue)); }
  .cs-anim .cs-steps:not(.is-in)::before { transform: scaleY(0); }
  .cs-step { display: grid; grid-template-columns: 44px 1fr; column-gap: var(--space-4); }
  .cs-step__n { grid-row: span 2; margin-bottom: 0; }

  .cs-glance,
  .cs-split,
  .cs-split--even,
  .cs-honest,
  .cs-ba-grid,
  .cs-rules__grid { grid-template-columns: 1fr; }
  .cs-deltas,
  .cs-facts { grid-template-columns: repeat(2, 1fr); }
  .cs-journey ol { grid-template-columns: 1fr; }
  .cs-anatomy__grid { grid-template-columns: 1fr; }
  .cs-anatomy__page { max-width: 460px; margin-inline: auto; width: 100%; }
}

@media (max-width: 640px) {
  .cs-case { padding: var(--space-16) 0; }
  .cs-case__head { gap: var(--space-2) var(--space-4); }
  .cs-status { margin-left: 0; }
  .cs-deltas__to { font-size: 2.4rem; }
  .cs-deltas li,
  .cs-facts li { padding: var(--space-5); }
  .ba__bar { flex-wrap: wrap; }
  .cs-pages { grid-auto-columns: 160px; }
  .cs-serp,
  .cs-gcard,
  .cs-feed { padding: var(--space-5); }
  .cs-serp li { grid-template-columns: 1.25rem 1fr auto; }
  .cs-serp li::before { grid-area: 1 / 1; }
  .cs-serp li b { grid-area: 1 / 2; }
  .cs-serp li em { grid-area: 1 / 3; }
  .cs-serp li span { grid-area: 2 / 2 / 3 / 4; }
  .cs-feed__grid { grid-template-columns: repeat(4, 1fr); }
  .cs-lightbox__inner { padding: 3.5rem 0.75rem 5rem; }
  .cs-lightbox__prev,
  .cs-lightbox__next { top: auto; bottom: 1rem; translate: none; }
  .cs-lightbox__prev { left: calc(50% - 60px); }
  .cs-lightbox__next { right: calc(50% - 60px); }
}

@media (max-width: 420px) {
  .cs-deltas,
  .cs-facts,
  .cs-minis { grid-template-columns: 1fr; }
}
