/* New Kingdom Creative — Website Portfolio page */

.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; margin-top: 4px; border-radius: 2px; background: var(--blue);
}

/* ---------- Hero ---------- */
.pf-hero { position: relative; overflow: hidden; padding: 128px 0 var(--s9); min-height: min(860px, 100svh); display: flex; align-items: center; }
.pf-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 480px at 78% 40%, rgba(10,92,255,0.28), transparent 70%),
    radial-gradient(520px 380px at 8% 90%, rgba(10,92,255,0.14), transparent 70%);
}
.pf-hero-bg::after { /* faint grid like the homepage hero */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
          mask: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.pf-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s7); align-items: center; width: 100%; }
.pf-title {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 400;
  font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.01em; margin: var(--s4) 0 var(--s5);
}
.pf-line { display: block; }
.pf-accent {
  background: linear-gradient(90deg, #2f76ff, #8fb6ff 45%, #2f76ff 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pf-sheen 6s linear infinite;
}
@keyframes pf-sheen { to { background-position: -200% 0; } }
.pf-hero .lead { max-width: 52ch; margin-bottom: var(--s6); }
.pf-stats { list-style: none; margin: var(--s7) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s6); }
.pf-stats li { display: flex; flex-direction: column; gap: 2px; }
.pf-stats strong { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 34px); font-variant-numeric: tabular-nums; }
.pf-stats span { color: var(--text-dim); font-size: 14px; font-weight: 600; }

/* The moving wall of client sites */
.pf-wall { position: relative; height: 640px; perspective: 1600px; }
.pf-wall-inner {
  position: absolute; inset: -12% -18% -12% -6%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  transform: rotateX(16deg) rotateY(-14deg) rotateZ(6deg);
  transform-origin: 40% 50%;
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}
.pf-col { overflow: hidden; }
.pf-track { display: flex; flex-direction: column; gap: 18px; animation: pf-up 46s linear infinite; }
.pf-col-2 .pf-track { animation-name: pf-down; animation-duration: 52s; }
.pf-col-3 .pf-track { animation-duration: 40s; }
.pf-track img {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.8), 0 0 0 1px rgba(10,92,255,0.12);
}
@keyframes pf-up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 9px)); } }
@keyframes pf-down { from { transform: translateY(calc(-50% - 9px)); } to { transform: translateY(0); } }
.pf-wall:hover .pf-track { animation-play-state: paused; }

/* ---------- Work grid ---------- */
.pf-work { padding-top: var(--s8); }
.pf-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 auto var(--s7); }
.pf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
.pf-card[hidden] { display: none !important; }
.js .pf-card.reveal { transition-delay: calc(min(var(--i, 0), 5) * 70ms); }
.pf-link { display: flex; flex-direction: column; gap: var(--s4); color: inherit; text-decoration: none; border-radius: 18px; }
.pf-link:focus-visible { outline: 2px solid var(--blue-hover); outline-offset: 6px; }

