/*
  Case study template (vertical scroll). Loaded after css/styles.css, which
  supplies the color tokens, nav, buttons, labels, footer and view transitions.

  Each page sets its project color in a small <style> block:
    --accent              the project color (art inside visual panels)
    --accent-label-light  accent at 4.5:1 on the light ground (mono labels)
    --accent-label-dark   accent at 4.5:1 on the dark ground (mono labels)
  Everything else follows the shared tokens.
*/

:root { --accent-label: var(--accent-label-light); }
@media (prefers-color-scheme: dark) {
  :root { --accent-label: var(--accent-label-dark); }
}

.nav-pill a[aria-current="true"] { color: var(--accent-ui); }

button:focus-visible {
  outline: 2px solid var(--heading);
  outline-offset: 3px;
}

/* ===== READING PROGRESS ===== */
/* Fixed to the top edge, above the sticky nav, whose pill starts 28px lower, so nothing is covered. */
.cs-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}
.cs-progress-bar {
  height: 100%;
  background: var(--accent-label);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ===== TITLE BLOCK ===== */
.cs-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 44px;
}
.cs-cat {
  margin-top: 20px;
  color: var(--accent-label);
}
.cs-title h1 {
  margin-top: 8px;
  font-size: 52px;
  line-height: 60px;
  letter-spacing: -0.01em;
}
.cs-outcome {
  margin-top: 12px;
  font-size: 20px;
  line-height: 30px;
  max-width: 34em;
}

/* ===== VISUAL PANELS ===== */
/* Same neutral grey panel as the home rows (mr-march.com): dark-on-light art in
   light mode, light-on-dark in dark. The project color lives only on labels and
   the outlines inside diagrams. */
