/* ==========================================================================
   PORTFOLIO LAYOUTS: what the three layouts share (layered after portfolio.css)
   Equal cards (portfolio.css makes every slot 16:9, the covers' own shape), each
   coming to life when the light reaches it, and the invitation card. Each
   layout's own arrangement is in offset.css, grid.css or reel.css.
   ========================================================================== */

/* ── each card comes up when the light reaches it ───────────────────────
   Pass 6 brought every card up once the sign had struck. Here each card waits
   for the light coming down the margin (main.js adds .is-lit when it gets
   there): a sweep runs out from the wire along the card's horizon, the horizon
   is drawn behind it at the sweep's speed (--hz-t), then the cover rises from
   it and the type word follows, with pass 6's own timings after --d. A card
   the light has not reached is not there yet. */
.work--room .case:not(.is-lit) .case__media, .work--room .invite:not(.is-lit) .case__media { opacity: 0; transition: opacity .2s ease; }
.work--room .case:not(.is-lit) .case__rise, .work--room .invite:not(.is-lit) .case__rise { transform: translate3d(0, 101%, 0); transition: transform .3s ease; }
.work--room .case:not(.is-lit) .case__horizon::before, .work--room .invite:not(.is-lit) .case__horizon::before { transform: scaleX(0); transition: transform .25s ease, opacity .5s var(--e-io); }
.work--room .case:not(.is-lit) .case__horizon::after, .work--room .invite:not(.is-lit) .case__horizon::after { opacity: 0; transition: opacity .25s ease; }
.work--room .case:not(.is-lit) .case__say { opacity: 0; transform: translate3d(0, 14px, 0); transition: opacity .2s ease, transform .3s ease; }
.work--room.is-open .is-lit .case__horizon::before { transform: none; transition: transform var(--hz-t, .9s) linear var(--d, 0ms), opacity .5s var(--e-io); }
.work--room.is-open .is-lit .case__horizon::after { opacity: 1; transition: opacity .9s var(--e-io) calc(var(--d, 0ms) + 120ms); }
/* (the sweep is the light that brings a card up; the small light on the horizon is for reaching for it) */
.work--room.is-open .case__run { animation: none; }
/* switched on at once (focus, a link, a category chosen, a fast jump): no transition */
.work--room.is-open .is-lit.is-now .case__media, .work--room.is-open .is-lit.is-now .case__rise,
.work--room.is-open .is-lit.is-now .case__horizon::before, .work--room.is-open .is-lit.is-now .case__horizon::after,
.work--room.is-open .is-lit.is-now .case__say { transition: none; }
/* the invitation is in the room like a card */
.work--room .invite { transition: none; }
.work--room:not(.is-open) .invite { opacity: 0; }

/* ── the invitation ──────────────────────────────────────────────────────
   One more card after the projects, in the frame of a cover: carbon, the
   covers' headline (Space Grotesk 600, set and placed as on the 1920 x 1080
   frame, here in container units so it scales with the card) and the nyteshift
   lockup in its place. It has no art and no type word; instead its horizon is
   lit, at full strength, with its light rising into the empty frame. It is a
   link to Let's work together, not a project. */
.invite { display: none; position: relative; min-width: 0; }
.work--cards .invite:not([hidden]) { display: block; }
.invite__card {
  position: relative; display: flex; flex-direction: column; color: inherit; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.invite__frame { display: block; container-type: inline-size; }
.invite__art { position: absolute; inset: 0; display: block; }
/* the covers' frame, at 1920 px: the headline 128 px at 96 px from the left, its foot where the covers'
   headlines end (above their context line's row, 160 px up); the lockup 246 px wide, 88 px in and 76 px up */
.invite__head {
  position: absolute; left: 5cqw; bottom: 8.36cqw;
  font-size: 6.667cqw; font-weight: 600; line-height: .97; letter-spacing: -.035em; color: var(--paper);
  white-space: nowrap; font-kerning: normal; -webkit-font-smoothing: antialiased;
}
.invite__lockup { position: absolute; right: 4.583cqw; bottom: 3.958cqw; display: block; width: 12.8125cqw; height: auto; }
/* the horizon lit: the line at full strength, and its light rising into the empty frame */
.invite__frame::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 78%; pointer-events: none; opacity: .85;
  background: radial-gradient(ellipse 58% 100% at 50% 100%, rgba(var(--glow), .13), rgba(var(--glow), .045) 48%, rgba(var(--glow), 0) 100%);
  transition: opacity .5s var(--e-io);
}
.invite .case__horizon::before { opacity: 1; }
.invite .case__horizon::after {
  background: radial-gradient(ellipse 60% 100% at 50% 0, rgba(var(--glow), .17), rgba(var(--glow), .05) 52%, rgba(var(--glow), 0));
}
/* reaching for it: a little more light, and the light runs along its horizon, as on a card */
@media (hover: hover) {
  .invite__card:hover .invite__frame::before { opacity: 1; }
  .invite__card:hover .case__run { animation: case-run 1s var(--e-io) both; }
}
/* (reached by the keyboard or a link, it lands clear of the nav and the categories, as a card does) */
.invite, .invite__card { scroll-margin-top: calc(var(--nav-h) + var(--bar-h, 3.5rem) + 1.5rem); scroll-margin-bottom: 1.5rem; }
.invite__card:focus-visible { outline: none; box-shadow: none; }
.invite__card:focus-visible .invite__frame::before { opacity: 1; }
.invite__card:focus-visible .case__run { animation: case-run 1s var(--e-io) both; }
.invite__card::after { content: ""; position: absolute; inset: -.5rem; z-index: 2; border-radius: calc(var(--media-r) + 6px); pointer-events: none; }
.invite__card:focus-visible::after { outline: 2px solid var(--sodium); outline-offset: 2px; box-shadow: 0 0 0 7px rgba(var(--glow), .2); }
html.reduce .invite__frame::before { transition: none; }

/* (the categories held by main.js instead, where the browser has let go of their sticky place: see work() in main.js) */
.work--barself .work__bar { position: relative; top: 0; will-change: transform; }
