/* Good Work Digital. The Our Work page.
   Everything here sits on the home page's system (styles.css): its grid, its spacing, type and corner scales, its one glass, one tint, one rule, one accent.
   This file adds only what this page alone has: the page heading, the project stage, the window that holds a real capture, the list that chooses a screen, the closing band. */

/* ---------- The page heading: the name of the page, and its one line on the same baseline beside it on a computer ---------- */
.page-head { display: grid; row-gap: var(--s-16); padding-top: var(--s-24); }

/* ---------- A project: one tinted field holding its words, its frame and pane, and what it has ---------- */
.show__stage { row-gap: var(--s-24); }
.show__stage > .show__say, .show__stage > .show__shot, .show__stage > .show__has { grid-column: 1 / -1; min-width: 0; }
.show__say { display: grid; gap: var(--s-16); align-content: start; }
.show__what { color: var(--text); }
.show__what strong, .show__what span { display: block; }
.show__what span { text-wrap: balance; }

/* the frame on every column, the phone pane over its lower right corner, hanging below it by one fixed step */
.show__shot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); grid-template-rows: auto var(--s-56); }
.show__shot .frame--wide { grid-column: 1 / -1; grid-row: 1; }
.show__shot .frame--tall { grid-column: 9 / span 4; grid-row: 1 / span 2; }

/* The window: a real capture, taller than the window, held at its top. page.js moves it gently as the page scrolls and swaps it when a row is chosen.
   It takes no presses, so the whole frame still opens the live site, as on the home page. */
