/* ============================================================
   SYZYGY Architects — project
   A rail that stays put on the left (symbol, way back, name,
   facts) while the right side scrolls: one photograph, then the
   write-up beside a tall slider of photographs. Below both, a
   full-width gallery of the film and every photograph, then the
   way on to the next project.
   Photographs run to the edges. That trims them, so each one is
   only ever placed in a frame that suits its shape: wide ones on
   the first screen and in the gallery, upright ones in the tall
   slider. --f is where a photograph is held when it is trimmed.
   ============================================================ */

/* the standard header is not shown here; its button only appears, as a cross, while the menu is open */
.hd--ghost { visibility: hidden; }
html.is-menu .hd--ghost { visibility: visible; }

.pj { position: relative; display: grid; grid-template-columns: clamp(300px, 28vw, 384px) 1fr; background: var(--paper); }

/* ------------------------------------------------------------
   Rail
   ------------------------------------------------------------ */
.pj-rail {
  position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; height: 100svh; color: var(--ink);
  padding: clamp(30px, 4vh, 52px) clamp(28px, 2.4vw, 40px) clamp(30px, 4vh, 52px) clamp(34px, 3vw, 52px);
}
.pj-top { display: flex; flex-direction: column; gap: clamp(26px, 5vh, 60px); }
.pj-logo { position: relative; align-self: flex-start; display: inline-flex; align-items: center; height: 40px; transition: opacity var(--fast) var(--ease-out); }
.pj-logo::before, .pj-menu::before, .pj-crumb a::before, .pj-all::before {      /* a comfortable area to press */
  content: ""; position: absolute; top: 50%; left: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%);
}
/* the studio's own mark, drawn from its brand file */
.pj-mark {
  width: 104px; aspect-ratio: 3.72; background: currentColor;
  -webkit-mask: url("/assets/brand/mark.svg") center / contain no-repeat; mask: url("/assets/brand/mark.svg") center / contain no-repeat;
}
.pj-util { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.pj-crumb, .pj-menu, .pj-fact dt, .pj-kind-label {
  font-family: var(--font-body); font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink);
}
.pj-crumb a { position: relative; }
.pj-slash { padding: 0 5px; opacity: 0.4; }
.pj-menu { position: relative; padding: 0; border: 0; background: none; cursor: pointer; line-height: normal; transition: opacity var(--fast) var(--ease-out); }
.pj-titles { display: flex; flex-direction: column; gap: 7px; margin-top: clamp(96px, 22vh, 260px); }
.pj-title { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 1.7vw, 1.625rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.pj-sub { font-family: var(--font-body); font-size: 12px; font-weight: 300; letter-spacing: 0.04em; opacity: 0.7; }
.pj-facts { display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 26px); margin: clamp(64px, 15vh, 190px) 0 0; }
.pj-fact { display: flex; flex-direction: column; gap: 4px; }
.pj-fact dt, .pj-fact dd { margin: 0; }
.pj-fact dd { font-family: var(--font-body); font-size: 12px; font-weight: 300; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.pj-facts--m { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vh, 28px) 32px; margin: 0; padding: clamp(28px, 5vh, 44px) clamp(28px, 5vw, 48px) 0; }
@media (min-width: 1024px) and (max-height: 860px) {
  .pj-titles { margin-top: clamp(64px, 15vh, 260px); }
  .pj-facts { margin-top: clamp(40px, 9vh, 190px); }
}
@media (min-width: 1024px) and (max-height: 700px) {
  .pj-titles { margin-top: clamp(36px, 9vh, 260px); }
  .pj-facts { gap: 12px; margin-top: clamp(24px, 6vh, 190px); }
}
@media (hover: hover) and (pointer: fine) {
  .pj-logo:hover { opacity: 0.78; }
  .pj-menu:hover, .pj-crumb a:hover { opacity: 0.6; }
}
.pj-logo:focus-visible, .pj-menu:focus-visible, .pj-crumb a:focus-visible, .pj-all:focus-visible, .pj-next:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ------------------------------------------------------------
   The photograph, then the write-up beside the tall slider
   ------------------------------------------------------------ */
