/* ============================================================================
   500x — the Work Gallery
   ----------------------------------------------------------------------------
   Twelve works hung on one eye line, walked past one or two at a time. On a
   wide screen assets/js/wall-walk.js pins .wall-pin and walks .wall-track
   sideways with the page's own scroll; below 900 px, or with reduced motion,
   the same markup is a column. Order and shape are data (tools/wall_data.py).

   #wall overlaps the last viewport of the film track (margin-top: -100vh), so
   it rises into view during the pull-back and is exactly in place when the
   film ends. hall-film.js drives --wall-in from 0 to 1. None of that changed
   when the wall learned to walk (spec 2026-09-24): the title still arrives
   16vh down, centred, fading on the same curve.
   ========================================================================== */

#wall {
  --wall-in: 1;
  --plaster: #cdbfa6;
  --ink-wall: #2b2118;
  --wall-side: 32px;
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  color: var(--ink-wall);
  background: var(--plaster);
}

/* ------------------------------------------------ the wall, wide screens */
.wall-pin {
  position: relative;
  container-type: inline-size;  /* 100cqw: the page's width without a classic scrollbar */
  height: 100vh;
  overflow-x: auto;           /* without JavaScript the row scrolls natively */
  overflow-y: hidden;
}
.wall-track {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;        /* the eye line: the middle of the band below the title */
  width: max-content;
  height: 100%;
  /* Measured against eight screens from 900x1200 to 2560x1080: the first work and its
     label always fit whole, and the second always shows its edge at the right. */
  padding: 16vh 20vw 0 max(8vw, 30vw - 200px);
  gap: 8vw;
  background: var(--plaster) url('/assets/wall/plaster-walk.webp') 0 0 / auto 100% repeat-x;
}

/* The same box the title had in the salon hang -- inset by --wall-side, 16vh down --
   so its arrival is measured identical (tools/shoot_handoff.py). It sits in the track,
   so it leaves with the wall. */
.wall-head {
  position: absolute;
  left: var(--wall-side);
  top: 16vh;
  width: calc(100cqw - 2 * var(--wall-side));
  margin: 0;
  text-align: center;
  opacity: clamp(0, calc(var(--wall-in) * 2 - 0.6), 1);
}
.wall-head h2 {
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(34px, 4.6vw, 72px);
}
.wall-head h2 b { font-weight: 600; }

.wall-frame {
  --shown: clamp(0, calc(var(--wall-in) * 2 - var(--d, 0)), 1);
  /* Each shape's height, capped by the screen's width so a tall narrow screen (a
     portrait tablet) still fits a work and its label on the first screen. */
  --ah: min(58vh, 45vw);
  position: relative;
  flex: none;
  display: flex;
  align-items: flex-end;      /* the label hangs level with the work's lower edge */
  gap: 28px;
  color: inherit;
  text-decoration: none;
  opacity: var(--shown);
  transform: translateY(calc((1 - var(--shown)) * 12px));
}
.wall-frame[data-kind="landscape"] { --ah: min(50vh, 34.5vw); }
.wall-frame[data-kind="tall"] { --ah: min(62vh, 53vw); }

.wall-art {
  position: relative;
  display: block;
  flex: none;
  box-sizing: border-box;
  height: var(--ah);
  aspect-ratio: var(--ar);
  padding: clamp(5px, 0.5vw, 10px);
  background: #efe7d8;
  border: clamp(7px, 0.7vw, 13px) solid transparent;
  border-image: url('/assets/wall/frame.webp') 60 / 1 / 0 stretch;
  box-shadow: 0 1px 2px rgba(20, 12, 4, 0.35), 0 18px 40px -12px rgba(20, 12, 4, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.wall-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The picture light and the pool of light it throws. */
.wall-art::before {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(-1 * clamp(16px, 1.5vw, 26px));
  width: 42%;
  height: clamp(14px, 1.4vw, 24px);
  transform: translateX(-50%);
  background: url('/assets/wall/light.webp') center / contain no-repeat;
  z-index: 2;
  pointer-events: none;
}
.wall-art::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 236, 196, 0.5), rgba(255, 236, 196, 0) 72%);
  opacity: 0.4;
  transition: opacity 0.22s ease;
}
a.wall-frame:hover .wall-art,
a.wall-frame:focus-visible .wall-art {
  transform: translateY(-4px);
  box-shadow: 0 2px 3px rgba(20, 12, 4, 0.35), 0 30px 60px -14px rgba(20, 12, 4, 0.55);
}
a.wall-frame:hover .wall-art::after,
a.wall-frame:focus-visible .wall-art::after { opacity: 1; }
a.wall-frame:focus-visible { outline: none; }
a.wall-frame:focus-visible .wall-art { outline: 2px solid var(--ink-wall); outline-offset: 6px; }

/* The wall label: a museum's, small and exact, beside the work. */
.wall-label {
  display: block;
  flex: none;
  width: min(240px, 24vw);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(43, 33, 24, 0.78);
}
.wall-label b {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-wall);
}
.wall-label span { display: block; }
.wall-impact { margin-top: 10px; color: var(--ink-wall); }
.wall-cta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-wall);
}
a.wall-frame:hover .wall-cta,
a.wall-frame:focus-visible .wall-cta { text-decoration: underline; text-underline-offset: 4px; }
.is-placeholder .wall-label span:last-child { color: rgba(43, 33, 24, 0.55); letter-spacing: 0.04em; }

/* ------------------------------------------------ walking (wall-walk.js) */
#wall.is-walk { height: calc(100vh + var(--travel, 0px)); }
#wall.is-walk .wall-pin {
  position: sticky;
  top: 0;
  overflow: clip;             /* not scrollable, so focus cannot slide it on its own */
}
#wall.is-walk .wall-track { will-change: transform; }

.wall-progress { display: none; }
#wall.is-walk .wall-progress {
  position: absolute;
  left: var(--wall-side);
  right: var(--wall-side);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(43, 33, 24, 0.7);
  opacity: clamp(0, calc(var(--wall-in) * 2 - 1), 1);
  pointer-events: none;
}
.wall-progress-line { position: relative; flex: 1; height: 1px; background: rgba(43, 33, 24, 0.18); }
.wall-progress-fill {
  position: absolute;
  inset: 0;
  background: var(--ink-wall);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ------------------------------------------ the column: phones, reduced motion */
@media (max-width: 899px), (prefers-reduced-motion: reduce) {
  #wall {
    padding: 16vh 20px 14vh;
    background: var(--plaster) url('/assets/wall/plaster-2400.webp') center top / cover no-repeat;
  }
  .wall-pin { height: auto; overflow: visible; }
  .wall-track {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    max-width: 560px;
    height: auto;
    margin: 0 auto;
    padding: 0;
    gap: 72px;
    background: none;
  }
  .wall-head { position: static; width: auto; }
  .wall-frame { flex-direction: column; align-items: stretch; gap: 16px; }
  .wall-art { width: 100%; height: auto; }
  .wall-label { width: auto; }
}
@media (max-width: 899px) and (max-aspect-ratio: 1 / 1) {
  #wall { background-image: url('/assets/wall/plaster-1200-portrait.webp'); }
}

@media (prefers-reduced-motion: reduce) {
  #wall { margin-top: 0; }
  .wall-frame { opacity: 1; transform: none; }
  .wall-head { opacity: 1; }
  .wall-art, .wall-art::after { transition: none; }
}

/* Frame -> case study as one continuous image (cross-document View
   Transitions). Browsers without support simply navigate. */
@view-transition { navigation: auto; }