.cs-visual {
  --v-panel: #F1F2F4;
  --v-text: var(--heading);
  --v-dim: var(--body);
  --v-accent: color-mix(in srgb, var(--accent) 70%, #000); /* accent as text, 4.5:1 on the grey */
  --v-line: rgba(18, 35, 43, 0.18);
  --v-fill: rgba(255, 255, 255, 0.6);
  --v-card: #fff;
  --v-side: rgba(18, 35, 43, 0.06);
  background: var(--v-panel);
  color: var(--v-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-width: 0;
}
@media (prefers-color-scheme: dark) {
  .cs-visual {
    --v-panel: #252527;
    --v-text: var(--heading);
    --v-dim: var(--body);
    --v-accent: color-mix(in srgb, var(--accent-label-dark) 80%, #fff); /* the dark label, lifted: 4.5:1 on --v-fill and the tinted matrix row */
    --v-line: rgba(255, 255, 255, 0.16);
    --v-fill: rgba(255, 255, 255, 0.07);
    --v-card: #2F2F31;
    --v-side: rgba(0, 0, 0, 0.25);
  }
}
.cs-visual .label { color: var(--v-dim); }



.cs-hero {
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* Hero screen (design/mockups/ render): starts inside the top-left and runs
   off the panel's right and bottom edges, like the home rows. Hero only. */
.cs-visual.cs-visual--shot {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
}
.cs-shot {
  position: absolute;
  top: 9%;
  left: 9%;
  width: 150%;
  max-width: none;
  height: auto;
}
.cs-hero.cs-visual--shot { aspect-ratio: 2 / 1; }

/* Whole image: shown uncropped, centered in the panel */
.cs-visual.cs-visual--fit { padding: 32px 7%; } /* about 10% with the picture's own shadow room, as mr-march.com leaves */
.cs-fit { display: block; width: 100%; height: auto; }
/* Case study hero (mr-march.com, Parkit): the screen centered at 79% of the panel's
   width, starting 10% down, running off the bottom edge, on the plain grey panel.
   --hero-from and --hero-to (set per page) now only color the footer band. */
.cs-hero .cs-shot { left: 50%; top: 10%; width: 79%; translate: -50% 0; }

/* Project accent (Norval, 2026-11-17): on a case study page the project's own
   color replaces the site cyan in the buttons, the tab pill and the footer.
   Each page already sets --accent-label-light/-dark and --hero-to. */
:root {
  --btn-bg: var(--accent-label-light);
  --btn-text: #FFFFFF;
  --accent-ui: var(--accent-label-light);
  --footer-bg: color-mix(in srgb, var(--hero-to, var(--accent)) 55%, #0C0C0D);
  --footer-heading: #FFFFFF;
  --footer-body: rgba(255, 255, 255, 0.74);
  --footer-btn: #FFFFFF;
  --footer-btn-text: var(--hero-to, var(--accent-label-light));
}
@media (prefers-color-scheme: dark) {
  :root {
    --btn-bg: var(--accent-label-dark);
    --btn-text: #0C0C0D;
    --accent-ui: var(--accent-label-dark);
    --footer-bg: color-mix(in srgb, var(--hero-to, var(--accent)) 40%, #0C0C0D);
    --footer-btn: var(--accent-label-dark);
    --footer-btn-text: #0C0C0D;
  }
}

/* Frameless screens lift off what is behind them with a soft shadow in both
   modes (no light outline: Norval, 2026-11-17). It follows the image's own shape.
   .cs-flat (a drawing with its own outline) opts out. */
.cs-shot, .cs-fit {
  filter: drop-shadow(0 1px 2px rgba(18, 35, 43, 0.10)) drop-shadow(0 12px 28px rgba(18, 35, 43, 0.13));
}
@media (prefers-color-scheme: dark) {
  .cs-shot, .cs-fit {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
  }
}
.cs-fit.cs-flat { filter: none; }

/* ===== TWO-COLUMN BLOCKS (The problem, Who it was for, Details, What it shows) ===== */
.cs-block {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  padding-top: 44px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--hairline);
}
.cs-block h2 {
  font-size: 32px;
  line-height: 40px;
}
.cs-block p {
  font-size: 20px;
  line-height: 30px;
}
/* Pull quote under a block's paragraph (the user story): a hairline above, a mono caption below. */
.cs-quote {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-strong);
}
.cs-block .cs-quote p {
  font-size: 24px;
  line-height: 1.4;
  color: var(--heading);
}
.cs-quote figcaption {
  display: block;
  margin-top: 12px;
}

/* Retrospective (mr-march.com): a centered head, then two-column blocks, no divider under the last. */
.cs-retro .cs-block:first-of-type { border-top: 1px solid var(--hairline); }
.cs-retro .cs-block:last-child { border-bottom: 0; }

.cs-details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-details li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  font-size: 18px;
  line-height: 27px;
}
.cs-details svg {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  fill: none;
  stroke: var(--heading);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cs-details .label { display: block; }

/* ===== CENTERED SECTION HEADS (Results, How I got there, Chapters) ===== */
.cs-section {
  padding-top: 76px;
}
/* A part heading (How I got there) sits closer to the chapter that follows it. */
.cs-part .cs-head { margin-bottom: 0; }
.cs-part + .cs-section { padding-top: 40px; }
.cs-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.cs-head .label { color: var(--accent-label); margin-bottom: 8px; }
.cs-head h2 {
  font-size: 36px;
  line-height: 44px;
  max-width: 20em;
}
.cs-head p {
  margin-top: 8px;
  font-size: 18px;
  line-height: 27px;
  max-width: 36em;
}

/* ===== RESULTS ===== */
/* Two columns on the page background: one whole image left, the stat cards stacked right */
/* The picture and the stat stack share one height (mr-march.com Highlights):
   the cards split the column evenly, flush with the picture's top and bottom. */
.cs-highlights {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 32px;
}
.cs-stats {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 32px;
}
.cs-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}
.cs-stat-num {
  font-size: 36px;
  line-height: 44px;
  color: var(--heading);
}
.cs-stat-cap { margin-top: 4px; }
/* Stat cards sit on the same neutral grey as the panels */
.cs-stat { background: #F1F2F4; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .cs-stat { background: #252527; }
}

/* Big figure inside a visual panel */
.cs-figure-num {
  font-size: 72px;
  line-height: 76px;
  letter-spacing: -0.02em;
  color: var(--v-accent);
}
.cs-figure-cap {
  margin-top: 4px;
  font-size: 18px;
  line-height: 27px;
  color: var(--v-dim);
}

/* Before/after bars: each bar's width is its share of the longest value (--w, 0 to 100) */
.cs-bars {
  display: grid;
  gap: 20px;
  width: 100%;
}
.cs-bar-row {
  display: grid;
  gap: 8px;
}
.cs-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  line-height: 24px;
}
.cs-bar-track {
  height: 14px;
  border-radius: 7px;
  background: var(--v-fill);
}
.cs-bar-fill {
  width: calc(var(--w) * 1%);
  min-width: 14px;
  height: 100%;
  border-radius: 7px;
  background: var(--v-dim);
}
.cs-bar-fill--accent { background: var(--accent); }

/* ===== CHAPTER TABS ===== */
.cs-tabs {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
}
.js .cs-tabs { display: flex; }
.cs-tab {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--nav-text);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.cs-tab:hover { color: var(--heading); }
.cs-tab[aria-selected="true"] {
  background: var(--btn-bg);
  color: var(--btn-text);
}
/* With the script, one filled pill sits behind the tabs and glides to the chosen one. */
.cs-tabs.has-pill { position: relative; }
.cs-tabs.has-pill .cs-tab { position: relative; z-index: 1; }
.cs-tabs.has-pill .cs-tab[aria-selected="true"] { background: none; }
.cs-tab-pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 100px;
  background: var(--btn-bg);
  transition: transform 450ms cubic-bezier(0.28, 1, 0.7, 1), width 450ms cubic-bezier(0.28, 1, 0.7, 1);
}

/* ===== SPLIT CARD ===== */
.cs-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 368px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}
.cs-card[hidden] { display: none; }
.cs-card + .cs-card { margin-top: 20px; }
.cs-card-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
}
.cs-card-text .label { color: var(--accent-label); }
.cs-card-text h3 {
  margin-top: 8px;
  font-size: 32px;
  line-height: 40px;
}
.cs-card-text p {
  margin-top: 12px;
  font-size: 18px;
  line-height: 27px;
}
.cs-card-text ul {
  margin-top: 12px;
  padding-left: 20px;
  font-size: 18px;
  line-height: 27px;
}
.cs-card-text li + li { margin-top: 4px; }

