/* =========================================================================
   MantaSys work page (work.html): the sites we have built.
   Loaded after story.css and uses its tokens, bar, rail, headline, demo
   frame, feature scenes (.s-demo, .try), contact scene and the
   --p / --a / --w timeline (see the top of story.css).
   As there, every animated rule is scoped to html.js, so without the script
   or with reduced motion each scene shows its finished state.
   ========================================================================= */

/* Client names are longer than the home page's section names. */
.rail-l { width: 9em; }

/* Logos are the clients' own artwork, most of it drawn for a light ground,
   so each sits on a light plate in both themes. */
:root { --plate: #FFFFFF; --plate-line: rgba(15, 22, 35, .08); }

/* =======================================================================
   01 · Work: the headline beside a wall of logos
   ======================================================================= */

.s-work .stage {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
}
html.js .work-copy .eyebrow { animation: fade-up .9s var(--ease) .05s both; }
html.js .work-copy .premise-lede { animation: fade-up .9s var(--ease) .55s both; }

.wall {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px);
}
.wall li { --t: 1; }
.wall a {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--plate); border: 1px solid var(--plate-line);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.wall a:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--teal-hi), var(--shadow); }
/* every logo fits the same box, whatever its own size */
.wall img { position: absolute; inset: 16%; width: 68%; height: 68%; object-fit: contain; }
.wall .lg-fem { inset: 26%; width: 48%; height: 48%; }
.wall .lg-wide { inset: 10%; width: 80%; height: 80%; }

/* the empty plate: room for the next one */
.wall-next a {
  background: transparent; border: 1px dashed var(--fg-4); box-shadow: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3); text-decoration: none; text-align: center;
}
.wall-next a:hover { color: var(--teal-hi); border-color: var(--teal-hi); box-shadow: none; }

/* the plates land one by one on load, then spread a little as you scroll on */
html.js .wall li { animation: fade-up .8s var(--ease) both; animation-delay: calc(.3s + var(--k) * .09s); }
html.js .wall { transform: translateY(calc(var(--p) * -24px)); }
html.js .wall li:nth-child(3n+1) { translate: calc(var(--p) * -14px) 0; }
html.js .wall li:nth-child(3n)   { translate: calc(var(--p) * 14px) 0; }

/* =======================================================================
   02 – 06 · Clients: the logo in a browser frame
   ======================================================================= */

.view.plate {
  display: grid; place-items: center;
  background: var(--plate);
}
.view.plate img {
  display: block;
  max-width: 62%; max-height: 42%;
  object-fit: contain;
}
.view.plate .lg-fem  { max-height: 30%; }   /* the source file is small (93 × 81) */
.view.plate .lg-tall { max-height: 62%; }
.view.plate .lg-wide { max-width: 72%; }
.s-client .demo-copy em { font-style: italic; }

/* =======================================================================
   Smaller and shorter screens
   ======================================================================= */

@media (max-width: 900px) {
  .s-work .stage { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 22px; }
  .wall { max-width: 520px; }
}

@media (max-width: 720px) {
  /* the headline and the wall don't fit one phone screen, so this scrolls normally */
  html.js .s-work { height: auto; }
  html.js .s-work .stage { position: relative; height: auto; overflow: visible; }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.js .wall { transform: none; }
  html.js .wall li:nth-child(n) { translate: none; }
}
