/* the work page: a grid you can use */
.page-work { background: var(--paper); }
.work { padding: 136px var(--gutter) 5vw; display: grid; gap: 2.6vw; }
.work__head { display: grid; gap: 1.2vw; max-width: 70vw; }
.work__title { font-size: 11vw; line-height: .85; letter-spacing: -.045em; font-weight: 700; }
.work__title .line { display: inline-block; }
.work__sub { font-size: 24px; line-height: 1.3; letter-spacing: -.015em; max-width: 44ch; }
.work__hint { color: var(--ink-2); display: flex; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.filter { cursor: pointer; transition: transform var(--fast), box-shadow var(--fast); }
.filter:hover { transform: rotate(var(--r, 0deg)) translateY(-2px); }
.filter.is-on { box-shadow: 0 0 0 2px var(--ink), 0 8px 18px -10px rgba(0, 0, 0, .35); }
.filter--shuffle { background: none; color: var(--ink-2); padding: 6px 2px; border-bottom: 1px solid var(--ink-2); margin-left: 8px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile { position: relative; aspect-ratio: 16 / 10; background: #fff; border: 1px solid rgba(20, 20, 20, .12); overflow: hidden; cursor: pointer; transition: transform var(--mid), box-shadow var(--mid); will-change: transform; }
.tile:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -28px rgba(0, 0, 0, .55); }
.tile.is-hidden { display: none; }
.tile__frame { position: absolute; inset: 14px; background: #000; overflow: hidden; }
.tile--browser .tile__frame { border-radius: 8px; }
.tile--browser .tile__frame::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px; background: #e9e6df; border-bottom: 1px solid rgba(0, 0, 0, .1); z-index: 2; }
.tile--browser .tile__frame::after { content: ""; position: absolute; left: 10px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #ff5f57; box-shadow: 10px 0 0 #febc2e, 20px 0 0 #28c840; z-index: 3; }
.tile--browser .tile__media { padding-top: 18px; box-sizing: border-box; background: #000; }
.tile--phone .tile__frame { inset: 10px 32% 0; border-radius: 26px 26px 0 0; border: 6px solid #111; border-bottom: 0; }
.tile__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tile--phone .tile__media { object-position: top; }
.tile__label { position: absolute; left: 14px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 6px 9px 5px; background: rgba(255, 255, 255, .92); color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.tile__tag { position: absolute; right: 14px; top: 12px; z-index: 4; transform: rotate(var(--r)) scale(.9); transition: transform var(--mid); }
.tile:hover .tile__tag { transform: rotate(var(--r)) scale(1.05); }
.tile__use { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%) scale(.8); opacity: 0; transition: opacity var(--fast), transform var(--mid); padding: 10px 14px; background: var(--ink); color: var(--white); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; white-space: nowrap; pointer-events: none; }
.tile:hover .tile__use { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.work__foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 2vw; border-top: 1px solid var(--ink); }
.work__foot-line { font-size: 2.6vw; letter-spacing: -.03em; font-weight: 500; }

/* the stage: the piece opens here, live where it can */
.stage { position: fixed; inset: 0; z-index: 90; background: var(--paper); display: grid; grid-template-rows: auto 1fr auto; padding: 14px var(--gutter) 14px; }
.stage[hidden] { display: none; }
.stage__bar { display: flex; align-items: center; gap: 18px; height: 44px; }
.stage__title { font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.stage__timer { margin-left: auto; color: var(--ink-2); display: inline-flex; align-items: center; }
.stage__timer b { color: var(--ink); margin-left: 6px; }
.stage__close { margin-left: auto; padding: 8px 12px; border: 1px solid var(--ink); }
.stage__timer:not([hidden]) + .stage__close { margin-left: 18px; }
.stage__body { display: grid; grid-template-columns: 1fr 380px; gap: 24px; min-height: 0; }
.stage__slot { position: relative; min-height: 0; display: grid; place-items: center; }
.device { position: relative; z-index: 0; background: #000; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.device--browser { width: 100%; height: 100%; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .25); }
.device--browser::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30px; background: #e9e6df; border-bottom: 1px solid rgba(0, 0, 0, .1); z-index: 2; }
.device--browser::after { content: attr(data-url); position: absolute; left: 60px; top: 7px; height: 16px; line-height: 16px; padding: 0 8px; background: #fff; border-radius: 4px; font-family: var(--mono); font-size: 10px; color: var(--ink-2); z-index: 3; width: 40%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.device--browser > * { position: absolute; inset: 30px 0 0 0; width: 100%; height: calc(100% - 30px); border: 0; }
.device--phone { width: min(400px, 100%); aspect-ratio: 9 / 19; border-radius: 38px; border: 8px solid #111; }
.device--phone > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.device video { object-fit: cover; object-position: top; }
.stage__report { display: grid; gap: 14px; align-content: start; padding: 6px 0 0; overflow: auto; }
.stage__k { color: var(--ink-2); }
.stage__h { font-size: 28px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.stage__dl { display: grid; gap: 10px; margin: 0; border-top: 1px solid var(--ink); }
.stage__dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding-top: 10px; border-bottom: 1px solid rgba(20, 20, 20, .14); padding-bottom: 10px; }
.stage__dl dt { color: var(--ink-2); }
.stage__dl dd { margin: 0; font-size: 15px; line-height: 1.4; }
.stage__links { display: flex; gap: 10px; flex-wrap: wrap; }
.btn--small { padding: 10px 14px 9px; font-size: 14px; }
.stage__note { color: var(--ink-2); }
.stage__nav { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; height: 36px; align-items: center; }
.stage__nav > button { flex: none; padding: 6px 10px; border: 1px solid rgba(20, 20, 20, .25); background: var(--paper); }
.stage__nav > button:hover { border-color: var(--ink); }
/* the channel strip: every piece, one line, between prev and next */
.stage__keys { display: flex; justify-content: center; gap: 4px; flex: 0 1 auto; min-width: 0; }
.stage__keys button { flex: 0 1 auto; width: 34px; min-width: 0; height: 26px; padding: 0; border: 1px solid rgba(20, 20, 20, .18); border-radius: 3px; background: var(--paper); color: var(--ink); transition: background var(--fast), border-color var(--fast); }
.stage__keys button:hover { border-color: var(--ink); }
.stage__keys button.is-on { background: var(--s-yellow); border-color: var(--ink); }
@media (max-width: 560px) { .stage__navw { display: none; } .stage__nav { gap: 8px; } .stage__keys { gap: 3px; } }
.ghost { position: fixed; z-index: 95; object-fit: cover; pointer-events: none; border-radius: 6px; }

.top__nav a.is-here::after { width: 100%; }
/* phone menu: the header stays above the yellow panel so close is reachable */
body.menu-open .top { z-index: 70; }
body.menu-open .top::before { opacity: 0; }

@media (max-width: 900px) {
  .work { padding-top: 100px; }
  .work__head { max-width: none; }
  .work__title { font-size: 20vw; }
  .work__sub { font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  .work__foot { flex-direction: column; align-items: flex-start; }
  .work__foot-line { font-size: 7vw; }
  .stage { padding: 10px var(--gutter); overflow: auto; }
  .stage__body { grid-template-columns: 1fr; }
  .stage__slot { min-height: 60vh; }
  .device--phone { width: min(320px, 90%); }
}

/* the lab table */
.views { display: inline-flex; margin-left: auto; border: 1px solid var(--ink); }
.views button { padding: 7px 12px 6px; color: var(--ink); }
.views button.is-on { background: var(--ink); color: var(--white); }
.page-work.is-table .grid, .page-work:not(.is-table) .table { display: none; }
.table { position: relative; z-index: 0; isolation: isolate; height: 82vh; min-height: 560px; margin: 0 calc(-1 * var(--gutter)); overflow: hidden; cursor: grab; touch-action: none; border-top: 1px solid rgba(20, 20, 20, .14); border-bottom: 1px solid rgba(20, 20, 20, .14);
  background-color: #efece4; background-image: radial-gradient(rgba(20, 20, 20, .16) 1px, transparent 1.2px); background-size: 26px 26px; }
.table.is-dragging { cursor: grabbing; }
.table__world { position: absolute; left: 0; top: 0; width: 2600px; height: 1720px; will-change: transform; }
.tcard { position: absolute; padding: 10px 10px 12px; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 24px 40px -24px rgba(0, 0, 0, .45); transition: box-shadow var(--mid), filter var(--mid); cursor: pointer; }
.tcard:hover { box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 50px 70px -30px rgba(0, 0, 0, .55); z-index: 5; }
.tcard.is-dim { filter: grayscale(1) opacity(.22); }
.tcard__frame { position: relative; overflow: hidden; background: #000; }
.tcard--browser .tcard__frame { aspect-ratio: 16 / 10; border-radius: 6px; padding-top: 16px; background: #e9e6df; }
.tcard--browser .tcard__frame::before { content: ""; position: absolute; left: 8px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #ff5f57; box-shadow: 9px 0 0 #febc2e, 18px 0 0 #28c840; z-index: 2; }
.tcard--phone .tcard__frame { aspect-ratio: 9 / 19; border-radius: 22px; border: 6px solid #111; }
.tcard__frame video { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: #000; }
.tcard__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 2px 0; }
.tcard__name { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.tcard__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; }
.tcard__meta .dot { width: 6px; height: 6px; margin-right: 6px; }
.tcard__live { position: absolute; right: -12px; top: -12px; z-index: 3; }
.tcard__open { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.85); opacity: 0; transition: opacity var(--fast), transform var(--mid); z-index: 3; padding: 9px 13px; background: var(--ink); color: var(--white); font-family: var(--mono); font-size: 12px; white-space: nowrap; pointer-events: none; }
.tcard:hover .tcard__open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.table__deco { position: absolute; pointer-events: none; }
.table__note { position: absolute; color: var(--ink-2); font-size: 13px; pointer-events: none; }
.table__ring { position: absolute; width: 150px; height: 150px; border-radius: 50%; box-shadow: inset 0 0 0 9px rgba(120, 72, 30, .09), inset 0 0 0 13px rgba(120, 72, 30, .04); pointer-events: none; }
.table__mini { position: absolute; left: var(--gutter); bottom: 18px; width: 182px; height: 120px; background: rgba(246, 244, 238, .92); border: 1px solid rgba(20, 20, 20, .3); z-index: 6; cursor: pointer; }
.table__mini i { position: absolute; background: rgba(20, 20, 20, .28); }
.table__mini i.is-dim { background: rgba(20, 20, 20, .08); }
.table__mini-view { position: absolute; border: 1.5px solid var(--signal); background: rgba(255, 90, 31, .08); pointer-events: none; }
@media (max-width: 900px) { .page-work.is-table .grid { display: grid; } .page-work .table, .views { display: none; } }

.tcard--phone .tcard__cap { flex-direction: column; align-items: flex-start; gap: 4px; }
.tcard--phone .tcard__name { font-size: 15px; line-height: 1.15; }
.work__head, .filters { position: relative; z-index: 2; }

.is-staged main.work, .is-staged .footer { visibility: hidden; }
.stage { isolation: isolate; }

html, body { overflow-x: clip; }

.device--nourl::after { display: none; }
.device--phone { height: 100%; width: auto; max-width: 100%; max-height: 100%; aspect-ratio: 9 / 19; }
.stage__slot { min-height: 0; height: 100%; }
@media (max-width: 900px) {
  .stage { display: block; overflow-y: auto; padding-top: 0; }
  .stage__bar { position: sticky; top: 0; z-index: 3; background: var(--paper); padding: 10px 0; height: auto; flex-wrap: wrap; gap: 8px 12px; }
  .stage__timer { display: none !important; }
  .stage__close { margin-left: auto; }
  .stage__body { display: block; }
  .stage__slot { height: auto; min-height: 0; padding: 10px 0 18px; }
  .device--browser { height: 56vw; }
  .device--phone { height: 70vh; width: auto; margin: 0 auto; }
  .stage__report { padding-bottom: 30px; }
}


/* the list: the index */
.grid { display: block; grid-template-columns: none; }
.index__rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.irow { position: relative; display: grid; grid-template-columns: 70px 1fr auto auto; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid rgba(20, 20, 20, .2); cursor: pointer; }
.irow.is-hidden { display: none; }
.irow::before { content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)); background: var(--row, var(--s-yellow)); transform: scaleY(0); transform-origin: bottom; transition: transform var(--mid); z-index: 0; }
.irow:hover::before, .irow:focus-visible::before { transform: scaleY(1); }
.irow > * { position: relative; z-index: 1; }
.irow__n { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.irow__t { font-size: clamp(34px, 5.4vw, 92px); line-height: .95; letter-spacing: -.045em; font-weight: 700; transition: transform var(--mid); }
.irow:hover .irow__t { transform: translateX(18px); }
.irow__k { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-align: right; }
.irow:hover .irow__k, .irow:hover .irow__n { color: var(--ink); }
.irow .sticker { font-size: 13px; }
.peek { position: fixed; left: 0; top: 0; z-index: 70; width: 360px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; pointer-events: none; opacity: 0; transform: scale(.6); box-shadow: 0 0 0 4px #fff, 0 30px 50px -20px rgba(0, 0, 0, .5); background: #000; }
.peek.is-phone { width: 220px; aspect-ratio: 9 / 19; }
.peek video { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 900px) {
  .irow { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .irow__n { display: none; }
  .irow__k { grid-column: 1; text-align: left; }
  .irow__t { font-size: 34px; }
  .peek { display: none; }
}

/* phones: every row carries its piece on a strip of the lab table; the row in the middle of the screen plays */
.irow__m { display: none; }
@media (max-width: 900px) {
  .irow { padding: 14px 0 18px; }
  .irow__m { display: block; position: relative; grid-column: 1 / -1; grid-row: 1; aspect-ratio: 16 / 10; margin-bottom: 8px; overflow: hidden; isolation: isolate; border-radius: 6px;
    background-color: color-mix(in srgb, var(--row, var(--s-yellow)) 26%, #efece4);
    background-image: radial-gradient(rgba(20, 20, 20, .16) 1px, transparent 1.2px); background-size: 18px 18px; box-shadow: inset 0 0 0 1px rgba(20, 20, 20, .1); }
  .irow__t { grid-column: 1; grid-row: 2; }
  .irow .sticker { grid-column: 2; grid-row: 3; align-self: center; }
  .irow__k { grid-column: 1; grid-row: 3; }
  .irow:hover .irow__t { transform: none; }
  .irow__scr { position: absolute; left: 50%; top: 18px; overflow: hidden; background: #000; transform: translateX(-50%) rotate(var(--tilt, 0deg)); box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 26px 36px -22px rgba(0, 0, 0, .55); }
  .irow__m--browser .irow__scr { width: 84%; aspect-ratio: 16 / 11; border-radius: 6px; padding-top: 14px; background: #e9e6df; }
  .irow__m--browser .irow__scr::before { content: ""; position: absolute; left: 8px; top: 4.5px; width: 5px; height: 5px; border-radius: 50%; background: #ff5f57; box-shadow: 8px 0 0 #febc2e, 16px 0 0 #28c840; z-index: 2; }
  .irow__m--phone .irow__scr { width: 36%; aspect-ratio: 9 / 19; border: 5px solid #111; border-radius: 22px; }
  .irow__scr > img, .irow__scr > video { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; background: #000; }
  .irow__m--browser .irow__scr > img, .irow__m--browser .irow__scr > video { top: 14px; height: calc(100% - 14px); }
  .irow__v { opacity: 0; transition: opacity .45s var(--ease); }
  .irow__v.is-on { opacity: 1; }
  /* the one that is running gets the live dot */
  .irow__m::after { content: ""; position: absolute; right: 12px; top: 12px; z-index: 3; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px #fff; opacity: 0; transform: scale(.4); transition: opacity var(--fast), transform var(--fast); }
  .irow__m.is-playing::after { opacity: 1; transform: scale(1); }
}

/* focus: a 2px ink ring 3px out, yellow where the ground is dark; mouse focus stays quiet */
.page-work :focus { outline: none; }
.page-work :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.page-work .footer :focus-visible { outline-color: var(--s-yellow); }
.page-work .filter.is-on:focus-visible { outline-offset: 4px; }
.page-work .views button:focus-visible { outline-offset: -5px; }
.page-work .views button.is-on:focus-visible { outline-color: var(--s-yellow); }
.page-work .stage__keys button:focus-visible, .page-work .stage__nav > button:focus-visible { position: relative; z-index: 1; border-color: var(--ink); }
.page-work .tcard:focus-visible { z-index: 5; box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 50px 70px -30px rgba(0, 0, 0, .55); }
.page-work .tcard:focus-visible .tcard__open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* a row lights up like its hover, with the ring drawn round the colour band */
.page-work .irow:focus-visible { outline: none; }
.irow:focus-visible::before { transform: scaleY(1); }
.irow:focus-visible::after { content: ""; position: absolute; z-index: 2; inset: 3px calc(3px - var(--gutter)); border: 2px solid var(--ink); border-radius: 4px; pointer-events: none; }
@media (min-width: 901px) { .irow:focus-visible .irow__t { transform: translateX(18px); } }
html { scroll-padding-top: 96px; }
/* a piece opened or closed with the mouse moves focus quietly; the ring comes back with the next key */
.quiet-focus .page-work :focus-visible { outline: none; }
.quiet-focus .irow:focus-visible::after { content: none; }
.quiet-focus .irow:focus-visible:not(:hover)::before { transform: scaleY(0); }
.quiet-focus .tcard:focus-visible:not(:hover) .tcard__open { opacity: 0; }
