/* Case study pages. Six sections in this order: Summary, Problem, Research, Decisions, Final screens, Next.
   Hero: H1, then the facts strip with Role and Problem as the anchors and the target last and plain.
   Right after it, the key screens strip (2 or 3 real screens with one decision each).
   Ruled lines, mono labels, figures numbered "Fig. n", one ultramarine accent.
   Real artefacts (sketches, screens) always sit on their own light plate, in both themes. */

/* ---------- shared bits ---------- */
.fig-cap { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; color: var(--ink-2); margin-top: 12px; text-wrap: pretty; }
.fig-n { color: var(--ink); margin-inline-end: 10px; white-space: nowrap; }
.k { color: var(--ink-3); margin-bottom: 12px; }
.sub { font-size: 15px; font-weight: 520; line-height: 1.3; margin: clamp(56px, 6vw, 88px) 0 0; padding-top: 12px; border-top: 1px solid var(--rule); }
.plate { display: block; background: var(--plate); border: 1px solid var(--plate-edge); padding: clamp(10px, 1.2vw, 18px); }
[data-theme="dark"] .plate, [data-theme="dark"] .shot, [data-theme="dark"] .phone img { filter: brightness(.94); }
button.plate, button.phone { cursor: zoom-in; }

/* the CSS device frame: proportional corners, so it scales with the screen */
.phone { position: relative; display: block; width: 100%; padding: 2.4%; background: var(--bezel); border-radius: 15% / 7%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent), 0 18px 40px -24px rgba(0, 0, 0, .45); }
.phone img, .phone .scr { border-radius: 12.6% / 5.85%; }
.phone img { width: 100%; height: auto; background: #f1f1f1; }
.phone .scr { position: relative; overflow: visible; }
.phone .scr img { border-radius: inherit; }
button.phone { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
button.phone:hover { transform: translateY(-3px); }
button.phone:focus-visible { outline-offset: 4px; border-radius: 15% / 7%; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(18px, 2.6vh, 32px); }
.crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink-2); font-size: 12px; }
.crumb a { color: var(--ink); text-decoration: none; padding-block: 4px; }
.crumb a:hover { text-decoration: underline; }
.crumb-t { margin-inline-start: auto; color: var(--ink-3); }
.hero-text { margin-top: clamp(24px, 4vh, 44px); max-width: 60em; }
.eyebrow { font-size: 17px; font-weight: 520; line-height: 1.3; }
.eyebrow span { color: var(--ink-2); font-weight: 400; }
.hero h1 { margin-top: 14px; font-weight: 440; font-size: clamp(40px, 4.6vw, 70px); line-height: 1.04; letter-spacing: -.026em; text-wrap: balance;
  font-variation-settings: "wght" 440; }
.hero-lede { margin-top: 24px; font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 40em; text-wrap: pretty; }

/* facts strip: Role and Problem first and larger; then scope, timeline, platform; the target last and plain */
.facts-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); margin-top: clamp(36px, 5vh, 56px);
  border-top: 1px solid var(--ink); }
.facts-strip > div { grid-column: span 3; padding: 12px 0 14px; min-width: 0; border-top: 1px solid var(--rule); }
.facts-strip > .fs-key { border-top: 0; padding-bottom: 20px; }
.facts-strip > .fs-role { grid-column: 1 / 4; }
.facts-strip > .fs-problem { grid-column: 4 / 13; }
.facts-strip dt { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.facts-strip dd { font-size: 15.5px; line-height: 1.4; margin-top: 4px; text-wrap: balance; }
.facts-strip .fs-key dd { font-size: clamp(19px, 1.55vw, 23px); line-height: 1.3; font-weight: 470; letter-spacing: -.006em; margin-top: 6px; max-width: 30em; }

/* key screens: three phones, each with the decision behind it */
.keys { margin-top: clamp(48px, 6vw, 88px); }
.keys-h { font-size: 12px; font-weight: 400; color: var(--ink-2); padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.keys-row { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--g); margin-top: 28px; }
.keys-row > li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(14px, 1.6vw, 24px); align-items: end; }
.key-v { min-width: 0; }
.key-k { display: grid; gap: 2px; font-size: 12px; color: var(--ink); }
.key-k span { color: var(--data-ink); }
.key-t { margin-top: 8px; font-size: 15.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.key-c { padding-bottom: 8px; }
.sub-t { margin-top: 10px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 40em; text-wrap: pretty; }
.sub-t + * { margin-top: 28px; }

/* ---------- body: contents rail + sections ---------- */
.case { margin-top: clamp(24px, 4vw, 48px); }
.rail { display: none; }
.body { min-width: 0; }

.cs { padding-top: clamp(88px, 10vw, 150px); scroll-margin-top: 8px; }
.cs:first-child { padding-top: clamp(56px, 6vw, 96px); }
.cs-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); border-top: 1px solid var(--ink); padding-top: 12px; }
.cs-n { grid-column: 1 / 2; grid-row: 1; color: var(--data-ink); font-size: 12px; line-height: 1.6; }
.cs-head h2 { grid-column: 2 / 13; grid-row: 1; font-size: 15px; font-weight: 520; line-height: 1.5; letter-spacing: 0; }
.cs-sum { grid-column: 2 / 12; margin-top: clamp(18px, 2vw, 28px); font-weight: 430; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.16;
  letter-spacing: -.016em; text-wrap: balance; font-variation-settings: "wght" 430; }
