/* ==========================================================================
   artist.css — individual artist pages
   Parallax hero, work gallery, interstitial plate, lightbox.
   Loaded alongside theme.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Parallax scaffolding

   Every parallax layer is moved with translate3d only — never top/left, never
   background-attachment: fixed, which is unreliable on iOS and forces a repaint
   on every scroll frame. Layers sit inside a clipping frame so the drift can
   never reveal an edge or widen the page.

   The whole effect is opt-in: js/parallax.js adds .parallax-ready to <html>
   and nothing moves until it does, so with JavaScript off, or under
   prefers-reduced-motion, these are ordinary static images.
   -------------------------------------------------------------------------- */
.px-frame {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.px-layer {
  position: absolute;
  /* Oversize the layer so it can drift without exposing the frame edge. */
  inset: -18% 0;
  z-index: -2;
  will-change: transform;
}
.px-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:root:not(.parallax-ready) .px-layer { inset: 0; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.artist-hero {
  display: flex;
  align-items: flex-end;
  min-height: min(88svh, 52rem);
  padding-block: clamp(6rem, 18vw, 11rem) clamp(2.5rem, 7vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}
.artist-hero .px-layer img {
  filter: grayscale(1) contrast(1.1) brightness(0.8);
  object-position: 50% 28%;
}
.artist-hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(98deg, rgba(8, 9, 11, 0.95) 0%, rgba(8, 9, 11, 0.72) 46%, rgba(8, 9, 11, 0.28) 100%),
    linear-gradient(to top, var(--ground) 1%, transparent 46%);
}

/* The name is set once at display size and once, much larger, as a ghosted
   outline drifting behind it — the layer that sells the depth. */
.artist-hero__ghost {
  position: absolute;
  left: 50%;
  top: 20%;
  /* Above the scrim, below the copy. At -1 it sat under the scrim and was
     invisible, which cost the hero the whole depth effect. */
  z-index: 0;
  transform: translateX(-50%);
  width: max-content;
  max-width: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(7rem, 26vw, 26rem);
  line-height: 0.8;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 242, 238, 0.16);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  will-change: transform;
}

.artist-hero__inner {
  position: relative;
  z-index: 1;
  display: grid; gap: var(--sp-5); width: 100%; min-width: 0;
}
.artist-hero__inner > * { min-width: 0; }
.artist-hero h1 {
  font-size: clamp(3rem, 11vw, 8.5rem);
  line-height: 0.84;
  margin: 0;
  max-width: 12ch;
}
.artist-hero__role {
  font-family: var(--label);
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--red-hi);
}
.artist-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

.artist-hero__crumb {
  font-family: var(--label);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.artist-hero__crumb a { color: var(--ink-2); }
.artist-hero__crumb a:hover { color: var(--red-hi); }

/* --------------------------------------------------------------------------
   Bio block
   -------------------------------------------------------------------------- */
.artist-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.artist-intro > * { min-width: 0; }
.artist-intro__meta { display: grid; gap: var(--sp-5); }
.artist-intro__body { display: grid; gap: var(--sp-5); }
.artist-intro__body p { color: var(--ink-2); max-width: 62ch; font-size: 1.08rem; }
.artist-intro__body p.first::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.6em;
  line-height: 0.72;
  padding: 0.06em 0.14em 0 0;
  color: var(--red-hi);
}

.spec-list { display: grid; }
.spec-list li {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--label);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.spec-list li:first-child { border-top: 1px solid var(--line-soft); }
.spec-list li::before {
  content: "";
  flex: none;
  width: 14px; height: 1px;
  background: var(--red);
  translate: 0 -0.28em;
}

/* --------------------------------------------------------------------------
   Interstitial — a full-bleed piece of the artist's own work, parallaxed
   -------------------------------------------------------------------------- */