/* ===== LAYOUT KIT ===== */
/* Six card layouts. Down the page no two neighbors share one.
   split    .cs-card                 text left, whole image right on the accent wash
   wide     .cs-card.cs-card--wide   text row, then one whole image across the width, on the page background
   zoom     .cs-card.cs-card--zoom   text row, then a tight crop band on the accent wash
   pair     .cs-card.cs-card--pair   text row, then two images side by side, on the page background
   diagram  .cs-card.cs-card--flow   text row, then an HTML/CSS diagram across the width on the accent wash
   note     .cs-card.cs-card--note   text row, then a text contrast, no image */
.cs-card--wide, .cs-card--zoom, .cs-card--pair, .cs-card--flow, .cs-card--note {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}
/* Text row: label and heading left, paragraph right */
.cs-card-text--row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  align-items: start;
}
.cs-card-text--row > :last-child { padding-top: 34px; } /* first line level with the heading */
.cs-card-text--row > :last-child > :first-child { margin-top: 0; }

/* Wide and pair sit on the page itself: no card surface */
.cs-card--wide, .cs-card--pair {
  overflow: visible;
  background: none;
  border-color: transparent;
  border-radius: 0;
}
.cs-card--wide .cs-card-text, .cs-card--pair .cs-card-text { padding: 8px 0 32px; }

/* Cushioned panel: a picture outside a split card (wide, pair, Results) sits in an
   accent wash panel and never touches its edges, like the split and zoom panels. */
.cs-visual.cs-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 10.7%;
  border-radius: var(--radius-card);
}
.cs-duo .cs-panel, .cs-highlights .cs-panel { padding: 48px 8%; }
/* Results bleed (mr-march.com, Parkit): a tall page shown large from its top,
   running off the panel's bottom edge; the stat column sets the panel's height. */
.cs-highlights .cs-visual.cs-panel--bleed { position: relative; display: block; padding: 0; overflow: hidden; }
.cs-panel--bleed .cs-fit { position: absolute; top: 44px; left: 50%; translate: -50% 0; width: 88%; }
@media (max-width: 800px) {
  .cs-highlights .cs-visual.cs-panel--bleed { aspect-ratio: 4 / 5; }
  .cs-panel--bleed .cs-fit { top: 24px; width: 88%; }
}

/* Pair: two whole images, each with a mono caption */
.cs-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cs-duo figcaption { margin-top: 12px; }

