/* A project switchboard, not an accordion or thumbnail gallery.
   Existing brand tokens own every color and typeface. Selection and reading
   have stable places; motion follows the visitor's choice. */
.work-selection {
  --work-rule: color-mix(in oklab, var(--fg) 30%, var(--bg));
  padding-block: var(--space-3xl);
}
.work-selection .selection-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.work-selection .all-work-link,
.work-selection .case-button {
  display: inline-grid; place-items: center;
  position: relative; isolation: isolate;
  min-height: 40px; padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-family: Caprasimo, Georgia, serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.1;
  text-decoration: none; text-align: center;
  transition: border-color .36s var(--ease-out-quint);
}
.work-selection .all-work-link { flex: none; }
/* Keep a 48px pointer/touch target around the slimmer visible pill. */
.work-selection :is(.all-work-link, .case-button)::after {
  content: ""; position: absolute; inset: -4px 0; border-radius: inherit;
}
.work-selection .button-fill {
  position: absolute; inset: -1px;
  display: grid; place-items: center;
  padding: 8px 20px;
  pointer-events: none;
  background: var(--accent); color: var(--bg);
  border-radius: inherit;
  clip-path: inset(0 0 0 0);
  transition: clip-path .36s var(--ease-out-quint);
}
/* Lower the accent fill and its reversed lettering together. The label stays
   still, with the paper/ink pair revealed exactly where the fill has left. */
