/* 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 top,
   cropped by the screen; their live site follows it as the pictures. The studio's butter, ink and pink do the rest.
   Five type sizes: the monument, the "More work" headline, the section heading, the lede, and text. */

.wk { --m: clamp(1.25rem, 2.2vw, 2rem); --h2: 2.25rem; --lead: 1.375rem; --text: 1.0625rem; --small: .875rem; background: var(--butter); }
@media (max-width: 760px) { .wk { --h2: 1.75rem; --lead: 1.25rem; } }

/* ---------- 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 var(--lead)/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; } }

/* ---------- hero: the client's name, cropped by the screen ---------- */
.wk-hero { position: relative; min-height: calc(100svh - 4.5rem); overflow: hidden; display: grid; align-content: start; }
.wk-hero-text { position: relative; z-index: 1; padding: clamp(2rem, 6vh, 4.5rem) var(--m) 0; max-width: 46rem; }
.wk-title { margin: 0; font: 800 var(--h2)/1.1 var(--display); letter-spacing: -.02em; max-width: 22ch; }
.wk-lede { margin: 1rem 0 1.75rem; max-width: 52ch; font-size: var(--text); }
.wk-btn { display: inline-flex; align-items: center; min-height: 3rem; padding: .8rem 1.4rem; 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); }
.wk-word {
  position: absolute; left: -6vw; bottom: -.17em; margin: 0; z-index: 0;
  font: 800 clamp(13rem, 40vw, 44rem)/.8 var(--display); letter-spacing: -.06em; white-space: nowrap;
  color: var(--client); transform-origin: 30% 100%; pointer-events: none;
}

/* ---------- live: the site itself, laptop or phone ---------- */
.wk-live { background: var(--ink); color: var(--butter); padding: clamp(4rem, 9vw, 8rem) 0 0; }
.wk-live-head { display: grid; gap: 1.5rem 3rem; padding: 0 var(--m) 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .wk-live-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; align-items: end; } }
.wk-h2 { margin: 0; font: 800 var(--h2)/1.05 var(--display); letter-spacing: -.03em; }
.wk-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 0; font-size: var(--text); }
.wk-facts dt { font-weight: 700; }
.wk-facts dd { margin: .2rem 0 0; }
@media (max-width: 560px) { .wk-facts { grid-template-columns: 1fr; gap: .9rem; } }
.wk-switch { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: color-mix(in srgb, var(--butter) 14%, var(--ink)); justify-self: start; }
.wk-switch button { min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: 999px; background: transparent; color: var(--butter); font: 700 var(--text)/1 var(--body); cursor: pointer; transition: background-color .2s, color .2s, transform .15s var(--spring); }
.wk-switch button[aria-pressed="true"] { background: var(--butter); color: var(--ink); }
.wk-switch button:active { transform: scale(.95); }
.wk-switch button:focus-visible { --focus: var(--butter); }
.wk-switch:not(.ready) { display: none; }
.wk-view { position: relative; overflow: hidden; }
.wk-view img { width: 100%; height: auto; }
.wk-phone { display: none; }
.wk-view[data-shows="phone"] .wk-laptop { display: none; }
.wk-view[data-shows="phone"] .wk-phone { display: block; width: min(24rem, 78vw); margin: 0 auto; padding-bottom: clamp(3rem, 6vw, 5rem); }
.wk-view[data-shows="phone"] .wk-phone img { border-radius: 1.75rem; }

/* ---------- inside: a band of unequal panels ---------- */
.wk-inside { padding: clamp(6rem, 12vw, 11rem) 0 0; }
.wk-inside > .wk-h2 { padding: 0 var(--m) 3rem; margin-left: calc(100% / 12 * 2); }
.wk-band { display: flex; height: 68svh; min-height: 26rem; background: var(--ink); }
.wk-panel { margin: 0; flex: 5 1 0; min-width: 0; overflow: hidden; transition: flex-grow .5s var(--ease); }
.wk-panel:nth-child(2) { flex-grow: 3; } .wk-panel:nth-child(3) { flex-grow: 3; } .wk-panel--phone { flex-grow: 2; }
.wk-panel img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
@media (hover: hover) and (min-width: 761px) { .wk-band:hover .wk-panel { flex-grow: 2; } .wk-band .wk-panel:hover { flex-grow: 6; } }
.wk-idea { margin: 1.5rem var(--m) 0; max-width: 62ch; font-size: var(--text); }
@media (max-width: 760px) {
  .wk-inside > .wk-h2 { margin-left: 0; padding-bottom: 2rem; }
  .wk-band { display: grid; grid-template-columns: 64fr 36fr; grid-template-rows: 1fr 1fr; height: 84svh; }
  .wk-band .wk-panel:nth-child(2), .wk-band .wk-panel:nth-child(3) { order: 0; }
  .wk-band .wk-panel:nth-child(3) { grid-column: 2; grid-row: 2; } .wk-band .wk-panel--phone { grid-column: 1; grid-row: 2; }
}