.cs-head + * { margin-top: clamp(36px, 4vw, 60px); }

.cs-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 40px; align-items: start; }
.prose { grid-column: 2 / 8; display: grid; gap: 1em; }
.prose p, .prose-s { font-size: 17px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; max-width: 38em; }

/* overview: four phases on a two-month axis */
.phases { grid-column: 9 / 13; padding-top: 4px; }
.ph-bar { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 3px; }
.ph-bar li { display: grid; gap: 8px; min-width: 0; }
.ph-bar span { font-family: var(--mono); font-size: 11.5px; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 1px; }
.ph-bar li::after { content: ""; display: block; height: 8px; background: var(--data); }
.ph-bar li:first-child::after { box-shadow: -1px 0 0 0 var(--data); }
.ph-axis { position: relative; display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ink);
  font-family: var(--mono); font-size: 12px; color: var(--ink); }
.ph-axis::before, .ph-axis::after { content: ""; position: absolute; top: -1px; height: 9px; width: 1px; background: var(--ink); }
.ph-axis::before { inset-inline-start: 0; }
.ph-axis::after { inset-inline-end: 0; }

/* problem */
.causes { grid-column: 2 / 6; }
.dash-list { list-style: none; display: grid; gap: 10px; }
.dash-list li { position: relative; padding-inline-start: 22px; font-size: 17px; line-height: 1.45; }
.dash-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .74em; width: 12px; height: 1px; background: var(--ink-2); }
.core { grid-column: 7 / 13; }
.core-list { list-style: none; counter-reset: c; border-top: 1px solid var(--rule); }
.core-list li { counter-increment: c; display: grid; grid-template-columns: 30px minmax(0, 13em) minmax(0, 1fr); column-gap: 14px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--rule); }
.core-list li::before { content: "0" counter(c); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.core-list b { font-weight: 520; font-size: 15.5px; line-height: 1.35; }
.core-list span { font-size: 15px; line-height: 1.45; color: var(--ink-2); }

/* goals */
.goals { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); row-gap: 0; margin-inline-start: calc((100% + var(--g)) / 12); }
.goals li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: baseline; padding: 16px 0 20px; border-top: 1px solid var(--rule); }
.g-n { color: var(--data-ink); font-size: 12px; }
.goals p { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.35; text-wrap: pretty; max-width: 24em; }

/* research */
.method { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-inline-start: calc((100% + var(--g)) / 12); font-size: 12px; color: var(--ink-2); }
.method span { color: var(--data-ink); }
.insights { list-style: none; margin-top: 28px; margin-inline-start: calc((100% + var(--g)) / 12); border-top: 1px solid var(--ink); counter-reset: i; }
.insights li { counter-increment: i; display: grid; grid-template-columns: 40px minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--g); align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule); }
.insights li::before { content: "I" counter(i); font-family: var(--mono); font-size: 12px; color: var(--data-ink); }
.insights h3 { font-weight: 480; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; letter-spacing: -.01em; }
.insights p { font-size: 16.5px; line-height: 1.5; color: var(--ink-2); }
.pull { margin-top: clamp(48px, 5vw, 72px); margin-inline-start: calc((100% + var(--g)) / 12); max-width: 820px; padding-inline-start: 22px; border-inline-start: 3px solid var(--data); }
.pull p { font-weight: 420; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.2; letter-spacing: -.014em; text-wrap: balance; }
.pull footer { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }

/* direction: questions, then the trace */
.hmw { list-style: none; counter-reset: h; margin-inline-start: calc((100% + var(--g)) / 12); display: grid; gap: 14px; }
.hmw li { counter-increment: h; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: baseline; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.3; }
.hmw li::before { content: "HMW " counter(h); font-family: var(--mono); font-size: 11.5px; color: var(--data-ink); white-space: nowrap; }

.trace { margin-top: clamp(44px, 5vw, 72px); }
.trace table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.trace th, .trace td { text-align: start; vertical-align: top; padding: 14px 14px 16px 0; }
.trace thead th { font-family: var(--mono); font-weight: 400; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); padding-top: 0; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.trace thead th:first-child { width: 20%; }
.trace tbody tr { border-bottom: 1px solid var(--rule); }
.trace tbody th { font-weight: 520; font-size: 16px; line-height: 1.35; position: relative; padding-inline-start: 18px; }
.trace tbody th::before { content: ""; position: absolute; inset-inline-start: 0; top: 21px; width: 8px; height: 8px; background: var(--data); }
.trace td { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.trace td a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--data) 55%, transparent); }
.trace td a:hover { text-decoration-color: var(--data); }
.trace td.none { color: var(--ink-3); }
.trace tr.is-next { border-bottom: 1.25px dashed var(--data); }
.trace tr.is-next th::before { background: none; border: 1.25px dashed var(--data); }

/* process */
.cs-cols--wf { align-items: start; }
.wf-wins { grid-column: 2 / 7; list-style: none; display: grid; gap: 8px; }
.wf-wins li { position: relative; padding-inline-start: 26px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.3; }
.wf-wins li::before { content: ""; position: absolute; inset-inline-start: 0; top: .5em; width: 14px; height: 6px; background: var(--data); }
.cs-cols--wf .prose-s { grid-column: 8 / 13; font-size: 16px; }

.sheets { margin-top: clamp(40px, 4vw, 56px); margin-inline-start: calc((100% + var(--g)) / 12); }
.sheets-in { display: grid; grid-template-columns: 700fr 700fr; column-gap: var(--g); align-items: start; }
.plate--sheet { transition: border-color .15s; }
.plate--sheet:hover { border-color: var(--ink-3); }

.pairs { list-style: none; margin-top: 8px; margin-inline-start: calc((100% + var(--g)) / 12); }
.pair { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); column-gap: var(--g); row-gap: 20px; align-items: start;
  padding: clamp(24px, 3vw, 40px) 0; border-bottom: 1px solid var(--rule); }