@media (hover: hover) and (pointer: fine) {
  .work-selection :is(.all-work-link, .case-button):hover {
    border-color: var(--work-rule);
  }
  .work-selection :is(.all-work-link, .case-button):hover .button-fill {
    clip-path: inset(100% 0 0 0);
  }
}
.work-selection :is(.all-work-link, .case-button):focus-visible .button-fill { clip-path: inset(100% 0 0 0); }
.work-selection :is(.all-work-link, .case-button):focus-visible { border-color: var(--work-rule); outline: 2px solid var(--accent); outline-offset: 4px; }
.work-collection .selection-heading { margin-bottom: var(--space-md); }
.work-collection .collection-intro { max-width: 65ch; margin-bottom: var(--space-xl); font-size: var(--text-base); }
.work-collection-page .site-nav a[aria-current=page] .nav-label { text-decoration: underline; text-underline-offset: 6px; }
.work-selection .project-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: relative;
  isolation: isolate;
  border: 1px solid var(--work-rule);
  overflow: hidden;
}
.work-selection .project-tabs { display: contents; }
.work-selection .all-work-tile {
  display: grid; place-items: center start;
  position: relative; isolation: isolate;
  min-width: 0; min-height: 132px; padding: var(--space-lg);
  border: 0; border-radius: 0;
  background: var(--bg); color: var(--accent);
  font-family: Caprasimo, Georgia, serif;
  font-size: var(--text-lg); line-height: 1.1;
  text-align: left; text-decoration: none;
}
.work-selection .all-work-tile .button-fill {
  inset: 0; padding: var(--space-lg); justify-items: start;
  clip-path: inset(100% 0 0 0);
}
@media (hover: hover) and (pointer: fine) {
  .work-selection .all-work-tile:hover .button-fill { clip-path: inset(0 0 0 0); }
}
.work-selection .all-work-tile:focus-visible { outline: 2px solid var(--bg); outline-offset: -6px; z-index: 1; }
.work-selection .all-work-tile:focus-visible .button-fill { clip-path: inset(0 0 0 0); }
.work-selection .selection-plate {
  position: absolute; top: 0; left: 0; z-index: -1;
  width: var(--plate-width, 25%); height: var(--plate-height, 50%);
  transform: translate(var(--plate-x, 0px), var(--plate-y, 0px));
  background: var(--accent);
}
.work-selection .project-switcher.plate-ready .selection-plate {
  transition: transform .4s var(--ease-out-quint);
}
.work-selection .project-tab {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  gap: var(--space-md); min-width: 0; min-height: 132px; padding: var(--space-lg);
  border: 0; border-right: 1px solid var(--work-rule); border-bottom: 1px solid var(--work-rule); border-radius: 0;
  background: transparent; color: var(--fg); text-align: left; cursor: pointer;
  font: inherit;
  transition: color .2s ease;
}
.work-selection .project-tab:nth-of-type(4n) { border-right: 0; }
.work-selection .project-tab:nth-of-type(n+5) { border-bottom: 0; }
.work-selection .tab-name { font-family: Caprasimo, Georgia, serif; font-size: var(--text-lg); line-height: 1.1; text-wrap: pretty; }
.work-selection .tab-hint { font-size: var(--text-base); line-height: 1.4; }
.work-selection .project-tab[aria-selected=true] { color: var(--bg); }
.work-selection .project-tab:hover:not([aria-selected=true]) .tab-name { color: var(--accent); }
.work-selection .project-tab:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }
.work-selection .project-reader { margin-top: var(--space-2xl); }
.work-selection .mobile-project-close { display: none; }
.work-selection .project-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl); align-items: start; min-height: 428px;
}
.work-selection .project-panel[hidden] { display: none; }
.work-selection .project-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: var(--space-xs); }
.work-selection .reader-story .display { font-size: var(--text-2xl); line-height: 1.08; text-wrap: pretty; margin-bottom: var(--space-lg); }
.work-selection .reader-story .display > span { color: var(--accent); }
.work-selection .reader-identity { font-size: var(--text-base); margin-bottom: var(--space-xs); }
.work-selection .reader-role { font-size: var(--text-base); }
.work-selection .reader-action {
  display: flex; justify-content: flex-end;
  margin-top: var(--space-lg);
}
.work-selection .reader-results { display: flex; align-items: flex-start; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.work-selection .reader-results > div { display: flex; flex-direction: column-reverse; gap: var(--space-sm); flex: 1; min-width: 0; container-type: inline-size; }
.work-selection .reader-results dt { font-size: var(--text-base); line-height: 1.4; max-width: 23ch; }
.work-selection .reader-results dd { font-family: Caprasimo, Georgia, serif; font-size: clamp(1.5rem, 20cqi, var(--text-2xl)); color: var(--accent); line-height: 1; white-space: nowrap; }
.work-selection .reader-copy { max-width: 68ch; }
.work-selection .reader-copy p { font-size: var(--text-base); line-height: 1.65; }
.work-selection .reader-copy p + p { margin-top: var(--space-md); }
@media (max-width: 1000px) {
  .work-selection .project-tab { padding: var(--space-md); min-height: 128px; }
  .work-selection .all-work-tile { padding: var(--space-md); min-height: 128px; }
  .work-selection .all-work-tile .button-fill { padding: var(--space-md); }
  .work-selection .project-panel { gap: var(--space-xl); }
}
@media (max-width: 760px) {
  .work-selection { position: relative; padding-block: var(--space-2xl); scroll-margin-top: 52px; }
  .work-selection .selection-heading { align-items: flex-start; flex-direction: column; gap: var(--space-lg); }
  .work-selection .project-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }
  .work-selection .project-tab {
    min-height: 112px;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border-right: 1px solid var(--work-rule);
    border-bottom: 1px solid var(--work-rule);
  }
  .work-selection .project-tab:nth-of-type(2n) { border-right: 0; }
  .work-selection .project-tab:nth-of-type(n+5) { border-bottom: 1px solid var(--work-rule); }
  .work-selection .project-tab:nth-of-type(n+7) { border-bottom: 0; }
  .work-selection .tab-name { font-size: clamp(1.05rem, 4.8vw, 1.25rem); }
  .work-selection .tab-hint { font-size: max(0.875rem, var(--text-sm)); line-height: 1.3; }
  .work-selection .all-work-tile {
    min-height: 112px;
    padding: var(--space-sm);
    border-bottom: 0;
    font-size: clamp(1.05rem, 4.8vw, 1.25rem);
  }
  .work-selection .all-work-tile .button-fill { padding: var(--space-sm); }
  .work-selection .selection-plate { display: none; }
  .work-selection .project-tab[aria-selected=true] { color: var(--fg); }
  .work-selection.work-mobile-ready:not(.mobile-summary-open) .project-reader { display: none; }
  .work-selection.work-mobile-ready.mobile-summary-open .project-switcher { display: none; }
  .work-selection .project-reader { margin-top: 0; overflow: clip; }
  .work-selection .mobile-project-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin: 0 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font: 400 1.65rem/1 'Schibsted Grotesk', system-ui, sans-serif;
    cursor: pointer;
  }
  .work-selection .mobile-project-close[hidden] { display: none; }
  .work-selection.mobile-summary-open .selection-heading { flex-direction: row; align-items: center; gap: var(--space-sm); }
  .work-selection.mobile-summary-open .selection-heading h2 {
    font-size: clamp(2rem, 10vw, 2.6rem);
    white-space: nowrap;
  }
  .work-selection .mobile-project-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
  .work-selection .project-panel { grid-template-columns: 1fr; min-height: 0; gap: var(--space-xl); }
  .work-selection .reader-story .display {
    max-width: none;
    margin-bottom: var(--space-md);
    font-size: clamp(1.7rem, 8.6vw, 2.8rem);
  }
  .work-selection .reader-results { margin-bottom: var(--space-lg); }
  .work-selection .reader-copy p { line-height: 1.55; }
}
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .work-selection .project-switcher.plate-ready .selection-plate,
  .work-selection .project-tab,
  .work-selection :is(.all-work-link, .case-button),
  .work-selection .button-fill { transition: none; }
}

.work-selection .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