.interstitial {
  min-height: min(62svh, 34rem);
  display: flex;
  align-items: center;
  border-block: 1px solid var(--line);
}
.interstitial .px-layer img { filter: saturate(0.9) contrast(1.04) brightness(0.62); }
.interstitial::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8, 9, 11, 0.9) 0%, rgba(8, 9, 11, 0.42) 55%, rgba(8, 9, 11, 0.72) 100%);
}
.interstitial__quote {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 4.6vw, 3.6rem);
  line-height: 0.98;
  max-width: 18ch;
}
.interstitial__quote span { color: var(--red-hi); }
.interstitial__attrib {
  margin-top: var(--sp-4);
  font-family: var(--label);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Work gallery — a column masonry so tall and wide pieces both sit naturally
   -------------------------------------------------------------------------- */
.work-grid { min-width: 0; }
.work {
  break-inside: avoid;
  margin-bottom: clamp(0.75rem, 1.6vw, 1.25rem);
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-soft);
  background: var(--surface);
  border: 0;
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  text-align: left;
}
.work img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
  filter: saturate(0.95);
}
.work::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: inherit;
  transition: box-shadow var(--dur) var(--ease);
}
.work:hover img, .work:focus-visible img { transform: scale(1.04); filter: saturate(1.05); }
.work:hover::after, .work:focus-visible::after { box-shadow: inset 0 0 0 1px var(--red-dim); }

.work__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.2rem 0.9rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink);
  background: linear-gradient(to top, rgba(8, 9, 11, 0.92), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.work:hover .work__caption,
.work:focus-visible .work__caption { opacity: 1; transform: none; }

/* ==========================================================================
   Gallery layouts

   Each artist's gallery is laid out the way their own work reads, rather than
   one grid for everybody:

     masonry    Chad      eclectic neotraditional and anime work of every
                          shape - a sketchbook wall, varied heights
     justified  Justin    black and grey realism - aligned rows with flush
                          edges, the precision the work is about
     stack      Christian photo-real single statements - one piece at a time,
                          large enough to read the detail
     square     Jake      American traditional - a flash sheet is literally a
                          uniform grid of designs
     carousel   Kurtis    Japanese and anime sleeves - a handscroll reads
                          sideways, and long limb panels suit a horizontal run
   ========================================================================== */

/* ---- masonry (default) -------------------------------------------------- */
.work-grid--masonry {
  columns: 3;
  column-gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

/* ---- justified: rows of equal height with flush left and right edges ----- */
.work-grid--justified {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.6rem, 1.2vw, 1rem);
  --row: 17rem;
}
.work-grid--justified .work {
  height: var(--row);
  /* Grow in proportion to the photograph's own aspect ratio, so every row
     ends flush without any of them being distorted. */
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row));
  margin-bottom: 0;
  min-width: 0;
}
.work-grid--justified .work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Absorbs the slack in the final row so its items are not stretched wide. */
.work-grid--justified .work-spacer {
  flex: 999999 1 auto;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

/* ---- square: a flash sheet ---------------------------------------------- */
.work-grid--square {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: clamp(0.6rem, 1.4vw, 1rem);
}
.work-grid--square .work {
  aspect-ratio: 1;
  margin-bottom: 0;
}
.work-grid--square .work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- stack: one statement piece at a time ------------------------------- */
.work-grid--stack {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 64rem;
  margin-inline: auto;
}
.work-grid--stack .work {
  margin-bottom: 0;
  width: min(100%, 42rem);
}
/* Alternate the side so the column reads as a sequence rather than a list. */
.work-grid--stack .work:nth-child(even) { justify-self: end; }
.work-grid--stack .work img { width: 100%; height: auto; }
.work-grid--stack .work__caption {
  opacity: 1;
  transform: none;
  font-size: 0.9rem;
  padding: 3rem 1.1rem 1rem;
}

/* ---- carousel: a horizontal handscroll ---------------------------------- */
.work-carousel { position: relative; }
.work-grid--carousel {
  display: flex;
  gap: clamp(0.6rem, 1.4vw, 1rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  padding-bottom: var(--sp-4);
  scrollbar-color: var(--red-dim) transparent;
  scrollbar-width: thin;
}
.work-grid--carousel::-webkit-scrollbar { height: 6px; }
.work-grid--carousel::-webkit-scrollbar-track { background: var(--line-soft); border-radius: var(--r-round); }
.work-grid--carousel::-webkit-scrollbar-thumb { background: var(--red-dim); border-radius: var(--r-round); }
.work-grid--carousel:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 4px; }
.work-grid--carousel .work {
  flex: 0 0 auto;
  height: clamp(19rem, 52vh, 32rem);
  width: auto;
  margin-bottom: 0;
  scroll-snap-align: center;
}
.work-grid--carousel .work img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
}