/* Zoom: the text row comes first, the band under it. The image is scaled up and its focal point (--fx, --fy, 0 to 1 across the image)
   is centered in the band. --zoom is the image width as a multiple of the band width. */
.cs-zoom {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 2;
  padding: 0;
}
.cs-zoom img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--zoom, 1.6) * 100%);
  max-width: none;
  height: auto;
  translate: calc(var(--fx, 0.5) * -100%) calc(var(--fy, 0.5) * -100%);
}

/* Diagram card: the panel spans the card under the text */
.cs-card--flow .cs-visual { padding: 44px; }

/* Note: two statements side by side, a hairline between them */
.cs-contrast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin: 0 44px 44px;
  border-top: 1px solid var(--hairline);
}
.cs-contrast > div { padding: 28px 32px 0 0; }
.cs-contrast > div + div {
  padding-left: 32px;
  padding-right: 0;
  border-left: 1px solid var(--hairline);
}
.cs-contrast .label { color: var(--accent-label); }
.cs-contrast-big {
  margin-top: 8px;
  font-size: 28px;
  line-height: 36px;
  color: var(--heading);
}
.cs-contrast-big + p {
  margin-top: 8px;
  font-size: 18px;
  line-height: 27px;
}

/* ===== TAB FRAME ===== */
/* Inside a tabbed chapter every tab is the same split card (mr-march.com, Parkit
   Discovery): text left, the picture or diagram in the right half, one fixed
   height, so switching tabs never changes the frame. Whatever layout a tab's
   markup names (zoom, diagram, wide, pair, note), it is drawn this way here. */
