/* Edgewater case studies (case-studies/*.html): one page per case, built from one template (head, at a glance and the
   client's words, the need and what we did, the result, announcements, the next case), and the index of all of them.
   Loaded after core.css and inner.css. No page script: core.js runs the reveals, the counters and the timeline's
   in-view class; the drawing is CSS. Hidden start states only under html.motion. */

/* == HEAD: the client's plate. From 1024 px it stands beside the title, its foot on the lede's last line; below,
   it follows the lede == */
.case-client { display: flex; width: fit-content; align-items: center; justify-content: center; gap: 16px;
  margin-top: clamp(22px, 3.2vh, 36px); padding: 16px 22px; background: #fff;
  outline: 1px solid rgba(255,255,255,.42); outline-offset: 6px; }
/* a short rule between a sponsor and its portfolio company: upright beside, flat between stacked logos */
.lg-rule { flex: none; width: 1px; height: 22px; background: #BFC6CF; }
.case-client img { width: auto; height: calc(var(--lh, 26) * .85px); }
.case-client--hig img { width: 112px; height: auto; }
/* from 1024 px the pair stacks; both plates grow with the title */
@media (min-width: 1024px) {
  .case-client { flex-direction: column; gap: 12px; padding: clamp(18px, 1.5vw, 22px) clamp(24px, 2.1vw, 30px); }
  .case-client img { height: calc(var(--lh, 26) * 1px); }
  .case-client--hig img { width: clamp(124px, 10.4vw, 150px); height: auto; }
  .case-ph .ph-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--gutter); }
  .case-ph .ph-in > * { grid-column: 1; }
  .case-ph .ph-in > .case-client { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0 7px 11px 0; }
  .case-client .lg-rule { width: 28px; height: 1px; }
}
html.motion .case-client { animation: phUp .7s var(--ease) .42s both; }

/* == AT A GLANCE (white): the facts in ruled rows beside the client's own words; a second voice sits under the first,
   smaller, over a rule == */
.case-intro-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 48px; align-items: start; }
.case-facts { grid-column: 1 / span 4; margin: 0; border-top: 1px solid var(--navy); }
.case-facts > div { display: grid; grid-template-columns: 6.75rem minmax(0, 1fr); column-gap: 18px; padding: 15px 0 16px; border-bottom: 1px solid var(--line); }
.case-facts dt { padding-top: 4px; font: 600 10.5px/1.5 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--label); }
.case-facts dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.case-says { grid-column: 6 / span 7; position: relative; padding-top: clamp(58px, 5.4vw, 84px); }
.case-mark { position: absolute; top: 0; left: -.06em; height: .5em; font: 400 clamp(120px, 10vw, 164px)/1 var(--serif); color: var(--gold); pointer-events: none; }
html.motion .case-mark { animation: phUp .8s var(--ease) .5s both; }
.case-q p { font: 400 clamp(22px, 2vw, 29px)/1.42 var(--serif); letter-spacing: -.006em; color: var(--navy); text-wrap: pretty; }
.case-q--long p { font-size: clamp(20px, 1.7vw, 25px); line-height: 1.46; }
.case-q figcaption { position: relative; text-wrap: balance; margin-top: 24px; padding-left: 48px; font: 600 11.5px/1.5 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--label); }
.case-q figcaption::before { content: ""; position: absolute; left: 0; top: .72em; width: 32px; height: 1px; background: var(--gold); }
.case-q--2 { margin-top: 40px; padding-top: 34px; border-top: 1px solid var(--line); }
.case-q--2 p { font-size: clamp(19px, 1.55vw, 23px); }

/* == THE CASE (stone): a rule draws; the figure and the need beside what we did; the portfolio; the result == */
.case-body { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 56px; padding-top: clamp(36px, 3.4vw, 52px); }
.case-text { grid-column: 1 / span 5; }
.case-did { grid-column: 7 / span 6; }
.case-figure { display: flex; align-items: flex-end; gap: 22px; padding-bottom: 26px; margin-bottom: 36px; border-bottom: 1px solid var(--stone-rule); }
.case-big { font: 300 clamp(96px, 10vw, 152px)/.78 var(--sans); letter-spacing: -.045em; color: var(--navy); }
.case-big-label { max-width: 12em; padding-bottom: 4px; font: 600 11.5px/1.5 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--label); }
.case-block + .case-block { margin-top: 36px; }
.case-block p { margin-top: 14px; color: var(--slate); }
.case-steps { counter-reset: s; margin-top: 14px; }
.case-steps li { counter-increment: s; position: relative; padding: 12px 0 12px 44px; border-top: 1px solid var(--stone-rule); }
.case-steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 600 12px/1.6 var(--sans); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--gold-deep); }