.carousel-nav {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-4);
}
.carousel-hint {
  margin-right: auto;
  align-self: center;
  font-family: var(--label);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 64rem) {
  .work-grid--masonry { columns: 2; }
  .work-grid--justified { --row: 13rem; }
}

@media (max-width: 40rem) {
  .work-grid--masonry { columns: 1; }
  .work-grid--justified { --row: 11rem; }
  .work-grid--square { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid--stack .work,
  .work-grid--stack .work:nth-child(even) { width: 100%; justify-self: stretch; }
  .work-grid--carousel .work { height: 60vh; }
}


/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  /* minmax(0, 1fr), never plain 1fr: the auto minimum would let this row grow
     to the image's intrinsic height and nothing would ever be scaled down. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--sp-4);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  padding-bottom: max(clamp(0.75rem, 2vw, 1.5rem), env(safe-area-inset-bottom));
  background: rgba(4, 5, 7, 0.96);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}
.lightbox[hidden] { display: none; }
.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
}
.lightbox__count {
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.lightbox__stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: var(--sp-3);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.lightbox__stage img {
  /* Fill the stage and letterbox inside it rather than relying on a
     percentage max-height: on a grid item that percentage does not reliably
     resolve, and images were rendering at natural size and overflowing the
     window. Filling the area and letterboxing with object-fit is exact at
     every viewport and aspect ratio, and never distorts the photograph. */
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border-radius: var(--r-soft);
}
.lightbox__caption {
  text-align: center;
  color: var(--ink-2);
  font-size: var(--fs-small);
  min-height: 1.5em;
}
.lb-btn {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.lb-btn:hover { border-color: var(--red); color: var(--red-hi); background: var(--red-faint); }
.lb-btn svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Artist pager — previous / next across the roster
   -------------------------------------------------------------------------- */
.artist-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.artist-pager a {
  background: var(--ground);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  transition: background-color var(--dur) var(--ease);
}
.artist-pager a:hover { background: var(--ground-2); }
.artist-pager a:last-child { text-align: right; }
.artist-pager__label {
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-hi);
}
.artist-pager__name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  text-transform: uppercase; line-height: 1;
}

/* --------------------------------------------------------------------------
   Roster cards on artists.html — now that every artist has a page
   -------------------------------------------------------------------------- */
.roster-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.75rem);
}
.roster-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-soft);
  aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  min-width: 0;
}
.roster-card img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(1) contrast(1.08);
  transition: filter 700ms var(--ease), transform 900ms var(--ease);
}
.roster-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(8, 9, 11, 0.95) 14%, rgba(8, 9, 11, 0.28) 58%, transparent 100%);
}
.roster-card:hover img, .roster-card:focus-within img { filter: grayscale(0) contrast(1.02); transform: scale(1.05); }
.roster-card__role {
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-hi);
  margin-bottom: 0.3rem;
}
.roster-card h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  margin-bottom: 0.5rem;
}
.roster-card__styles { color: var(--ink-2); font-size: var(--fs-small); }
.roster-card__count {
  margin-top: var(--sp-3);
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
}
/* Aly has no page of her own on the studio site yet, so her card is a plain
   panel rather than a link that would go nowhere. */
.roster-card--nolink { cursor: default; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 64rem) {
  .artist-intro { grid-template-columns: minmax(0, 1fr); }
  .roster-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  .roster-cards { grid-template-columns: minmax(0, 1fr); }
  .artist-hero { min-height: auto; padding-block: clamp(4rem, 16vw, 6rem) var(--sp-7); }
  .artist-hero__ghost { font-size: 42vw; top: 26%; }
  .artist-hero__actions .btn { flex: 1 1 auto; }
  .artist-pager { grid-template-columns: minmax(0, 1fr); }
  .artist-pager a:last-child { text-align: left; }
  .lightbox__stage { grid-template-columns: minmax(0, 1fr); }
  .lightbox__stage .lb-btn { display: none; }
  .work__caption { opacity: 1; transform: none; }
}

/* Motion is a nicety. Under reduced motion nothing drifts, nothing scales. */
@media (prefers-reduced-motion: reduce) {
  .px-layer { inset: 0 !important; transform: none !important; }
  .artist-hero__ghost { transform: translateX(-50%) !important; }
  .work img { transition: none; }
}