@media (min-width: 801px) {
  .cs-card[role="tabpanel"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: none;
    height: 480px;
    overflow: hidden;
    background: var(--surface);
    border-color: var(--hairline);
    border-radius: var(--radius-card);
  }
  .cs-card[role="tabpanel"] > .cs-card-text,
  .cs-card[role="tabpanel"] > .cs-card-text--row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 44px;
  }
  .cs-card[role="tabpanel"] .cs-card-text--row > :last-child { padding-top: 0; }
  .cs-card[role="tabpanel"] .cs-card-text--row > :last-child > :first-child { margin-top: 12px; }
  /* The right half: one panel filling the card's height */
  .cs-card[role="tabpanel"] > .cs-visual,
  .cs-card[role="tabpanel"] > .cs-contrast,
  .cs-card[role="tabpanel"] > .cs-duo {
    height: 100%;
    min-height: 0;
    margin: 0;
    border-radius: 0;
  }
  .cs-card[role="tabpanel"] > .cs-visual { padding: 28px 7%; }
  .cs-card[role="tabpanel"] > .cs-visual.cs-zoom { padding: 0; aspect-ratio: auto; }
  .cs-card[role="tabpanel"] .cs-visual img.cs-fit { width: 100%; height: 100%; min-height: 0; max-width: none; object-fit: contain; }
  /* Phones keep their outline and fit the half's height */
  .cs-card[role="tabpanel"] .cs-duo figure { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  .cs-card[role="tabpanel"] .cs-duo figure > :first-child { flex: 1; min-height: 0; }
  /* Diagrams in a half: flows run top to bottom */
  /* They fill the half's padded width, like a picture would (mr-march.com leaves about 10% each side) */
  .cs-card[role="tabpanel"] .cs-flow { max-width: none; }
  .cs-card[role="tabpanel"] .cs-flow--row { flex-direction: column; }
  .cs-card[role="tabpanel"] .cs-flow--row .cs-flow-step { flex: none; }
  .cs-card[role="tabpanel"] .cs-flow--row .cs-flow-arrow { transform: none; }
  .cs-card[role="tabpanel"] .cs-tree-fork { gap: 16px; }
  .cs-card[role="tabpanel"] .cs-flow-step { padding: 14px 18px; font-size: 16px; line-height: 23px; }
  /* Note: the two statements stack in the right half, on the grey panel */
  .cs-card[role="tabpanel"] > .cs-contrast {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    padding: 32px 44px;
    border-top: 0;
    background: #F1F2F4;
  }
  .cs-card[role="tabpanel"] > .cs-contrast > div { padding: 20px 0; }
  .cs-card[role="tabpanel"] > .cs-contrast > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--hairline); }
  /* Pair: the two pictures side by side in the grey half */
  .cs-card[role="tabpanel"] > .cs-duo {
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    gap: 16px;
    padding: 28px 7%; /* the same cushion as every other tab half */
    background: #F1F2F4;
  }
  .cs-card[role="tabpanel"] > .cs-duo .cs-panel { padding: 0; background: none; }
}
@media (min-width: 801px) and (prefers-color-scheme: dark) {
  .cs-card[role="tabpanel"] { border-color: transparent; }
  .cs-card[role="tabpanel"] > .cs-contrast,
  .cs-card[role="tabpanel"] > .cs-duo { background: #252527; }
}


/* ===== SCREENS (Be Sure) ===== */
/* A bare app screen, still or clip, with the phone screen's corner radius and the site's soft shadow. */
.cs-screen {
  width: min(260px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 36px;
  background: #FBF5EC;
  box-shadow: 0 1px 2px rgba(18, 35, 43, 0.10), 0 12px 28px rgba(18, 35, 43, 0.13);
}
.cs-screen img, .cs-screen video { display: block; width: 100%; height: auto; }
.cs-screen video { aspect-ratio: 780 / 1688; }
@media (prefers-color-scheme: dark) {
  .cs-screen { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); }
}
/* Hero with the home row's two phones: centered both ways, both phones whole */
.cs-hero--phones .cs-shot { left: 50%; top: 50%; width: 44%; translate: -50% -50%; filter: none; }


/* ===== MOTION ===== */
/* Scroll reveal: every [data-reveal] block fades and rises 60px as its top edge
   passes 12% above the bottom of the window, once. js/case-study.js adds
   .js-reveal to <html> (never under reduced motion), marks each block .is-in,
   and staggers blocks that start together through --reveal-delay. Without the
   script nothing is hidden. */
:root { --reveal-ease: cubic-bezier(0.28, 1, 0.7, 1); }
/* Only the shown state carries the transition, so hiding lands instantly. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(60px);
}
.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1300ms var(--reveal-ease), transform 1300ms var(--reveal-ease);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Tab change: the selected card's text rises 20px on the same curve, lines 40ms apart. */
.cs-in > * { animation: cs-rise 600ms var(--reveal-ease) both; }
.cs-in > :nth-child(2) { animation-delay: 40ms; }
.cs-in > :nth-child(3) { animation-delay: 80ms; }
.cs-in > :nth-child(n+4) { animation-delay: 120ms; }
@keyframes cs-rise {
  from { opacity: 0; transform: translateY(20px); }
}

/* Picture motion: each [data-motion] plays once, as its block rises in. js/case-study.js
   sets --motion-delay, adds .is-playing to start it and .is-done for one already passed.
   Every motion ends on the still picture, so without the script nothing changes.
   - trace: a diagram starts with nothing highlighted; a light runs down its steps (.is-lit,
            400ms apart, fork branches together), jumps back to the highlighted step if that sits
            higher, and holds there as the still picture. data-motion="still" opts a diagram out.
   - ring:  the Be Sure Clarity ring fills while its number counts to 98
   - clip:  every Be Sure video (.cs-clip) plays, looping, only while on screen; poster only
            under reduced motion and in print */
.cs-flow-step { position: relative; }
.cs-flow-step::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--v-accent);
  border-radius: inherit;
  box-shadow: 0 0 14px -2px var(--v-accent);
  opacity: 0;
  pointer-events: none;
}
.is-lit::after { opacity: 1; }
.cs-flow-step::after { transition: opacity 500ms ease-in-out; }
.cs-flow-step--accent, .cs-flow-step .label { transition: border-color 500ms ease-in-out, color 500ms ease-in-out; }
.cs-flow-arrow { transition: stroke 500ms ease-in-out; }
.cs-flow-arrow.is-lit { stroke: var(--v-accent); }

/* Clarity ring, drawn at the tile image's 446x780 canvas and cropped the way the image is
   (object-fit: cover). --deg is the fill, 353deg for 98. */