/* the H.I.G. portfolio (data-pending="hig-portfolio"): to drop it, delete every [data-pending="hig-portfolio"] element and remove
   hidden from every [data-pending-alt="hig-portfolio"] element; the band then follows the body */
.case-portfolio { margin-top: clamp(48px, 4.4vw, 64px); }
.pf-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid var(--stone-rule); border-left: 1px solid var(--stone-rule); transition: border-color .8s var(--ease); }
html.motion .pf-grid[data-r]:not(.in) { border-color: transparent; }
.pf-grid li { background: #fff; border-right: 1px solid var(--stone-rule); border-bottom: 1px solid var(--stone-rule); }
.pf-grid img { width: 100%; aspect-ratio: 400 / 204; }
.case-band { margin-top: clamp(40px, 4vw, 56px); }

/* the timeline: the rule draws, the nodes fill in turn */
.tl { position: relative; }
.tl-track { position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--stone-rule); }
.tl-line { position: absolute; inset: 0; background: var(--navy); transform-origin: left; }
.tl-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: var(--gutter); }
.tl-step { position: relative; padding: 44px 32px 0 0; }
.tl-node { position: absolute; left: 0; top: 1px; width: 11px; height: 11px; background: var(--stone); border: 1px solid var(--navy); transform: rotate(45deg); }
.tl-node::after { content: ""; position: absolute; inset: 1px; background: var(--navy); }
.tl-step h3 { margin-top: 12px; font: 400 clamp(23px, 2.1vw, 30px)/1.2 var(--serif); color: var(--navy); text-wrap: balance; }
.tl-kicker { color: var(--label); }
/* the separator travels with the second half (a real space sits between the halves) */
.tl-kicker .nw:first-child { margin-right: .37em; }
.tl-kicker .nw .sep { margin-left: 0; }
.tl-when { margin-top: 8px; font: 600 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: lining-nums tabular-nums; color: var(--gold-deep); }
.tl-step > p:last-child { margin-top: 14px; max-width: 34em; font-size: 16.5px; color: var(--slate); }
html.motion .tl .tl-line { transition: transform 1.1s var(--ease) .2s; }
html.motion .tl:not(.in) .tl-line { transform: scaleX(0); }
html.motion .tl .tl-node::after { transition: transform .45s var(--ease) calc(.35s + var(--k, 0) * .3s); }
html.motion .tl:not(.in) .tl-node::after { transform: scale(0); }
.tl-step:nth-child(2) { --k: 1; }
.tl-step:nth-child(3) { --k: 2; }
.tl-step:nth-child(4) { --k: 3; }
.tl-step:nth-child(5) { --k: 4; }
/* side by side, each step's rows (kicker, title, date, text) line up with its neighbours' */
@media (min-width: 1024px) {
  .tl-list { grid-template-rows: repeat(4, auto); }
  .tl-step { display: grid; grid-row: span 4; grid-template-rows: subgrid; align-content: start; }
}

