/* The case studies (studio-site/work/<slug>/): real client sites we built, what we changed, a link out to the live
   site and a way to get a preview of your own.
   The idea: the client's own name, in the colour of their own logo (--client on <body>), is the monument at the foot
   of the first screen, cropped by its sides; their live site stands on it in the landing page's browser window, with
   the phone beside it. Two monuments a page, the name and "Start"; everything between is at reading sizes.
   Five type sizes: the monument, the page title, the section heading, the lede, and text. */

.wk {
  --m: clamp(1.25rem, 2.2vw, 2rem);
  --gap: clamp(2rem, 5vw, 5rem);
  --h1: clamp(2.375rem, 4.4vw, 4.25rem); --h2: clamp(2rem, 3.6vw, 3.5rem); --lead: 1.3125rem; --text: 1.0625rem; --small: .875rem;
  --word: clamp(13rem, 40vw, 44rem);
  --band: clamp(5rem, 9vw, 8.5rem);
  background: var(--butter);
}
@media (max-width: 760px) { .wk { --lead: 1.1875rem; --word: 48vw; } }

/* ---------- header: wordmark, three links ---------- */
.wk-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem var(--m); }
.wk-brand { white-space: nowrap; display: inline-flex; align-items: center; gap: .55rem; font: 700 1.35rem/1 var(--pixel); text-decoration: none; }
.wk-nav { display: flex; gap: 1.5rem; white-space: nowrap; }
@media (max-width: 560px) { .wk-nav { gap: 1rem; } .wk-brand { font-size: var(--text); } }
.wk-nav a { font-weight: 600; font-size: var(--text); text-decoration: none; padding: .55rem 0; }
.wk-nav a:hover { text-decoration: underline; text-underline-offset: .25em; }
@media (max-width: 560px) { .wk-nav a:nth-child(2) { display: none; } }

/* ---------- the browser window: the same one the landing page's work cards wear ---------- */
.wk-win { display: block; margin: 0; border: 3px solid var(--ink); border-radius: 18px; overflow: clip; background: var(--white); box-shadow: var(--pop); color: var(--ink); text-decoration: none; }
.wk-win-bar { display: flex; align-items: center; gap: .35rem; padding: .55rem .8rem; border-bottom: 3px solid var(--ink); background: var(--butter); font: 600 .75rem/1 var(--body); }
.wk-win-bar i { flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink); opacity: .25; }
.wk-win-bar b { margin-left: .5rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-win img { display: block; width: 100%; height: auto; background: var(--butter); }

/* ---------- hero: the title, their site in its window, and their name underneath, cropped by the screen ---------- */
/* Cut by its sides and its foot, open at the top: Pearl's ears reach above it. */
.wk-hero { position: relative; clip-path: inset(-6rem 0 0 0); display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; padding: clamp(.75rem, 3vh, 2.5rem) var(--m) calc(var(--word) * .55); }
@media (min-width: 960px) { .wk-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); } }
.wk-hero-text, .wk-stage { position: relative; z-index: 1; }
.wk-crumb { margin: 0 0 1.25rem; font: 600 1rem/1.3 var(--pixel); }
.wk-crumb a { text-underline-offset: .25em; }
.wk-title { margin: 0; font: 800 var(--h1)/1 var(--display); letter-spacing: -.035em; text-wrap: balance; max-width: 15ch; }
.wk-lede { margin: 1.25rem 0 1.75rem; max-width: 44ch; font-size: var(--lead); line-height: 1.5; text-wrap: pretty; }
.wk-btn { display: inline-block; padding: .85rem 1.4rem; line-height: 1.3; border-radius: 0; background: var(--ink); color: var(--butter); font-weight: 700; font-size: var(--text); text-decoration: none; transition: transform .2s var(--spring), background-color .2s; }
.wk-btn:hover { background: var(--client); transform: translateY(-2px); }
.wk-btn:active { transform: scale(.97); }
/* The window stands on the name: it hangs a fifth of a letter into it, and the phone a little further. */
.wk-stage { margin-bottom: calc(var(--word) * -.2); }
.wk-hand { position: absolute; left: calc(var(--gap) * -.45); bottom: calc(var(--word) * -.3); width: clamp(5.5rem, 12vw, 10.5rem); height: auto; aspect-ratio: 9 / 17; object-fit: cover; object-position: top; border: 3px solid var(--ink); border-radius: clamp(.9rem, 1.6vw, 1.4rem); box-shadow: var(--pop); background: var(--white); }
@media (max-width: 959px) { .wk-hand { left: auto; right: -.25rem; bottom: calc(var(--word) * -.1); width: clamp(5.5rem, 24vw, 9rem); } }
.wk-word {
  position: absolute; left: -6vw; bottom: -.17em; margin: 0; z-index: 0;
  font: 800 var(--word)/.8 var(--display); letter-spacing: -.06em; white-space: nowrap;
  color: var(--client); transform-origin: 30% 100%; pointer-events: none;
}
@media (max-width: 760px) { .wk-word { left: -4vw; } }
/* Pearl looks over the top of the window, as she does over the landing page's site card (same drawing, same blink). */
.wk-peek { left: auto; right: clamp(1.25rem, 4vw, 3.5rem); width: clamp(4rem, 6vw, 5.5rem); }