/* ---------- what changed: a line-up at one size ---------- */
.wk-changed { padding: clamp(6rem, 12vw, 11rem) var(--m) 0; }
.wk-changed > .wk-h2 { color: var(--client); margin-bottom: 2.5rem; }
.wk-table { width: 100%; border-collapse: collapse; font-size: var(--lead); line-height: 1.4; }
.wk-table th, .wk-table td { text-align: left; vertical-align: top; padding: 0 1.5rem 1.6rem 0; font-weight: 400; }
.wk-table thead th { font-weight: 700; padding-bottom: 1rem; }
.wk-table tbody th { font-weight: 700; width: 12%; }
.wk-table td { width: 44%; }
.wk-table td:nth-child(2) { color: color-mix(in srgb, var(--ink) 72%, var(--butter)); }
@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-bottom: 1.75rem; }
  .wk-table th, .wk-table td { padding: 0 0 .35rem; }
  .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: 1rem 0 0; font-size: var(--text); }
.wk-out a { font-weight: 700; text-underline-offset: .25em; }

/* ---------- more work: the other two sites, dropped beside the headline ---------- */
.wk-more { margin-top: clamp(6rem, 12vw, 11rem); min-height: 100svh; background: var(--sky); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding: clamp(3rem, 6vw, 5rem) var(--m); }
.wk-more-title { margin: 0; font: 800 clamp(7.5rem, 15vw, 14rem)/.85 var(--display); letter-spacing: -.05em; }
.wk-more-note { margin: 1.5rem 0 0; font-size: var(--text); max-width: 30ch; }
.wk-prints { display: flex; justify-content: center; align-items: center; }
.wk-print { display: block; width: clamp(11rem, 20vw, 19rem); padding: .5rem .5rem 0; background: var(--white); text-decoration: none; transition: transform .2s var(--ease); }
.wk-print img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.wk-print span { display: block; padding: .6rem .2rem .8rem; font-weight: 700; font-size: var(--text); line-height: 1.25; }
.wk-print:nth-child(1) { transform: rotate(-8deg) translate(12%, 4%); }
.wk-print:nth-child(2) { transform: rotate(6deg) translate(-12%, -6%); }
.wk-print:hover, .wk-print:focus-visible { transform: rotate(0) scale(1.03); z-index: 2; }
@media (max-width: 760px) {
  .wk-more { grid-template-columns: 1fr; min-height: 0; }
  .wk-more-title { font-size: 26vw; }
  .wk-print { width: 44vw; }
}

/* ---------- 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(--ink); color: var(--pink); }
.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; }
@media (max-width: 760px) { .wk-cta { min-height: 46svh; } .wk-cta-note { max-width: 70%; } .wk-cta-arrow { width: 2rem; height: 2rem; } }

/* ---------- footer: the name first ---------- */
.wk-foot { background: var(--ink); color: var(--butter); padding: clamp(3rem, 6vw, 5rem) var(--m) 1.5rem; overflow: hidden; }
.wk-foot a { color: inherit; }
.wk-foot :focus-visible { --focus: var(--butter); }
.wk-foot-name { margin: 0 0 4.5rem; font: 800 clamp(4.5rem, 15vw, 15rem)/.85 var(--display); letter-spacing: -.05em; white-space: nowrap; }
.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 var(--h2)/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-last { display: flex; justify-content: space-between; gap: 1rem; margin-top: 6rem; font-size: var(--small); }
.wk-foot-last p { margin: 0; }

/* ---------- motion: the monument eases back as the page moves on; each part rises in as it arrives ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .wk-word { animation: wk-settle linear both; animation-timeline: scroll(); animation-range: 0 90vh; }
    @keyframes wk-settle { to { transform: scale(.93) translateY(-3%); } }
    .wk-in, .wk-panel, .wk-table tbody tr, .wk-print, .wk-cta-word, .wk-foot-name { animation: wk-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
    .wk-panel:nth-child(2), .wk-table tbody tr:nth-child(2) { animation-range: entry 6% cover 30%; }
    .wk-panel:nth-child(3), .wk-table tbody tr:nth-child(3) { animation-range: entry 12% cover 35%; }
    .wk-panel:nth-child(4), .wk-table tbody tr:nth-child(4) { animation-range: entry 18% cover 40%; }
    .wk-table tbody tr:nth-child(5) { animation-range: entry 24% cover 45%; }
    .wk-print { animation-name: wk-drop; }
    @keyframes wk-rise { from { opacity: 0; translate: 0 28px; } }
    @keyframes wk-drop { from { opacity: 0; translate: 0 -12vh; } }
    .wk-laptop img { animation: wk-drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    @keyframes wk-drift { from { transform: scale(1.06) translateY(2%); } to { transform: scale(1) translateY(-2%); } }
  }
  .wk-hero-text > * { animation: wk-load .7s var(--ease) both; }
  .wk-hero-text > :nth-child(2) { animation-delay: .07s; } .wk-hero-text > :nth-child(3) { animation-delay: .14s; } .wk-hero-text > :nth-child(4) { animation-delay: .21s; }
  @keyframes wk-load { from { opacity: 0; translate: 0 20px; } }
}

/* ---------- phone: the name stays along the bottom edge, cut by both sides ---------- */
@media (max-width: 760px) {
  .wk-hero { min-height: calc(100svh - 4rem); }
  .wk-hero-text { padding-top: 1.5rem; }
  .wk-word { font-size: 48vw; left: -4vw; }
}