.cs-tile { position: relative; }
.cs-ring { position: absolute; inset: 0; container-type: size; pointer-events: none; --deg: 353deg; }
.cs-ring-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100cqw, 100cqh * 446 / 780);
  aspect-ratio: 446 / 780;
  translate: -50% -50%;
  container-type: inline-size;
  --u: calc(100cqw / 446);
}
.cs-ring-track, .cs-ring-knob {
  position: absolute;
  left: calc(var(--u) * 73);
  top: calc(var(--u) * 150);
  width: calc(var(--u) * 300);
  aspect-ratio: 1;
}
.cs-ring-track {
  border-radius: 50%;
  background: rgba(120, 95, 70, 0.14);
  -webkit-mask: radial-gradient(circle, transparent calc(var(--u) * 118), #000 calc(var(--u) * 119));
  mask: radial-gradient(circle, transparent calc(var(--u) * 118), #000 calc(var(--u) * 119));
}
.cs-ring-fill {
  position: absolute;
  inset: 0;
  background: conic-gradient(#F2A96E 0deg, #E8357A var(--deg), #E8357A 360deg);
  -webkit-mask: conic-gradient(#000 var(--deg), transparent 0);
  mask: conic-gradient(#000 var(--deg), transparent 0);
}
.cs-ring-knob { rotate: var(--deg); }
/* Round cap at the start (top) and a white thumb at the end, 0.62x the 32-unit stroke (the brand icon) */
.cs-ring-track::after, .cs-ring-knob::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: calc(var(--u) * 32);
  height: calc(var(--u) * 32);
  margin-left: calc(var(--u) * -16);
  border-radius: 50%;
  background: #F2A96E;
}
.cs-ring-knob::before { background: #E8357A; }
.cs-ring-knob i {
  position: absolute;
  left: 50%;
  top: calc(var(--u) * 6);
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
  margin-left: calc(var(--u) * -10);
  border-radius: 50%;
  background: #fff;
}
.cs-ring-num {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--u) * 250);
  text-align: center;
  font: 700 calc(var(--u) * 88) / 1 'Figtree', sans-serif;
  letter-spacing: -0.02em;
  color: #3D322A;
}

/* ===== DIAGRAMS (inside visual panels) ===== */
/* Flow: boxes joined by arrows */
.cs-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.cs-flow-step {
  padding: 16px 20px;
  border: 1px solid var(--v-line);
  border-radius: 12px;
  background: var(--v-fill);
  font-size: 16px;
  line-height: 24px;
}
.cs-flow-step .label { display: block; }
.cs-flow-step--accent { border-color: var(--accent); }
.cs-flow-step--accent .label { color: var(--v-accent); }
.cs-flow-arrow {
  align-self: center;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--v-dim);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Row flow: the same boxes left to right, filling the width */
.cs-flow--row {
  flex-direction: row;
  max-width: none;
}
.cs-flow--row .cs-flow-step { flex: 1 1 0; }
/* A flow standing in for the Results picture fills its panel the way the picture would */
.cs-highlights .cs-flow { max-width: none; }
.cs-highlights .cs-flow-step { padding: 22px 26px; font-size: 18px; line-height: 27px; }

/* Matrix: rows of items against a few features, scored with dots.
   Full dot has it, half dot partly, ring does not. The lead row is tinted in the project color. */
.cs-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}
.cs-matrix th {
  padding: 0 4px 10px;
  text-align: center;
  vertical-align: bottom;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v-dim);
}
.cs-matrix td {
  padding: 5px 4px;
  border-top: 1px solid var(--v-line);
  text-align: center;
}
.cs-matrix th:first-child, .cs-matrix td:first-child { text-align: left; padding-left: 10px; }
.cs-matrix tr.is-lead td { border-top: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cs-matrix tr.is-lead td:first-child { border-radius: 8px 0 0 8px; font-weight: 600; color: var(--v-accent); }
.cs-matrix tr.is-lead td:last-child { border-radius: 0 8px 8px 0; }
.cs-matrix tr.is-lead + tr td { border-top: 0; }
.cs-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--v-text);
  background: var(--v-text);
  vertical-align: middle;
}
.cs-dot--half { background: linear-gradient(90deg, var(--v-text) 50%, transparent 50%); }
.cs-dot--none { background: none; border-color: var(--v-line); }
.is-lead .cs-dot { background: var(--v-accent); border-color: var(--v-accent); }
.cs-matrix-note { margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--v-dim); }
.cs-visual:has(> .cs-matrix-wrap) { align-items: center; }
.cs-matrix-wrap { width: 100%; }
/* Read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Stat row: the stat cards side by side, for an Outcomes section with no picture */
.cs-stats--row { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }

/* ===== LOOSE LAYOUTS (mr-march.com, Solace) ===== */
/* Loose split: text sits on the page with no card around it; the picture is a grey
   panel on the right, a phone centered near its top and cut by the panel's bottom. */
.cs-loose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}
.cs-loose + .cs-loose { margin-top: 64px; }
.cs-loose-text .label { color: var(--accent-label); }
.cs-loose-text h3 { margin-top: 8px; font-size: 32px; line-height: 40px; color: var(--heading); }
.cs-loose-text p { margin-top: 12px; font-size: 18px; line-height: 27px; }
.cs-visual.cs-crop {
  height: 560px;
  padding: 0;
  overflow: hidden;
  align-items: flex-start;
  border-radius: var(--radius-card);
}
.cs-crop .cs-screen { width: 300px; margin-top: 56px; }
.cs-crop--two { gap: 24px; }
.cs-crop--two .cs-screen { width: 236px; margin: 56px 0 0; }
/* Whole phones (Be Sure Status and Boundaries): the panel grows so the space below equals the space above */
.cs-visual.cs-crop--whole { height: auto; padding-bottom: 56px; }
/* A window in a loose row: the same crop, a frameless screen instead of a phone */
.cs-crop > img {
  width: 90%;
  height: auto;
  margin-top: 44px;
  border-radius: 10px;
  filter: drop-shadow(0 1px 2px rgba(18, 35, 43, 0.10)) drop-shadow(0 12px 28px rgba(18, 35, 43, 0.13));
}
/* Columns of screens (mr-march.com Wireframes): the image fills the panel and the frame cuts
   every column at the top or bottom; the screens carry their own shadows */
.cs-crop--cols > img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center top;
  filter: none !important;
}
@media (prefers-color-scheme: dark) {
  .cs-crop > img { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35)); }
  .cs-flow-step--accent { border-color: var(--v-accent); }
}

/* Wall: one wide grey panel holding several whole phones in a row */
.cs-visual.cs-wall {
  padding: 56px 6%;
  gap: 28px;
  overflow: hidden;
  align-items: flex-start;
  border-radius: var(--radius-card);
}
.cs-wall figure { flex: 1 1 0; min-width: 0; text-align: center; }
.cs-wall figcaption { margin-bottom: 14px; }
.cs-wall .cs-screen { width: 100%; max-width: 244px; }