/* four or five steps: the columns are narrower, so the step's text steps down */
.tl--4 .tl-step, .tl--5 .tl-step { padding-right: 20px; }
.tl--4 .tl-step > p:last-child, .tl--5 .tl-step > p:last-child { font-size: 16px; }
.tl--5 .tl-step h3 { font-size: clamp(21px, 1.8vw, 26px); }
/* four or five steps: the kicker in two lines at every width, the service in gold */
.tl--4 .tl-kicker .nw, .tl--5 .tl-kicker .nw { display: block; }
.tl--4 .tl-kicker .nw:first-child, .tl--5 .tl-kicker .nw:first-child { margin-right: 0; }
.tl--4 .tl-kicker .sep, .tl--5 .tl-kicker .sep { display: none; }
.tl--4 .tl-kicker .nw + .nw, .tl--5 .tl-kicker .nw + .nw { margin-top: 2px; color: var(--gold-deep); }
/* five steps stand up below 1280 px, as every timeline does below 1024 */
@media (min-width: 1024px) and (max-width: 1279px) {
  .tl--5 { padding-left: 34px; }
  .tl--5 .tl-track { top: 6px; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .tl--5 .tl-line { transform-origin: top; }
  html.motion .tl--5:not(.in) .tl-line { transform: scaleY(0); }
  .tl--5 .tl-list { grid-auto-flow: row; grid-template-rows: none; row-gap: 44px; }
  .tl--5 .tl-step { display: block; grid-row: auto; padding: 0; }
  .tl--5 .tl-node { left: -34px; top: 4px; }
  .tl--5 .tl-step > p:last-child { max-width: 38em; }
}
/* the timeline under the need and what we did; with a figure, what we did runs over the timeline at full measure */
.case-body + .tl { margin-top: clamp(48px, 4.4vw, 64px); }
.case-lead { margin-top: clamp(40px, 3.6vw, 52px); }
.case-lead p { max-width: 46em; }
.case-lead + .tl { margin-top: clamp(36px, 3.2vw, 44px); }
/* the figure stands alone beside the need: no rule under it */
.case-body--fig .case-figure { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

/* == ANNOUNCEMENTS (white): the case's own releases, as Press ledger rows without the plate (the plate is the head's) == */
.case-press-head { margin-bottom: 0; }
.case-press { margin-top: clamp(18px, 1.7vw, 24px); margin-bottom: clamp(56px, 5.4vw, 84px); }
@media (min-width: 768px) and (max-width: 1199px) { .tx--bare { grid-template-columns: 8.5rem minmax(0, 1fr) 22px; } }
@media (min-width: 1200px) { .tx--bare .tx-title { grid-area: 1 / 4 / 3 / 12; } }
/* == NEXT (white): the other case as one row (the title is the link; it covers the row), and the way back == */
/* the row's own top padding is the gap under the label line, so its sweep starts there */
.case-next .ch-head { row-gap: 0; margin-bottom: 0; }
.cn-row { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; grid-template-areas: "kicker logos ." "title logos arrow" "sub logos ."; align-items: start; column-gap: clamp(24px, 3vw, 48px);
  padding: 24px 0 30px; border-bottom: 1px solid var(--line); }
/* the ledger's grammar: stone sweeps in from the left (from under the label line), the arrow nudges */
.cn-row::before { content: ""; position: absolute; top: 1px; bottom: 0; left: -20px; right: -20px; z-index: -1; background: var(--stone); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.cn-row:hover::before, .cn-row:focus-within::before { transform: none; }
.cn-link { color: var(--navy); text-decoration: none; }
/* the link covers the row and the sweep; its focus ring is drawn there */
.cn-link::after { content: ""; position: absolute; inset: 1px -20px 0; }
.cn-link:focus-visible { outline: 0; }
.cn-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.cn-title { grid-area: title; font: 400 var(--t-d2)/1.2 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.cn-t { padding-bottom: 2px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.cn-row:hover .cn-t, .cn-link:focus-visible .cn-t { background-size: 100% 1px; }
.cn-sub { grid-area: sub; max-width: 34em; margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--slate); }
.cn-logos { grid-area: logos; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; width: 13rem; height: 92px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); }
.cn-logos img { width: auto; height: calc(var(--lh, 26) * .82px); }
.cn-logos--hig img { width: 124px; height: auto; }
.cn-logos--pair { gap: 6px; padding-block: 8px; }
.cn-logos .lg-rule { width: 24px; height: 1px; }
/* centred on the title's first line */
.cn-arrow { grid-area: arrow; width: 22px; height: 22px; margin-top: calc(var(--t-d2) * .6 - 11px); fill: none; stroke: var(--navy); stroke-width: 1.5; transition: transform .35s var(--ease-ui); }
.cn-row:hover .cn-arrow, .cn-row:focus-within .cn-arrow { transform: translateX(6px); }
.cn-back { margin-top: 22px; }

/* the work, in small caps over the title */
.cn-kicker { grid-area: kicker; margin-bottom: 8px; color: var(--label); text-wrap: balance; }

/* == INDEX (white): every case as one row, in the homepage's order == */
.case-index { padding-top: clamp(40px, 4vw, 64px); }
.cn-list { border-top: 1px solid var(--navy); }
.cn-list .cn-row { padding-top: 28px; }
.cn-list > li:last-child .cn-row { border-bottom: 0; }

/* == RESPONSIVE == */
@media (max-width: 1199px) {
  .pf-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  /* timeline kickers: two equal lines, the bar dropped, the service in gold */
  .tl-kicker .nw { display: block; }
  .tl-kicker .nw:first-child { margin-right: 0; }
  .tl-kicker .sep { display: none; }
  .tl-kicker .nw + .nw { margin-top: 2px; color: var(--gold-deep); }
}
@media (max-width: 1023px) {
  .case-text, .case-did { grid-column: 1 / -1; }
  .case-block p, .case-steps { max-width: 38em; }
  /* the timeline stands up: the rule draws downwards */
  .tl { padding-left: 34px; }
  .tl-track { top: 6px; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .tl-line { transform-origin: top; }
  html.motion .tl:not(.in) .tl-line { transform: scaleY(0); }
  .tl-list { grid-auto-flow: row; row-gap: 44px; }
  .tl-step { padding: 0; }
  .tl-node { left: -34px; top: 4px; }
  .tl-step > p:last-child { max-width: 38em; }
}
@media (max-width: 767px) {
  .case-big { font-size: 96px; }
  /* four columns, and three on phones (tiles about 113 px), so every name reads; the wall ends on a step */
  .pf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pf-grid img { aspect-ratio: 400 / 240; object-fit: contain; }
  /* the portfolio label sets in two lines from 360 px (balanced, never a lone word, at 320) */
  .case-portfolio .label-rule { letter-spacing: .12em; text-wrap: balance; }
  .case-band .band-in { padding: 24px 20px; }
  .tl-step h3 { font-size: 24px; }
  .tl-step > p:last-child { font-size: 16px; }
  .cn-row { grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "kicker kicker" "title arrow" "sub sub" "logos logos"; column-gap: 16px; padding: 22px 0 26px; }
  .cn-row::before, .cn-link::after { left: -12px; right: -12px; }
  .cn-sub { font-size: 15.5px; }
  .cn-logos { flex-direction: row; gap: 18px; width: auto; height: 64px; margin-top: 18px; justify-self: start; padding: 10px 18px; }
  .cn-logos img { height: calc(var(--lh, 26) * .68px); }
  .cn-logos--hig img { width: 92px; height: auto; }
  .cn-logos .lg-rule { width: 1px; height: 22px; }
}
@media (max-width: 639px) { .pf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 1023px) {
  /* at a glance: the facts in two columns over the words */
  .case-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
  .case-says { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .case-intro-grid { row-gap: 36px; }
  .case-facts { grid-template-columns: minmax(0, 1fr); }
  .case-facts > div { grid-template-columns: 6.25rem minmax(0, 1fr); padding: 12px 0 13px; }
  .case-facts dd { font-size: 15.5px; }
  .case-mark { font-size: 110px; }
  .case-says { padding-top: 52px; }
  .case-q p { font-size: 21px; }
  .case-q--long p, .case-q--2 p { font-size: 19px; }
  .case-press { margin-bottom: 52px; }
  .cn-kicker { margin-bottom: 6px; }
}
/* phones: a long attribution may wrap inside its parenthesis; two logos fit the narrowest plate */
@media (max-width: 479px) { .case-q figcaption .nw { white-space: normal; } }
@media (max-width: 374px) {
  .case-client { gap: 14px; padding-inline: 16px; }
  .case-client img { height: calc(var(--lh, 26) * .76px); }
}

/* == failsafe, forced colours, print == */
/* the timeline's drawing sits below [data-r]: its own copy of core.css's 2.5 s failsafe */
html.motion:not(.ready) .tl[data-r] .tl-line, html.motion:not(.ready) .tl[data-r] .tl-node::after { animation: esg-failsafe .01s 2.5s forwards; }
@media (forced-colors: active) {
  /* logos keep their white plates */
  .case-client, .cn-logos, .pf-grid li { forced-color-adjust: none; background: #fff; }
  .case-client { outline-color: CanvasText; }
  .case-q figcaption::before { forced-color-adjust: none; background: CanvasText; }
  .tl-line, .tl-node, .tl-node::after { forced-color-adjust: none; background: CanvasText; border-color: CanvasText; }
  .cn-arrow { stroke: currentColor; }
  .cn-row:hover .cn-t, .cn-link:focus-visible .cn-t { text-decoration: underline; }
}
@media print {
  .tl-line, .tl-node::after { transform: none !important; }
  .pf-grid { border-color: var(--stone-rule) !important; }
  .case-next .ch-head:not(.case-press-head), .case-next .cn-back { display: none !important; }
  .case-mark { color: var(--gold) !important; }
  .case-client { padding: 0; }
  .case-body, .tl { break-inside: avoid; }
}
