/* =====================================================================
   PORTFOLIO PRO — 3D browser cards with auto-scrolling full-page previews.
   Fast by design: pre-captured WebP (no live iframes), compositor-only
   animation (transform), animations run only for cards on screen.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

.pf-card,
.pf-bar,
.pf-lb {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.pf-card *,
.pf-bar *,
.pf-lb * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- card */
.pf-card {
  position: relative;
  min-width: 0;
  padding: 10px;
  perspective: 1200px;
}

.pf-card[hidden] {
  display: none;
}

.pf-card__tilt {
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out;
}

.pf-device {
  position: relative;
  overflow: hidden;
  background: #14141a;
  border: 1px solid rgba(255, 193, 7, 0.22);
  border-radius: 18px 6px 18px 6px;
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transform: translateZ(28px);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.pf-card:nth-child(even) .pf-device {
  border-radius: 6px 18px 6px 18px;
}

.pf-card:hover .pf-device {
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 34px 60px -22px rgba(0, 0, 0, 0.9), 0 0 46px rgba(255, 193, 7, 0.22);
}

.pf-device__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 12px;
  background: #1b1b23;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-dots {
  display: inline-flex;
  gap: 6px;
}

.pf-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}

.pf-dots i:nth-child(2) { background: #febc2e; }
.pf-dots i:nth-child(3) { background: #28c840; }

.pf-url {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 22px;
  padding: 0 12px;
  overflow: hidden;
  font-size: 0.72rem;
  color: #a9a9b6;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.pf-url i {
  font-size: 0.6rem;
  color: #28c840;
}

.pf-device__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1c24, #101015);
  cursor: zoom-in;
}

.pf-shot {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
}

/* static top-cropped preview — a gentle zoom on hover instead of a constant auto-scroll */
.pf-card:hover .pf-shot {
  transform: translate3d(0, 0, 0) scale(1.045);
}

.pf-noshot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #a9a9b6;
}

.pf-noshot i {
  font-size: 1.8rem;
  color: #ffc107;
}

.pf-device__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pf-card:hover .pf-device__glare {
  opacity: 1;
}

.pf-card__meta {
  padding: 18px 6px 0;
  transform: translateZ(14px);
}

.pf-card__cat {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffc107;
}

.pf-card__title {
  margin: 0 0 6px;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  overflow-wrap: anywhere;
}

.pf-card__desc {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #a9a9b6;
  opacity: 1;
  transform: none;
}