/* Tiles: a grid of pictures, some spanning two columns, all one height */
.cs-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 300px;
  gap: 24px;
}
/* Every tile is a designed image filling its tile edge to edge: no empty grey */
.cs-tile { overflow: hidden; border-radius: var(--radius-card); }
.cs-tile--wide { grid-column: span 2; }
.cs-tile--tall { grid-row: span 2; }
.cs-tile > img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* A pull quote standing in a visual panel (Solace's evaluative research card) */
.cs-visual > .cs-quote { max-width: 26em; margin: 0; padding: 0; border: 0; }
.cs-visual > .cs-quote p { font-size: 28px; line-height: 38px; color: var(--v-text); }
.cs-visual > .cs-quote figcaption { margin-top: 16px; }
.cs-card-text ul { margin-top: 12px; padding-left: 20px; }
.cs-card-text li { margin-top: 6px; }

@media (max-width: 800px) {
  .cs-loose { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cs-loose + .cs-loose { margin-top: 44px; }
  .cs-loose-text h3 { font-size: 26px; line-height: 34px; }
  .cs-visual.cs-crop { height: 420px; }
  .cs-crop .cs-screen { width: 220px; margin-top: 36px; border-radius: 28px; }
  .cs-crop--two { gap: 12px; }
  .cs-crop--two .cs-screen { width: min(160px, 44%); margin: 36px 0 0; border-radius: 22px; }
  .cs-visual.cs-crop--whole { height: auto; padding-bottom: 36px; }
  .cs-visual.cs-wall { height: auto; flex-direction: column; align-items: center; padding: 32px 16px; }
  .cs-wall figure { flex: none; width: 220px; }
  .cs-tiles { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 260px; gap: 16px; }
  .cs-tile--wide, .cs-tile--tall { grid-column: auto; grid-row: auto; }
  .cs-visual > .cs-quote p { font-size: 22px; line-height: 30px; }
}
.cs-flow--row .cs-flow-arrow { flex: none; transform: rotate(-90deg); }

/* Tree: one box on top, then a row flow or a fork (one arrow and box per branch) under it */
.cs-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.cs-tree > .cs-flow-step { width: 100%; max-width: 420px; }
.cs-tree-fork {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 760px;
}
.cs-tree-fork > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-tree-fork .cs-flow-step { flex: 1; }

/* ===== PAGE END ===== */
/* Space between the last section and the footer */
.cs-page { padding-bottom: 76px; }

/* ===== DARK: NO OUTLINES ===== */
/* Cards go borderless (transparent, width kept); the hairline dividers stay. */
@media (prefers-color-scheme: dark) {
  .cs-stat, .cs-card { border-color: transparent; }
}

/* ===== MOBILE ===== */
@media (max-width: 800px) {
  .cs-title { padding-top: 8px; padding-bottom: 24px; }
  .cs-title h1 { font-size: 36px; line-height: 44px; }
  .cs-outcome { font-size: 18px; line-height: 27px; }

  .cs-visual { padding: 24px 16px; }
  .cs-hero.cs-visual--shot { aspect-ratio: 4 / 3; }
  .cs-hero .cs-shot { width: 88%; top: 8%; }
  .cs-visual.cs-visual--fit { padding: 16px; min-height: 0; }
  .cs-visual.cs-panel, .cs-duo .cs-panel, .cs-highlights .cs-panel { padding: 24px 16px; }

  .cs-block {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .cs-block h2 { font-size: 26px; line-height: 34px; }
  .cs-block p { font-size: 18px; line-height: 27px; }
  .cs-quote { margin-top: 20px; padding-top: 16px; }
  .cs-block .cs-quote p { font-size: 21px; }

  .cs-section { padding-top: 52px; }
  .cs-part + .cs-section { padding-top: 24px; }
  .cs-head { margin-bottom: 20px; }
  .cs-head h2 { font-size: 28px; line-height: 36px; }

  .cs-highlights { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cs-stat { padding: 20px; }
  .cs-stats--row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cs-matrix { font-size: 13px; }
  .cs-matrix th { font-size: 10px; letter-spacing: 0.03em; }
  .cs-figure-num { font-size: 56px; line-height: 60px; }

  .cs-tabs { margin-bottom: 16px; }
  .cs-tab { padding: 10px 18px; }

  /* Split cards stack: text first, then its picture */
  .cs-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .cs-card .cs-visual { min-height: 260px; }
  .cs-card-text { padding: 24px 20px 24px; }
  .cs-card-text h3 { font-size: 26px; line-height: 34px; }

  /* Layout kit: every text row and side-by-side stacks */
  .cs-card-text--row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cs-card-text--row > :last-child { padding-top: 0; }
  .cs-card-text--row > :last-child > :first-child { margin-top: 12px; }
  .cs-card--wide .cs-card-text, .cs-card--pair .cs-card-text { padding: 0 0 20px; }
  .cs-duo { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cs-card .cs-zoom { aspect-ratio: 4 / 3; min-height: 0; }
  .cs-card--flow .cs-visual { min-height: 0; padding: 24px 16px; }
  .cs-flow--row { flex-direction: column; }
  .cs-flow--row .cs-flow-arrow { transform: none; }
  .cs-tree-fork { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cs-contrast { grid-template-columns: minmax(0, 1fr); margin: 0 20px 24px; }
  .cs-contrast > div { padding: 20px 0; }
  .cs-contrast > div + div { padding-left: 0; padding-bottom: 0; border-left: 0; border-top: 1px solid var(--hairline); }
  .cs-contrast-big { font-size: 24px; line-height: 32px; }

  .cs-page { padding-bottom: 52px; }
}

@media (max-width: 800px) {
  .cs-hero--phones .cs-shot { width: 66%; top: 50%; }
  .cs-screen { width: min(220px, 100%); }
}

/* ===== REDUCED MOTION / PRINT ===== */
/* styles.css already switches off every animation and transition; this keeps
   the reveal's hidden starting state from ever applying. */
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}
@media print {
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
  .cs-progress { display: none; }
}
