/* ===========================================================================
   PORTFOLIO PAGE — /portfolio/  (9/16, second pass: CONCEPT E)
   ---------------------------------------------------------------------------
   Built by scripts/build-portfolio.py from Alie's locked copy. Brees picked
   concept E ("animated scroll gallery", _preview/portfolio-concepts/e/) and
   asked for it on the page 9/16. The motion is assets/js/portfolio-gallery.js.
   Tokens only: verify.js rejects hex colours and certain effect words in this
   sheet, and it reads comments, so effects are described, never named.

   Sections: 1 the scene (white: centred copy over the wall, then the masonry)
   · 2 the shared .final-cta (sky, single top-left corner — this is the
   section 1 -> 2 join).
   Contrast: ink on white 13.3 · ink-muted on white above 5 · 🔴 petal on white
   1.70 (the "Almost nothing." accent — a known failure, Brees' call, as on the
   homepage) · captions are ink on white.
   =========================================================================== */

/* ---------------------------------------------------------------- 1. scene */
/* overflow clips BOTH axes: while the wall lies back, its near rows paint far below the section and doubled the
   page height (measured 7,459px vs ~3,000). */
.pf-scene {
  position: relative;
  padding-bottom: calc(var(--section-pad) + var(--corner-1));
  background-color: var(--white);
  overflow: clip;
}

/* the copy: centred, above the wall */
.pf-copy {
  position: relative;
  z-index: 20;
  max-width: 44rem;
  margin: 0 auto;
  /* 🔁 9/18 (responsive list #4): top was a flat 3rem, so the H1 sat 44-45px under the header at EVERY width while
     every other hero sits on the site's shared clearance — 75-83px desktop, 61-75 phones. Same expression as .hero,
     .pr-hero, .ss-hero, .lp-hero, .legal-hero, .gt-hero and the Perspectives heads. Sides and bottom unchanged. */
  padding: calc(var(--section-pad) * 0.5 + 43px) 1.5rem 0;
  text-align: center;
}
/* The H1 is the shared .t-display + .hero__headline (Brees 9/16: match every other page). Local: margin + the
   break before "Almost nothing." only. */
.pf-copy__h1 { margin: 0; }
.pf-copy__h1 .pf-in { display: block; }
/* 🔁 9/16 LIGHT PINK — Brees: "almost nothing is an indigo but we need that as a calling-out color ... change that to
   light pink", matching the homepage's "different" / "Be Different.". 🔴 SAME KNOWN WCAG FAILURE, BREES' CALL: --petal
   on white is 1.70:1, under the 3:1 large-text floor (--petal-deep would pass at 3.47:1). Needs his sign-off. */
/* 🔁 9/16 (later), Brees: "On the portfolio page - remove the pink from the hero." Pink off; the line inherits ink
   (same move as the homepage's "Don't Compete. Be Different."). The span + class stay so the line break still holds. */
.pf-copy__accent { color: inherit; }
.pf-copy__p { max-width: 40rem; margin: 1rem auto; color: var(--ink-muted); line-height: 1.5; }
.pf-copy__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; }
.pf-copy__link { padding: 10px 16px; color: var(--ink); font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.pf-copy__link:hover { text-decoration: underline; }
.pf-copy__link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
/* each piece of copy fades up in turn on load */
.pf-in { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.pf-in.is-in { opacity: 1; transform: none; }
/* With JS off nothing adds .is-in, so the copy must not start hidden: html[data-js="on"] is set by shared-v3.js. */
html:not([data-js="on"]) .pf-in { opacity: 1; transform: none; }

/* the wall -> masonry. The wrapper holds the 3D lens; the masonry lies back from its TOP edge at rest.
   🔴 The lens is WIDTH-PROPORTIONAL (170vw): the wall's height grows with the viewport width, and a fixed px lens
   let the near rows pass the camera at 1920 (one tile painted 18,000px wide). */
.pf-wall {
  position: relative;
  z-index: 1;
  padding: 5rem clamp(16px, 4vw, 64px) 0;
  perspective: 170vw;
  perspective-origin: 50% 0%;
}
.pf-masonry {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* 🔁 9/16: plain rows (Brees: "laid out in a normal way"), no column stagger; tiles are direct grid items. */
  gap: clamp(36px, 4vw, 72px) clamp(28px, 3.2vw, 56px);
  max-width: 1600px;
  margin: 0 auto;
  transform-origin: 50% 0%;
  transform: rotateX(var(--gal-rx, 0deg)) scale(var(--gal-sc, 1));
  transform-style: preserve-3d;
  will-change: transform;
}

.pf-tile { position: relative; z-index: 1; display: block; color: var(--ink); text-decoration: none; transform-origin: 0 0; will-change: transform; }
.pf-tile__media {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--white);
  box-shadow: 0 1px 2px rgb(76 78 104 / 0.10), 0 24px 48px -26px rgb(76 78 104 / 0.42);
  /* the wall shows a 16:9 crop; it eases open to the whole 16:10 capture (--crop 10% -> 0) */
  clip-path: inset(0 0 var(--crop, 0%) 0 round var(--rad, 12px));
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.pf-tile__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; }
.pf-tile__cap { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; opacity: var(--cap, 1); }
.pf-tile__name { font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; }
.pf-tile__loc { color: var(--ink-muted); font-size: var(--fs-small); }
.pf-tile:hover .pf-tile__media { transform: translateY(-6px); box-shadow: 0 2px 4px rgb(76 78 104 / 0.10), 0 34px 60px -28px rgb(76 78 104 / 0.5); }
.pf-tile:focus-visible { outline: none; }
.pf-tile:focus-visible .pf-tile__media { box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--ink); }

/* the wall's five repeats: decoration, placed by the script, gone once the wall has rearranged */
.pf-dup { position: absolute; top: 0; left: 0; z-index: 0; display: block; overflow: hidden; border-radius: 6px; box-shadow: 0 1px 3px rgb(47 47 53 / 0.1); transform-origin: 0 0; pointer-events: none; }
.pf-dup img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* static: under 900px, with reduced motion, or with JS off — the masonry only */
@media (max-width: 899px) {
  .pf-masonry { grid-template-columns: 1fr; }
  .pf-wall { padding-top: 4rem; }
}
.pf-scene.is-static .pf-masonry { transform: none; }
.pf-scene.is-static .pf-dup,
html:not([data-js="on"]) .pf-dup { display: none; }
@media (prefers-reduced-motion: reduce) {
  .pf-in { opacity: 1; transform: none; transition: none; }
  .pf-tile__media { transition: none; }
}

/* ------------------------------------------ 2. closing CTA (shared .final-cta) */
/* Only the corner and the second action are page-local. Single corner: the section 1 -> 2 join. */
.page-portfolio .pf-cta {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--corner-1));
  border-top-left-radius: var(--corner-1);
}
.pf-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pf-cta__line { background-color: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pf-cta__line:hover { background-color: var(--ink); color: var(--oat); }
