:root {
  --bg: #f0f0f0;
  --fg: #111111;
  --muted: #2b2b2b;
  --tag-bg: #111111;
  --tag-fg: #f0f0f0;
  --gutter: clamp(16px, 2.1vw, 30px);
  --text: clamp(16px, 1.6vw, 23px);
  --corner: clamp(16px, 1.6vw, 23px);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-ui: "Montserrat", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --fg: #ededed;
  --muted: #d6d6d6;
  --tag-bg: #ededed;
  --tag-fg: #121212;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color .35s ease, color .35s ease;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; }

/* ---------- Corners ---------- */
.corner {
  display: flex;
  justify-content: space-between;
  padding: var(--gutter);
  font-family: var(--font-ui);
  font-size: var(--corner);
  font-weight: 400;
  letter-spacing: .01em;
}

.corner--top { align-items: flex-start; }
.corner--bottom { align-items: flex-end; margin-top: auto; }

/* work / back: bold, with the same centre-out underline on hover as the intro links */
.nav-left { position: relative; }
.nav-link {
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 50% 96% / 0% 1.5px;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link:focus-visible { background-size: 100% 1.5px; outline: none; }
.nav-link[hidden] { display: none; }
.nav-back { font-weight: 400; }

.top-right {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2.2vw, 32px);
}

.resume {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.theme-toggle {
  width: clamp(28px, 2.6vw, 38px);
  height: clamp(28px, 2.6vw, 38px);
  margin-top: -2px;
  display: grid;
  place-items: center;
}
.theme-toggle svg { width: 100%; height: 100%; display: block; }
.theme-toggle:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }

.linkedin,
.email {
  text-decoration: none;
}

/* ---------- Intro ---------- */
.intro {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: clamp(8px, 4.5vh, 64px) var(--gutter) clamp(12px, 3vh, 40px) clamp(16px, 10.5vw, 151px);
  max-width: calc(clamp(16px, 10.5vw, 151px) + var(--gutter) + 30.8em);
  font-size: var(--fit, var(--text));
  line-height: 1.38;
  font-weight: 400;
  letter-spacing: -.003em;
}

.intro p { margin: 0 0 1.2em; }
.intro p:last-child { margin-bottom: 0; }

/* Links read as bold text; on hover an underline grows from the centre out to both sides */
.intro a,
.name-trigger {
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 50% 92% / 0% 1.5px;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1);
}

/* WellHabit and Colombia: italic instead of bold */
.intro a:not(.strong) { font-weight: 400; font-style: italic; }

.intro a:hover,
.intro a:focus-visible,
.name-trigger:hover,
.name-trigger:focus-visible { background-size: 100% 1.5px; outline: none; }

.name-trigger { cursor: default; }

/* ---------- Portrait ---------- */
.portrait {
  position: fixed;
  left: 50%;
  top: 50%; /* GSAP shifts it back by half its size, so it sits in the centre of the window */
  width: min(clamp(220px, 22vw, 320px), 60vw, calc(80vh * 601 / 822));
  margin: 0;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  z-index: 5;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35);
}


/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  will-change: transform;
}

.cursor__dot {
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--fg);
  flex: none;
  transform: scale(0);
}

