/* Portfolio (/portfolio/): the bubble map and the project panel. Colours, fonts and easing come from styles.css. */

.pf-hero { padding-bottom: 30px; }
.pf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.pf-tour { cursor: pointer; }
.pf-tour-ico { display: inline-block; width: 0; height: 0; margin-right: 10px; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.pf-tour.playing .pf-tour-ico { width: 9px; height: 11px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.pf-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease, transform .14s var(--ease);
}
.pf-chip.on { color: var(--ink); border-color: var(--orange); background: var(--soft); }
.pf-chip:active { transform: scale(.97); }
/* one dot colour per kind of work, used in the chips, the bubble labels and the panel tag */
i.k-agents, i.k-video, i.k-web { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; }
i.k-agents { background: var(--red); }
i.k-video { background: var(--orange); }
i.k-web { background: var(--yellow); }

.pf-wrap { padding: 10px 0 100px; }
.pf { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr); gap: 44px; align-items: start; }

/* ---------- the map ---------- */
.pf-stage {
  position: sticky; top: 96px; aspect-ratio: 1 / .98; container-type: inline-size; overflow: hidden;
  border-radius: 28px; border: 1px solid var(--line);
  background: radial-gradient(58% 54% at 50% 50%, var(--soft), transparent 72%), var(--surface-2);
}
/* faint Python in-jokes behind the map; clear in the middle so the logo and bubbles stay clean */
.pf-code {
  position: absolute; inset: 0; margin: 0; padding: 20px 24px; overflow: hidden; pointer-events: none; user-select: none;
  font-family: var(--mono); font-variation-settings: "wdth" 85; font-size: clamp(8px, 1.75cqw, 12px); line-height: 1.8; white-space: pre;
  columns: 2; column-gap: 7%; color: var(--ink); opacity: .14;
  -webkit-mask-image: radial-gradient(closest-side at 50% 50%, transparent 26%, #000 72%); mask-image: radial-gradient(closest-side at 50% 50%, transparent 26%, #000 72%);
}
.pf-code i { font-style: normal; }
.pf-code .k { color: var(--orange); }
.pf-code .s { color: #e0a800; }
.pf-code .d { color: #ff3d7f; }
.pf-code .n { color: #1e88ff; }
.pf-code .c { opacity: .55; }
:root[data-theme="dark"] .pf-code { opacity: .17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf-code { opacity: .17; } }
.pf-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-lines line { stroke: var(--line); stroke-width: 1.5; transition: stroke .2s ease, opacity .2s ease; }
.pf-lines line.on { stroke: var(--orange); stroke-width: 2; }
.pf-lines line.dim { opacity: .35; }
.pf-ring { position: absolute; left: 50%; top: 50%; translate: -50% -50%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed var(--line); pointer-events: none; }
.pf-ring.r1 { width: 46%; }
.pf-ring.r2 { width: 86%; }

.pf-core {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1;
  width: clamp(76px, 20cqw, 132px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid transparent; background: linear-gradient(#17120f, #17120f) padding-box, var(--grad) border-box;
  box-shadow: 0 22px 50px -22px rgba(255, 90, 31, .7);
}
.pf-core::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid var(--orange); opacity: .5; animation: pf-halo 3.4s ease-in-out infinite alternate; }
.pf-core .logo { color: #fff; font-size: clamp(11px, 2.7cqw, 17px); }

.pf-node {
  position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; z-index: 2;
  display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--ink);
  -webkit-tap-highlight-color: transparent; transition: opacity .2s ease;
}
.pf-node.s3 { --d: clamp(80px, 21cqw, 132px); }
.pf-node.s2 { --d: clamp(66px, 17cqw, 108px); }
.pf-node.s1 { --d: clamp(56px, 14cqw, 88px); }
.pf-float { display: block; animation: pf-float calc(6s + var(--i) * .7s) ease-in-out calc(var(--i) * -1.3s) infinite alternate; }
.pf-disc {
  display: grid; place-items: center; width: var(--d); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 3px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(var(--line), var(--line)) border-box;
  box-shadow: 0 16px 34px -20px rgba(23, 18, 15, .55);
  transition: transform .16s var(--ease), box-shadow .2s ease;
}
.pf-disc img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* each project bubble has its own bright colour (--c from PROJECTS), with a soft top-left highlight */
.pf-disc-ico { --fill: radial-gradient(circle at 30% 24%, rgba(255,255,255,.32), rgba(255,255,255,0) 58%) padding-box, radial-gradient(circle at 50% 120%, rgba(0,0,0,.28), rgba(0,0,0,0) 60%) padding-box, linear-gradient(var(--c, #17120f), var(--c, #17120f)) padding-box;
  background: var(--fill), linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)) border-box; box-shadow: 0 16px 34px -18px var(--c, rgba(23,18,15,.55)); }
.pf-disc-ico .pf-ico, .pf-disc-ico .cat { filter: drop-shadow(0 3px 0 rgba(0,0,0,.22)); }
.pf-ico { width: 44%; fill: #fff; }
.pf-ico-12 { width: 53%; }   /* same pixel size as the 10×10 icons */
.pf-disc .cat { width: 62%; }
.pf-name {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; line-height: 1.3; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  transition: color .16s ease, border-color .16s ease;
}
.pf-node.on .pf-disc {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  box-shadow: 0 0 0 7px rgba(255, 106, 26, .16), 0 20px 40px -18px rgba(255, 90, 31, .65);
}
.pf-node.on .pf-disc-ico { background: var(--fill), var(--grad) border-box; box-shadow: 0 0 0 7px rgba(255, 106, 26, .16), 0 20px 44px -14px var(--c); }
.pf-node.on .pf-name { color: var(--ink); border-color: var(--orange); }
.pf-node.dim { opacity: .3; }
.pf-node:active .pf-disc { transform: scale(.97); }
.pf-node:focus-visible { outline: none; }
.pf-node:focus-visible .pf-disc { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--orange); }
@media (hover: hover) and (pointer: fine) {
  .pf-node:hover .pf-disc { transform: scale(1.05); }
  .pf-node:hover .pf-name { color: var(--ink); }
  .pf-chip:hover, .pf-step:hover { border-color: var(--orange); color: var(--ink); }
}
/* the bubbles arrive one after another when the map scrolls into view */
.js .pf-stage:not(.in) .pf-node { opacity: 0; scale: .93; }
.pf-stage.in:not(.ready) .pf-node { transition: opacity .5s var(--ease) calc(var(--i) * 60ms + 140ms), scale .5s var(--ease) calc(var(--i) * 60ms + 140ms); }

@keyframes pf-float { from { transform: translate3d(0, -5px, 0); } to { transform: translate3d(0, 6px, 0); } }
@keyframes pf-halo { from { opacity: .15; transform: scale(.96); } to { opacity: .6; transform: scale(1.04); } }

/* ---------- the project panel ---------- */
.pf-panel { min-width: 0; scroll-margin-top: 90px; }
.pf-bar { display: none; align-items: center; gap: 12px; margin-bottom: 14px; }
.pf.js-on .pf-bar { display: flex; }
.pf-step {
  flex: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: color .16s ease, border-color .16s ease, transform .14s var(--ease);
}
.pf-step:active { transform: scale(.95); }
.pf-count { min-width: 50px; text-align: center; font-size: 13px; color: var(--muted); }
.pf-count b { color: var(--ink); font-weight: 600; }
.pf-progress { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pf-progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }

.pf-card { padding: 16px 22px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); scroll-margin-top: 96px; }
.pf-card + .pf-card { margin-top: 18px; }
.pf.js-on .pf-card { margin-top: 0; }
.pf.js-on .pf-card:not(.on) { display: none; }
.pf-media { margin: 0 -6px 18px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-tint); }
.pf-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pf-media-cat { display: grid; place-items: center; background: #17120f; }
.pf-media-cat .cat { width: 30%; }
.pf-media-live { aspect-ratio: auto; padding: 14px; }
.pf-media-live .case-visual { margin: 0; max-width: none; box-shadow: none; }
.pf-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent); text-transform: lowercase; }
.pf-card h2 { margin: 10px 0; font-size: clamp(22px, 2.1vw, 28px); line-height: 1.15; letter-spacing: -.02em; }
.pf-short { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.pf-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 2px; }
.pf-facts dt { font-family: var(--display); font-variation-settings: "wdth" 80; font-weight: 700; font-size: 20px; line-height: 1.1; letter-spacing: -.04em; }
.pf-facts dd { margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.pf-card h3 { margin: 20px 0 10px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: lowercase; }
.pf-built { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pf-built li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.pf-built li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--grad); }
.pf-built b { color: var(--ink); font-weight: 600; }
.pf-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }
.pf-note { font-size: 13px; color: var(--muted); }

@media (max-width: 1000px) {
  .pf { grid-template-columns: 1fr; gap: 22px; }
  .pf-stage { position: relative; top: auto; width: min(100%, 620px); margin-inline: auto; }
  .pf-wrap { padding-bottom: 70px; }
}
@media (max-width: 560px) {
  .pf-stage { aspect-ratio: 1 / 1.2; border-radius: 22px; }
  /* bring the bubbles in from the edges so no disc or label is cut off; the lines get the same squeeze
     (y' = 50 + (y - 50) * .93 + 2 = y * .93 + 5.5). The smallest bubble moves further in, clear of its neighbour's label. */
  .pf-node { left: calc(50% + (var(--x) - 50%) * .92); top: calc(var(--y) * .93 + 5.5%); }
  .pf-node.s1 { left: calc(50% + (var(--x) - 50%) * .62); }
  .pf-node[data-id="office"] { top: 20%; }   /* the top bubble: clear of the frame even with the float and the active ring, clear of the logo halo */
  .pf-lines { transform: translateY(2%) scale(.92, .93); }
  .pf-name { max-width: 104px; white-space: normal; padding: 3px 8px; font-size: 12px; font-variation-settings: "wdth" 75; }
  .pf-media-live { padding: 8px; }
  .pf-media-live .crm-h { gap: 4px; }
  .pf-name i { display: none; }
  .pf-node { gap: 6px; }
  .pf-card { padding: 14px 16px 20px; border-radius: 18px; }
  .pf-facts { gap: 10px; }
  .pf-facts dt { font-size: 17px; }
  .pf-tools { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-float, .pf-core::after { animation: none; }
  .js .pf-stage:not(.in) .pf-node { scale: 1; }
  .pf-node:hover .pf-disc, .pf-node:active .pf-disc { transform: none; }
}
