/* /work/: built by tools/work.py */
:root {
  --rule: rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --peek: clamp(220px, 20vw, 340px);
}
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } * { transition: none !important; } }

main.work { max-width: none; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.25; letter-spacing: 0; }
main.work > * + * { margin-top: 0; }
.work .intro { font-size: clamp(28px, 4.65vw, 64px); line-height: 1; letter-spacing: -0.01em; max-width: 14.5em; color: var(--muted); }
.work .intro span { color: var(--ink); }

.bar {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em 2.2em;
  margin: clamp(32px, 5vw, 72px) calc(-1 * var(--gutter)) 0; padding: .75em var(--gutter); background: var(--bg);
  font-size: clamp(16px, 1.3vw, 20px);
}
.group { display: inline-flex; flex-wrap: wrap; gap: .2em .75em; }
.label { color: var(--muted-small); }
.bar button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline 2px transparent; text-underline-offset: .22em; transition: text-decoration-color .25s, color .15s;
}
.bar button:hover, .bar button:active { color: var(--hot); }
.bar button[aria-pressed="true"] { text-decoration-color: currentColor; }
.count { margin-left: auto; color: var(--muted-small); }

.pieces { list-style: none; margin-top: 1em; }
.piece a { color: var(--ink); display: block; }
.frame { display: block; overflow: hidden; }
.frame img { display: block; width: 100%; height: auto; transition: transform .7s var(--ease), opacity .6s var(--ease); }
.frame img.loading { opacity: 0; }
.ty, .se, .y { color: var(--muted-small); }

/* grid: a loose masonry of posters, captions appear on hover */
.pieces[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: calc(var(--gutter) * 1.8) var(--gutter); align-items: end; }
/* each poster sits on a shared baseline, like prints pinned along a rail */
.pieces[data-view="grid"] .frame { box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 24px 40px -30px rgba(0, 0, 0, .45); }
.pieces[data-view="grid"] .piece a:hover .frame img { transform: scale(1.025); }
.pieces[data-view="grid"] .t, .pieces[data-view="grid"] .ty { display: inline; font-size: .85em; }
.pieces[data-view="grid"] .t { display: block; margin-top: .55em; }
.pieces[data-view="grid"] .se, .pieces[data-view="grid"] .y { display: none; }
.pieces[data-view="grid"] .piece a:hover .t, .pieces[data-view="grid"] .piece a:active .t { color: var(--hot); }

/* list: an index, the hovered piece shows at the right */
.pieces[data-view="list"] .piece a {
  display: grid; grid-template-columns: 3.4em minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2fr) 4em; column-gap: 1em; align-items: center;
  padding: .45em 0; border-top: 1px solid var(--rule);
}
.pieces[data-view="list"] .frame { width: 3.4em; aspect-ratio: auto !important; height: 2.6em; }
.pieces[data-view="list"] .frame img { height: 100%; object-fit: cover; }
.pieces[data-view="list"] .t { font-size: 1.35em; letter-spacing: -0.005em; }
.pieces[data-view="list"] .y { text-align: right; font-variant-numeric: tabular-nums; }
.pieces[data-view="list"] .piece a:hover .t, .pieces[data-view="list"] .piece a:active .t { color: var(--hot); }
.peek { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .pieces[data-view="list"] { padding-right: calc(var(--peek) + var(--gutter) * 2); }
  .peek {
    display: block; position: fixed; right: var(--gutter); top: 50%; width: var(--peek); height: auto; z-index: 2;
    transform: translateY(-46%) rotate(1.2deg); opacity: 0; pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 30px 60px -30px rgba(0, 0, 0, .5);
    transition: opacity .3s var(--ease), transform .5s var(--ease);
  }
  .peek.on { opacity: 1; transform: translateY(-50%) rotate(0); }
}
.pieces .hidden { display: none; }

/* one piece */
main.one { max-width: none; font-size: inherit; line-height: 1.25; letter-spacing: 0; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 4.5vw, 80px); align-items: start; margin-top: clamp(24px, 3vw, 48px); }
main.one > * + * { margin-top: 0; }
.plate { position: sticky; top: var(--gutter); }
.plate img { display: block; width: 100%; height: auto; max-height: calc(100vh - 2 * var(--gutter)); object-fit: contain; object-position: left top; background: var(--bg); }
.plate { background: none !important; }
.info h1 { font-weight: 500; color: var(--ink); font-size: clamp(32px, 4vw, 64px); line-height: .98; letter-spacing: -0.02em; }
.note { margin-top: 1.2em; font-family: "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 400; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.55; color: #1b1b1b; }
.note > * + * { margin-top: .8em; }
.info dl { display: grid; grid-template-columns: max-content 1fr; gap: .4em 1.4em; margin-top: 1.6em; padding-top: 1em; border-top: 1px solid var(--rule); font-size: clamp(15px, 1.15vw, 18px); }
.info dt { color: var(--muted-small); }
.info dd { color: var(--ink); }
.swatches { display: flex; gap: 8px; margin-top: 1.4em; }
.sw { position: relative; flex: 1; height: 54px; border: 0; border-radius: 3px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: flex .35s var(--ease); }
.sw:hover { flex: 1.8; }
.sw span { position: absolute; left: 6px; bottom: -1.5em; font: 11px var(--mono); color: var(--muted-small); opacity: 0; transition: opacity .2s; }
.sw:hover span, .sw.done span { opacity: 1; }
.sw.done span { color: var(--hot); }
.turn { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.4em; align-items: end; margin-top: clamp(48px, 6vw, 96px); font-size: clamp(15px, 1.15vw, 18px); line-height: 1.25; }
.turn .label { display: block; font-size: .85em; color: var(--muted-small); }
.turn [rel="next"] { text-align: right; }
.turn .all { white-space: nowrap; }

@media (max-width: 860px) {
  .count { margin-left: 0; }
  .pieces[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pieces[data-view="list"] .piece a { grid-template-columns: 3em minmax(0, 1fr) auto; }
  .pieces[data-view="list"] .ty, .pieces[data-view="list"] .se { display: none; }
  main.one { grid-template-columns: 1fr; }
  .plate { position: static; }
  .turn { grid-template-columns: 1fr 1fr; }
  .turn .all { grid-column: 1 / -1; grid-row: 2; }
}