.cursor__tag {
  display: none;
  margin-top: -6px;
  padding: 4px 9px 5px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.cursor[data-mode="copy"] .cursor__tag { display: inline-block; }

@media (hover: hover) and (pointer: fine) {
  [data-cursor] { cursor: none; }
}

/* ---------- Toast (touch devices) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translate(-50%, 10px);
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .corner { font-size: 15px; }
  .theme-toggle { width: 26px; height: 26px; }
  .intro { padding-left: var(--gutter); }
}

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

/* ---------- Cursor: back arrow mode ---------- */
.cursor__back {
  display: none;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scale(0);
}
.cursor[data-mode="back"] .cursor__dot { display: none; }
.cursor[data-mode="back"] .cursor__back { display: block; }

/* ---------- Project panel ---------- */
.project {
  --side-bg: #ececec;
  --main-bg: #f3f3f3;
  --p-fg: #111;
  --p-soft: #a3a3a3;
  --gap: max(12px, calc(var(--gutter) - 4px));
  --edge: clamp(14px, 2vw, 28px); /* hover strip over the sheet's left edge */
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
}
:root[data-theme="dark"] .project {
  --side-bg: #1c1c1c;
  --main-bg: #161616;
  --p-fg: #ededed;
  --p-soft: #7a7a7a;
}

.project__back {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(0, 0, 0, .28);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: max(0px, calc(var(--gap) / 2 - 9px));
}
.project__back:focus-visible { outline: none; }
.project__back:focus-visible .project__back-icon { opacity: 1; }

/* Static arrow: shown on touch screens / keyboard focus, where there is no custom cursor */
.project__back-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
@media not all and (hover: hover) and (pointer: fine) {
  .project__back-icon { opacity: 1; }
}

.project__edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--gap) + var(--edge));
  z-index: 2;
}

.project__sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--gap);
  right: 0;
  display: flex;
  background: var(--main-bg);
  color: var(--p-fg);
  border-radius: 14px 0 0 14px;
  overflow: hidden;
  box-shadow: -20px 0 60px -30px rgba(0, 0, 0, .45);
  will-change: transform;
}

