/* ==========================================================================
   Case study template
   Loaded after styles.css. Each project sets its own --accent on <body>.
   ========================================================================== */
.case-study {
  --accent: #466eff;
  --accent-soft: #8aa2ff;          /* readable accent for small text on black */
  --panel-bg: #0c0c12;
  --measure: 62ch;
  --cs-body: #d4d4d4;              /* paragraph text */
  --cs-strong: #e5e5e5;            /* emphasised text */
  --cs-on-accent: #fff;            /* text on solid accent fills */
}

/* Light theme: whole page (.case-study--light) or individual white sections (.cs-band--light) */
.case-study--light,
.cs-band--light {
  --color-bg: #fff;
  --color-text: #111;
  --color-muted: #5c5c5c;
  --color-line: #e3e6ee;
  --color-surface: #f4f6fb;
  --color-focus: var(--accent);
  --panel-bg: #f4f7ff;
  --cs-body: #3a3a3a;
  --cs-strong: #1a1a1a;
  --accent-soft: var(--accent);
}

.case-study--light .logo img { content: url("../assets/img/logo-pink.png"); }

.case-study--light .nav__list,
.case-study--light .nav__toggle {
  background: rgba(17, 17, 17, 0.04);
  border-color: rgba(17, 17, 17, 0.2);
  color: var(--color-text);
}

.case-study--light .nav__list a:hover { color: var(--accent); }

@media (max-width: 719.98px) {
  .case-study--light .js .nav__list,
  .js .case-study--light .nav__list { background: rgba(255, 255, 255, 0.95); }
}

/* Header sits in normal flow on inner pages (no hero behind it) */
.site-header--page {
  position: relative;
  inset: auto;
  padding: var(--header-top) var(--gutter) 0;
}

.cs {
  width: min(100% - 2 * var(--gutter), var(--content-max));
  margin-inline: auto;
}

.cs-block { padding-block: clamp(3.5rem, 7vw, 6.5rem); }