.view { position: relative; overflow: hidden; isolation: isolate; pointer-events: none; border-radius: var(--r-1); background: #fff; box-shadow: 0 0 0 1px rgba(11, 13, 18, 0.10); }
.view--wide { aspect-ratio: 16 / 10; }
.view--tall { aspect-ratio: 390 / 760; }
.frame .view img {
  position: absolute; left: 0; top: 0; width: 100%; height: auto; aspect-ratio: auto; object-fit: fill;
  border-radius: 0; box-shadow: none; background: none; backface-visibility: hidden;
  opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.frame .view img.is-on { opacity: 1; visibility: visible; transition: opacity 0.4s ease; }
.frame .view img.is-under { opacity: 1; visibility: visible; transition: none; } /* the screen being left stays whole underneath until the new one has arrived */

/* What it has: a label, a ruled list, and the way out to the live site as the last ruled row */
.show__label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-16); padding-bottom: var(--s-12); }
.show__label h3 { font: 600 var(--small)/var(--small-lh) var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.show__hint { display: none; font-size: var(--small); line-height: var(--small-lh); color: var(--muted); white-space: nowrap; }
.ow-ready .show__hint { display: block; }
.show__rows li { align-content: stretch; align-items: stretch; padding-block: 0; font-size: var(--body); line-height: var(--small-lh); }
.pick {
  display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: var(--s-16); align-content: center; align-items: start;
  width: 100%; margin: 0; padding: var(--s-12) 0; border: 0; border-radius: 0; background: none;
  font: inherit; letter-spacing: inherit; text-align: left; color: var(--ink); text-wrap: pretty;
  transition: color 0.14s ease;
}
.pick::before { content: ""; width: 8px; height: 8px; margin-top: var(--s-8); border-radius: 2px; background: var(--accent); transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
button.pick { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.pick:hover { color: var(--accent-ink); }
button.pick:focus-visible { outline-offset: -2px; }
/* once a row is chosen it stays lit and the others go quiet */
.show__rows.is-picking .pick { color: var(--muted); }
.show__rows.is-picking .pick::before { background: rgba(11, 13, 18, 0.22); transform: scale(0.75); }
.show__rows.is-picking .is-shown .pick { color: var(--ink); }
.show__rows.is-picking .is-shown .pick::before { background: var(--accent); transform: none; }
.show__rows.is-picking button.pick:hover { color: var(--accent-ink); }

.show__visit { box-shadow: inset 0 1px 0 var(--rule), inset 0 -1px 0 var(--rule); }
.show__visit a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-16); min-height: var(--s-56);
  color: var(--ink); font-weight: 600; letter-spacing: -0.01em; line-height: var(--small-lh); text-decoration: none; transition: color 0.14s ease;
}
.show__visit a:hover { color: var(--accent-ink); }
.show__visit a:active { color: var(--ink); }
.show__visit svg { flex: none; width: 16px; height: 16px; transition: transform 0.14s ease; }
.show__visit a:hover svg { transform: translate(2px, -2px); }
.show__visit a:focus-visible { outline-offset: -2px; }

/* ---------- The closing band: the one dark field, and the one filled button on the page ---------- */
.ask { row-gap: var(--s-32); padding-block: var(--s-32); }
.ask > h2, .ask > .btn { grid-column: 1 / -1; }
.ask > .btn { justify-self: start; }

@media (max-width: 374px) {
  .page-head { padding-top: var(--s-16); }
}

/* ---------- From a large phone up ---------- */
@media (min-width: 600px) {
  .page-head { row-gap: var(--s-32); padding-top: var(--s-40); }
  .show__stage { row-gap: var(--s-32); }
  .show__shot { grid-template-rows: auto var(--s-96); }
  .show__shot .frame--tall { grid-column: 10 / span 3; }
  .ask { padding-block: var(--bleed); }
}

/* ---------- Computer: the frame on eight columns, the words on four, both starting level and ending level.
   Every second project is set the other way round. The list is one fixed height whatever it holds
   (four rows of 48 are three rows of 64), so every stage is the same height and the pane's foot is the list's last rule. ---------- */
@media (min-width: 1200px) {
  .page-head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; align-items: last baseline; }
  .page-head h1 { grid-column: 1 / span 6; }
  .page-head .lead { grid-column: 7 / span 6; }

  .show__stage { grid-template-rows: auto 1fr; row-gap: 0; }
  .show__stage > .show__say { grid-column: 9 / span 4; grid-row: 1; }
  .show__stage > .show__shot { grid-column: 1 / span 8; grid-row: 1 / span 2; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: auto minmax(var(--s-56), 1fr); }
  .show__stage > .show__has { grid-column: 9 / span 4; grid-row: 2; align-self: end; margin-top: var(--s-32); }
  .show__shot .frame--tall { grid-column: 7 / span 2; }
  main > .show:nth-child(odd) .show__say, main > .show:nth-child(odd) .show__has { grid-column: 1 / span 4; }
  main > .show:nth-child(odd) .show__shot { grid-column: 5 / span 8; }

  .show__rows { display: grid; grid-auto-rows: minmax(var(--s-48), 1fr); min-height: calc(var(--s-48) * 4); }
  .show__rows li { min-height: 0; }
  .pick { padding-block: var(--s-8); }

  .ask { align-items: center; }
  .ask > h2 { grid-column: 1 / span 8; }
  .ask > .btn { grid-column: 9 / span 4; justify-self: end; }
}

/* ---------- Movement. Position and opacity only, and none of it without the script or where less movement is asked for.
   Each project arrives once as it comes into view: the frame, then the words, then the list, then the pane settling onto the frame. ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ow-ready .show__shot, .ow-ready .show__say, .ow-ready .show__has, .ow-ready .show__shot .frame--tall {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .ow-ready .show__shot .frame--tall { opacity: 1; transform: translateY(24px); transition-delay: 0.18s; }
  .ow-ready .show__say { transition-delay: 0.08s; }
  .ow-ready .show__has { transition-delay: 0.16s; }
  .ow-ready .show.is-in .show__shot, .ow-ready .show.is-in .show__say, .ow-ready .show.is-in .show__has, .ow-ready .show.is-in .show__shot .frame--tall { opacity: 1; transform: none; }
  .view img.is-on, .view img.is-under { will-change: transform; }
}