.pf-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* ------------------------------------------------------------- buttons */
.pf-btn,
.pf-icon,
.pf-chip {
  font-family: inherit;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #14100a;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(120deg, #ffe259, #ffc107 55%, #ff9800);
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: 0 10px 22px -8px rgba(255, 193, 7, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.pf-btn:hover {
  color: #14100a;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -8px rgba(255, 193, 7, 0.75);
}

.pf-btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.pf-btn--ghost:hover {
  color: #fff;
  background: rgba(255, 193, 7, 0.16);
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: none;
}

.pf-btn i {
  font-size: 0.72rem;
}

.pf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.pf-icon:hover,
.pf-icon[aria-pressed="false"] {
  color: #14100a;
  background: #ffc107;
  border-color: #ffc107;
}

.pf-icon:hover {
  transform: scale(1.08);
}

/* --------------------------------------------------------- control bar */
.pf-bar {
  position: sticky;
  top: var(--hdr-h, 72px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 24px;
  background: rgba(13, 13, 17, 0.94);
  border-bottom: 1px solid rgba(255, 193, 7, 0.18);
}

.pf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.pf-tab {
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #a9a9b6;
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.pf-tab span {
  margin-left: 4px;
  font-size: 0.75rem;
  color: #6f6f7c;
}

.pf-tab:hover,
.pf-tab[aria-selected="true"] {
  color: #ffc107;
  border-bottom-color: #ffc107;
}

.pf-search {
  position: relative;
  flex: 1 1 200px;
  max-width: 300px;
  margin-left: auto;
}

.pf-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  background: #1a1a22;
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 999px;
}

.pf-search input:focus {
  outline: none;
  border-color: #ffc107;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.pf-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #ffc107;
}

.pf-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.pf-seg button {
  padding: 8px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #a9a9b6;
  cursor: pointer;
  background: none;
  border: 0;
}

.pf-seg button[aria-pressed="true"] {
  color: #14100a;
  background: #ffc107;
}

/* ----------------------------------------------------------- grid/wall */
.pf-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px 14px 90px;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 24px 20px;
}

.pf-grid[data-view="wall"] {
  perspective: 1800px;
  transform-style: preserve-3d;
  padding: 30px 0;
}

.pf-grid[data-view="wall"] .pf-card {
  transition: transform 0.5s ease;
}

.pf-grid[data-view="wall"] .pf-card:nth-child(3n + 1) { transform: rotateY(14deg) translateZ(0); }
.pf-grid[data-view="wall"] .pf-card:nth-child(3n + 2) { transform: translateZ(60px); }
.pf-grid[data-view="wall"] .pf-card:nth-child(3n) { transform: rotateY(-14deg) translateZ(0); }

.pf-grid[data-view="wall"] .pf-card:hover {
  transform: translateZ(90px) scale(1.02);
  z-index: 3;
}

.pf-empty {
  padding: 60px 20px;
  text-align: center;
  color: #a9a9b6;
}

.pf-card.pf-in {
  animation: pfIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--n, 0) * 35ms);
}

@keyframes pfIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ lightbox */
.pf-lb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 3vw;
  background: rgba(5, 5, 8, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: pfLbIn 0.3s ease;
}

.pf-lb[hidden] {
  display: none;
}

.pf-lb__panel {
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  height: 100%;
  overflow: hidden;
  background: #101015;
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 22px 8px 22px 8px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 60px rgba(255, 193, 7, 0.12);
}

.pf-lb__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #17171e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pf-lb__title {
  flex: 1;
  min-width: 0;
  margin: 0 6px;
  line-height: 1.25;
}

.pf-lb__title b {
  display: block;
  overflow: hidden;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pf-lb__title span {
  font-size: 0.78rem;
  color: #a9a9b6;
}

.pf-lb__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0d0d11;
}

.pf-lb__scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.pf-lb__frame {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
}

.pf-lb.is-live .pf-lb__scroll { overflow: hidden; }
.pf-lb.is-live .pf-lb__scroll img { display: none; }
.pf-lb.is-live .pf-lb__frame { display: block; }

.pf-lb__hint {
  padding: 8px 16px;
  font-size: 0.76rem;
  text-align: center;
  color: #7c7c88;
  background: #17171e;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.pf-lb-open {
  overflow: hidden;
}

@keyframes pfLbIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .pf-bar {
    padding: 12px 14px;
  }
  .pf-search {
    max-width: none;
    margin-left: 0;
    flex-basis: 100%;
    order: 3;
  }
  .pf-tabs {
    flex: 1 1 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .pf-tab {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .pf-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pf-grid[data-view="wall"] .pf-card {
    transform: none !important;
  }
  .pf-lb {
    padding: 0;
  }
  .pf-lb__panel {
    border-radius: 0;
    border: 0;
  }
  .pf-lb__bar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .pf-lb__title {
    flex-basis: 100%;
    order: -1;
    margin: 0 0 4px;
  }
  .pf-lb__hint {
    display: none;
  }
}

/* ---------------------------------------------------------------- page */
.pf-page {
  margin: 0;
  background: #0d0d11;
}

.pf-showing {
  margin: 0 0 18px;
  padding: 0 10px;
  font-size: 0.86rem;
  color: #7c7c88;
  opacity: 1;
  transform: none;
}

.pf-showing b {
  color: #ffc107;
}
