/* Portfolio / work gallery (light) */
body.portfolio { background: #e2f5ff; color: #151c28; }

.p-sec { position: relative; background: var(--mbg, #fff); }
.p-canvas { position: relative; }
.p-it { margin: 0; }
.p-it img { width: 100%; height: auto; }
.p-txt { white-space: pre-line; font-weight: var(--fw, 400); font-style: var(--fst, normal); color: var(--c, #000); text-align: var(--al, left); }
.p-sub img { margin-inline: auto; }

/* Lottie slot: canvas sits exactly over the poster image */
[data-lottie] { position: relative; }
.lottie-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 200ms ease; }
[data-lottie].is-playing .lottie-canvas { opacity: 1; }
[data-lottie].is-playing > img { visibility: hidden; }
/* An animation placed inside a picture (In-App Promotions phone banner): the picture stays visible as its poster. */
.p-it .p-anim { position: absolute; }
/* Carousel of screens: each .p-slide is a full-size background layer; the incoming one is revealed right-to-left
   with a soft edge. The Lotties sit above in .p-stage (clipped to the phone screen) and slide across separately.
   Nothing shows until the first Lottie has loaded, so the plain backgrounds never appear without their animation. */
.p-carousel .p-slide, .p-carousel .p-stage { position: absolute; inset: 0; pointer-events: none; }
.p-carousel:not(.is-ready) .p-slide, .p-carousel:not(.is-ready) .p-stage { visibility: hidden; }
/* --wipe-edge is the soft edge's centre (in % of the figure); --wipe-from/--wipe-to are the phone screen's right
   and left edges pushed out by the feather's half-width, so the whole blend crosses the screen over the transition. */
@property --wipe-edge { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
/* The feather (half-width 20% of the figure, about a screen's width in all) ramps with a smoothstep curve, so the
   blend has no visible start or end line. */
.p-carousel { --wipe-from: 60.3%; --wipe-to: -15.2%; --wipe-feather: 20%; }
.p-carousel .p-slide { --wipe-edge: var(--wipe-from);
  --wipe-mask: linear-gradient(to right,
    rgb(0 0 0 / 0) calc(var(--wipe-edge) - var(--wipe-feather)),
    rgb(0 0 0 / .043) calc(var(--wipe-edge) - var(--wipe-feather) * .75),
    rgb(0 0 0 / .156) calc(var(--wipe-edge) - var(--wipe-feather) * .5),
    rgb(0 0 0 / .316) calc(var(--wipe-edge) - var(--wipe-feather) * .25),
    rgb(0 0 0 / .5) var(--wipe-edge),
    rgb(0 0 0 / .684) calc(var(--wipe-edge) + var(--wipe-feather) * .25),
    rgb(0 0 0 / .844) calc(var(--wipe-edge) + var(--wipe-feather) * .5),
    rgb(0 0 0 / .957) calc(var(--wipe-edge) + var(--wipe-feather) * .75),
    rgb(0 0 0 / 1) calc(var(--wipe-edge) + var(--wipe-feather)));
  -webkit-mask: var(--wipe-mask); mask: var(--wipe-mask);
  transition: --wipe-edge 0.65s cubic-bezier(.22, 1, .36, 1) 0.1s; }  /* starts just after the Lotties begin to switch */
.p-carousel .p-slide.is-in { --wipe-edge: var(--wipe-to); }
.p-carousel .p-stage { z-index: 1000; }
.p-carousel .p-stage .p-anim:not(.is-current) { opacity: 0; }
.p-carousel .p-slide.no-tr { transition: none; }
/* Progress bar that fills in step with its slide's Lottie (lottie-lazy.js animates the fill). */
.p-it .p-progress { position: absolute; overflow: hidden; border-radius: 99px; background: rgb(124 144 245); }
.p-it .p-progress.is-green { background: rgb(19 155 96); }
.p-it .p-progress::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgb(232 239 255); transform: translateX(-100%); will-change: transform; }
/* Grid of animation tiles: each tile shows its slice of the old one-row poster until its animation plays. */
.p-it .p-poster-tile { background: url(../portfolio/shopkeeper-referral-02.webp) no-repeat 0 0 / 435.1% 100%; }
.p-it .p-poster-tile.is-playing { background-image: none; }
/* Picture that only holds the animations' first frames: hide it once every animation in it is playing, so it can't show through. */
.p-poster-swap:not(:has(.p-anim:not(.is-playing))) > img:first-child { visibility: hidden; }
/* Optional strip above a playing animation that hides the poster's edge when the animation sits lower than the poster's art. */
.p-it .p-anim.is-playing::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--mask-top, 0); background: var(--mask-c, transparent); }
.p-it .p-anim-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* In-App Promotions hover (in-app-hover.js): a banner and its pick-up card (same data-hz) enlarge together in a
   "lift" layer over their picture; the pictures and phones fade to 15%. A card's picture copy (.p-hz-back) only
   shows while lifted, so its shadow is not drawn twice at rest. */
.p-sec--in-app-promotions [data-hz] { pointer-events: auto; }
.p-sec--in-app-promotions .p-hz-back { visibility: hidden; }
.p-sec--in-app-promotions .p-it:is([data-name="Phone mockup"], [data-name="Promotion banners"]) { transition: opacity .45s ease; }
.p-sec--in-app-promotions.is-hz .p-it:is([data-name="Phone mockup"], [data-name="Promotion banners"]) { opacity: .15; }
.p-it.p-hz-lift { position: absolute; z-index: 60; pointer-events: none; filter: drop-shadow(0 14px 24px rgb(21 28 40 / .16)); }
.p-hz-lift > * { transition: transform .45s cubic-bezier(.22, 1, .36, 1); }
.p-hz-lift > .p-hz-back { visibility: visible; }
.p-hz-lift.is-on > * { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) {
  .p-hz-lift > *, .p-sec--in-app-promotions .p-it { transition: none; }
}

/* Hero cursor: the same picture twice, cut into the pointer and the name tag so the intro can move them apart.
   The two cut-outs are exact complements, so at rest they add up to the original picture. */
.p-hero-cursor img { display: block; width: 100%; height: auto; }
.p-hero-cursor .p-hero-ptr { clip-path: polygon(0 0, 22% 0, 22% 47.5%, 14.8% 47.5%, 14.8% 65%, 0 65%); }
.p-hero-cursor .p-hero-tag { position: absolute; inset: 0; height: 100%; clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%, 0 65%, 14.8% 65%, 14.8% 47.5%, 22% 47.5%); }
.p-hero-lines__extra { visibility: hidden; }   /* only shown while the intro pulls the paper */
/* The hero illustration is inline (its groups are tagged h-*) so the intro can assemble it as the paper opens:
   bushes rise into place with a small bounce, the dashed route draws from right to left, the pin pops up, and
   finally the bike with its shadow and bright blue path rides in from the right. hero-intro.js adds .is-armed
   (each part waits on its first frame) and then .is-play at the start of the pull; delays count from there. */
.p-hero-svg { display: block; width: 100%; height: auto; overflow: visible; }
/* The pointer is drawn at 60% everywhere (it was 100%), scaled around its tip; the name tag sits proportionally closer:
   its corner moves 40% of the way in toward the tip (tip to corner was 30.3 x 44.5 design px of the 241.8 x 99.9
   picture). --ps / --tx / --ty / --to / --ts are the intro's live values (hero-intro.js). */
.p-hero-cursor .p-hero-ptr { scale: var(--ps, 0.6); transform-origin: 2.3% 3.4%; }
.p-hero-cursor .p-hero-tag { translate: calc(-5% + var(--tx, 0px)) calc(-17.8% + var(--ty, 0px)); opacity: var(--to, 1); scale: var(--ts, 1); transform-origin: 14.8% 47.9%; }
/* Illustration assembly (keyframes; hero-intro.js drives the route trim, the bike and its trail). Each part waits on
   its first frame under .is-armed and starts with .is-play, at the start of the pull; delays count from there.
   Bushes emerge from under the paper that covers them: the top two drop down from under the top edge, the lower two
   rise from under the V's sides, each overshooting a little and settling (staggered, so they overlap). The pin rises
   into place the moment the route's trim reaches it (.is-pin). */
.p-hero-svg .h-pin { transform-box: fill-box; transform-origin: 50% 58%; }   /* the pin's tip, above its shadow */
/* One continuous curve: fast out, a soft ~4% overshoot (about 2px) and an ease to rest with no stops on the way
   (intermediate keyframes restart the easing at each stop, which reads as a jerk). */
.p-hero-svg.is-armed .h-bush { animation: h-bush-up 780ms cubic-bezier(.2, 1.35, .4, 1) both paused; }
.p-hero-svg.is-armed .h-bush.h-bush--3 { animation-name: h-bush-down; animation-delay: 200ms; }   /* top left */
.p-hero-svg.is-armed .h-bush.h-bush--4 { animation-name: h-bush-down; animation-delay: 270ms; }   /* top middle */
.p-hero-svg.is-armed .h-bush.h-bush--2 { animation-delay: 340ms; }   /* bottom middle */
.p-hero-svg.is-armed .h-bush.h-bush--1 { animation-delay: 410ms; }   /* lower right, by the bike */
.p-hero-svg.is-armed .h-pin { animation: h-pin 620ms linear both paused; }
.p-hero-svg.is-play .h-bush { animation-play-state: running; }
.p-hero-svg.is-pin .h-pin { animation-play-state: running; }   /* the script adds .is-pin when the route's trim reaches the pin */
@keyframes h-bush-up { from { transform: translateY(56px); } to { transform: none; } }
@keyframes h-bush-down { from { transform: translateY(-56px); } to { transform: none; } }
/* The pin rises and grows in one smooth ease-out, with only a slight settle at the end. */
@keyframes h-pin {
  from { opacity: 0; transform: translateY(14px) scale(0.5); animation-timing-function: cubic-bezier(.22, .8, .32, 1); }
  35% { opacity: 1; }
  72% { transform: translateY(-1.5px) scale(1.02); animation-timing-function: cubic-bezier(.4, 0, .4, 1); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 899.98px) { .p-hero-cursor { position: relative; } }

/* Packers & Movers: room tabs (buttons) and the household icon layers they dim. Sizes follow the tab row's own width. */
.p-tabs { aspect-ratio: var(--tw) / var(--th); container-type: inline-size; }
.p-tab {
  --px: calc(100cqw / var(--tw)); /* 1 Figma px */
  position: absolute; padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  border-radius: calc(20 * var(--px)); background: #fff;
  /* Raised like the site's 3D buttons: thin outline + a solid 5px ledge (no blurred shadow). Pressing sinks it onto the ledge. */
  --ring: inset 0 0 0 max(1px, calc(1.5 * var(--px))) #d3dce8;
  box-shadow: var(--ring), 0 calc(5 * var(--px)) 0 #c9d4e3;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.p-tab::after { content: ""; position: absolute; inset: -6px 0; } /* taller touch area on phones */
.p-tab img { display: block; width: 100%; height: 100%; pointer-events: none; }
.p-tab:hover {
  transform: translateY(calc(-2 * var(--px))); --ring: inset 0 0 0 max(1px, calc(1.5 * var(--px))) #b9c7da;
  box-shadow: var(--ring), 0 calc(7 * var(--px)) 0 #c9d4e3; /* lifts: the ledge grows by the same 2px */
}
.p-tab:active, .p-tab[aria-pressed="true"] {
  transform: translateY(calc(5 * var(--px))); background: #edf4ff;
  box-shadow: inset 0 calc(4 * var(--px)) calc(8 * var(--px)) rgb(6 52 153 / 0.14), inset 0 0 0 max(1px, calc(1.5 * var(--px))) #8fb4ff;
}
.p-tab:focus-visible { outline: 3px solid #0a57ff; outline-offset: 3px; }
.p-icons .p-room { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 200ms ease; }
.p-icons .p-room.is-dim { opacity: 0.15; }
@media (prefers-reduced-motion: reduce) { .p-tab, .p-icons .p-room { transition: none; } }
/* Visual redesign characters: the panels and the characters are separate layers, so the characters can reveal one by
   one over their panels (reveal.js). */
.p-it .p-chars { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 899.98px) { .p-icons, .p-tabs { position: relative; } }
/* Packers & Movers phone: the Add Items list scrolls to its end, as in Figma (frame "Item categories", 250:2715,
   rendered from the .fig to packers-movers-list.svg). The window runs from under the header to the bottom of the
   screen (screen px 125.74 to 628 of the 298 x 628 screen); the tab / search bar and the bottom bar float above it, as
   in Figma (their own SVGs, with room for their shadows). At rest it matches the static mockup underneath exactly.
   Figure box: 1280 x 687.7 from (38, 1550.8); the screen is at (79, 1564.82). Images use .p-icons in the selector to
   beat .p-it img (width: 100%). */
.p-phone-scroll {
  position: absolute; left: 3.2031%; top: 20.3228%; width: 23.2813%; height: 73.0348%;
  overflow: hidden; background: #f1f5f9; border-radius: 0 0 12.9195% 12.9195% / 0 0 7.6653% 7.6653%;
}
.p-phone-scroll__view {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior-y: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.p-phone-scroll__view::-webkit-scrollbar { display: none; }
.p-phone-scroll__view:focus-visible { outline: 3px solid #0a57ff; outline-offset: -3px; }
/* 65.16 above the list (190.9 - 125.74), 13 from the left, 272 wide */
.p-icons .p-phone-scroll__list { display: block; width: 91.2752%; height: auto; margin: 21.8658% 0 0 4.3624%; }
.p-icons .p-phone-scroll__tabs, .p-icons .p-phone-scroll__cta { position: absolute; max-width: none; height: auto; pointer-events: none; }
.p-icons .p-phone-scroll__tabs { left: -3.6091%; top: -2.9507%; width: 107.2183%; }   /* 271.51 + 2 x 24 wide, at (13.24, 9.18) */
/* One tab bar per room, stacked; phone-list.js moves .is-on to the room the list is scrolled to. */
.p-icons .p-phone-scroll__tabs:not(.is-on) { opacity: 0; }
.p-icons .p-phone-scroll__tabs { transition: opacity 220ms ease; }
@media (prefers-reduced-motion: reduce) { .p-icons .p-phone-scroll__tabs { transition: none; } }
/* Tab buttons (added by phone-list.js) over the four pills of the bar: 51.32 x 27.24 each, from (19.84, 15.78), 54.63
   apart. In cqw of the 298-wide screen, so they keep to the pills at any size. */
.p-phone-scroll { container-type: inline-size; }
.p-phone-scroll__tab {
  position: absolute; top: calc(15.78 / 2.98 * 1cqw); left: calc((19.84 + var(--i) * 54.63) / 2.98 * 1cqw);
  width: calc(51.32 / 2.98 * 1cqw); height: calc(27.24 / 2.98 * 1cqw);
  margin: 0; padding: 0; border: 0; border-radius: 999px; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.p-phone-scroll__tab:focus-visible { outline: 2px solid #0a57ff; outline-offset: 2px; }
.p-icons .p-phone-scroll__cta { left: -13.4228%; top: 75.7098%; width: 126.8456%; }    /* 298 + 2 x 40 wide, at (0, 420.26) */

/* Stroke | Fill and Selected | Default switches. --px = 1 Figma px of the 438.3px wide item. */
.p-switch { aspect-ratio: 438.3 / 81.8; container-type: inline-size; }
.p-switch__bar {
  --px: calc(100cqw / 438.3);
  position: absolute; left: calc(4.1 * var(--px)); top: calc(2.1 * var(--px)); width: calc(430 * var(--px)); height: calc(73.6 * var(--px));
  border-radius: calc(16 * var(--px)); background: #f1f5f9; box-shadow: 0 calc(2 * var(--px)) calc(4 * var(--px)) rgb(55 73 98 / 0.16);
}
.p-switch__pill {
  position: absolute; left: calc(12 * var(--px)); top: calc(12 * var(--px)); width: calc(200 * var(--px)); height: calc(49.6 * var(--px));
  border-radius: calc(14 * var(--px)); background: #063499; transition: transform 220ms cubic-bezier(0.3, 0.8, 0.3, 1);
}
.p-switch__bar:has(button:last-child[aria-pressed="true"]) .p-switch__pill { transform: translateX(calc(206 * var(--px))); }
.p-switch button {
  position: absolute; top: 0; left: 0; width: 50%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  color: #283548; border-radius: calc(16 * var(--px)); transition: color 160ms ease; -webkit-tap-highlight-color: transparent;
}
.p-switch button:last-child { left: 50%; }
.p-switch button[aria-pressed="true"] { color: #fff; }
.p-switch button:hover:not([aria-pressed="true"]) { color: #0a57ff; }
.p-switch button:focus-visible { outline: 3px solid #0a57ff; outline-offset: 2px; }
.p-switch svg { display: block; width: 100%; height: 100%; }
.p-views img { transition: opacity 220ms ease; }
.p-views .p-view { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-views img.is-off { opacity: 0; }
/* Vehicles: a diagonal wipe that runs inside every vehicle's own tile (226 x 240 design px, one per vehicle), left to
   right for Default and back for Selected. --wipe is the edge's position along each tile, --band the width of its eased
   fall-off. The two pictures get opposite masks; plus-lighter keeps the soft edge fully opaque. --d = 1 design px. */
@property --wipe { syntax: "<percentage>"; inherits: true; initial-value: -42%; }
#vehicle-set { --d: calc(100cqw / 1318); --band: 60%; --wipe: -42%; isolation: isolate; transition: --wipe 900ms cubic-bezier(0.22, 0.75, 0.3, 1); }
#vehicle-set.is-alt { --wipe: 91%; } /* -42% / 91%: the edge starts and ends right at the vehicles, so it moves on the first frame */
#vehicle-set img { opacity: 1; transition: none; }
#vehicle-set [data-view="default"] { --g: linear-gradient(115deg, rgb(0 0 0 / 1) calc(var(--wipe) + var(--band) * 0), rgb(0 0 0 / 0.957) calc(var(--wipe) + var(--band) * 0.125), rgb(0 0 0 / 0.844) calc(var(--wipe) + var(--band) * 0.25), rgb(0 0 0 / 0.684) calc(var(--wipe) + var(--band) * 0.375), rgb(0 0 0 / 0.5) calc(var(--wipe) + var(--band) * 0.5), rgb(0 0 0 / 0.316) calc(var(--wipe) + var(--band) * 0.625), rgb(0 0 0 / 0.156) calc(var(--wipe) + var(--band) * 0.75), rgb(0 0 0 / 0.043) calc(var(--wipe) + var(--band) * 0.875), rgb(0 0 0 / 0) calc(var(--wipe) + var(--band) * 1)); mix-blend-mode: plus-lighter; }
#vehicle-set [data-view="selected"] { --g: linear-gradient(115deg, rgb(0 0 0 / 0) calc(var(--wipe) + var(--band) * 0), rgb(0 0 0 / 0.043) calc(var(--wipe) + var(--band) * 0.125), rgb(0 0 0 / 0.156) calc(var(--wipe) + var(--band) * 0.25), rgb(0 0 0 / 0.316) calc(var(--wipe) + var(--band) * 0.375), rgb(0 0 0 / 0.5) calc(var(--wipe) + var(--band) * 0.5), rgb(0 0 0 / 0.684) calc(var(--wipe) + var(--band) * 0.625), rgb(0 0 0 / 0.844) calc(var(--wipe) + var(--band) * 0.75), rgb(0 0 0 / 0.957) calc(var(--wipe) + var(--band) * 0.875), rgb(0 0 0 / 1) calc(var(--wipe) + var(--band) * 1)); }
#vehicle-set [data-view] { -webkit-mask: var(--g) calc(26 * var(--d)) calc(-11.3 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(228.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(468.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(139 * var(--d)) calc(708.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(948.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x; mask: var(--g) calc(26 * var(--d)) calc(-11.3 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(228.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(468.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(139 * var(--d)) calc(708.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x, var(--g) calc(26 * var(--d)) calc(948.7 * var(--d)) / calc(226 * var(--d)) calc(240 * var(--d)) repeat-x; }
@media (max-width: 899.98px) { #vehicle-set { --d: calc((100vw - 32px) / 1151.6); } }
@media (prefers-reduced-motion: reduce) { #vehicle-set { transition: none; } }
@media (prefers-reduced-motion: reduce) { .p-switch__pill, .p-switch button, .p-views img { transition: none; } }
@media (max-width: 899.98px) { .p-switch, .p-views, .p-it:has(.p-anim) { position: relative; } }

/* Other Work: bento grid of Behance projects. Sizes follow the grid's own width (--b = 1 design px of its 1191px). */
.p-bento {
  list-style: none; padding: 0; container-type: inline-size;
  /* Top row: Boss Banana (wide strip) + Chanel (small). Bottom row: Get Out (tall) + Stranger Things (largest).
     Design px: columns 380 | 380 | 383, rows 354 / 525.5 (24 gaps), 1191 x 903.5 in all. */
  display: grid; grid-template-columns: 380fr 380fr 383fr; grid-template-rows: 354fr 525.5fr;
  grid-template-areas: "bb bb ch" "go st st";
  aspect-ratio: 1191 / 903.5;
}
.p-bento > li { min-width: 0; min-height: 0; }
.p-bento__st { grid-area: st; } .p-bento__go { grid-area: go; } .p-bento__bb { grid-area: bb; } .p-bento__ch { grid-area: ch; }
/* --b is used by the tiles (their container is the grid); the grid's own gap measures against the 1318px canvas. */
.p-bento { --b: calc(100cqw / 1191); gap: calc(24 / 1318 * 100cqw); }
/* Each tile tilts toward the cursor and its picture drifts the other way (parallax). tile-parallax.js writes
   --mx / --my (-1..1) while the cursor is over a tile; transforms driven by them have no transition because the
   script already eases them. The hover lift and zoom use the separate translate / scale properties, which do. */
.p-tile {
  --r: calc(24 * var(--b));
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  border-radius: var(--r); background: #151c28; color: #fff; text-decoration: none;
  box-shadow: 0 0 0 1px rgb(21 28 40 / 0.06);
  transform: perspective(1200px) rotateX(calc(var(--my, 0) * -8deg)) rotateY(calc(var(--mx, 0) * 8deg));
  translate: 0 0;
  transition: translate 300ms cubic-bezier(.22, 1, .36, 1), box-shadow 300ms cubic-bezier(.22, 1, .36, 1);
  -webkit-tap-highlight-color: transparent;
}
.p-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
  translate: calc(var(--mx, 0) * -6%) calc(var(--my, 0) * -6%);  /* stays inside the 1.16 hover zoom (8% spare per side) */
  scale: 1; transition: scale 600ms cubic-bezier(.22, 1, .36, 1);
}
/* Where each picture sits in its cropped tile. */
.p-bento__st .p-tile img { object-position: 50% 45%; }  /* Dustin and the title lines */
.p-bento__go .p-tile img { object-position: 50% 50%; }  /* nearly the whole poster fits */
.p-bento__bb .p-tile img { object-position: 50% 50%; }  /* the lettering and the mascot */
.p-bento__ch .p-tile img { object-position: 50% 100%; } /* the bottle's label, clear of the caption */
/* Dark fade under the caption; it lightens a touch on hover. */
.p-tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgb(10 14 22 / 0.86) 0%, rgb(10 14 22 / 0.5) 24%, rgb(10 14 22 / 0) 50%);
  transition: opacity 260ms ease;
}
.p-tile__meta {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: calc(4 * var(--b));
  padding: calc(28 * var(--b)) calc(30 * var(--b));
  transform: translate(calc(var(--mx, 0) * 16 * var(--b)), calc(var(--my, 0) * 10 * var(--b)));
  translate: 0 0; transition: translate 300ms cubic-bezier(.22, 1, .36, 1);
}
/* Every tile's caption uses the Stranger Things size. */
.p-tile__cat { font-size: max(15px, calc(19 * var(--b))); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.p-tile__title { display: flex; align-items: center; gap: 0.25em; font-size: max(20px, calc(34 * var(--b))); font-weight: 600; line-height: 1.2; }
/* "Open" chevron right after the project name, in the caption's white; it nudges right on hover. Its stroke (3.45 of
   24 units at 0.8em = 0.115em) matches the semi bold letters' stem width. Its ink (0.55em tall) sits on the lowercase
   band, baseline to x-height (0.551em): 0.135em below the line box's centre, where it read as floating high. */
.p-tile__go { display: flex; flex: none; width: 0.8em; height: 0.8em; translate: 0 0.135em; transition: translate 300ms cubic-bezier(.22, 1, .36, 1); }
.p-tile__go svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3.45; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  /* The shadow slides opposite the cursor, so the tile reads as lifted and leaning. */
  .p-tile:hover { translate: 0 calc(-6 * var(--b)); box-shadow: 0 0 0 1px rgb(21 28 40 / 0.06), calc(var(--mx, 0) * -18 * var(--b)) calc((28 - var(--my, 0) * 12) * var(--b)) calc(48 * var(--b)) rgb(21 28 40 / 0.24); }
  .p-tile:hover img { scale: 1.16; }
  .p-tile:hover .p-tile__meta { translate: 0 calc(-6 * var(--b)); }
  .p-tile:hover .p-tile__go { translate: 0.12em 0.135em; }
}
.p-tile:active { translate: 0 calc(2 * var(--b)); box-shadow: 0 0 0 1px rgb(21 28 40 / 0.06); }
.p-tile:focus-visible { outline: 3px solid #0a57ff; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .p-tile, .p-tile img, .p-tile__meta, .p-tile__go, .p-tile::before { transition: none; } }
/* Phones and tablets: Stranger Things across the top, then Get Out (tall) beside Boss Banana over a shorter Chanel.
   Sizes still fall in the same order. Design px for a 343px-wide grid: rows 200 / 170 / 126 (12 gaps). */
@media (max-width: 899.98px) {
  .p-bento { grid-template-columns: 1fr 1fr; grid-template-rows: 200fr 170fr 126fr; grid-template-areas: "st st" "go bb" "go ch"; aspect-ratio: 343 / 520; --b: calc(100cqw / 640); gap: 12px; }
  /* The tiles are small here, so every caption steps down to one smaller size. */
  .p-tile__meta { padding: calc(20 * var(--b)) calc(22 * var(--b)); }
  .p-tile__cat { font-size: max(14px, calc(17 * var(--b))); }
  .p-tile__title { font-size: max(15px, calc(22 * var(--b))); }
}

/* Sticky header (band + nav) */
/* A plain white-to-transparent fade behind the buttons (no background blur). */
.p-header { position: sticky; top: 0; z-index: 50; isolation: isolate; }
.p-header::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, #fff, rgb(255 255 255 / 0)); }
.p-nav { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 24px; }

/* Footer */
.p-footer { padding: 72px 16px 96px; text-align: center; background: #e2f5ff; }
.p-footer p { font-size: 22px; line-height: 1.5; margin-bottom: 24px; }
/* Same visual size and weight as the text before it: the hand font's x-height is 0.589em vs 0.54em, so 0.92em lines the lowercase up; the text is medium weight. */
.p-footer p { font-weight: 500; }
.p-footer .p-hand { display: inline-block; height: 1.16em; width: calc(1.16em * 596 / 116); max-width: none; font-size: 0.92em; vertical-align: -0.16em; margin-left: 0.2em; overflow: visible; }
.p-footer__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }

/* ---------- Desktop: exact Figma composition, scaled to the viewport ---------- */
@media (min-width: 900px) {
  /* Same side margins as the Resume page: every section (hero illustration included) is the 1318px Figma frame,
     centred and never wider than that; the nav sits 64 design-px inside it, lining up with the Resume nav.
     On narrower windows the frame fills the width and scales down. */
  body.portfolio { overflow-x: clip; --u: calc(min(100vw, 1318px) / 1318); /* 1 Figma px at the frame's current width */ }
  /* Browsers pass body's clip to the window as "hidden", which scripts can still scroll; clipping main removes the overflow. */
  body.portfolio main { overflow-x: clip; }
  /* Footer sits 30% closer to the Other Work images (the gap was 156 design-px + the footer's 72px padding). */
  .p-footer { margin-top: calc(-0.3 * (156 * var(--u) + 75px)); }
  .p-canvas {
    width: min(100%, 1318px);
    margin-inline: auto;
    aspect-ratio: 1318 / var(--h);
    container-type: inline-size;
  }
  /* Exception: the hero covers the full screen width and scales with the window as one piece
     (illustration, perspective lines and the "WORK GALLERY" title together), exactly as composed in Figma. */
  .p-sec--hero .p-canvas { width: 100%; }
  /* Hero background lines must match the illustration exactly (the floor lines meet the sky edges),
     so here the background is the canvas width, not the window width (which also counts the scrollbar). */
  .p-sec--hero .p-bg { left: 0; width: 100%; transform: none; }
  /* Hero intro (hero-intro.js): the cursor group moves by --cx / --cy design px; the pointer scales (--ps: small in
     flight, full size on landing, pressed while pulling) around its tip, never rotating; the name tag fades and scales in (--to, --ts) from its corner by the tip. Before the
     script takes over (html.hero-intro) the paper is closed: the illustration's window is shut at the y 291 line,
     the ruled lines sit flat one ruling higher (CSS d, where supported), and the cursor is hidden. */
  .p-hero-cursor { translate: calc(var(--cx, 0) * 100cqw / 1318) calc(var(--cy, 0) * 100cqw / 1318); }
  .hero-intro .p-hero-cursor { visibility: hidden; }
  .hero-intro .p-hero-ill { clip-path: inset(0 0 100% 0); }
  .hero-intro .p-hero-lines path:nth-child(1) { d: path("M0 291L880.27 291L1318 291"); }
  .hero-intro .p-hero-lines path:nth-child(2) { d: path("M0 339L880.27 339L1318 339"); }
  .hero-intro .p-hero-lines path:nth-child(3) { d: path("M0 387L880.27 387L1318 387"); }
  .hero-intro .p-hero-lines path:nth-child(4) { d: path("M0 435L880.27 435L1318 435"); }
  .hero-intro .p-hero-lines path:nth-child(5) { d: path("M0 483L880.27 483L1318 483"); }
  .hero-intro .p-hero-lines path:nth-child(6) { d: path("M0 531L880.27 531L1318 531"); visibility: visible; }
  /* Background art (gradients, ruled lines, strips) still runs edge to edge. */
  /* Each section background is the frame's artwork widened by 700 design-px per side (lines, fills and the
     dotted strips continue), drawn at the frame's own scale, so nothing is stretched and squares stay square. */
  .p-bg { position: absolute; top: 0; left: calc(-700 / 1318 * 100%); width: calc(2718 / 1318 * 100%); max-width: none; height: 100%; pointer-events: none; }
  .p-it, .p-txt {
    position: absolute;
    left: calc(var(--x) / 1318 * 100%);
    top: calc(var(--y) / var(--h) * 100%);
    width: calc(var(--w) / 1318 * 100%);
    z-index: var(--z, 1);
  }
  .p-txt {
    font-size: calc(var(--fs) / 1318 * 100cqw);
    line-height: calc(var(--lh) / 1318 * 100cqw);
    letter-spacing: calc(var(--ls, 0) / 1318 * 100cqw);
  }
  /* Header is exactly the Figma band (1318 x 210, full width) and overlaps the top of the hero,
     so the page looks identical at the top; it then stays pinned while everything scrolls under it. */
  /* Height and negative margin move together, so slimming the bar never shifts the page under it. */
  .p-header {
    --hh: calc(210 * var(--u));
    height: var(--hh);
    margin-bottom: calc(-1 * var(--hh));
    transition: height 260ms ease, margin-bottom 260ms ease;
  }
  .p-nav { position: absolute; left: calc((100% - min(100%, 1318px)) / 2 + 64 * var(--u)); right: calc((100% - min(100%, 1318px)) / 2 + 32 * var(--u)); top: calc(24 * var(--u)); gap: calc(24 * var(--u)); } /* same height as the Resume nav, scrolled or not */
  /* Nav buttons follow the design proportions (60px tall, 24px apart in a 1318px frame), scaled with the page. */
  .p-nav .btn, .p-nav .btn::before { border-radius: calc(20 * var(--u)); }
  .p-nav .btn { padding-bottom: calc(6 * var(--u)); }
  .p-nav .btn::before { inset: calc(6 * var(--u)) 0 0 0; }
  .p-nav .btn__face {
    min-height: calc(60 * var(--u)); padding: calc(10 * var(--u)) calc(24 * var(--u)); gap: calc(12 * var(--u));
    border-radius: calc(20 * var(--u)); font-size: calc(20 * var(--u)); box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--border);
  }
  .p-nav .btn--caps .btn__face { letter-spacing: calc(2 * var(--u)); }
  .p-nav .btn__face img { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }
  .p-nav .btn:hover .btn__face { transform: translateY(calc(-3 * var(--u))); }
  .p-nav .btn:active .btn__face { transform: translateY(calc(6 * var(--u))); }
  /* Slim state once the page is scrolled: same white fade, a short band hugging the buttons. */
  /* Slim state, like the resume nav: the buttons shrink to 80% toward the top right and rise to 12 design px from the
     top; the band hugs them: 12 + 66 x 0.8 + 12 = 77. Transforms only on the buttons, so the squircle paths stay valid. */
  .p-header.is-slim { --hh: calc(77 * var(--u)); }
  .p-nav { transform-origin: 100% 0; transition: scale 260ms ease, translate 260ms ease; }
  .p-header.is-slim .p-nav { scale: 0.8; translate: 0 calc(-12 * var(--u)); }
  @media (prefers-reduced-motion: reduce) { .p-nav { transition: none; } }
  /* Slim state: the band itself stays short, but its fade reaches a little further down the page. */
  .p-header::before { transition: bottom 260ms ease; }
  .p-header.is-slim::before { bottom: -36px; }  .p-sec { scroll-margin-top: calc(114 * var(--u) + 8px); }
  @media (prefers-reduced-motion: reduce) { .p-header, .p-header::before { transition: none; } }
}

/* ---------- Mobile / tablet: items flow in reading order ---------- */
@media (max-width: 899.98px) {
  .p-bg { display: none; }
  .p-canvas { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 56px 16px; }
  .p-it { width: min(100%, calc(var(--w) * 0.85px)); }
  .p-it.is-wide { width: 100%; }
  .p-txt { width: min(100%, 560px); font-size: max(15px, calc(var(--fs) * 0.75px)); line-height: 1.45; letter-spacing: calc(var(--ls, 0) * 0.75px); }
  .p-txt:is(h1, h2, h3) { text-align: center; line-height: 1.2; }
  h2.p-txt { margin-top: 24px; }
  .p-sub { margin-top: -12px; }
  .p-sec--hero .p-canvas { padding-top: 20px; }
  .p-header { padding: 12px 16px 28px; margin-bottom: -16px; }
  .p-nav { justify-content: center; gap: 12px; flex-wrap: wrap; }
  .p-sec { scroll-margin-top: 96px; }
  .p-footer { margin-top: -38px; } /* 30% of the 128px gap below Other Work */
}

@media (max-width: 640px) {
  .p-footer p { font-size: 18px; }
}
/* Phones: the Behance button is icon-only so the bar stays on one row. */
@media (max-width: 429.98px) {
  .p-nav__label { display: none; }
  .p-nav__behance .btn__face { padding: 8px 12px; }
}
