/* Inner pages: the company pages and the case pages. Their first screen is built the way the
   site's first screen is: the name across the paper, the ruled lines running through the
   letters, a large picture at the right, and the words on paper tabs at the left. */

/* ---- first screen of a company page ---- */
.co .co-head { position: sticky; top: 0; z-index: 0; height: 100svh; min-height: 640px; padding: 0; display: block; overflow: hidden;
  --name-top: 11svh; --name-size: min(calc(205vw / var(--chars, 6)), 58svh);
  background: linear-gradient(var(--paper) 0 72px, transparent 72px),
    repeating-linear-gradient(180deg, transparent 0 calc(max(10px, .694vw) - 1.3px), color-mix(in srgb, var(--ink) 62%, transparent) calc(max(10px, .694vw) - 1.3px) max(10px, .694vw)), var(--paper); }
.co-head::after { content: ""; position: absolute; inset: 0; z-index: 9; background: var(--slate); opacity: var(--veil, 0); pointer-events: none; }
.co .co-head > * { position: absolute; }
.co .co-head h1 { left: var(--gutter); right: var(--gutter); top: var(--name-top); z-index: 4; margin: 0; text-align: left; white-space: nowrap; color: #fff; mix-blend-mode: difference;
  font-size: var(--name-size); line-height: .8; font-weight: 900; font-stretch: 75%; letter-spacing: -.02em; text-transform: uppercase; }