.pj-content { min-width: 0; }
.pj-hero { position: relative; width: 100%; height: 100svh; overflow: hidden; }
.pj-hero .fi img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--f, 50% 50%); }
.pj-over { display: grid; grid-template-columns: 1fr clamp(280px, 34vw, 540px); align-items: stretch; min-height: 100svh; }
.pj-text { display: flex; flex-direction: column; padding: clamp(72px, 12vh, 150px) clamp(36px, 4.5vw, 88px) clamp(56px, 9vh, 110px); }
.pj-kind { display: flex; flex-direction: column; gap: 4px; margin-bottom: clamp(28px, 4vh, 48px); }
.pj-kind-label { letter-spacing: 0.2em; }
.pj-kind-value { font-family: var(--font-body); font-size: 13px; font-weight: 300; letter-spacing: 0.04em; }
.pj-body { display: flex; flex-direction: column; gap: 1.2em; max-width: 560px; }
.pj-body p { margin: 0; font-family: var(--font-display); font-size: clamp(0.9375rem, 1vw, 1.0625rem); font-weight: 300; line-height: 1.75; color: var(--ink); }
.pj-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.4vw, 18px); max-width: 560px; margin-top: clamp(40px, 6vh, 72px); }
.pj-shot { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--linen); }
.pj-shot .fi img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--f, 50% 50%); }
.pj-tall { position: relative; }

/* tall slider: one screen tall, to the right edge, staying in view while the text beside it
   scrolls; upright photographs fade one into the next; a count and two arrows at its foot */
/* never narrower in shape than 49:90 (its shape on a 1440×900 screen), so an upright photograph
   keeps the same share of itself on small and very large screens alike */
.pc { position: sticky; top: 0; width: 100%; aspect-ratio: 49 / 90; max-height: 100svh; overflow: hidden; background: var(--linen); outline: none; }
.pc:focus-visible, .wg:focus-visible { outline: 2px solid var(--paper); outline-offset: -4px; }
.pc::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 32%; pointer-events: none;
  background: linear-gradient(to top, rgb(var(--shade) / 0.62) 0%, rgb(var(--shade) / 0) 100%);
}
.pc-stage { position: absolute; inset: 0; z-index: 1; }
.pc-frame, .wg-frame { position: absolute; inset: 0; opacity: 0; transition: opacity var(--slow) var(--ease-out); }
.pc-frame[data-active], .wg-frame[data-active] { opacity: 1; }
.pc-frame img, .wg-frame img, .wg-frame video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--f, 50% 50%); }
.pc-controls {
  position: absolute; left: 50%; bottom: clamp(18px, 2.4vw, 30px); z-index: 3; display: flex; align-items: center;
  gap: clamp(8px, 1.2vw, 14px); transform: translateX(-50%); color: var(--paper);
}
.pc-arrow, .wg-arrow {
  flex: 0 0 auto; display: flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  background: none; cursor: pointer; color: var(--paper); font-family: var(--font-display); font-size: 24px; font-weight: 300; line-height: 1;
  transition: opacity var(--fast) var(--ease-out);
}
.wg-arrow { font-size: 26px; }
.pc-arrow[aria-disabled="true"] { opacity: 0.3; cursor: default; }
.wg-arrow[aria-disabled="true"] { opacity: 0.25; cursor: default; }
.pc-arrow:focus-visible, .wg-arrow:focus-visible { outline: 1px solid var(--paper); outline-offset: -6px; }
.pc-count { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .pc-arrow:not([aria-disabled="true"]):hover, .wg-arrow:not([aria-disabled="true"]):hover { opacity: 0.6; }
}

/* ------------------------------------------------------------
   Gallery — the film and the wide photographs, edge to edge and
   one at a time, with a strip of small ones to choose from
   ------------------------------------------------------------ */