.pf-browser {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%;
  position: relative; border-radius: 16px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.9);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 500ms var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  will-change: transform;
}
.pf-link:hover .pf-browser, .pf-link:focus-visible .pf-browser {
  border-color: rgba(47,118,255,0.55);
  box-shadow: 0 40px 90px -40px var(--blue-glow), 0 0 0 1px rgba(47,118,255,0.25);
}
.pf-browser.is-tilting { transition: transform 120ms linear, box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out); }
.pf-bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; background: #10141d; border-bottom: 1px solid var(--border); }
.pf-dots { display: inline-flex; gap: 6px; }
.pf-dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3040; transition: background var(--dur) var(--ease-out); }
.pf-link:hover .pf-dots i:nth-child(1) { background: #ff5f57; }
.pf-link:hover .pf-dots i:nth-child(2) { background: #febc2e; transition-delay: 60ms; }
.pf-link:hover .pf-dots i:nth-child(3) { background: #28c840; transition-delay: 120ms; }
.pf-url {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 22px; padding: 0 10px; border-radius: 6px; background: rgba(255,255,255,0.05);
  font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-url svg { width: 11px; height: 11px; flex: none; }
.pf-shot { aspect-ratio: 16 / 10; overflow: hidden; }
.pf-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transform: scale(1.001); transition: transform 900ms var(--ease-out); }
.pf-link:hover .pf-shot img { transform: scale(1.06); }
.pf-glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease-out);
  background: radial-gradient(420px circle at var(--gx) var(--gy), rgba(255,255,255,0.16), transparent 55%);
}
.pf-link:hover .pf-glare { opacity: 1; }

.pf-meta { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.pf-cat { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-hover); }
.pf-name { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.pf-desc { margin: 0; color: var(--text-muted); font-size: 15px; }
.pf-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14.5px; font-weight: 700; color: var(--blue-hover); }
.pf-go svg { width: 15px; height: 15px; transition: transform var(--dur-fast) var(--ease-out); }
.pf-link:hover .pf-go svg { transform: translate(3px, -3px); }
.pf-status { text-align: center; color: var(--text-dim); margin: var(--s5) 0 0; }
.pf-status:empty { display: none; }

/* Smooth filtering (View Transitions where supported) */
::view-transition-group(*) { animation-duration: 420ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
.pf-card.pf-enter { animation: pf-pop 520ms var(--ease-out) both; animation-delay: calc(var(--n, 0) * 50ms); }
@keyframes pf-pop { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* ---------- Closing CTA ---------- */
.pf-cta-wrap { padding-top: var(--s4); }
.pf-cta {
  position: relative; overflow: hidden; text-align: center;
  padding: var(--s9) var(--s6); border-radius: var(--radius-lg);
  border: 1px solid rgba(10,92,255,0.45);
  background: radial-gradient(700px 360px at 50% 0%, rgba(10,92,255,0.3), transparent 70%), var(--surface);
}
.pf-cta .eyebrow { justify-content: center; }
.pf-cta .lead { max-width: 58ch; margin: var(--s3) auto var(--s6); }
.pf-cta .hero-actions { justify-content: center; }
.pf-cta-glow {
  position: absolute; width: 520px; height: 520px; left: 50%; top: 100%; translate: -50% -40%;
  border-radius: 50%; background: radial-gradient(circle, rgba(47,118,255,0.35), transparent 60%);
  filter: blur(20px); animation: pf-breathe 7s ease-in-out infinite; pointer-events: none;
}
.pf-cta > *:not(.pf-cta-glow) { position: relative; }
@keyframes pf-breathe { 50% { transform: scale(1.18); opacity: 0.7; } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .pf-hero { padding-top: 112px; min-height: 0; }
  .pf-hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .pf-wall { height: 380px; margin: 0 -16px; }
  .pf-wall-inner { inset: -20% -10%; transform: rotateX(18deg) rotateZ(-6deg); }
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pf-stats { gap: var(--s5); margin-top: var(--s6); }
  .pf-wall { height: 300px; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .pf-filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .pf-filters::-webkit-scrollbar { display: none; }
  .pf-filters .bubble { flex: none; }
  .pf-cta { padding: var(--s8) var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  .pf-track, .pf-accent, .pf-cta-glow { animation: none !important; }
  .pf-browser, .pf-shot img { transition: none !important; transform: none !important; }
  .pf-card.pf-enter { animation: none; }
}

/* ---------- Animated industry filters ---------- */
.pf-filters { position: relative; isolation: isolate; width: fit-content; max-width: 100%; padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.pf-filters .pf-filter {
  position: relative; z-index: 1; border-color: transparent; background: transparent;
  transition: color 300ms var(--ease-out), transform 220ms var(--ease-out), background-color 220ms var(--ease-out);
}
.pf-filters .pf-filter:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); }
.pf-filters .pf-filter[aria-pressed="true"] { background: transparent; border-color: transparent; box-shadow: none; color: #fff; }
.pf-filters .pf-filter[aria-pressed="true"]:hover { background: transparent; }
.pf-filters .pf-filter .bubble-price { transition: color 300ms var(--ease-out); display: inline-block; }
.pf-filters .pf-filter[aria-pressed="true"] .bubble-price { color: rgba(255,255,255,0.85); }
.pf-filters .pf-filter.bump .bubble-price { animation: pf-count 420ms var(--ease-out); }
@keyframes pf-count { 35% { transform: scale(1.45) translateY(-2px); } }

/* The blue pill that slides to the selected filter */
.pf-pill {
  position: absolute; z-index: 0; top: 6px; left: 0; height: calc(100% - 12px); width: 0;
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(135deg, var(--blue), #3d82ff);
  box-shadow: 0 10px 30px -10px var(--blue-glow), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateX(var(--pill-x, 0px)); width: var(--pill-w, 0px);
  transition: transform 520ms cubic-bezier(0.34, 1.4, 0.5, 1), width 520ms cubic-bezier(0.34, 1.4, 0.5, 1);
}
.pf-pill::after { /* soft shine that sweeps across on every move */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  background-size: 250% 100%; background-position: 120% 0; opacity: 0;
}
.pf-pill.moving::after { animation: pf-shine 700ms var(--ease-out); }
@keyframes pf-shine { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -60% 0; } }
.pf-pill.no-anim { transition: none; }

/* Filters arrive one by one when the section scrolls in */
.js .pf-filters.reveal .pf-filter { opacity: 0; transform: translateY(10px); }
.js .pf-filters.reveal.is-visible .pf-filter { opacity: 1; transform: none;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out), color 300ms var(--ease-out), background-color 220ms var(--ease-out);
  transition-delay: calc(var(--k, 0) * 70ms + 150ms), calc(var(--k, 0) * 70ms + 150ms), 0ms, 0ms; }
.js .pf-filters.reveal.is-visible.ready .pf-filter { transition-delay: 0ms; }
.js .pf-filters.reveal .pf-pill { opacity: 0; transition: opacity 400ms var(--ease-out) 400ms, transform 520ms cubic-bezier(0.34, 1.4, 0.5, 1), width 520ms cubic-bezier(0.34, 1.4, 0.5, 1); }
.js .pf-filters.reveal.is-visible .pf-pill { opacity: 1; }

@media (max-width: 640px) {
  .pf-filters { width: auto; border-radius: 999px; margin-left: -6px; margin-right: -6px; padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-pill, .pf-filters .pf-filter { transition: none !important; }
  .pf-pill.moving::after, .pf-filters .pf-filter.bump .bubble-price { animation: none !important; }
  .js .pf-filters.reveal .pf-filter { opacity: 1; transform: none; }
}