.project__side {
  flex: 0 0 clamp(230px, 22vw, 340px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(20px, 2.4vw, 36px) clamp(20px, 2.4vw, 36px) clamp(28px, 4vh, 48px);
  background: var(--side-bg);
  font-family: var(--font-body);
}

/* The logo file is a square with lots of white space: crop to the artwork
   (ink box 77,131 to 361,314 in the 447px image) */
.wh-logo {
  display: block;
  width: clamp(64px, 6vw, 92px);
  aspect-ratio: 285 / 184;
  overflow: hidden;
  margin-bottom: clamp(16px, 2vh, 24px);
}
.wh-logo img {
  display: block;
  width: 156.84%;
  height: auto;
  margin-left: -27.02%;
  margin-top: -45.96%;
  mix-blend-mode: multiply; /* drops the white background */
}
:root[data-theme="dark"] .wh-logo img { filter: invert(1); mix-blend-mode: screen; }

.project__title {
  margin: 0;
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 500;
  letter-spacing: -.005em;
}
.project__kind {
  margin: 2px 0 0;
  font-size: clamp(15px, 1.15vw, 18px);
  color: var(--p-soft);
}

/* Text sits right under the title; the nav stays centered in the space left */
.project__text {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.3;
  letter-spacing: -.005em;
  color: var(--p-fg);
}
.project__text p { margin: 0; }

.project__heading {
  flex: none;
  padding-top: clamp(16px, 2.4vh, 28px);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.3;
}
.project__heading:empty { padding-top: 0; }
.project__heading button { display: block; text-align: left; color: var(--p-fg); transition: color .2s ease; }
.project__heading button:hover,
.project__heading button:focus-visible,
.project__heading button[aria-pressed="true"] { color: var(--p-soft); outline: none; }
.project__heading button[aria-pressed="true"] { margin-bottom: .1em; }
.project__text:empty { padding: 0; }

.project__nav {
  flex: none;
  margin: auto 0; /* vertically centered in the remaining space */
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: clamp(15px, 1.2vw, 18px);
}
.project__nav button {
  color: var(--p-fg);
  transition: color .2s ease;
  text-align: left;
}
.project__nav button:hover,
.project__nav button:focus-visible,
.project__nav button[aria-pressed="true"] { color: var(--p-soft); outline: none; }

.project__frame {
  flex: 1 1 auto;
  min-width: 0;
  padding: clamp(12px, 1.4vw, 20px);
  display: flex;
}
.project__frame { position: relative; overflow: hidden; }
.project__frame:not(.project__frame--shot)::before {
  content: "loading wellhabit.com.au…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--p-soft);
}
.project__frame iframe {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  opacity: 0;
  transition: opacity .4s ease;
}
.project__frame.is-loaded iframe { background: #fff; opacity: 1; }

@media (max-width: 900px) {
  .project__back { padding-left: 0; justify-content: center; width: var(--gap); }
  .project__back-icon { width: 12px; height: 12px; }
  .project { --edge: 10px; }
  .project__sheet { flex-direction: column; border-radius: 12px 0 0 12px; }
  .project__side {
    flex: 0 0 auto;
    padding: 16px 16px 12px;
  }
  .wh-logo { margin-bottom: 8px; width: 58px; }
  .project__text { max-height: 34vh; }
  .project__heading { padding-top: 10px; font-size: 15px; }
  .project__heading:empty { padding-top: 0; }
  .project__nav { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 10px 0 0; font-size: 15px; }
  .project__frame { padding: 8px; }
}

/* ---------- Magenta Cloud case study ---------- */
:is(#magenta, #shiftjuggler, #editorial, #host) {
  --accent: #e20074;
  --p-line: rgba(0, 0, 0, .12);
}
:root[data-theme="dark"] :is(#magenta, #shiftjuggler, #editorial, #host) { --p-line: rgba(255, 255, 255, .14); }

/* Telekom "T" cropped from the All polls screen, as an app-icon tile */
.mc-logo {
  --t: clamp(36px, 3vw, 44px);
  display: block;
  width: var(--t);
  height: var(--t);
  border-radius: 22%;
  background: #e20074 url("assets/magenta/all-polls.png") no-repeat;
  background-size: calc(var(--t) * 1600 / 56) auto;
  background-position: calc(var(--t) * -163 / 56) calc(var(--t) * -8 / 56);
  margin-bottom: clamp(16px, 2vh, 24px);
}

.case {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(12px, 1.4vw, 20px) clamp(16px, 3.4vw, 64px) clamp(56px, 10vh, 120px);
  font-family: var(--font-body);
  color: var(--p-fg);
  outline: none;
}
.case > * { max-width: 980px; margin-inline: auto; }

.case__hero { margin-block: 0; border-radius: 8px; overflow: hidden; background: #c9456a; }
.case__hero img { display: block; width: 100%; height: auto; }

.case__intro {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  padding-top: clamp(28px, 5vh, 56px);
}
.case__lede { margin: 0; font-size: clamp(18px, 1.55vw, 24px); line-height: 1.28; letter-spacing: -.01em; }
.case__meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 14px 20px; font-size: 14px; line-height: 1.3; }
.case__meta dt { color: var(--p-soft); margin-bottom: 2px; }
.case__meta dd { margin: 0; }

.case__block { padding-top: clamp(56px, 10vh, 112px); }
.case__label { margin: 0 0 6px; font-size: 14px; font-weight: 400; color: var(--p-soft); }
.case__note { margin: 0; font-size: 15px; line-height: 1.35; }

/* Design process: a timeline with a loop back from testing to interface */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: clamp(16px, 2vw, 32px);
  margin-top: 22px;
}
.process__list { display: contents; list-style: none; }
.process__list li {
  grid-row: 1;
  position: relative;
  padding-top: 18px;
  border-top: 1px solid var(--p-line);
  font-size: 14px;
  line-height: 1.35;
  color: var(--p-soft);
}
.process__list li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.process__n { display: block; font-size: 12px; margin-bottom: 6px; }
.process__list strong { display: block; margin-bottom: 4px; font-size: 16px; font-weight: 500; color: var(--p-fg); }
.process__return {
  grid-row: 2;
  grid-column: 3 / 5;
  position: relative;
  height: 30px;
  margin: 16px 4px 0 4px;
  border: 1.5px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 16px 16px;
}
.process__return::before { /* arrowhead pointing up into "Interface" */
  content: "";
  position: absolute;
  top: -6px;
  left: -5.5px;
  border: 5px solid transparent;
  border-bottom: 7px solid var(--accent);
  border-top: 0;
}
.process__return span {
  position: absolute;
  left: 50%;
  bottom: -9px;
  translate: -50% 0;
  padding: 0 8px;
  background: var(--main-bg);
  font-size: 12px;
  line-height: 18px;
  color: var(--accent);
  white-space: nowrap;
}

/* User flow overview */
.flowmap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 8px;
  margin-top: 20px;
}
.flowmap__node {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1;
  padding: 9px 13px;
  border: 1px solid var(--p-fg);
  border-radius: 8px;
  color: var(--p-fg);
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
button.flowmap__node:hover,
button.flowmap__node:focus-visible { background: var(--p-fg); color: var(--main-bg); outline: none; }
.flowmap__node.is-alt { border-style: dashed; border-color: var(--p-soft); color: var(--p-soft); }
.flowmap__fork { display: flex; flex-direction: column; gap: 6px; }
.flowmap__fork .flowmap__node { text-align: center; }
.flowmap__arrow { position: relative; width: 18px; height: 1px; background: var(--p-fg); flex: none; }
.flowmap__arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3.5px;
  border: 4px solid transparent;
  border-left: 6px solid var(--p-fg);
  border-right: 0;
}
/* Phones: the flow reads top to bottom, so no arrow is left hanging at a line end */
@media (max-width: 900px) {
  .flowmap { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 8px; }
  .flowmap__fork { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .flowmap__arrow { width: 1px; height: 16px; margin-left: 22px; }
  .flowmap__arrow::after { right: auto; top: auto; left: -3.5px; bottom: -1px; border: 4px solid transparent; border-top: 6px solid var(--p-fg); border-bottom: 0; }
}

/* User flow, step by step */
.steps { list-style: none; margin: clamp(40px, 7vh, 72px) 0 0; padding: 0; }
.step { position: relative; padding: 0 0 clamp(48px, 9vh, 96px) 46px; }
.step::before { /* the rail between steps */
  content: "";
  position: absolute;
  left: 13px;
  top: 34px;
  bottom: 6px;
  width: 1px;
  background: var(--p-line);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step__n {
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
}
.step h4 { margin: 3px 0 6px; font-size: clamp(17px, 1.4vw, 21px); font-weight: 500; letter-spacing: -.005em; }
.step p { margin: 0; max-width: 52ch; font-size: 15px; line-height: 1.4; }
.step__media {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  align-items: start;
  margin-top: 20px;
}
.step__media figure { margin: 0; }
.step__media figcaption { margin-top: 8px; font-size: 13px; color: var(--p-soft); }
.shot {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--p-line), 0 14px 30px -22px rgba(0, 0, 0, .45);
}
.shot img { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .mc-logo { --t: 32px; margin-bottom: 8px; }
  .case { padding: 8px 12px 56px; }
  .case__intro { grid-template-columns: 1fr; gap: 20px; }
  .process { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .process__list li { grid-row: auto; }
  .process__return { display: none; }
  .step { padding-left: 38px; }
  .step__media { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
}

/* Case study: four sections the side menu points to */
.case__body { margin: 14px 0 0; max-width: 58ch; font-size: 15px; line-height: 1.45; }
#mc-process .case__body { margin: 0 0 8px; }
#mc-conclusion .case__lede { max-width: 40ch; }
.project__nav--toc button[aria-pressed="true"] { color: var(--p-soft); }

/* Case study type scale: two sizes only, matching the sidebar text.
   body  = sidebar text size (paragraphs, step titles, process names)
   small = labels, captions, meta, diagram nodes */
:is(#magenta, #shiftjuggler, #editorial, #host) {
  --fs-body: clamp(15px, 1.2vw, 18px);
  --fs-small: 13px;
  --lh-body: 1.35;
}
:is(#magenta, #shiftjuggler, #editorial, #host) .case__lede,
:is(#magenta, #shiftjuggler, #editorial, #host) .case__body,
:is(#magenta, #shiftjuggler, #editorial, #host) .case__note,
:is(#magenta, #shiftjuggler, #editorial, #host) .step h4,
:is(#magenta, #shiftjuggler, #editorial, #host) .step p,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__list strong {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: -.005em;
}
:is(#magenta, #shiftjuggler, #editorial, #host) .case__lede,
:is(#magenta, #shiftjuggler, #editorial, #host) .case__body { max-width: 58ch; }
:is(#magenta, #shiftjuggler, #editorial, #host) .case__body { margin-top: .9em; }
:is(#magenta, #shiftjuggler, #editorial, #host) #mc-process .case__body,
:is(#magenta, #shiftjuggler, #editorial, #host) #mc-conclusion .case__body { margin-top: 0; }
:is(#magenta, #shiftjuggler, #editorial, #host) .case__label,
:is(#magenta, #shiftjuggler, #editorial, #host) .case__meta,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__list li,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__n,
:is(#magenta, #shiftjuggler, #editorial, #host) .flowmap__node,
:is(#magenta, #shiftjuggler, #editorial, #host) .step__media figcaption,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__return span { font-size: var(--fs-small); }
:is(#magenta, #shiftjuggler, #editorial, #host) .process__list strong { margin-top: 2px; }
:is(#magenta, #shiftjuggler, #editorial, #host) .step h4 { margin: 2px 0 4px; }

.case__wide { margin: clamp(40px, 7vh, 72px) 0 0; border-radius: 8px; overflow: hidden; background: #c8177c; }
.case__wide img { display: block; width: 100%; height: auto; }

/* Screen recording of the new-poll flow */
.case__video {
  margin-top: clamp(28px, 5vh, 48px);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--p-line), 0 14px 30px -22px rgba(0, 0, 0, .45);
}
.case__video video { display: block; width: 100%; height: auto; pointer-events: none; }

/* Case study fills the panel with an 80px margin on each side */
.case { padding-inline: 80px; }
.case > * { max-width: none; }
.case__hero { margin-inline: 0; }
@media (max-width: 900px) {
  .case { padding-inline: 12px; }
}

/* Second recording closes the user flow, before the conclusion */
.case__video--end { margin-top: clamp(48px, 9vh, 96px); }
/* More air between the process paragraph and the timeline */
:is(#magenta, #shiftjuggler, #editorial, #host) .process { margin-top: clamp(40px, 6vh, 64px); }
/* One rhythm for the small type (labels, meta, timeline, flow map) */
.project__kind { font-size: clamp(15px, 1.2vw, 18px); }
:is(#magenta, #shiftjuggler, #editorial, #host) .case__label,
:is(#magenta, #shiftjuggler, #editorial, #host) .case__meta,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__list li,
:is(#magenta, #shiftjuggler, #editorial, #host) .flowmap__node,
:is(#magenta, #shiftjuggler, #editorial, #host) .process__return span { line-height: 1.35; }

/* ---------- Shift Juggler case study (shares the Magenta case-study styles) ---------- */
#shiftjuggler { --accent: #8fbc1b; --sj-pain: #e95009; }

.sj-logo {
  --t: clamp(36px, 3vw, 44px);
  display: grid;
  place-items: center;
  width: var(--t);
  height: var(--t);
  border-radius: 22%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--p-line);
  margin-bottom: clamp(16px, 2vh, 24px);
}
.sj-logo img { width: 62%; height: auto; display: block; }

/* Hero: three phones on a soft tint */
.sj-hero {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 48px);
  padding: clamp(28px, 5vw, 72px) clamp(16px, 4vw, 64px) 0;
  background: #eaf4fb;
  max-height: clamp(360px, 46vw, 680px);
  overflow: hidden;
}
.sj-hero img {
  width: min(26%, 300px);
  height: auto;
  border-radius: clamp(14px, 1.8vw, 28px);
  box-shadow: 0 24px 60px -30px rgba(20, 40, 80, .45);
}
.sj-hero img:nth-child(2) { margin-top: clamp(24px, 4vw, 64px); }

/* Phone screens in a row */
.sj-phones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 220px));
  gap: clamp(12px, 1.6vw, 24px);
  margin-top: 20px;
}
.sj-phones img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(12px, 1.4vw, 20px);
  box-shadow: 0 0 0 1px var(--p-line), 0 14px 30px -22px rgba(0, 0, 0, .45);
}
.sj-phones--before { grid-template-columns: repeat(4, minmax(0, 200px)); }
.sj-before-note { margin-top: clamp(48px, 8vh, 80px); }

/* Research numbers */
.sj-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(48px, 8vh, 80px);
}
.sj-stats div { border-top: 1px solid var(--p-line); padding-top: 14px; color: var(--p-soft); }
.sj-stats strong { display: block; margin-bottom: 6px; color: var(--accent); font-weight: 500; letter-spacing: -.01em; }

/* Three problems with their root causes */
.sj-problems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(40px, 7vh, 64px);
}
.sj-problems h4 { margin: 0 0 6px; font-weight: 500; }
.sj-problems p { margin: 0; }
.sj-problems .sj-why { margin-top: 8px; color: var(--p-soft); }
.sj-problems .sj-why::before { content: "Cause: "; color: var(--p-fg); }

/* Onboarding flow, before and after */
.sj-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 48px);
  margin-top: 22px;
  max-width: 900px;
}
.sj-flow h4 { margin: 0 0 12px; font-weight: 500; }
.sj-flow ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sj-flow li {
  position: relative;
  padding: 10px 12px 10px 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .035);
}
.sj-flow li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--p-soft);
}
.sj-flow li.is-pain::before { background: var(--sj-pain); }
.sj-flow li.is-fix::before { background: var(--accent); }
.sj-flow li.is-pain { background: rgba(233, 80, 9, .08); }
.sj-flow li.is-fix { background: rgba(143, 188, 27, .14); }
:root[data-theme="dark"] .sj-flow li { background: rgba(255, 255, 255, .06); }
.sj-flow + .steps { margin-top: clamp(56px, 10vh, 96px); }

/* Same two-size type scale as Magenta */
#shiftjuggler .sj-stats strong,
#shiftjuggler .sj-problems h4,
#shiftjuggler .sj-problems p,
#shiftjuggler .sj-flow h4 { font-size: var(--fs-body); line-height: 1.35; }
#shiftjuggler .sj-stats div,
#shiftjuggler .sj-flow li { font-size: var(--fs-small); line-height: 1.35; }

@media (max-width: 900px) {
  .sj-stats { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .sj-problems, .sj-flow { grid-template-columns: 1fr; }
  .sj-phones--before { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sj-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sj-logo { --t: 32px; margin-bottom: 8px; }
}

/* Sub-blocks: each one names its phase, what it is and what was done */
.sj-sub { margin-top: clamp(64px, 11vh, 112px); max-width: 58ch; }
.sj-sub__phase { display: block; margin-bottom: 6px; color: var(--accent); }
.sj-sub h4 { margin: 0 0 6px; font-weight: 500; }
.sj-sub p { margin: 0; }
#shiftjuggler .sj-sub__phase { font-size: var(--fs-small); line-height: 1.35; }
#shiftjuggler .sj-sub h4,
#shiftjuggler .sj-sub p { font-size: var(--fs-body); line-height: 1.35; }
.sj-sub + .sj-stats,
.sj-sub + .sj-problems,
.sj-sub + .sj-phones,
.sj-sub + .sj-flow { margin-top: 24px; }
#sj-redesign > .case__label + .sj-sub { margin-top: 0; }
.sj-flow + .sj-sub { margin-top: clamp(64px, 11vh, 112px); }
.sj-sub + .steps { margin-top: clamp(32px, 5vh, 48px); }

/* Second block of the same phase sits closer, with no repeated phase label */
.sj-sub.sj-sub--cont { margin-top: clamp(40px, 7vh, 64px); }

/* Header is now a single rendered mockup image */
.sj-hero { display: block; padding: 0; max-height: none; background: #e2edf6; }
.sj-hero img { display: block; width: 100%; height: auto; border-radius: 0; box-shadow: none; margin: 0 !important; }

/* ---------- Shift Juggler: phase colours (from the logo + app) ---------- */
#shiftjuggler [data-phase="discover"] { --phase: #94c11c; }
#shiftjuggler [data-phase="define"]   { --phase: #e85a5a; }
#shiftjuggler [data-phase="ideate"]   { --phase: #2db4e8; }
#shiftjuggler [data-phase="design"]   { --phase: #1f3a5f; }
:root[data-theme="dark"] #shiftjuggler [data-phase="design"] { --phase: #9fb4cc; }

/* Timeline: a coloured line per phase, no dots, description in body size */
#shiftjuggler .process__list li { border-top: 2px solid var(--phase); padding-top: 22px; font-size: var(--fs-body); line-height: 1.35; color: var(--p-soft); }
#shiftjuggler .process__list li::before { display: none; }
#shiftjuggler .process__list strong { margin: 0 0 4px; font-weight: 400; }

/* Phase headings: the name, underlined in the phase colour, one timeline column wide */
#shiftjuggler .sj-sub { max-width: none; }
#shiftjuggler .sj-sub p { max-width: 58ch; }
#shiftjuggler .sj-sub__phase {
  width: calc((100% - 3 * clamp(16px, 2vw, 32px)) / 4);
  min-width: 160px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--phase);
  color: var(--p-fg);
  font-size: var(--fs-body);
}

/* Research numbers as soft cards, text in body size */
#shiftjuggler .sj-stats div {
  border-top: 0;
  padding: clamp(18px, 1.8vw, 26px);
  border-radius: 6px;
  background: rgba(0, 0, 0, .04);
  color: var(--p-fg);
  font-size: var(--fs-body);
}
:root[data-theme="dark"] #shiftjuggler .sj-stats div { background: rgba(255, 255, 255, .05); }
#shiftjuggler .sj-stats strong { margin-bottom: 8px; }

/* Define: the three problems as cards, same as the research numbers */
#shiftjuggler .sj-problems > div {
  padding: clamp(18px, 1.8vw, 26px);
  border-radius: 6px;
  background: rgba(0, 0, 0, .04);
}
:root[data-theme="dark"] #shiftjuggler .sj-problems > div { background: rgba(255, 255, 255, .05); }
#shiftjuggler .sj-sub + .sj-problems { margin-top: 24px; }

/* Define: problem titles in green, like the research numbers */
#shiftjuggler .sj-problems h4 { color: var(--accent); }

/* Red marks problems, green marks fixes */
#shiftjuggler { --sj-pain: #e85a5a; }
#shiftjuggler .sj-problems .sj-why::before { color: var(--sj-pain); }
#shiftjuggler .sj-flow__col:first-child h4 { color: var(--sj-pain); }
#shiftjuggler .sj-flow__col:last-child h4 { color: var(--accent); }
#shiftjuggler .sj-flow li.is-pain { background: rgba(232, 90, 90, .1); }

/* Shift Juggler: the app recording in a phone frame */
.case__video.sj-video {
  width: min(340px, 80%);
  margin: clamp(56px, 10vh, 96px) auto 0;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(135deg, #9aa1aa 0%, #3a3e45 18%, #1c1e22 50%, #3a3e45 82%, #b9c0c8 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 40px 70px -35px rgba(20, 45, 80, .55);
}
.sj-video video { border-radius: 37px; background: #fff; }

/* Tablets: the four "before" screens fit on one row; problem cards stack until there is room for three */
@media (min-width: 560px) and (max-width: 900px) {
  .sj-phones--before { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sj-problems { grid-template-columns: 1fr; }
}


/* Magenta: the second line of the intro, and the three key decisions after the process */
.case__lede--sub { margin-top: .35em; }
.case__lede--title { font-weight: 700; }
.mc-decisions { display: grid; gap: clamp(40px, 7vh, 64px); margin-top: clamp(56px, 10vh, 96px); }
.mc-decision { max-width: 58ch; }
.mc-decision__n { display: block; margin-bottom: 6px; color: var(--accent); font-size: var(--fs-small); line-height: 1.35; }
.mc-decision h4 { margin: 0 0 6px; font-weight: 500; font-size: var(--fs-body); line-height: 1.35; }
.mc-decision p { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); }
:is(#magenta, #shiftjuggler, #editorial, #host) #mc-conclusion .case__body + .case__body { margin-top: .9em; }

/* Shift Juggler: paragraphs that follow each other inside a sub-block */
#shiftjuggler .sj-sub p + p { margin-top: .9em; }

/* ---------- Work page: the case studies as cards ---------- */
.work {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  padding: clamp(16px, 4vh, 48px) clamp(16px, 4vw, 56px);
}
.work[hidden] { display: none; }
.work__grid {
  list-style: none;
  margin: auto; /* centred when it fits, scrolls from the top when it doesn't */
  padding: 0;
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4.5vw, 64px);
}.work-card { display: block; color: inherit; text-decoration: none; font-family: var(--font-ui); }
.work-card__img {
  display: block;
  aspect-ratio: 572 / 350;
  overflow: hidden;
  background: var(--fg);
}
.work-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.22, 1, .36, 1);
}
.work-card__title {
  display: inline-block;
  margin: 14px 8px 0;
  font-size: var(--corner);
  font-weight: 500;
  background: linear-gradient(currentColor, currentColor) no-repeat 50% 96% / 0% 1.5px;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1);
}
.work-card__desc { display: block; margin: 4px 8px 0; font-size: clamp(14px, 1.1vw, 16px); }
.work-card:hover .work-card__img img,
.work-card:focus-visible .work-card__img img { transform: scale(1.035); }
.work-card:hover .work-card__title,
.work-card:focus-visible .work-card__title { background-size: 100% 1.5px; }
.work-card:focus-visible { outline: none; }

@media (max-width: 720px) {
  .work { align-items: flex-start; }
  .work__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Sites that can't be embedded: a capture of the page, linking to the real one */
.project__frame--shot { color: inherit; text-decoration: none; }
/* The capture spans the full width from the top; the page's own white continues below it */
.project__shot { flex: 1; min-height: 0; overflow: hidden; border-radius: 6px; background: #fff; }
.project__shot img { display: block; width: 100%; height: auto; }


/* ---------- Editorial design ---------- */
#editorial { --accent: #1f4fd8; }
#editorial .case__hero,
#editorial .case__wide { background: #e6e6e6; }
#editorial #ed-bde .case__hero { margin-top: 0; }
/* Two images side by side at the same height (each figure grows by its aspect ratio) */
.ed-pair { display: flex; gap: clamp(12px, 1.6vw, 24px); margin-top: clamp(40px, 7vh, 72px); }
.ed-pair figure { flex: 1 1 0; min-width: 0; margin: 0; border-radius: 8px; overflow: hidden; background: #e6e6e6; }
.ed-pair img { display: block; width: 100%; height: auto; }
#editorial .case__wide + .case__wide,
#editorial .ed-pair + .case__wide,
#editorial .case__wide + .ed-pair { margin-top: clamp(12px, 1.6vw, 24px); }
@media (max-width: 560px) {
  .ed-pair { flex-direction: column; }
  .ed-pair figure { flex-grow: 1 !important; }
}

/* ---------- HOST ---------- */
#host { --accent: #6f5380; }
/* some brand boards are near-white: a hairline edge keeps them off the page background */
#host .case__wide,
#host .ed-pair figure { background: none; outline: 1px solid var(--p-line); outline-offset: -1px; }
#host .case__hero { background: #32253a; }
#host .ed-pair + .case__wide,
#host .case__wide + .ed-pair { margin-top: clamp(12px, 1.6vw, 24px); }
#host .case__label.host-sub { margin-top: clamp(48px, 8vh, 80px); }
#host .case__label + .ed-pair,
#host .case__label + .case__wide,
#host .case__label + .host-swatches { margin-top: 12px; }
.host-swatches { list-style: none; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; }
.host-swatch {
  display: flex; align-items: flex-end;
  min-height: clamp(44px, 6vw, 72px);
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: .06em;
}
.host-swatch--dark { color: #32253a; }
.host-swatch--light { color: #f3f3f3; }
#host .case__body + .host-swatches { margin-top: 24px; }
