/* ===== Webrozo Portfolio Grid v3.0.0 ===== */
/* ✅ Desktop layout 100% UNCHANGED        */
/* ✅ Mobile height INCREASED to 340px+    */
/* ✅ Category + keyword tags added        */

.pf-section {
  --card:  #0b1030;
  --card2: #0a0e24;
  --stroke: rgba(255,255,255,.10);
  --text:  #eaf0ff;
  --muted: rgba(234,240,255,.65);

  background:
    radial-gradient(1200px 500px at 0% 0%, rgba(67,128,253,.35), transparent 60%),
    linear-gradient(90deg, #0b1e4a 0%, #000 55%, #000 100%);

  padding: 0 !important;
  margin: 0 !important;
  border-radius: 18px;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.pf-header,
.pf-grid {
  padding: clamp(22px, 4vw, 48px) clamp(14px, 3vw, 18px);
}
.pf-grid { padding-top: 0; padding-bottom: clamp(28px, 6vw, 60px); }

.pf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto clamp(12px, 2vw, 20px);
}
.pf-header h2 {
  font-size: clamp(24px, 4.2vw, 42px);
  letter-spacing: -.02em;
  margin: 0;
}
.pf-header p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(12px, 1.6vw, 15px);
  white-space: nowrap;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
.pf-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 22px);
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.pf-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    radial-gradient(120% 120% at 0% 0%, #191a50 0%, var(--card2) 55%, #070a1b 100%);
  border: 1px solid var(--stroke);
  border-radius: clamp(14px, 2vw, 20px);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  transition: transform .25s ease, border-color .25s ease;
  z-index: 1;
}

.pf-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.pf-card::before {
  content: "";
  position: absolute;
  inset: -35px;
  background:
    radial-gradient(420px 220px at 20% 0%, rgba(77,142,255,.45), transparent 60%),
    radial-gradient(420px 260px at 100% 100%, rgba(160,90,255,.35), transparent 65%);
  filter: blur(28px);
  opacity: 0;
  transform: scale(.96);
  transition: opacity .35s ease, transform .35s ease;
  z-index: -1;
}
.pf-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.18);
}
.pf-card:hover::before { opacity: 1; transform: scale(1); }

/* ── Thumbnail ──────────────────────────────────────────────────────────── */
.pf-thumb {
  display: block;
  height: clamp(280px, 38vw, 440px); /* Desktop */
  overflow: hidden;
  position: relative;
  background: #05081b;
  z-index: 1;
}
.pf-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(0) translateZ(0); /* GPU layer — prevents blur on transform */
  transition: transform var(--scroll-speed, 5s) linear;
  will-change: transform;
  /* ✅ Anti-blur fixes */
  image-rendering: -webkit-optimize-contrast; /* Safari sharpness */
  image-rendering: crisp-edges;               /* Firefox sharpness */
  backface-visibility: hidden;                /* prevents subpixel blur on GPU */
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}
.pf-card[data-scroll="true"]:hover .pf-thumb img {
  transform: translateY(calc(-1 * var(--scroll-distance, 0px)));
}
.pf-card.is-touch-active .pf-thumb img {
  transform: translateY(calc(-1 * var(--scroll-distance, 0px)));
}
.pf-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}

/* ── Card Body ──────────────────────────────────────────────────────────── */
.pf-body {
  padding: clamp(14px, 2.2vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 3;
}
.pf-body h3 {
  font-size: clamp(15px, 2.2vw, 20px);
  margin: 0;
  line-height: 1.3;
}

/* ── Category badge — hidden from card display, kept in DOM for SEO only ── */
.pf-category {
  display: none; /* visually hidden — category stays in HTML for schema crawlers */
}

/* ── Keyword tags ───────────────────────────────────────────────────────── */
.pf-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pf-keyword-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.65);
  border: 1px solid rgba(255,255,255,.1);
}

/* ── Button ─────────────────────────────────────────────────────────────── */
.pf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  color: #fff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .25s;
  position: relative;
  z-index: 4;
  margin-top: 4px;
}
.pf-btn-arrow { transition: transform .2s, opacity .2s; opacity: .9; }
.pf-btn:hover,
.pf-card:active .pf-btn {
  background: rgba(90,160,255,.16);
  border-color: rgba(120,190,255,.55);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(70,140,255,.35), 0 0 0 3px rgba(90,160,255,.12), inset 0 1px 0 rgba(255,255,255,.12);
}
.pf-btn:hover .pf-btn-arrow,
.pf-card:active .pf-btn-arrow { transform: translateX(3px); opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop untouched. Tablet + Mobile improved.
   ══════════════════════════════════════════════════════════════════════════ */

/* Tablet (1025px and below) */
@media (max-width: 1024px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .pf-thumb { height: clamp(300px, 42vw, 400px); }
}

/* Mobile (640px and below) — HEIGHT MAXIMISED */
@media (max-width: 640px) {
  .pf-section { border-radius: 12px; }

  .pf-header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0;
  }
  .pf-header h2 { font-size: clamp(20px, 6vw, 30px); }
  .pf-header p  { white-space: normal; font-size: 13px; }

  .pf-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* ✅ MOBILE IMAGE HEIGHT — 420px minimum for clear preview on all phones */
  .pf-thumb {
    height: clamp(420px, 90vw, 540px) !important;
  }

  .pf-body { padding: 16px 14px; gap: 8px; }
  .pf-body h3 { font-size: 16px; }

  .pf-btn {
    font-size: 13px;
    padding: 10px 14px;
    width: 100%;
    justify-content: center;
  }

  /* Keyword tags hidden on mobile — still in DOM for SEO */
  .pf-keywords { display: none; }
}

/* Very small mobile (400px and below) */
@media (max-width: 400px) {
  .pf-thumb { height: clamp(360px, 92vw, 460px) !important; }
  .pf-body h3 { font-size: 15px; }
}

/* ── Accessibility ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .pf-thumb img { transition-duration: 0.01ms !important; }
}

.pf-card-link:focus-visible,
.pf-btn:focus-visible {
  outline: 3px solid rgba(90,160,255,.8);
  outline-offset: 2px;
  border-radius: 6px;
}