/* ---------- inside: the idea, who it's for, and two more screens, whole ---------- */
.wk-inside { background: var(--ink); color: var(--butter); padding: var(--band) var(--m) calc(var(--band) + 1rem); }
.wk-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 960px) { .wk-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); } }
.wk-h2 { margin: 0; font: 800 var(--h2)/1 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.wk-idea { margin: 0; max-width: 46ch; font-size: var(--lead); line-height: 1.5; text-wrap: pretty; }
.wk-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 2.25rem 0 0; padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, var(--butter) 28%, transparent); font-size: var(--text); }
.wk-facts dt { font: 700 1.0625rem/1.3 var(--pixel); }
.wk-facts dd { margin: .2rem 0 0; color: color-mix(in srgb, var(--butter) 82%, var(--ink)); }
@media (max-width: 560px) { .wk-facts { grid-template-columns: 1fr; gap: .9rem; } }
.wk-shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: clamp(3rem, 6vw, 5.5rem); align-items: start; }
@media (min-width: 760px) {
  .wk-shots { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); }
  .wk-shots .wk-win:nth-child(2) { margin-top: clamp(3rem, 8vw, 7rem); }
}
.wk-inside .wk-win { box-shadow: 5px 5px 0 var(--pink); }

/* ---------- what changed: a line-up, ruled ---------- */
.wk-changed { padding: var(--band) var(--m) 0; }
.wk-changed > .wk-h2 { color: var(--client); margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.wk-table { width: 100%; border-collapse: collapse; font-size: var(--text); line-height: 1.5; }
.wk-table th, .wk-table td { text-align: left; vertical-align: top; padding: 1.4rem 2rem 1.5rem 0; font-weight: 400; border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.wk-table thead th { font: 700 1rem/1.3 var(--pixel); padding: 0 2rem .8rem 0; border-top: 0; }
.wk-table tbody th { width: 17%; font: 800 var(--lead)/1.25 var(--display); letter-spacing: -.02em; }
.wk-table td { width: 41.5%; }
.wk-table td:nth-child(2) { color: color-mix(in srgb, var(--ink) 70%, var(--butter)); }
.wk-table td:nth-child(3) { font-size: var(--lead); font-weight: 500; line-height: 1.4; padding-right: 0; }
.wk-table tbody tr:last-child > * { border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
@media (max-width: 760px) {
  .wk-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wk-table, .wk-table tbody, .wk-table tr, .wk-table th, .wk-table td { display: block; width: auto; }
  .wk-table tr { padding: 1.25rem 0 1.4rem; border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
  .wk-table tbody tr:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
  .wk-table tbody th, .wk-table tbody td, .wk-table tbody tr:last-child > * { padding: 0 0 .4rem; border: 0; }
  .wk-table td::before { font-weight: 700; }
  .wk-table td:nth-child(2)::before { content: "Before: "; } .wk-table td:nth-child(3)::before { content: "Now: "; }
}
.wk-out { margin: clamp(2rem, 4vw, 3rem) 0 0; }

/* ---------- more work: the other two sites, in their windows ---------- */
.wk-more { padding: var(--band) var(--m); align-items: start; }
.wk-more-note { margin: 1rem 0 0; font-size: var(--text); max-width: 30ch; }
.wk-prints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
@media (max-width: 560px) { .wk-prints { grid-template-columns: 1fr; gap: 2rem; } }
.wk-print { display: block; text-decoration: none; }
.wk-print .wk-win { transition: translate .2s var(--ease), box-shadow .2s var(--ease); }
.wk-print img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.wk-print > span:last-child { display: block; margin-top: 1.1rem; font: 800 var(--lead)/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
@media (hover: hover) {
  .wk-print:hover .wk-win { translate: -3px -3px; box-shadow: 8px 8px 0 var(--ink); }
  .wk-print:hover > span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
}
.wk-print:active .wk-win { translate: 2px 2px; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- the call to action: one word is the button ---------- */
.wk-cta { position: relative; display: block; min-height: 60svh; background: var(--pink); color: var(--ink); text-decoration: none; overflow: hidden; transition: background-color .15s, color .15s; }
.wk-cta:hover, .wk-cta:focus-visible { background: var(--sky); }
.wk-cta:focus-visible { outline-offset: -6px; --focus: var(--butter); }
.wk-cta-note { position: absolute; top: var(--m); left: var(--m); max-width: 34ch; font-size: var(--lead); font-weight: 600; }
.wk-cta-arrow { position: absolute; top: var(--m); right: var(--m); width: 3rem; height: 3rem; transition: transform .25s var(--spring); }
.wk-cta:hover .wk-cta-arrow { transform: translate(4px, -4px); }
.wk-cta-word { position: absolute; left: calc(var(--m) - .04em); bottom: .5rem; font: 800 clamp(7.5rem, 27vw, 30rem)/.8 var(--display); letter-spacing: -.06em; }
/* Pearl sits on the footer's edge beside the word: the landing page's kitty, blinking and swishing as she does there. */
.wk-pearl { position: absolute; right: var(--m); bottom: 0; width: clamp(8rem, 22vw, 20rem); }
.wk-pearl .kitty-art { display: block; animation: none; }
.wk-pearl .bubble { animation: none; }
@media (max-width: 760px) { .wk-cta { min-height: 46svh; } .wk-cta-note { max-width: 70%; } .wk-cta-arrow { width: 2rem; height: 2rem; } .wk-cta-word { font-size: 24vw; } .wk-pearl { width: 30vw; } .wk-pearl .bubble { left: -45%; } }

/* ---------- footer: quiet, after "Start" ---------- */
.wk-foot { background: var(--ink); color: var(--butter); padding: clamp(3rem, 6vw, 5rem) var(--m) 1.5rem; }
.wk-foot a { color: inherit; text-underline-offset: .2em; }
.wk-foot :focus-visible { --focus: var(--butter); }
.wk-foot-brand { display: inline-flex; margin-bottom: 2.5rem; text-decoration: none; }
.wk-foot-row { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .wk-foot-row { grid-template-columns: 5fr 3fr 3fr; } }
.wk-foot ul { list-style: none; margin: 0; padding: 0; }
.wk-foot-places { font: 800 clamp(1.5rem, 2.4vw, 2.25rem)/1.2 var(--display); letter-spacing: -.02em; }
.wk-foot-places a { color: var(--pink); text-decoration: none; overflow-wrap: anywhere; }
.wk-foot-places a:hover { text-decoration: underline; }
.wk-foot-links { font-size: var(--text); }
.wk-foot-links li { margin-bottom: .5rem; }
.wk-foot-links a { display: inline-block; padding: .2rem 0; }
.wk-foot-links a[aria-current] { text-decoration: none; font-weight: 700; }
.wk-foot-last { display: flex; justify-content: space-between; gap: 1rem; margin-top: clamp(3rem, 6vw, 5rem); padding-top: 1.25rem; border-top: 1px solid color-mix(in srgb, var(--butter) 22%, transparent); font-size: var(--small); }
.wk-foot-last p { margin: 0; }

/* ---------- motion: the first screen arrives in order; the name eases back as the page moves on; each part rises
   in as it arrives, and is at rest well before it's read ---------- */
@media (prefers-reduced-motion: no-preference) {
  .wk-hero-text > *, .wk-stage { animation: wk-load .7s var(--ease) both; }
  .wk-hero-text > :nth-child(2) { animation-delay: .06s; } .wk-hero-text > :nth-child(3) { animation-delay: .12s; } .wk-hero-text > :nth-child(4) { animation-delay: .18s; }
  .wk-stage { animation-delay: .16s; }
  .wk-hand { animation: wk-load .7s var(--ease) .34s both; }
  @keyframes wk-load { from { opacity: 0; translate: 0 22px; } }
  .wk-cta:hover .wk-pearl .kitty-art, .wk-cta:focus-visible .wk-pearl .kitty-art { animation: pet .55s var(--spring); }
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .wk-word { animation: wk-settle linear both; animation-timeline: scroll(); animation-range: 0 90vh; }
    @keyframes wk-settle { to { transform: scale(.94) translateY(-3%); } }
    .wk-in, .wk-shots .wk-win, .wk-print, .wk-cta-word { animation: wk-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    .wk-shots .wk-win:nth-child(2), .wk-print:nth-child(2) { animation-range: entry 12% entry 70%; }
    .wk-table.wk-in { animation-range: cover 0% cover 12%; }
    @keyframes wk-rise { from { opacity: 0; translate: 0 26px; } }
  }
}