.pair-a { grid-column: 1 / 5; }
.pair-t { grid-column: 5 / 9; }
.pair-b { grid-column: 9 / 12; }
.pair figcaption { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.pair-a .plate { display: grid; place-items: center; }
.pair-a .plate img { width: auto; max-width: 100%; max-height: 300px; }
.shot { background: #f1f1f1; padding: clamp(10px, 1.2vw, 16px); border: 1px solid var(--plate-edge); }
.shot img { width: 100%; max-width: 300px; margin-inline: auto; border-radius: 10px; }
.shot--bar img { max-width: 100%; border-radius: 8px; }
.note-k { font-size: 11.5px; color: var(--ink-3); }
.note { margin-top: 6px; font-style: italic; font-size: 18px; line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.note--split { display: grid; gap: 8px; }
.note-v { display: grid; gap: 2px; }
.note-v .mono { font-style: normal; font-size: 11.5px; color: var(--data-ink); }
.pair-r { margin-top: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.pair-r .mono { display: block; font-size: 11.5px; color: var(--data-ink); margin-bottom: 4px; }
.pair-why { margin-top: 14px; padding-inline-start: 14px; border-inline-start: 2px solid var(--data); font-size: 15.5px; line-height: 1.45; font-weight: 500; text-wrap: pretty; }
/* the tab bar pair is wide: sketch and screen side by side, the words underneath */
.pair--wide { align-items: center; }
.pair--wide .pair-a { grid-column: 1 / 7; grid-row: 1; }
.pair--wide .pair-b { grid-column: 7 / 12; grid-row: 1; }
.pair--wide .pair-a .plate img { max-height: none; width: 100%; }
.pair--wide .pair-t { grid-column: 1 / 9; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--g); align-items: start; }
.pair--wide .pair-t > .note-k { grid-column: 1 / -1; }
.pair--wide .pair-r { grid-column: 1; margin-top: 18px; }
.pair--wide .pair-why { grid-column: 2; margin-top: 18px; align-self: start; }
.pair--wide .note--split { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; column-gap: var(--g); }

/* final screens: one phone, numbered pins, captions that say what each decision does */
.screen { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 28px; align-items: center; scroll-margin-top: 16px; }
.screen + .screen { margin-top: clamp(64px, 7vw, 112px); }
.screen-v { grid-column: 2 / 6; display: flex; justify-content: center; }
.phone--l { max-width: 320px; }
.screen-t { grid-column: 7 / 12; }
.screen--flip .screen-v { grid-column: 8 / 12; grid-row: 1; }
.screen--flip .screen-t { grid-column: 2 / 7; grid-row: 1; }
.screen-k { font-size: 12px; color: var(--data-ink); }
.screen-t h3 { margin-top: 8px; font-weight: 460; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.12; letter-spacing: -.016em; text-wrap: pretty; }
.screen-sum { margin-top: 10px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.calls { list-style: none; margin-top: 24px; border-top: 1px solid var(--rule); }
.calls li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.calls p { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.calls b { color: var(--ink); font-weight: 520; }
.call-n, .pin { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2b3ee0; color: #fff;
  font-family: var(--mono); font-size: 11.5px; line-height: 1; }
.call-n { transform: translateY(-1px); }
.pin { position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .25); z-index: 1; }
.screen .fig-cap { margin-top: 16px; }

.flow { margin-top: clamp(72px, 8vw, 120px); scroll-margin-top: 16px; }
.flow .sub { margin-top: 0; }
.flow-row { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 40px); row-gap: 36px; margin-top: 28px; }
.flow-row li { min-width: 0; }
.flow-row .phone { max-width: 240px; }
.flow-k { margin-top: 14px; font-size: 12px; color: var(--ink); }
.flow-k span { color: var(--data-ink); margin-inline-end: 8px; }
.flow-t { margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; max-width: 22em; }
.flow > .fig-cap { margin-top: 24px; }

/* design system */
.ds { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 48px; align-items: start; }
.ds-col:first-child { grid-column: 2 / 7; }
.ds-col:last-child { grid-column: 8 / 13; display: grid; gap: 44px; }
.sw-list { list-style: none; border-top: 1px solid var(--ink); }
.sw { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.sw-chip { grid-row: 1 / 3; align-self: start; width: 56px; height: 56px; display: block; }
.sw-chip { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }
.sw-chip--line { box-shadow: inset 0 0 0 1px var(--rule-2); }
.sw-name { font-weight: 520; font-size: 16px; }
.sw-hex { font-size: 12.5px; color: var(--ink); justify-self: end; }
.sw-use { grid-column: 2 / 4; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.ds-k { font-size: 11.5px; color: var(--ink-3); padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.ds-face { margin-top: 14px; font-size: 24px; font-weight: 500; line-height: 1.2; }
.ds-why { margin-top: 4px; font-size: 15.5px; color: var(--ink-2); line-height: 1.45; }
.ds-inuse { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-top: 16px; }
.plate--crop { background: #f1f1f1; display: grid; place-items: center; padding: 12px; }
.ds-comp .plate--crop { background: #fff; }
.ds-inuse .plate--crop:first-child { flex: 0 0 auto; }
.ds-inuse .plate--crop:last-child { flex: 1 1 260px; }
.ds-comp-row { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-top: 16px; align-items: flex-end; }
.ds-c { display: grid; gap: 8px; }
.ds-c:first-child { flex: 0 0 auto; }
.ds-c:last-child { flex: 1 1 300px; }
.ds-c .mono { font-size: 11.5px; color: var(--ink-3); }
.ds-c .plate--crop { min-height: 100px; }

/* the target: plain, labelled, never louder than the work */
.exp { margin-inline-start: calc((100% + var(--g)) / 12); border-top: 1px solid var(--ink); padding-top: 12px; }
.exp-tag { font-size: 12px; color: var(--ink-2); }
.exp-big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); row-gap: 20px; margin-top: 18px; }
.exp-big p { display: grid; gap: 6px; align-content: start; }
.exp-big b { font-weight: 400; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
.exp-big span { font-size: 17px; line-height: 1.35; max-width: 22em; color: var(--ink-2); text-wrap: balance; }
/* a result told in a word ("Fewer", "One") instead of a number: set in the text face, smaller */
.exp-big p.is-word b { font-family: var(--sans); font-weight: 460; font-size: clamp(22px, 2vw, 28px); line-height: 1.2; letter-spacing: -.01em; }
.exp-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); margin-top: 28px; border-top: 1px solid var(--rule); }
.exp-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.exp-list .arr { font-size: 17px; line-height: 1.3; color: var(--ink-2); }
.exp-list b { font-weight: 520; font-size: 16px; }
.exp-list p { font-size: 15px; line-height: 1.45; color: var(--ink-2); margin-top: 2px; }
.impact-note { margin-top: 28px; margin-inline-start: calc((100% + var(--g)) / 12); max-width: 44em; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.impact-note b { color: var(--ink); font-weight: 540; }
.impact-note + .sub { margin-inline-start: calc((100% + var(--g)) / 12); }

/* what next */
.nexts { list-style: none; counter-reset: n; margin-inline-start: calc((100% + var(--g)) / 12); border-top: 1px solid var(--ink); }
.nexts > li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--g); align-items: baseline;
  padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.nexts > li::before { content: "N" counter(n); font-family: var(--mono); font-size: 12px; color: var(--data-ink); }
.nexts h3 { font-weight: 480; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.25; letter-spacing: -.008em; text-wrap: pretty; }
.nexts p { font-size: 16px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.open-notes { list-style: none; display: grid; gap: 10px; }
.open-notes li { display: grid; grid-template-columns: 86px minmax(0, 1fr); column-gap: 10px; align-items: baseline; font-style: italic; font-size: 16px; line-height: 1.45; }
.open-notes .mono { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

/* more work */
.more { padding-top: clamp(64px, 7vw, 104px); }
.more-l { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-inline-start: calc((100% + var(--g)) / 12); padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15.5px; }
.more-l a { white-space: nowrap; padding-block: 6px; }

/* template placeholders: a neutral box standing in for an image until the real one is added */
.ph { display: grid; place-items: center; min-height: 160px; aspect-ratio: var(--ar, 16 / 10); background: var(--paper-2); border: 1px dashed var(--rule-2);
  font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: center; padding: 12px; }
.tpl-note { margin-top: 24px; padding: 12px 16px; border: 1px solid var(--rule-2); font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-2); }

/* enlarge dialog */
.zoom { border: 0; padding: 0; margin: auto; background: var(--paper); color: var(--ink); max-width: min(94vw, 1100px); max-height: 94vh; overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4); }
.zoom::backdrop { background: rgba(10, 11, 13, .74); }
.zoom-in { position: relative; padding: 52px clamp(14px, 2vw, 24px) 18px; display: grid; justify-items: center; gap: 12px; }
.zoom-img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(94vh - 120px); background: #fff; }
.zoom-cap { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; text-align: center; }
.zoom-x { position: absolute; top: 10px; inset-inline-end: 12px; display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px;
  border: 1px solid var(--rule-2); font-size: 14px; }
.zoom-x:hover { border-color: var(--ink); }
.zoom-x .mono { font-size: 11px; color: var(--ink-3); }

/* ---------- wide desktop: the contents rail ---------- */
@media (min-width: 1280px) {
  .case { display: grid; grid-template-columns: 176px minmax(0, 1fr); column-gap: clamp(28px, 3vw, 56px); align-items: start; }
  .rail { display: block; position: sticky; top: 24px; margin-top: clamp(56px, 6vw, 96px); }
  .rail-h { font-size: 11.5px; color: var(--ink-3); padding-bottom: 10px; }
  .rail ol { list-style: none; border-inline-start: 1px solid var(--rule-2); }
  .rail a { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); padding: 5px 0 5px 14px; font-size: 13.5px; line-height: 1.35;
    color: var(--ink-2); text-decoration: none; transition: color .15s; }
  .rail a span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); line-height: 1.6; }
  .rail a::before { content: ""; position: absolute; inset-inline-start: -2px; top: 4px; bottom: 4px; width: 3px; background: transparent; transition: background-color .15s; }
  .rail a:hover { color: var(--ink); }
  .rail a.is-on { color: var(--ink); }
  .rail a.is-on::before { background: var(--data); }
  .rail a.is-on span { color: var(--data-ink); }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .facts-strip > div { grid-column: span 6; }
  .facts-strip > .fs-role { grid-column: 1 / 5; }
  .facts-strip > .fs-problem { grid-column: 5 / 13; }
  .keys-row > li { grid-template-columns: 1fr; row-gap: 16px; align-items: start; }
  .key-v { max-width: 220px; }
  .cs-sum { grid-column: 2 / 13; }
  .prose { grid-column: 2 / 13; }
  .phases { grid-column: 2 / 10; }
  .causes { grid-column: 2 / 13; }
  .core { grid-column: 2 / 13; }
  .wf-wins { grid-column: 2 / 13; }
  .cs-cols--wf .prose-s { grid-column: 2 / 11; }
  .screen-v { grid-column: 1 / 6; }
  .screen-t { grid-column: 6 / 13; }
  .screen--flip .screen-v { grid-column: 8 / 13; }
  .screen--flip .screen-t { grid-column: 1 / 8; }
  .ds-col:first-child { grid-column: 1 / 7; }
  .ds-col:last-child { grid-column: 7 / 13; }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .crumb-t { margin-inline-start: 0; flex-basis: 100%; }
  .hero-text { margin-top: 22px; }
  .eyebrow { font-size: 16px; }
  .hero h1 { font-size: clamp(34px, 10vw, 46px); line-height: 1.06; }
  .hero-lede { font-size: 16.5px; margin-top: 18px; }
  .facts-strip { margin-top: 32px; }
  .facts-strip > div, .facts-strip > .fs-role, .facts-strip > .fs-problem { grid-column: 1 / -1; }
  .facts-strip > .fs-problem { border-top: 1px solid var(--rule); padding-top: 12px; }
  .facts-strip > div:nth-child(n+3) { grid-column: span 6; }
  .facts-strip dd { font-size: 15px; }
  .facts-strip .fs-key dd { font-size: 19px; }
  .keys-row { grid-template-columns: 1fr; row-gap: 28px; margin-top: 22px; }
  .keys-row > li { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); align-items: center; }
  .key-v { max-width: none; }
  .key-t { font-size: 15px; }

  .cs { padding-top: 80px; }
  .cs:first-child { padding-top: 56px; }
  .cs-head { display: block; }
  .cs-n { display: inline; margin-inline-end: 12px; }
  .cs-head h2 { display: inline; }
  .cs-sum { font-size: clamp(24px, 6.8vw, 30px); line-height: 1.18; margin-top: 16px; }
  .cs-head + * { margin-top: 32px; }
  .cs-cols { display: block; }
  .cs-cols > * + * { margin-top: 36px; }
  .prose p { font-size: 16.5px; }
  .goals, .method, .insights, .pull, .hmw, .sheets, .pairs, .exp, .impact-note, .impact-note + .sub, .nexts, .more-l { margin-inline-start: 0; }

  .core-list li { grid-template-columns: 28px minmax(0, 1fr); row-gap: 2px; }
  .core-list span { grid-column: 2; }
  .goals { grid-template-columns: 1fr; }
  .goals li { padding: 14px 0 16px; }
  .insights li, .nexts > li { grid-template-columns: 34px minmax(0, 1fr); row-gap: 6px; }
  .insights li > p, .nexts > li > p, .nexts > li > .open-notes { grid-column: 2; }
  .hmw li { grid-template-columns: 1fr; gap: 2px; }
  .open-notes li { grid-template-columns: 1fr; gap: 0; }

  /* the trace table becomes one block per direction */
  .trace table, .trace tbody, .trace tr, .trace th, .trace td { display: block; width: auto; }
  .trace thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .trace tbody tr { padding: 14px 0 12px; border-bottom: 1px solid var(--rule); }
  .trace tbody tr:first-child { border-top: 1px solid var(--ink); }
  .trace tbody th { padding: 0 0 8px 18px; font-size: 17px; }
  .trace tbody th::before { top: 7px; }
  /* label column drawn by ::before, the cell stays one block of inline text (so ", " between two links stays inline) */
  .trace td { --lab: 138px; display: flow-root; padding: 5px 0 5px calc(var(--lab) + 10px); font-size: 14.5px; }
  .trace td::before { content: attr(data-l); float: left; width: var(--lab); margin-left: calc(-1 * var(--lab) - 10px); font-family: var(--mono); font-size: 11px; line-height: 1.75; color: var(--ink-3); }
  [dir="rtl"] .trace td { padding: 5px calc(var(--lab) + 10px) 5px 0; }
  [dir="rtl"] .trace td::before { float: right; margin-left: 0; margin-right: calc(-1 * var(--lab) - 10px); }
  .trace tr.is-next { border-bottom: 1.25px dashed var(--data); }

  .sheets-in { grid-template-columns: 1fr; row-gap: 12px; }
  .pair, .pair--wide { display: block; padding: 28px 0 32px; }
  .pair-t { margin-top: 20px; }
  .pair-b { margin-top: 22px; }
  .pair--wide .pair-t { display: block; }
  .pair--wide .note--split { grid-template-columns: 1fr; }
  .pair-b .shot img { max-width: 280px; }

  .screen, .screen--flip { display: block; }
  .screen-v { display: flex; justify-content: center; padding-inline: 34px; }
  .phone--l { max-width: 250px; }
  .pin { width: 19px; height: 19px; font-size: 10.5px; }
  .screen-t { margin-top: 28px; }
  .flow-row { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; row-gap: 30px; }
  .flow-t { font-size: 14px; }

  .ds { display: block; }
  .ds-col:last-child { margin-top: 44px; gap: 40px; }
  .sw { grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 12px; }
  .sw-chip { width: 48px; height: 48px; }

  .exp-big, .exp-list { grid-template-columns: 1fr; }
  .exp-big b { font-size: 34px; }
  .exp-big p.is-word b { font-size: 24px; }
  .exp-big span { font-size: 17px; }

  .zoom-in { padding: 50px 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  button.phone, .rail a, .rail a::before { transition: none; }
  button.phone:hover { transform: none; }
}

/* ---------- the case study's accent (body data-accent maps --data and --data-ink to it, see tokens.css) ---------- */
.crumb > span:nth-child(3) { color: var(--data-ink); }
.hero-text .case-tags { margin-top: 24px; }
.body a:not(.btn):not(.phone):not(.plate) { text-decoration-color: color-mix(in srgb, var(--data) 60%, transparent); }
.body a:not(.btn):not(.phone):not(.plate):hover { text-decoration-color: var(--data); }

/* ---------- slight parallax on the final screens (js/shared.js sets --py; off under reduced motion) ---------- */
.has-px .screen-v { transform: translate3d(0, var(--py, 0px), 0); will-change: transform; }
@media (prefers-reduced-motion: reduce) { .has-px .screen-v { transform: none; } }

/* enlarge on phones: a wide image at its readable size in a pan area (js/case.js adds .zoom-pan, the hint and the toggle) */
.zoom-pan { display: grid; justify-items: center; justify-self: stretch; width: 100%; min-width: 0; }
.zoom.is-pan { width: 94vw; overflow: hidden; }
.zoom.is-pan .zoom-pan { justify-items: start; width: 100%; max-height: calc(94dvh - 150px); overflow: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; cursor: grab; background: #fff; box-shadow: inset 0 0 0 1px var(--rule-2); }
.zoom.is-pan .zoom-pan.is-dragging { cursor: grabbing; }
.zoom.is-pan .zoom-img { max-width: none; max-height: none; }
.zoom-hint { font-size: 11.5px; line-height: 1.5; color: var(--ink-2); justify-self: start; }
.zoom-fit { position: absolute; top: 10px; inset-inline-start: 12px; display: inline-flex; align-items: center; height: 34px; padding: 0 12px;
  border: 1px solid var(--rule-2); font-size: 14px; white-space: nowrap; }
.zoom-fit:hover { border-color: var(--ink); }
.zoom-fit[hidden], .zoom-hint[hidden] { display: none; }