.wg {
  --thumb: clamp(44px, 5.4vw, 70px); --strip-at: clamp(20px, 3vw, 36px);
  position: relative; width: 100%; overflow: hidden; background: var(--ink); color: var(--paper); outline: none;
  /* one screen tall, but never a wider shape than 16:9: on a short, wide window a full-bleed
     frame would otherwise trim too much off the top and bottom of a photograph */
  height: max(100svh, 56.25vw);
}
.wg::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 34vh; pointer-events: none;
  background: linear-gradient(rgb(var(--shade) / 0) 0%, rgb(var(--shade) / 0.7) 100%);
}
.wg-stage { position: absolute; inset: 0; z-index: 1; }
/* two upright photographs side by side fill the wide frame almost untrimmed */
.wg-frame.is-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--ink); }
.wg-frame.is-pair img { position: relative; inset: auto; min-width: 0; min-height: 0; }
/* a drawing is never trimmed: whole, on paper, clear of the strip */
.wg-frame.is-plan { background: var(--paper); }
.wg-frame.is-plan img { object-fit: contain; padding: clamp(28px, 5vh, 56px) clamp(24px, 4vw, 64px) calc(var(--strip-at) + var(--thumb) + 8px + clamp(28px, 5vh, 56px)); }
.wg-frame video { opacity: 0; }
.wg-frame video[data-shown] { opacity: 1; }
.wg-strip {
  position: absolute; left: 50%; bottom: var(--strip-at); z-index: 5; display: flex; align-items: center;
  gap: clamp(8px, 1.4vw, 18px); max-width: min(92vw, 760px); transform: translateX(-50%);
}
.wg-thumbs { display: flex; align-items: center; gap: 8px; padding: 4px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.wg-thumbs::-webkit-scrollbar { display: none; }
.wg-thumb {
  position: relative; flex: 0 0 auto; width: clamp(64px, 8vw, 104px); height: var(--thumb); padding: 0; border: 0; overflow: hidden;
  background: var(--linen); cursor: pointer; opacity: 0.5; outline: 1px solid transparent; outline-offset: 0;
  transition: opacity var(--fast) var(--ease-out), outline-color var(--fast) var(--ease-out);
}
.wg-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--f, 50% 50%); }
.wg-thumb.is-pair img { width: 50%; }
.wg-thumb.is-pair img + img { left: 50%; }
.wg-thumb.is-plan img { object-fit: contain; background: var(--paper); }
.wg-thumb[data-active] { opacity: 1; outline-color: var(--paper); }
.wg-thumb:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.wg-thumb i { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 2px; background: var(--paper); opacity: 0.9; }      /* marks the film */
@media (hover: hover) and (pointer: fine) { .wg-thumb:not([data-active]):hover { opacity: 0.85; } }

/* ------------------------------------------------------------
   The way on
   ------------------------------------------------------------ */
.pj-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: clamp(32px, 6vw, 72px) clamp(24px, 6vw, 96px); background: var(--paper); border-top: 1px solid rgb(168 150 126 / 0.2);
}
.pj-all { position: relative; font-family: var(--font-body); font-size: 12px; font-weight: 300; letter-spacing: 0.04em; color: var(--accent); transition: color var(--quick) var(--ease-out); }
.pj-next { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.pj-next-label { font-family: var(--font-body); font-size: 10px; font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.pj-next-title { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; line-height: 1.75; color: var(--ink); transition: color var(--quick) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .pj-all:hover { color: var(--ink); }
  .pj-next:hover .pj-next-title { color: var(--accent); }
}

/* ------------------------------------------------------------
   Narrower screens: the rail becomes the top of the page
   ------------------------------------------------------------ */
@media (max-width: 1023px) {
  .pj { grid-template-columns: 1fr; }
  .pj-rail { position: static; height: auto; padding: clamp(28px, 5vh, 44px) clamp(28px, 5vw, 48px) clamp(20px, 3vh, 32px); }
  .pj-titles { margin-top: clamp(20px, 4vh, 36px); }
  .pj-rail .pj-facts { display: none; }
  .pj-facts--m { display: grid; }
  .pj-kind { display: none; }
  .pj-hero { height: 64svh; }
  .pj-over { grid-template-columns: 1fr; min-height: 0; }
  .pc { position: relative; aspect-ratio: 4 / 5; max-height: 92svh; }
  .wg { --strip-gutter: 40px; }
  .wg-strip { max-width: min(calc(100% - 2 * var(--strip-gutter)), 760px); }
}
@media (max-width: 767px) {
  .pj-hero { height: 56svh; }
  .pj-text { padding: 48px 24px 64px; }
  .wg { --strip-gutter: 24px; }
  .wg-strip { max-width: calc(100% - 2 * var(--strip-gutter)); bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px)); }
}
/* upright screens: the gallery's photograph sits above its strip instead of behind it */
@media (max-width: 1023px) and (orientation: portrait) {
  .wg { height: auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .wg::after { display: none; }
  .wg-stage { position: relative; inset: auto; width: 100%; aspect-ratio: 3 / 2; }
  .wg-frame.is-plan img { padding: 12px; }
  .wg-strip { position: static; max-width: calc(100% - 2 * var(--strip-gutter)); margin: 20px auto 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-frame, .wg-frame, .pc-arrow, .wg-arrow, .wg-thumb, .pj-logo, .pj-menu { transition: none; }
  .wg-thumbs { scroll-behavior: auto; }
}