/* ---- Type ---- */
.cs-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-soft);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cs-h2 {
  margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.cs-h3 {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.cs-sub {
  margin: 0.5rem 0 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.cs-text p,
.cs-p {
  max-width: var(--measure);
  margin: 1rem 0 0;
  color: var(--cs-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
}

.cs-lead {
  margin: 0;
  font-size: clamp(1.375rem, 1rem + 1.5vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.cs-center { text-align: center; }
.cs-center .cs-p,
.cs-center.cs-text p { margin-inline: auto; }

/* ---- Hero ---- */
.cs-hero { padding-top: clamp(3rem, 7vw, 5.5rem); }

.cs-hero__title {
  margin: 0;
  font-size: clamp(2.5rem, 1.5rem + 4.5vw, 5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.cs-hero__tagline {
  max-width: 34ch;
  margin: 1rem 0 0;
  color: var(--cs-body);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.35;
}

.cs-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.cs-tag {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.cs-cover {
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  overflow: hidden;
  border-radius: clamp(16px, 2vw, 28px);
  background: var(--panel-bg);
}

.cs-cover img { width: 100%; }

/* ---- Overview ---- */
.cs-overview {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 860px) {
  .cs-overview { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; }
}

.cs-facts {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

.cs-facts dt {
  color: var(--accent-soft);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cs-facts dd {
  margin: 0.4rem 0 0;
  color: var(--cs-strong);
  line-height: 1.5;
}

/* ---- Gradient panel ---- */
.cs-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: clamp(20px, 2.4vw, 32px);
  background:
    radial-gradient(60% 90% at 0% 100%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    radial-gradient(50% 70% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--panel-bg);
  border: 1px solid var(--color-line);
}

.cs-split {
  display: grid;
  gap: 1rem 3rem;
}

@media (min-width: 860px) {
  .cs-split { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
  .cs-split > .cs-eyebrow { padding-top: 0.6rem; }
}

/* ---- Stats ---- */
.cs-research {
  display: grid;
  gap: 2rem 4rem;
}

@media (min-width: 1024px) {
  .cs-research { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
}

.cs-stats {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cs-stats { grid-template-columns: repeat(3, 1fr); }
}

.cs-stat {
  padding: 1.75rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  text-align: center;
  transition: transform 0.5s var(--ease-out), border-color 0.4s ease;
}

.cs-stat:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.cs-stat__num {
  display: block;
  color: var(--accent-soft);
  font-size: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cs-stat__label {
  display: block;
  margin-top: 0.85rem;
  color: var(--cs-body);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---- Quote bubble ---- */
.cs-voices {
  display: grid;
  gap: 3rem 4rem;
  align-items: center;
}

@media (min-width: 860px) {
  .cs-voices { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.cs-bubble {
  position: relative;
  margin: 0;
  padding: 1.75rem 2rem;
  border-radius: 28px;
  background: var(--accent);
  color: var(--cs-on-accent);
  transform: rotate(-2deg);
}

.cs-bubble::before {                 /* speech tail */
  content: "";
  position: absolute;
  top: -22px;
  right: 22%;
  border: 0 solid transparent;
  border-width: 0 0 26px 30px;
  border-bottom-color: var(--accent);
}

.cs-bubble blockquote { margin: 0; }

.cs-bubble p {
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-style: italic;
  line-height: 1.45;
}

.cs-bubble figcaption {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
}

/* ---- Icon columns (patterns, insights, values) ---- */
.cs-cols {
  display: grid;
  gap: 2.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 760px) {
  .cs-cols { grid-template-columns: repeat(3, 1fr); }
}

.cs-col { text-align: center; }

.cs-col p {
  max-width: 30ch;
  margin: 1rem auto 0;
  color: var(--cs-body);
  line-height: 1.55;
}

.cs-col strong { color: var(--color-text); font-weight: 600; }

.cs-burst {
  width: 38px;
  height: 21px;
  fill: var(--accent);
  transition: transform 0.6s var(--ease-spring);
}

.cs-col:hover .cs-burst { transform: scale(1.2) rotate(-8deg); }

.cs-insight__text {
  max-width: 22ch;
  margin: 0.5rem auto 0;
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
}

.cs-insight .cs-burst {
  width: clamp(90px, 10vw, 140px);
  height: auto;
  aspect-ratio: 140 / 75.7;
  margin-top: 1.75rem;
}

/* ---- Values cards ---- */
.cs-card {
  padding: 1.75rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 20px;
  text-align: center;
}

.cs-card h3 {
  margin: 0;
  color: var(--accent-soft);
  font-size: 1.375rem;
  line-height: 1.2;
}

.cs-card p {
  margin: 0.75rem 0 0;
  color: var(--cs-body);
  line-height: 1.5;
}

/* ---- Figures ---- */
.cs-figure { margin: clamp(2rem, 4vw, 3rem) 0 0; }

.cs-figure img {
  width: 100%;
  border-radius: 18px;
  background: var(--panel-bg);
}

.cs-figure--framed img { border: 1px solid var(--color-line); }

.cs-figure figcaption {
  margin-top: 0.85rem;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

/* ---- Phones ---- */
.cs-phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(0.75rem, 2.5vw, 2rem);
}

.cs-phones img {
  width: min(44%, 240px);
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.6));
  transition: transform 0.6s var(--ease-out);
}

.cs-phones img:nth-child(2) { margin-top: clamp(2rem, 5vw, 4rem); }
.cs-phones img:nth-child(3) { margin-top: clamp(1rem, 2.5vw, 2rem); }

.cs-phones:hover img:nth-child(odd) { transform: translateY(-6px) rotate(-1.5deg); }
.cs-phones:hover img:nth-child(even) { transform: translateY(-6px) rotate(1.5deg); }

/* ---- Feature rows ---- */
.cs-feature {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .cs-feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; }
  .cs-feature--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cs-feature--flip > :first-child { order: 2; }
}

.cs-feature__media--wide { margin: 0; }

.cs-feature__media--wide img {
  width: 100%;
  border-radius: 16px;
}

/* Two features side by side (e.g. Function 4 + 5) */
.cs-pair {
  display: grid;
  gap: 4rem 3rem;
}

@media (min-width: 1024px) {
  .cs-pair { grid-template-columns: repeat(2, 1fr); }
}

.cs-pair .cs-phones { margin-top: 2rem; justify-content: flex-start; }

/* Annotated detail crops */
.cs-details {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (min-width: 760px) {
  .cs-details { grid-template-columns: repeat(2, 1fr); }
}

.cs-details figure { margin: 0; }

.cs-details img {
  width: 100%;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent);
}

.cs-details figcaption {
  margin-top: 0.75rem;
  color: var(--cs-body);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---- Iterations ---- */
.cs-iterations {
  display: grid;
  gap: 2.5rem 4rem;
}

@media (min-width: 1024px) {
  .cs-iterations { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

.cs-compare {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cs-compare { grid-template-columns: repeat(2, 1fr); }
}

.cs-version {
  padding: 1.5rem;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  text-align: center;
}

.cs-version--after {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.cs-version__label {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.cs-version--after .cs-version__label { color: var(--accent-soft); }

.cs-version h3 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.cs-version--after h3 { color: var(--accent-soft); }

.cs-version p {
  margin: 0.6rem 0 0;
  color: var(--cs-body);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---- Pager ---- */
.cs-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2.5rem 1rem;
  border-top: 1px solid var(--color-line);
}

.cs-pager a {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
  text-decoration: none;
}

.cs-pager__label {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.cs-pager__title {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  font-weight: 600;
  transition: color 0.2s ease;
}

.cs-pager a:hover .cs-pager__title { color: var(--accent-soft); }

.cs-pager__next { margin-left: auto; text-align: right; }

/* Pager sits right above the footer */
.cs-pager-wrap { padding-bottom: clamp(2rem, 4vw, 3rem); }

ol.cs-cols {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.cs-kicker {
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

/* ---- Icon grid (icon + title + text) ---- */
.cs-icon {
  width: 56px;
  height: 56px;
  margin-inline: auto;
  object-fit: contain;
  transition: transform 0.6s var(--ease-spring);
}

.cs-col:hover .cs-icon { transform: translateY(-4px) rotate(-6deg); }

.cs-col h3 {
  margin: 1rem 0 0;
  font-size: 1.1875rem;
  line-height: 1.25;
}

.cs-cols--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

@media (min-width: 760px) {
  .cs-cols--2 { grid-template-columns: repeat(2, 1fr); }
  .cs-cols--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Dashed objective cards */
.cs-card--dashed {
  border-style: dashed;
  border-width: 2px;
  background: none;
}

.cs-card--dashed p {
  margin: 0;
  color: var(--accent-soft);
  font-size: 1.125rem;
  font-weight: 600;
}

/* ---- Small speech bubbles (participant quotes) ---- */
.cs-quotes {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 760px) {
  .cs-quotes { grid-template-columns: repeat(2, 1fr); }
}

.cs-quote {
  margin: 0;
  padding: 1.1rem 1.35rem;
  border-radius: 20px 20px 20px 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.cs-quote:nth-child(even) {
  border-radius: 20px 20px 6px 20px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cs-on-accent);
}

.cs-quote p { margin: 0; line-height: 1.5; }
.cs-quote strong { font-weight: 700; }

/* ---- Image grids ---- */
.cs-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 760px) {
  .cs-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .cs-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .cs-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.cs-grid figure { margin: 0; }

.cs-grid img {
  width: 100%;
  border-radius: 14px;
}

.cs-grid figcaption {
  margin-top: 0.6rem;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Contained art (illustrations, small graphics) */
.cs-art {
  width: min(100%, var(--art-w, 240px));
  margin-inline: auto;
}

/* ---- Link buttons ---- */
.cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.cs-center .cs-actions { justify-content: center; }

.cs-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease-out);
}

.cs-button:hover {
  background: var(--accent);
  color: var(--cs-on-accent);
  transform: translateY(-2px);
}

.cs-button::after {
  content: "↗";
  font-size: 0.9em;
}

/* ---- Video ---- */
.cs-video {
  width: 100%;
  border-radius: 16px;
  background: #000;
}

/* ---- Lists inside text ---- */
.cs-list {
  list-style: disc;
  max-width: var(--measure);
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--cs-body);
  line-height: 1.6;
}

.cs-list li + li { margin-top: 0.35rem; }
.cs-list li::marker { color: var(--accent-soft); }

/* Consecutive panels need breathing room */
.cs-panel + .cs-panel { margin-top: clamp(1.25rem, 2.5vw, 2rem); }

/* ---- Tall page screenshots: cropped preview that opens the full image ---- */
.cs-preview {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--color-line);
  text-decoration: none;
}

.cs-preview img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
  transition: transform 0.8s var(--ease-out);
}

.cs-preview::after {
  content: "View full page ↗";
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1rem 0.9rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.cs-preview:hover img,
.cs-preview:focus-visible img { transform: scale(1.04); }

/* ==========================================================================
   On-this-page navigation (built by main.js from [data-toc] sections)
   Wide screens: fixed column on the left with a sliding indicator.
   Smaller screens: sticky, horizontally scrolling chip bar.
   ========================================================================== */
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.25s ease;
}

.toc a:hover,
.toc a[aria-current] { color: var(--color-text); }

/* Small screens: sticky chip bar */
@media (max-width: 1279.98px) {
  html:has(.toc) { scroll-padding-top: 4.5rem; }

  .toc {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-top: 2rem;
    background: color-mix(in srgb, var(--color-bg) 86%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-block: 1px solid var(--color-line);
  }

  .toc__title,
  .toc__indicator { display: none; }

  .toc ol {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .toc ol::-webkit-scrollbar { display: none; }

  .toc li { flex-shrink: 0; scroll-snap-align: start; }

  .toc a {
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  }

  .toc a[aria-current] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--cs-on-accent);
    font-weight: 600;
  }
}

/* Wide screens: fixed side column */
@media (min-width: 1280px) {
  .case-study main { padding-left: var(--toc-space, 190px); }

  .toc {
    position: fixed;
    top: 50%;
    left: var(--gutter);
    z-index: 20;
    width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-12px, -50%);
    transition: opacity 0.4s ease, transform 0.5s var(--ease-out), visibility 0s linear 0.4s;
  }

  .toc.is-shown {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    transition-delay: 0s;
  }

  .toc__title {
    margin: 0 0 0.9rem;
    color: var(--accent-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .toc ol {
    position: relative;
    border-left: 1px solid var(--color-line);
  }

  .toc a {
    padding: 0.4rem 0 0.4rem 1rem;
  }

  .toc a[aria-current] { font-weight: 600; }

  .toc__indicator {
    position: absolute;
    top: 0;
    left: -1px;
    width: 2px;
    height: var(--h, 0px);
    background: var(--accent);
    border-radius: 2px;
    transform: translateY(var(--y, 0px));
    transition: transform 0.45s var(--ease-out), height 0.45s var(--ease-out);
  }
}

/* Sections receive focus when jumped to from the side nav; no outline needed on whole sections */
[data-toc]:focus { outline: none; }


/* ---- Light band: a white section inside a dark page ---- */
.cs-band--light {
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem);
  border-radius: clamp(20px, 2.4vw, 32px);
  background: var(--color-bg);
  color: var(--color-text);
}

.cs-band--light .cs-figure img { background: transparent; }

/* Images designed on white, shown inside a dark section */
.cs-on-white img {
  padding: clamp(0.75rem, 1.5vw, 1.25rem);
  background: #fff;
}

/* Solid accent panels (no gradient): opt in with .cs-panels--solid on <body> */
.cs-panels--solid .cs-panel {
  --accent-soft: #fff;
  --cs-body: #fff;
  --cs-strong: #fff;
  --color-text: #fff;
  --color-muted: rgba(255, 255, 255, 0.85);
  --color-line: rgba(255, 255, 255, 0.35);
  --color-focus: #fff;
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.cs-panels--solid .cs-panel .cs-button { border-color: #fff; }

.cs-panels--solid .cs-panel .cs-button:hover {
  background: #fff;
  color: var(--accent);
}

/* ==========================================================================
   Band layout: full-width sections that alternate colour, as on the live site.
   .band            black (page default)
   .band--accent    solid project colour, white text
   .band--white     white, dark text
   .band--strip     short band holding a single centred heading
   ========================================================================== */
.case-study .cs-h2,
.case-study .cs-h3,
.case-study .cs-hero__title,
.case-study .band h2,
.case-study .band h3 { font-family: var(--font-display, var(--font-sans)); }

.band {
  padding-block: clamp(4rem, 8vw, 6.5rem);
  background: var(--color-bg);
  color: var(--color-text);
}

.band__inner {
  width: min(100% - 2 * var(--gutter), 1100px);
  margin-inline: auto;
}

.band--accent {
  --color-bg: var(--accent);
  --color-text: #fff;
  --color-muted: rgba(255, 255, 255, 0.88);
  --color-line: rgba(255, 255, 255, 0.45);
  --color-focus: #fff;
  --cs-body: #fff;
  --cs-strong: #fff;
  --accent-soft: #fff;
}

.band--white {
  --color-bg: #fff;
  --color-text: #111;
  --color-muted: #555;
  --color-line: #dfe3ea;
  --color-surface: #f2f5fb;
  --color-focus: var(--accent);
  --cs-body: #333;
  --cs-strong: #111;
  --accent-soft: var(--accent);
}

.band--strip { padding-block: clamp(1.5rem, 3vw, 2.25rem); }
.band--strip h2 { margin: 0; text-align: center; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); }

.band:not(.band--accent):not(.band--white) + .band:not(.band--accent):not(.band--white) { padding-top: 0; }

/* Centred section heading in the project colour */
.band-title {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  color: var(--accent-soft);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.band--accent .band-title { color: #fff; }
.band-title--left { text-align: left; }
.band-title span { color: var(--color-text); }

.band-lede {
  max-width: 62ch;
  margin: -1rem auto 2.5rem;
  color: var(--cs-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  text-align: center;
}

/* Two-column band content */
.band-split {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: center;
}

@media (min-width: 900px) {
  .band-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .band-split--even { grid-template-columns: 1fr 1fr; }
  .band-split--flip > :first-child { order: 2; }
}

/* Highlighted phrase: white tag with italic serif text, like the live site */
.hl {
  padding: 0 0.25em;
  background: #fff;
  color: var(--accent);
  font-family: var(--font-display, var(--font-sans));
  font-style: italic;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.band:not(.band--accent) .hl { background: var(--accent); color: #fff; }

/* Black pill button with arrow disc */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
  padding: 0.35rem 0.4rem 0.35rem 1.4rem;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out);
}

.pill-btn::after {
  content: "→";
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  transition: transform 0.3s var(--ease-out);
}

.pill-btn:hover { transform: translateY(-2px); }
.pill-btn:hover::after { transform: translateX(3px); }
.band:not(.band--accent):not(.band--white) .pill-btn { background: var(--accent); }

/* White label boxes with italic serif text (e.g. Clarity / Structure / Simplicity) */
.label-stack {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 260px;
}

.label-stack li {
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--accent);
  font-family: var(--font-display, var(--font-sans));
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem);
  font-style: italic;
  text-align: center;
}

/* Outlined task cards on a colour band */
.task-cards {
  display: grid;
  gap: 1.5rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) { .task-cards { grid-template-columns: repeat(3, 1fr); } }

.task-card {
  padding: 1.75rem;
  border: 2px solid currentColor;
  border-radius: 22px;
}

.task-card p { margin: 0; font-family: var(--font-display, var(--font-sans)); }
.task-card h3 { margin: 0.75rem 0 0; font-size: clamp(1.25rem, 1rem + 0.7vw, 1.5rem); line-height: 1.25; }
.task-card ul { margin: 1rem 0 0; padding-left: 1.2rem; list-style: disc; line-height: 1.55; }

/* Icon grid with coloured titles */
.icon-grid {
  display: grid;
  gap: 3rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

@media (min-width: 760px) { .icon-grid { grid-template-columns: repeat(3, 1fr); } }

.icon-grid img { width: 64px; height: 64px; margin: 0 auto; object-fit: contain; }
.icon-grid h3 { margin: 1rem 0 0; color: var(--accent-soft); font-family: var(--font-sans); font-size: 1.0625rem; }
.icon-grid p { max-width: 28ch; margin: 0.5rem auto 0; color: var(--color-muted); line-height: 1.5; }

/* Dashed boxes */
.dash-grid {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .dash-grid--4 { grid-template-columns: repeat(4, 1fr); }
  .dash-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.dash-grid li {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 1.5rem;
  border: 2px dashed var(--color-line);
  border-radius: 14px;
  color: var(--accent-soft);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* Insights (dashed rows) beside problems (filled labels) */
.insight-rows { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

.insight-rows li {
  padding: 0.9rem 1.25rem;
  border: 2px dashed var(--color-line);
  border-radius: 10px;
  color: var(--accent-soft);
  text-align: center;
}

.problem-tags { display: grid; gap: 1rem; justify-items: center; margin: 0; padding: 0; list-style: none; }

.problem-tags li {
  width: min(100%, 220px);
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

/* Big numbers */
.big-stat { margin: 0; color: var(--accent-soft); font-size: clamp(3.5rem, 2rem + 5vw, 6rem); font-weight: 700; line-height: 1; }
.big-stat-label { margin: 0.5rem 0 0; color: var(--color-muted); }

/* 2x2 with dashed dividers */
.quad {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

@media (min-width: 760px) {
  .quad { grid-template-columns: 1fr 1fr; }
  .quad li:nth-child(odd) { border-right: 2px dashed var(--color-line); }
  .quad li:nth-child(-n+2) { border-bottom: 2px dashed var(--color-line); }
}

.quad li { padding: 2rem; }
.quad h3 { margin: 0; color: var(--accent-soft); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem); }
.quad p { max-width: 32ch; margin: 0.75rem auto 0; color: var(--color-muted); line-height: 1.55; }

/* Figures inside bands */
.band figure { margin: 0; }
.band figure img { width: 100%; }
.band figcaption { margin-top: 0.75rem; color: var(--color-muted); font-size: 0.9375rem; text-align: center; }

/* Solution heading block */
.sol-head p { margin: 0; color: var(--accent-soft); font-weight: 600; }
.sol-head h3 { margin: 0.5rem 0 0; color: var(--accent-soft); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); line-height: 1.2; }

/* Large serif statement (HMW, conclusion) */
.statement {
  max-width: 34ch;
  margin: 0 auto;
  font-family: var(--font-display, var(--font-sans));
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.875rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}


/* Wide screens: bands bleed under the side-nav column so colours run edge to edge */
@media (min-width: 1280px) {
  .case-study main > .band {
    margin-left: calc(-1 * var(--toc-space, 190px));
    padding-left: var(--toc-space, 190px);
  }

}

/* Side nav over a solid colour band: each line switches to white on its own (set by main.js) */
@media (min-width: 1280px) {
  .toc .on-accent { --color-text: #fff; --color-muted: rgba(255, 255, 255, 0.82); --accent-soft: #fff; color: var(--color-muted); }
  .toc .on-accent a { color: rgba(255, 255, 255, 0.82); }
  .toc .on-accent a[aria-current], .toc .on-accent a:hover { color: #fff; }
  .toc__title.on-accent { color: #fff; }
  .toc__indicator.on-accent { background: #fff; }
  .toc li { transition: color 0.2s ease; }
}

/* Captions on solid colour bands must stay full-contrast */
.band--accent figcaption { color: #fff; }

/* Phone-sized videos sit alongside phone screenshots */
.cs-phones video {
  width: min(44%, 240px);
  height: auto;
  border-radius: 28px;
  background: #000;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.6));
}

/* "Dark patterns avoided" chips */
.cs-chips-label {
  margin: 1.5rem 0 0.6rem;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cs-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.cs-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 45%, transparent);
  border-radius: 999px;
  color: var(--cs-strong);
  font-size: 0.875rem;
}
.cs-chips li::before { content: "✕"; color: var(--accent-soft); font-size: 0.7rem; }

/* Data tables */
.cs-table-wrap { margin-top: 2rem; overflow-x: auto; border: 1px solid var(--color-line); border-radius: 18px; }
.cs-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.9375rem; }
.cs-table th, .cs-table td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-line); text-align: left; vertical-align: top; line-height: 1.5; }
.cs-table thead th { color: var(--accent-soft); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cs-table tbody th { color: var(--cs-strong); font-weight: 600; }
.cs-table td { color: var(--cs-body); }
.cs-table tbody tr:last-child > * { border-bottom: 0; }

/* ---- Live prototype call-to-action ---- */
.proto-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 52px;
  margin-top: 1.75rem;
  padding: 0.6rem 0.75rem 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1a0f14;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-soft) 60%, transparent);
  animation: proto-pulse 2.4s ease-out infinite;
  transition: transform 0.3s var(--ease-out);
}
.proto-btn:hover { transform: translateY(-2px); }
.proto-btn__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2fbf71;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.25);
}
.proto-btn__arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1a0f14;
  color: #fff;
  transition: transform 0.3s var(--ease-out);
}
.proto-btn:hover .proto-btn__arrow { transform: rotate(45deg); }
@keyframes proto-pulse {
  70% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent-soft) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.proto-banner {
  display: grid;
  overflow: hidden;
  border-radius: clamp(20px, 2.4vw, 32px);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: transform 0.5s var(--ease-out);
}
@media (min-width: 860px) { .proto-banner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: stretch; } }
.proto-banner:hover { transform: translateY(-4px); }
.proto-banner img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.proto-banner:hover img { transform: scale(1.04); }
.proto-banner__text { display: flex; flex-direction: column; justify-content: center; gap: 0.9rem; padding: clamp(2rem, 4vw, 3.5rem); }
.proto-banner__eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.proto-banner__title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.proto-banner__sub { max-width: 40ch; color: rgba(255, 255, 255, 0.9); line-height: 1.55; }
.proto-banner__cta {
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-weight: 600;
}
.proto-banner:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 5px; }

html.motion-off .proto-btn { animation: none; }
@media (prefers-reduced-motion: reduce) { .proto-btn { animation: none; } }


/* ==========================================================================
   Nuuly case study: pain chips, personas, theme-coloured groups, flows
   ========================================================================== */
.nu-sub { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.nu-pains { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.nu-pains li { padding: 0.6rem 1.1rem; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 999px; color: var(--color-text); font-weight: 500; }
.nu-hmw { margin: 2rem 0 0; padding: 1.75rem 2rem; border-left: 4px solid var(--accent); border-radius: 0 16px 16px 0; background: var(--panel-bg, #0b0f1d); }
.nu-hmw p:last-child { margin: 0.5rem 0 0; color: var(--color-text); font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem); font-weight: 600; line-height: 1.3; }
.nu-quotes { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 760px) { .nu-quotes { grid-template-columns: 1fr 1fr; } }

.nu-personas { display: grid; gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .nu-personas { grid-template-columns: repeat(3, 1fr); } }
.nu-personas li { padding: 1.5rem; border-radius: 18px; background: var(--panel-bg, #0b0f1d); }
.nu-persona__name { margin: 0; color: var(--color-text); font-size: 1.375rem; font-weight: 700; }
.nu-persona__name span { display: block; margin-top: 0.2rem; color: var(--accent-soft); font-size: 0.875rem; font-weight: 500; }
.nu-persona__quote { margin: 1rem 0; color: var(--cs-body, #d9d9d9); font-style: italic; line-height: 1.5; }
.nu-persona__pain { margin: 0; color: var(--color-muted); font-size: 0.9375rem; line-height: 1.5; }
.nu-persona__pain strong { color: var(--color-text); font-weight: 600; }

.nu-aside { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding: 1.75rem 2rem; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 18px; }
.nu-aside__cols { display: grid; gap: 1.5rem; margin-top: 1rem; }
@media (min-width: 760px) { .nu-aside__cols { grid-template-columns: 1fr 1fr; } }
.nu-aside .cs-kicker { margin-top: 0; }

.nu-workshop { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.nu-workshop img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.nu-workshop img:nth-child(-n + 2) { aspect-ratio: 3 / 4; }
.nu-workshop img:last-child { grid-column: 1 / -1; height: auto; }
@media (min-width: 900px) {
  .nu-workshop { grid-template-columns: 1fr 1fr 2.4fr; align-items: stretch; }
  .nu-workshop img:last-child { grid-column: auto; height: 100%; }
}

/* Theme colours (match the deck's three themes) */
.nu-theme--ops { --theme: #9ec5ff; }
.nu-theme--scale { --theme: #f3e58a; }
.nu-theme--eco { --theme: #b9e48f; }
.cs-card.nu-theme { border-color: var(--theme); text-align: left; }
.cs-card.nu-theme h3 { color: var(--theme); }

.nu-fixes { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .nu-fixes { grid-template-columns: 1fr 1fr; } }
.nu-fixes li { padding: 1.25rem 1.5rem; border-radius: 16px; background: var(--panel-bg, #0b0f1d); }
.nu-fixes p { margin: 0; color: var(--color-text); line-height: 1.5; }
.nu-fixes__was { margin-bottom: 0.4rem !important; color: var(--color-muted) !important; font-size: 0.875rem; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); }

.nu-group { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.5rem; border-top: 3px solid var(--theme); }
.nu-group__label { display: inline-block; margin: 0 0 1rem; padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--theme); color: #0b1020; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.nu-rules { display: grid; gap: 0.75rem; margin: 1.25rem 0 1.75rem; padding: 0; list-style: none; }
@media (min-width: 760px) { .nu-rules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .nu-rules { grid-template-columns: repeat(4, 1fr); } }
.nu-rules li { padding: 1rem 1.25rem; border: 1px solid color-mix(in srgb, var(--theme) 55%, transparent); border-radius: 14px; color: var(--cs-body, #d9d9d9); line-height: 1.45; }
.nu-rules strong { display: block; margin-bottom: 0.25rem; color: var(--theme); }

.nu-flow { display: grid; gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 760px) { .nu-flow { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .nu-flow { grid-template-columns: repeat(4, 1fr); } }
.nu-flow li { counter-increment: step; }
.nu-flow img { width: 100%; border-radius: 10px; border: 1px solid var(--color-line, rgba(255,255,255,.15)); }
.nu-flow span { display: flex; gap: 0.5rem; margin-top: 0.6rem; color: var(--color-text); font-size: 0.9375rem; font-weight: 500; }
.nu-flow span::before { content: counter(step); display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--theme); color: #0b1020; font-size: 0.75rem; font-weight: 700; }

.nu-pair { display: grid; gap: 2rem; }
@media (min-width: 900px) { .nu-pair { grid-template-columns: 1fr 1fr; } }
.nu-pair img, .nu-feature img { width: 100%; border-radius: 14px; background: #fff; }
.nu-pair .cs-h3 { margin-top: 1rem; }
.nu-feature { display: grid; gap: 1.5rem 2.5rem; align-items: center; margin-top: 2.5rem; }
@media (min-width: 900px) { .nu-feature { grid-template-columns: 1.3fr 1fr; } }
.nu-plans { display: grid; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.nu-plans li { padding: 0.7rem 1rem; border-radius: 12px; background: var(--panel-bg, #0b0f1d); color: var(--cs-body, #d9d9d9); }
.nu-plans strong { display: inline-block; min-width: 6rem; color: var(--theme); }

.nu-next { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .nu-next { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .nu-next { grid-template-columns: repeat(3, 1fr); } }
.nu-next li { padding: 1.25rem 1.5rem; border-radius: 16px; background: var(--panel-bg, #0b0f1d); }
.nu-next h3 { margin: 0; color: var(--accent-soft); font-size: 1.125rem; }
.nu-next p { margin: 0.4rem 0 0; color: var(--cs-body, #d9d9d9); line-height: 1.5; }
.nu-pair img { aspect-ratio: 1360 / 910; object-fit: cover; object-position: top; }


/* ==========================================================================
   Google Nest: smaller IA/wireframes, prototype videos sitting straight on
   the black page (their own backgrounds are #000, so edges disappear).
   ========================================================================== */
.gn-narrow { max-width: 46rem; margin-inline: auto; }
.gn-small-pair, .gn-small-trio { display: grid; gap: clamp(1.5rem, 4vw, 3rem); justify-content: center; align-items: end; margin-top: 2rem; }
.gn-small-pair { grid-template-columns: repeat(2, minmax(0, 280px)); }
.gn-small-pair--wide { grid-template-columns: repeat(2, minmax(0, 380px)); }
.gn-small-trio { grid-template-columns: repeat(3, minmax(0, 280px)); }
.gn-small-pair img, .gn-small-trio img { width: 100%; height: auto; border-radius: 12px; }
.gn-small-pair figcaption, .gn-small-trio figcaption { margin-top: 0.75rem; color: var(--color-muted); font-size: 0.875rem; }
@media (max-width: 640px) {
  .gn-small-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gn-small-trio figure:first-child { grid-column: 1 / -1; max-width: 320px; margin-inline: auto; }
}

.gn-goal { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .gn-goal { grid-template-columns: 1.2fr 1fr; } }
.gn-goal figure { margin: 0; text-align: center; }
.gn-goal img { width: min(100%, 300px); height: auto; }
.gn-goal figcaption { margin-top: 0.5rem; color: var(--color-muted); font-size: 0.875rem; }

.gn-stats { margin: 1.75rem 0 0; }

/* Videos: no frame, no panel, no native controls (a pause button is added by JS) */
.gn-vid { position: relative; margin: 0; background: #000; }
.gn-vid video, .gn-vid img { display: block; width: 100%; height: auto; background: #000; }
.gn-vid figcaption { margin-top: 0.5rem; color: var(--color-muted); font-size: 0.875rem; text-align: center; }
.gn-vid--phone { width: min(100%, 300px); margin-inline: auto; }
.gn-vid--device { width: min(100%, 520px); margin-inline: auto; }
.vid-toggle {
  position: absolute;
  right: 0.6rem;
  bottom: 2.4rem;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.gn-vid:not(:has(figcaption)) .vid-toggle { bottom: 0.6rem; }
.gn-vid:hover .vid-toggle, .vid-toggle:focus-visible { opacity: 1; }
.vid-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.vid-toggle svg { width: 16px; height: 16px; fill: currentColor; }

.gn-protos { display: grid; gap: 2.5rem; align-items: center; margin-top: 2.5rem; }
@media (min-width: 860px) { .gn-protos { grid-template-columns: 1.4fr 1fr; } }

.gn-gestures { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.5rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.gn-gestures li { display: flex; align-items: center; gap: 0.75rem; }
.gn-gestures p { margin: 0; color: var(--cs-body, #d9d9d9); }
.gn-gesture { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); }
.gn-gesture svg { width: 20px; height: 20px; fill: none; stroke: #000; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.gn-row { margin-top: clamp(3rem, 7vw, 5rem); }
.gn-dial { width: min(100%, 360px); height: auto; justify-self: center; border-radius: 50%; }
.gn-sched { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 3vw, 2.5rem); }
.gn-sched .gn-vid--phone { width: min(50%, 260px); margin: 0; }
.gn-sched img { width: min(42%, 240px); height: auto; border-radius: 50%; }

.gn-eco { display: grid; gap: 3rem; margin-top: 1rem; text-align: center; }
@media (min-width: 760px) { .gn-eco { grid-template-columns: 1fr 1fr; } }
.gn-eco .cs-h3 { margin-top: 1.25rem; }
.gn-eco .cs-p { max-width: 26rem; margin-inline: auto; }
.gn-eco > div:last-child .gn-vid--phone { width: min(100%, 262px); }
/* Eco Mode: both phones render at the same size and their titles line up */
.gn-eco > div:last-child .gn-vid--phone { width: min(100%, 278px); }
@media (min-width: 760px) {
  .gn-eco { grid-template-rows: auto auto auto; }
  .gn-eco > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
  .gn-eco .gn-vid { align-self: center; }
}

/* Nuuly: no cropping anywhere, plus persona photos, bags and a screen gallery */
.nu-pair img { aspect-ratio: auto; object-fit: initial; }
.nu-workshop { grid-template-columns: 1fr 1fr; align-items: start; }
.nu-workshop img, .nu-workshop img:nth-child(-n + 2) { height: auto; aspect-ratio: auto; object-fit: initial; }
.nu-workshop img:last-child { grid-column: 1 / -1; height: auto; }
@media (min-width: 900px) {
  .nu-workshop { grid-template-columns: 1fr 1fr 2.6fr; align-items: center; }
  .nu-workshop img:last-child { grid-column: auto; height: auto; }
}
.nu-persona__photo { display: block; width: auto; max-width: 100%; height: 200px; margin: 0 auto 1.25rem; border-radius: 12px; }
.nu-bags { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 640px; margin: 2rem auto 0; }
.nu-bags img { width: 100%; height: auto; border-radius: 16px; }
.nu-screens { margin-top: 1.75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
.nu-screens:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.nu-screens ul { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.nu-screens li { flex: 0 0 min(80%, 560px); scroll-snap-align: start; }
.nu-screens li.nu-screens__phone { flex-basis: min(40%, 200px); }
.nu-screens img { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff; }
.nu-screens span { display: block; margin-top: 0.6rem; color: var(--color-text); font-size: 0.9375rem; font-weight: 500; }
@media (min-width: 760px) { .gn-eco { row-gap: 0; } .gn-eco .cs-p { margin-top: 0.5rem; } }
@media (min-width: 900px) { .nu-pair { grid-template-rows: auto auto auto; row-gap: 0; } .nu-pair > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; } .nu-pair img { align-self: center; } }

/* Nuuly: product shots that straddle section boundaries and bleed off the right edge */
.case-study main { overflow-x: clip; }
.nu-has-float { position: relative; }
.nu-float {
  position: absolute;
  z-index: 3;
  right: calc(50% - 50vw - 3vw);
  width: clamp(200px, 22vw, 340px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}
.nu-float--a { top: clamp(-11rem, -12vw, -6rem); transform: rotate(-8deg); }
.nu-float--b { top: clamp(-9rem, -9vw, -5rem); width: clamp(180px, 18vw, 280px); transform: rotate(6deg); }
.nu-float--c { top: clamp(-10rem, -10vw, -5rem); width: clamp(170px, 17vw, 260px); transform: scaleX(-1) rotate(-10deg); }
/* keep text clear of the bags */
@media (min-width: 900px) {
  .nu-has-float > .cs-p, .nu-has-float > .cs-h2 { max-width: min(46rem, calc(100% - 18vw)); }
}
@media (max-width: 899.98px) {
  .nu-float { width: 140px; right: -36px; }
  .nu-float--a { top: -3.5rem; }
  .nu-float--b, .nu-float--c { top: -3rem; width: 120px; }
  .nu-has-float > .cs-eyebrow, .nu-has-float > .cs-h2 { padding-right: 90px; }
}
@media (min-width: 900px) { .nu-float { right: clamp(-5rem, -4vw, -1.5rem); } }
@media (min-width: 900px) { .nu-float--c { top: -2.5rem; } }
/* Narrow screens: the section chip bar moves down while the floating header is showing */
@media (max-width: 1279.98px) {
  .toc { transition: top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .header-revealed .toc { top: 76px; }
}

/* ==========================================================================
   Story navigation (from the Zillow case study), styled by each project's own
   colours: jump cards from opportunities to solutions, "answered by" links
   under insights, and a feature index. Works on dark and light pages.
   ========================================================================== */
.case-study [id$="-title"] { scroll-margin-top: 7rem; }
.cs-jump { display: grid; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; text-align: left; }
@media (min-width: 760px) { .cs-jump { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); } }
.cs-jump a {
  display: flex; flex-direction: column; height: 100%;
  padding: 1.5rem; border: 2px solid var(--accent); border-radius: 20px;
  color: inherit; text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease-out);
}
.cs-jump__n { color: var(--accent-soft); font-size: 2rem; font-weight: 700; line-height: 1; }
.cs-jump h3 { margin: 0.6rem 0 0; color: var(--color-text); font-size: 1.1875rem; line-height: 1.25; }
.cs-jump p { margin: 0.4rem 0 0; color: var(--color-muted); line-height: 1.5; }
.cs-jump__go { margin-top: auto; padding-top: 0.9rem; color: var(--accent-soft); font-size: 0.875rem; font-weight: 600; }
.cs-jump a:hover, .cs-jump a:focus-visible { background: var(--accent); transform: translateY(-2px); }
.cs-jump a:hover :is(.cs-jump__n, h3, p, .cs-jump__go),
.cs-jump a:focus-visible :is(.cs-jump__n, h3, p, .cs-jump__go) { color: var(--cs-on-accent); }
.cs-jump a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }

.cs-trace { margin: 1rem 0 0; color: var(--color-muted); font-size: 0.875rem; }
.cs-trace a { color: var(--accent-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.cs-index { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.cs-index a {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px;
  padding: 0.45rem 1rem 0.45rem 0.5rem; border: 1px solid var(--color-line); border-radius: 999px;
  color: var(--color-text); font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cs-index a span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--cs-on-accent); font-size: 0.8125rem; font-weight: 700; }
.cs-index a:hover, .cs-index a:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cs-index-label { margin: 2.5rem 0 0; color: var(--color-muted); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }
@media (prefers-reduced-motion: reduce) { .cs-jump a { transition: none; } }

/* Allkind: numbered problems, each linked to the flow that solves it */
.ak-problems { display: grid; gap: 0.6rem; margin: 1.25rem 0 0; padding: 0; list-style: none; counter-reset: p; }
.ak-problems li { counter-increment: p; display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; padding: 0.7rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.ak-problems li::before { content: counter(p); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: #1a0f14; font-size: 0.8125rem; font-weight: 700; }
.ak-problems span { flex: 1 1 14rem; color: var(--color-text); line-height: 1.4; }
.ak-problems a { color: var(--accent-soft); font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* Nuuly: jump cards and pain chips carry each theme's colour */
.nu-jump a { border-color: var(--theme); }
.nu-jump .cs-jump__n, .nu-jump .cs-jump__go { color: var(--theme); }
.nu-jump a:hover, .nu-jump a:focus-visible { background: var(--theme); }
.nu-jump a:hover :is(.cs-jump__n, h3, p, .cs-jump__go), .nu-jump a:focus-visible :is(.cs-jump__n, h3, p, .cs-jump__go) { color: #0b1020; }
.nu-pains a { color: inherit; text-decoration: none; }
.nu-pains li:has(a:hover), .nu-pains li:has(a:focus-visible) { background: var(--accent); color: #0b1020; }
.nu-pains li { transition: background-color 0.2s ease, color 0.2s ease; }

/* "Delivered by / Answered by" links: a small tag instead of underlined text */
.cs-trace { display: flex; flex-wrap: wrap; align-items: center; justify-content: inherit; gap: 0.35rem; margin: 1rem 0 0; font-size: 0.75rem; letter-spacing: 0.02em; }
.cs-center .cs-trace, .cs-card .cs-trace, .cs-insight .cs-trace { justify-content: center; }
.cs-trace a {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-soft); font-weight: 600; text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cs-trace a::after { content: "→"; transition: transform 0.2s ease; }
.cs-trace a:hover, .cs-trace a:focus-visible { background: var(--accent); color: var(--cs-on-accent); }
.cs-trace a:hover::after { transform: translateX(2px); }

/* Google Nest: bigger challenge image and goal thermostat; prototypes at equal height */
.gn-goal img { width: min(100%, 420px); }
@media (min-width: 860px) { .gn-goal { grid-template-columns: 1fr 1fr; } }
.cs-feature__media--wide img[src*="google-nest/app-hero"] { width: auto; max-width: 100%; max-height: 600px; margin-inline: auto; }
/* Both prototypes render at the same height */
@media (min-width: 860px) {
  .gn-protos { grid-template-columns: 1fr 1fr; justify-items: center; }
  .gn-protos .gn-vid { width: auto; }
  .gn-protos .gn-vid video { width: auto; height: min(470px, 46vw); }
}
.cs-trace a { white-space: nowrap; }
/* Gesture hints: small, tucked under the thermostat they belong to */
.gn-vid .gn-gestures { justify-content: center; gap: 0.5rem 1.1rem; margin: 0.75rem 0 0; }
.gn-vid .gn-gestures li { gap: 0.4rem; }
.gn-vid .gn-gestures p { font-size: 0.8125rem; }
.gn-vid .gn-gesture { width: 24px; height: 24px; }
.gn-vid .gn-gesture svg { width: 13px; height: 13px; }
.gn-vid .gn-gestures { flex-wrap: nowrap; }
/* pause buttons sit at the video's top-right corner so they never cover captions or hints */
.gn-vid .vid-toggle, .gn-vid:not(:has(figcaption)) .vid-toggle { top: 0.6rem; bottom: auto; }
/* Gesture hints stay inside the thermostat column */
.gn-vid--device { display: flex; flex-direction: column; align-items: center; }
.gn-vid .gn-gestures { flex-wrap: wrap; max-width: 100%; }

/* Google Nest: "Intuitive Functionality" */
.gn-sync { position: relative; margin: clamp(2rem, 4vw, 3rem) 0 0; }
.gn-sync img { display: block; width: 100%; height: auto; }
.gn-sync__tag {
  position: absolute; left: 50%; top: 37.5%; transform: translate(-50%, -50%);
  padding: 0.35rem 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 999px;
  background: #000; color: var(--accent); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.gn-one__row { display: grid; gap: 2.5rem; align-items: center; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 860px) { .gn-one__row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; } }
.gn-one__row > img { width: min(100%, 440px); height: auto; justify-self: center; }
.gn-points { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: pt; }
.gn-points li { counter-increment: pt; display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; padding: 1.25rem 1.4rem; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 18px; }
.gn-points li::before { content: counter(pt, decimal-leading-zero); grid-row: span 2; color: var(--accent); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.gn-points h4 { margin: 0; color: var(--color-text); font-size: 1.125rem; }
.gn-points p { margin: 0.35rem 0 0; color: var(--color-muted); line-height: 1.5; }
.gn-sync__tag { top: 51.5%; }
/* Word clock embed */
.wc-frame { position: relative; margin-top: 2rem; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--color-line); border-radius: 20px; background: #141113; }
.wc-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wc-open { margin: 1.25rem 0 0; text-align: center; }
@media (max-width: 640px) { .wc-frame { aspect-ratio: 3 / 4; } }
/* Titles: Inter Semi Bold + Libre Baskerville italic accent (wins over per-page display fonts) */
html .case-study :is(.cs-hero__title, .cs-h2, .band-title, .band h2, .zl-big, .statement) { font-family: "Inter", var(--font-sans); font-weight: 600; letter-spacing: -0.02em; }
html .case-study :is(.cs-hero__title, .cs-h2, .band-title, .band h2, .zl-big) em { font-family: "Libre Baskerville", Georgia, serif; font-style: italic; font-weight: 400; }
/* Zillow: How / Who We Recruited titles start on the same line */
.band-split:has(#recruit-title) { align-items: start; }
/* Key insights + problem areas: rows line up across both columns */
@media (min-width: 900px) {
  .band-split:has(.insight-rows) { grid-template-rows: auto repeat(4, auto); row-gap: 1rem; align-items: stretch !important; }
  .band-split:has(.insight-rows) > div { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
  .band-split:has(.insight-rows) :is(.insight-rows, .zl-problems) { display: contents; }
  .band-split:has(.insight-rows) :is(.insight-rows, .zl-problems) li { display: flex; align-items: center; justify-content: center; margin: 0; }
  .band-split:has(.insight-rows) .zl-problems li { justify-content: flex-start; }
  .band-split:has(.insight-rows) .band-title { margin-bottom: 0.5rem; }
}
/* Nuuly next steps: the pile of bags pops up from behind the cards */
.nu-next-wrap { position: relative; isolation: isolate; margin-top: clamp(7rem, 14vw, 11rem); }
.nu-next-wrap .nu-next { position: relative; z-index: 1; margin-top: 0; }
.nu-next li { background: var(--panel-bg, #0b0f1d); }
.nu-pile {
  position: absolute; z-index: 0; right: 2%; bottom: calc(100% - 4.5rem);
  width: clamp(220px, 30vw, 420px); height: auto; pointer-events: none;
  transform: translateY(60%); opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.4s ease;
}
.nu-pile.is-visible { transform: translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .nu-pile { transition: none; transform: none; opacity: 1; } }
html.motion-off .nu-pile { transition: none; transform: none; opacity: 1; }