/* the picture: a wide frame set into the name, or a cut-out figure standing beside it */
.co .co-head__frame { z-index: 3; left: 34vw; right: 0; bottom: 7svh; top: calc(var(--name-top) + var(--name-size) * .76); margin: 0; overflow: hidden; }
.co-head__frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.co-head__frame figcaption, .still figcaption { position: absolute; right: 14px; bottom: 12px; padding: 5px 9px; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.co .co-head__figure { z-index: 5; right: clamp(24px, 9vw, 150px); bottom: 0; height: min(76svh, 62vw); width: auto; pointer-events: none; }

/* the words: paper tabs at the lower left, as on the first page */
.co .co-head__words { z-index: 6; left: var(--gutter); bottom: 28px; display: grid; gap: 12px; justify-items: start; width: min(350px, 30vw); }
.co-head__lead, .co-head__meta { margin: 0; background: var(--paper); padding: 14px 16px; }
.co-head__lead { max-width: none; font-size: 17px; line-height: 1.42; font-weight: 500; }
.co-head__meta { display: grid; gap: 3px; font-size: 13px; font-weight: 750; letter-spacing: .04em; line-height: 1.5; text-transform: uppercase; }
.co-head__meta i { font-style: normal; color: var(--graphite); font-weight: 650; letter-spacing: .1em; font-size: 12px; }
.co-head__meta b { width: fit-content; color: var(--clay); font-weight: 800; }
.co-head__go { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* everything after the first screen slides over it, as the scenes do on the first page */
.co main > *:not(.co-head), .case main > *:not(.case__head) { position: relative; z-index: 1; }
.co-block.light { background: var(--paper); }

/* ---- rows that lead somewhere say so ---- */
.co-rows li.is-link, .built li.is-link { position: relative; }
.co-rows li.is-link h3 a, .built li.is-link h3 a { color: inherit; text-decoration: none; }
.co-rows li.is-link h3 a::after, .built li.is-link h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.co-rows li.is-link em, .built li.is-link em { grid-column: 3; justify-self: start; font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--clay);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; padding-bottom: 3px; transition: background-size .45s cubic-bezier(.65,.01,.05,.99); }
.co-rows li.is-link em::after, .built li.is-link em::after { content: " \2192"; }
.co-rows li.is-link:hover em, .co-rows li.is-link:focus-within em, .built li.is-link:hover em, .built li.is-link:focus-within em { background-size: 100% 1.5px; }
.co-rows li.is-link h3 a:focus-visible, .built li.is-link h3 a:focus-visible { outline: 2px solid var(--clay); outline-offset: 4px; }
a.card { color: inherit; }

/* ---- what I built, and when: the years stand at the left while their work passes ---- */
.built__years { position: relative; --when: clamp(150px, 21vw, 330px); border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.built__years::before { content: ""; position: absolute; left: calc(var(--when) - 1px); top: 0; bottom: 0; width: 2.5px; background: var(--clay); transform: scaleY(var(--run, 1)); transform-origin: top; }
.built__year { display: grid; grid-template-columns: var(--when) minmax(0, 1fr); border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.built__when { position: sticky; top: 13svh; align-self: start; margin: 0; padding: clamp(18px, 2.2vw, 30px) 0; display: grid; }
.built__when b { font-size: clamp(64px, 9.4vw, 150px); line-height: .82; font-weight: 900; font-stretch: 75%; letter-spacing: -.03em; transition: color .4s; }
.built__when small { margin-top: 8px; font-size: 13px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.built__year.is-now .built__when b { color: var(--clay); }
.built__year ol { --pad: clamp(18px, 3vw, 48px); list-style: none; margin: 0; padding: 0 0 0 var(--pad); }
.built__year li { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: 10px clamp(16px, 3vw, 48px); align-items: baseline; padding: clamp(18px, 2.2vw, 30px) 0; transition: padding-left .45s cubic-bezier(.65,.01,.05,.99); }
.built__year li + li { border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.built__year li::before { content: ""; position: absolute; left: calc(var(--pad) * -1 - 5px); top: calc(clamp(18px, 2.2vw, 30px) + .45em); width: 11px; height: 11px; border-radius: 50%; background: var(--clay-fill); box-shadow: 0 0 0 4px var(--slate); }
.built__year li:hover { padding-left: 14px; }
.built__year h3 { font-size: clamp(20px, 2.3vw, 36px); line-height: 1.05; font-weight: 800; font-stretch: 86%; letter-spacing: -.02em; text-transform: uppercase; }
.built__year p { font-size: clamp(16px, 1.35vw, 20px); line-height: 1.5; opacity: .82; }
.built li.is-link em { grid-column: 2; }
/* the result of a piece of work stands at the end of its row */
.built__year li { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(4.6em, auto); }
.row__num { grid-column: 3; grid-row: 1; justify-self: end; font-size: clamp(26px, 3.2vw, 52px); line-height: .9; font-weight: 900; font-stretch: 75%; letter-spacing: -.02em; text-transform: uppercase; color: var(--clay); white-space: nowrap; }

/* ---- a wide still between two blocks ---- */
.still { margin: 0; height: clamp(260px, 46vw, 640px); overflow: hidden; background: var(--slate); }
.still img { display: block; width: 100%; height: 118%; object-fit: cover; object-position: var(--focus, 50% 50%); will-change: transform; }

/* ---- a case page ---- */
.case .case__head { position: sticky; top: 0; z-index: 0; min-height: 100svh; align-items: end; padding-bottom: clamp(48px, 8svh, 96px); }
.case__head::after { content: ""; position: absolute; inset: 0; z-index: 9; background: var(--slate); opacity: var(--veil, 0); pointer-events: none; }
/* the title stands at the top, the result fills the lower right, the way back sits at the lower left */
.case .case__head > div { align-self: stretch; display: flex; flex-direction: column; }
.case .case__head .case__where { margin-top: auto; padding-top: 26px; }
.case .case__result b { font-size: min(24vw, calc(92vw / var(--chars, 4)), 46svh); }
.case__where { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 13px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.case__where a { display: inline-block; padding: 10px 16px; border-radius: 99px; background: var(--ink); color: var(--paper); text-decoration: none; transition: background-color .3s; }
.case__where a::after { content: " \2192"; }
.case__where a:hover, .case__where a:focus-visible { background: var(--clay-fill); color: #fff; }
.case__where span { background: var(--paper); padding: 4px 8px; }
.case__body { border-radius: clamp(26px, 4.6vw, 78px) clamp(26px, 4.6vw, 78px) 0 0; }
.case__facts { background: var(--slate); margin: 0; }
.case__facts li { background: none; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 55%, transparent); }
.case__more { padding: clamp(40px, 6vw, 90px) var(--gutter) clamp(56px, 8vw, 120px); border-top: 1px solid rgba(246,244,238,.16); }
.case__more .rows { margin-bottom: 34px; }
.case__more .rows a { font-size: clamp(20px, 2.7vw, 44px); }
.case__more .pill { background: var(--paper); color: var(--ink); }

/* the opening: the name is uncovered from its baseline, the picture rises, the tabs settle */
@media (prefers-reduced-motion: no-preference) {
  .co-head h1, .case__head h1 { animation: name-in 1.15s cubic-bezier(.2,.8,.2,1) both; }
  .co-head__figure { animation: figure-in 1.25s cubic-bezier(.2,.8,.2,1) .15s both; }
  .co-head__frame { animation: frame-in 1.2s cubic-bezier(.65,.01,.05,.99) .15s both; }
  .co-head__frame img { animation: frame-settle 1.9s cubic-bezier(.2,.8,.2,1) .15s both; }
  .co-head__lead, .co-head__meta, .co-head__go, .case__where, .case__result span, .case__head .eyebrow { animation: settle-in .8s cubic-bezier(.2,.8,.2,1) .8s both; }
  .case__result b { animation: name-in 1.15s cubic-bezier(.2,.8,.2,1) .2s both; }
  html.arrived .co-head h1, html.arrived .case__head h1 { animation: none; }
}
@keyframes figure-in { from { opacity: 0; translate: 0 7svh; } to { opacity: 1; translate: 0 0; } }
@keyframes frame-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes frame-settle { from { scale: 1.22; } to { scale: 1; } }

/* phones: the first screen keeps the name and the picture; the words follow underneath */
@media (max-width: 760px) {
  .co .co-head { position: relative; height: auto; min-height: 0; padding: 84px 0 0; }
  .co .co-head > * { position: relative; }
  .co .co-head h1 { left: auto; right: auto; top: auto; padding: 0 var(--gutter); font-size: min(calc(190vw / var(--chars, 6)), 52vw); white-space: normal; }
  .co .co-head__frame { left: auto; right: auto; top: auto; bottom: auto; width: 100%; aspect-ratio: 4 / 5; margin-top: 10px; }
  .co-head__frame img { object-position: var(--focus-phone, var(--focus, 50% 50%)); }
  .co .co-head__figure { display: block; right: auto; bottom: auto; height: auto; width: 78vw; margin: -24vw 0 0 auto; }
  .co .co-head__words { left: auto; bottom: auto; width: auto; gap: 0; padding: 0 0 22px; }
  .co-head__lead, .co-head__meta { padding: 16px var(--gutter); width: 100%; }
  .co-head__go { padding: 6px var(--gutter) 0; }
  .built__year { grid-template-columns: 1fr; } .built__when { position: static; padding-bottom: 0; } .built__years::before { display: none; }
  .built__year ol { padding-left: 0; } .built__year li { grid-template-columns: 1fr; } .built__year li::before { display: none; }
  .co-rows li.is-link em { grid-column: 2; } .built li.is-link em { grid-column: 1; } .row__num { grid-column: 1; grid-row: auto; justify-self: start; }
  .case .case__head { position: relative; min-height: 0; }
}

/* accents that are light need dark words on them */
.co--on .pill.clay, .co--fq .pill.clay, .co--on .case__where a:hover, .co--fq .case__where a:hover { color: var(--ink); }
.co--on .pill.clay::before, .co--fq .pill.clay::before { background: var(--ink); }
.co--on .pill.clay:hover, .co--fq .pill.clay:hover, .co--on .pill.clay:focus-visible, .co--fq .pill.clay:focus-visible { color: #fff; }
.co--on .ring.is-open span, .co--fq .ring.is-open span { color: var(--ink); }
/* the frame's picture is a little larger than its frame, so it can lean without showing an edge */
.co-head__frame img { scale: 1.06; transform-origin: 50% 0; }
@keyframes frame-settle { from { scale: 1.24; } to { scale: 1.06; } }

/* ---- the menu's second column: a picture, the pages, the place ---- */
.menu__label { margin-top: 6px; font-size: 12px; letter-spacing: .14em; color: var(--mist); }
.menu__pages { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.menu__pages li { overflow: visible; }
.menu .menu__pages a { display: inline-block; translate: none; font-size: clamp(20px, 2.3vw, 34px); line-height: 1.15; font-weight: 800; font-stretch: 84%; letter-spacing: -.01em; text-transform: uppercase; text-decoration: none; transition: color .25s, padding-left .4s cubic-bezier(.65,.01,.05,.99); }
.menu .menu__pages a::before { content: none; }
.menu__place { margin-top: 8px; color: var(--mist); font-size: 12px; }
@media (max-width: 760px) { .menu__side { margin-top: 18px; } }

/* ---- the last screen of a company page is the door to the next company ---- */
.next-door { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; min-height: 100svh; padding: clamp(40px, 6vw, 90px) var(--gutter);
  overflow: hidden; isolation: isolate; background: var(--ink); color: var(--paper); text-decoration: none; }
.next-door img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 20%); filter: grayscale(1) brightness(.5) contrast(1.05);
  transition: filter .8s cubic-bezier(.2,.8,.2,1), scale 1.8s cubic-bezier(.2,.8,.2,1); }
.next-door::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16,21,31,.25) 0%, rgba(16,21,31,0) 40%, rgba(16,21,31,.88) 100%); }
.next-door img { transform-origin: 50% 0; }
.next-door:hover img, .next-door:focus-visible img { filter: grayscale(0) brightness(.82); scale: 1.04; }
.next-door small { font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.next-door span { font-size: min(calc(190vw / var(--chars, 6)), 38svh); line-height: .8; font-weight: 900; font-stretch: 75%; letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap; }
.next-door em { margin-top: 26px; padding: 13px 20px; border-radius: 99px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.next-door:focus-visible { outline: 3px solid var(--ember); outline-offset: -6px; }
@media (max-width: 760px) { .next-door { min-height: 72svh; } .next-door span { font-size: min(calc(180vw / var(--chars, 6)), 30vw); white-space: normal; } }

/* the Menu button shows itself when the keyboard reaches it, even on a first screen */
.menu-btn:focus-visible { opacity: 1; pointer-events: auto; translate: 0 0; outline: 2px solid var(--ember); outline-offset: 3px; }
/* on a first screen the top bar is showing: the button appears under it, clear of the CV button */
.menu-btn:focus-visible:not(.is-on):not(.is-close) { top: 62px; }

/* a cut-out figure needs a slightly smaller name, so the name never reaches the words below it */
.co .co-head--figure { --name-size: min(calc(205vw / var(--chars, 6)), 50svh); }
/* the menu lists eleven sections; they must fit one screen */
.menu nav li a { font-size: clamp(26px, min(5vw, 6.7svh), 84px); }
/* a career step that is reached by keyboard before it has arrived shows itself */
.stop:focus-within { opacity: 1 !important; }
.stop:focus-within > * { transform: none !important; }

/* the door to the next company is dressed the same way as the three doors on the first page:
   dimmed at rest, and in that company's own colour when pointed at */
.next-door { --door: var(--clay-fill); --door-ink: #fff; transition: background-color .45s, color .3s; }
.next-door--teleperformance { --door: #6A2BD9; --door-ink: #fff; }
.next-door--on { --door: #E8FA80; --door-ink: #0B0B0B; }
.next-door--fq-central { --door: #C5A55A; --door-ink: #0A0B0E; }
.next-door img { opacity: .4; filter: grayscale(1) contrast(1.1); transition: opacity .6s, scale 1.8s cubic-bezier(.2,.8,.2,1); }
.next-door::before { background: none; }
.next-door:hover, .next-door:focus-visible { background: var(--door); color: var(--door-ink); }
.next-door:hover img, .next-door:focus-visible img { opacity: .55; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; scale: 1.04; }
.next-door em { background: var(--ink); color: var(--paper); }
