﻿/* ============================================================
   PORTFOLIO PAGE — Red-White-Black Theme
   Enhanced UI/UX: masonry grid, filter tabs, lightbox
   ============================================================ */

[hidden] { display: none !important; }

:root {
  --pf-bg:          #ffffff;
  --pf-red:         #D71920;
  --pf-red-dark:    #b0141a;
  --pf-black:       #0d0d0d;
  --pf-text-1:      #111111;
  --pf-text-2:      #555555;
  --pf-text-3:      #888888;
  --pf-border:      #e2e2e6;
  --pf-shadow-sm:   0 1px 4px rgba(0,0,0,0.08);
  --pf-shadow-md:   0 4px 20px rgba(0,0,0,0.11);
  --pf-shadow-lg:   0 8px 40px rgba(0,0,0,0.16);
  --pf-radius:      12px;
  --pf-radius-sm:   8px;
  --pf-ease:        0.22s ease;
  --pf-font-d:      'Bricolage Grotesque', sans-serif;
  --pf-font-b:      'Montserrat', sans-serif;
  --navbar-height:  80px;
}

.pf-page {
  background-color: #0d0d0d;
  /* pfgridbg.webp is a dark leather/patch texture — a light wash made it
     invisible, so the grid section now runs dark (matching the hero and
     the already-dark project cards) instead of a light page. Text that
     sits directly on this background (results count, empty/loading
     states) is overridden to light colors further down. */
  background-image:
    linear-gradient(rgba(6,6,6,0.72), rgba(6,6,6,0.72)),
    url('../images/webporavif/pfgridbg.webp');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  font-family: var(--pf-font-b);
  color: rgba(255,255,255,0.85);
  min-height: 100vh;
}

@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */

.pf-page {
  min-height: 133.3333vh;
} }
@supports (-webkit-touch-callout: none) {
  .pf-page { background-attachment: scroll; }
}

/* ============================================================
   HERO
   ============================================================ */
.pf-hero {
  background-color: var(--pf-black);
  /* Horizontal scrim, not a flat wash: strong/near-solid over the text
     column on the left, easing off toward the right so the patches/caps/
     lanyards in pfherobg.webp actually read where the product cutout sits. */
  background-image:
    linear-gradient(100deg, rgba(6,6,6,0.90) 0%, rgba(6,6,6,0.78) 32%, rgba(6,6,6,0.42) 62%, rgba(6,6,6,0.30) 100%),
    url('../images/webporavif/pfherobg.webp');
  background-size: cover;
  background-position: center;
  padding: 90px 0 0;
  position: relative;
  overflow: hidden;
}
.pf-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(215,25,32,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.pf-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pf-red) 0%, rgba(215,25,32,0.30) 60%, transparent 100%);
}

.pf-hero-inner {
  max-width: clamp(1200px, 78vw, 2200px);
  margin: 0 auto;
  padding: 0 clamp(24px, 3vw, 80px) 56px;
  position: relative;
  z-index: 1;
}

@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */

.pf-hero-inner {
  max-width: clamp(1200px, 104vw, 2200px);
  padding: 0 clamp(24px, 4vw, 80px) 56px;
} }
.pf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 32px;
}
.pf-breadcrumb a {
  color: rgba(255,255,255,0.50);
  text-decoration: none;
  transition: color var(--pf-ease);
}
.pf-breadcrumb a:hover { color: var(--pf-red); }
.pf-breadcrumb span { color: rgba(255, 255, 255, 0.692); }

.pf-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(215,25,32,0.14);
  border: 1px solid rgba(215,25,32,0.32);
  color: #ff7c7e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.pf-hero-title {
  font-family: var(--pf-font-d);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.0;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
.pf-hero-title {
  font-size: clamp(2.8rem, 8vw, 4.6rem);
} }
.pf-hero-title em { font-style: normal; color: var(--pf-red); }
.pf-hero-desc {
  max-width: 560px;
  font-size: 1.05rem;
  line-height: 1.72;
  color: #ffffff;
  margin: 0;
}

/* ── HERO VISUAL — premium product cutout, right side ─────────────────
   Purely decorative (aria-hidden + empty alt); the headline/description
   carry the real content. Positioned against .pf-hero itself (not
   .pf-hero-inner) so it can sit past the text column's max-width instead
   of being squeezed by it. Hidden below 901px — see the 900px block. */
.pf-hero-visual {
  position: absolute;
  top: 50%;
  right: clamp(-40px, 2vw, 60px);
  transform: translateY(-46%);
  width: clamp(320px, 32vw, 620px);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.55));
}
@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
.pf-hero-visual {
  right: clamp(-40px, 2.6667vw, 60px);
  width: clamp(320px, 42.6667vw, 620px);
} }
.pf-hero-visual-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Below ~1100px the 4-column stat bar and the visual's minimum width
   (320px) start colliding — measured overlap at 1024px. Hide the
   decorative visual rather than shrinking it past legibility or
   cramping the stats further. */
@media (max-width: 1100px) {
  .pf-hero-visual { display: none; }
}

/* ── HERO ENTRANCE — staggered, varied reveal (runs when the hero is
   injected by portfolio.js). Motion-safe only. ─────────────────────── */
@keyframes heroRevUp   { from { opacity: 0; transform: translateY(30px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes heroRevDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes heroRevZoom { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes heroRevVisual {
  from { opacity: 0; transform: translateY(-46%) translateX(24px) scale(0.94); }
  to   { opacity: 1; transform: translateY(-46%) translateX(0) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .pf-hero .pf-hero-tag    { animation: heroRevDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) both 0.15s; }
  .pf-hero .pf-hero-title  { animation: heroRevUp   0.9s cubic-bezier(0.16, 1, 0.3, 1) both 0.30s; }
  .pf-hero .pf-hero-desc   { animation: heroRevUp   0.9s cubic-bezier(0.16, 1, 0.3, 1) both 0.45s; }
  .pf-hero .pf-hero-stats  { animation: heroRevZoom 0.9s cubic-bezier(0.16, 1, 0.3, 1) both 0.60s; }
  .pf-hero .pf-hero-visual { animation: heroRevVisual 1s cubic-bezier(0.16, 1, 0.3, 1) both 0.35s; }
}

/* Stats strip inside hero */
.pf-hero-stats {
  display: flex;
  max-width: 640px;
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pf-stat {
  flex: 1;
  padding: 28px 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.pf-stat:last-child { border-right: none; }
.pf-stat-num {
  font-family: var(--pf-font-d);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--pf-red);
  display: block;
  line-height: 1;
}
.pf-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
  display: block;
  margin-top: 6px;
}

/* ============================================================
   FILTER TABS — sticky
   ============================================================ */
.pf-filters-wrap {
  background-color: #161616;
  background-image:
    linear-gradient(rgba(16,16,16,0.90), rgba(16,16,16,0.90)),
    url('../images/webporavif/bg-1.webp');
  background-size: cover;
  background-position: center;
  position: sticky;
  top: var(--navbar-height, 80px);
  z-index: 100;
  border-bottom: 2px solid rgba(215,25,32,0.30);
}
/* Right-edge fade hint for horizontal scroll */
.pf-filters-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 2px;
  width: 52px;
  background: linear-gradient(to left, #161616 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.pf-filters {
  max-width: clamp(1200px, 78vw, 2200px);
  margin: 0 auto;
  padding: 0 clamp(24px, 3vw, 80px);
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #d71920 rgba(255,255,255,0.10);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */

.pf-filters {
  max-width: clamp(1200px, 104vw, 2200px);
  padding: 0 clamp(24px, 4vw, 80px);
} }
.pf-filters::-webkit-scrollbar { height: 6px; }
.pf-filters::-webkit-scrollbar-track { background: rgba(255,255,255,0.10); border-radius: 100px; }
.pf-filters::-webkit-scrollbar-thumb { background: #d71920; border-radius: 100px; }
.pf-filters::-webkit-scrollbar-thumb:hover { background: #ff3b42; }

.pf-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 16px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255,255,255,0.46);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--pf-ease), border-color var(--pf-ease);
  position: relative;
  bottom: -2px;
  font-family: var(--pf-font-b);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.pf-filter-btn:hover { color: rgba(255,255,255,0.82); }
.pf-filter-btn.active { color: #ffffff; border-bottom-color: var(--pf-red); }
.pf-filter-btn:focus-visible {
  outline: 2px solid var(--pf-red);
  outline-offset: -2px;
  border-radius: 3px;
}

.pf-filter-count {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.40);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  transition: background var(--pf-ease), color var(--pf-ease);
  line-height: 1.6;
}
.pf-filter-btn.active .pf-filter-count {
  background: rgba(215,25,32,0.22);
  color: #ff8a8c;
}

/* ============================================================
   GRID SECTION
   ============================================================ */
.pf-section {
  max-width: clamp(1200px, 78vw, 2200px);
  margin: 0 auto;
  padding: 44px clamp(24px, 3vw, 80px) 80px;
}
@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
.pf-section {
  max-width: clamp(1200px, 104vw, 2200px);
  padding: 44px clamp(24px, 4vw, 80px) 80px;
} }

.pf-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.pf-results-count {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}
.pf-results-count strong { color: #ffffff; font-weight: 700; }
.pf-results-active-filter {
  display: inline-flex;
  align-items: center;
  background: rgba(215,25,32,0.14);
  border: 1px solid rgba(215,25,32,0.32);
  color: #ff7c7e;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Auto-fit Grid (fills width at every breakpoint, ~6 cols at 4K) ── */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.25rem;
}

/* ── Project Card ── */
.pf-card {
  position: relative;
  border-radius: var(--pf-radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--pf-black);
  box-shadow: var(--pf-shadow-sm);
  transition: box-shadow var(--pf-ease), transform var(--pf-ease);
  display: block;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
}
.pf-card:hover {
  box-shadow: var(--pf-shadow-lg);
  transform: translateY(-5px);
}
.pf-card:focus-visible {
  outline: 3px solid var(--pf-red);
  outline-offset: 2px;
}

.pf-card-img-wrap { width: 100%; overflow: hidden; line-height: 0; aspect-ratio: 1 / 1; }
.pf-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.28s ease;
}
.pf-card:hover .pf-card-img {
  transform: scale(1.07);
  filter: brightness(0.68);
}

/* Gradient overlay */
.pf-card-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.30) 42%,
    transparent 68%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pf-card:hover .pf-card-overlay { opacity: 1; }

/* Category pill — always visible */
.pf-card-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 100px;
  background: var(--pf-red);
  color: #ffffff;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  line-height: 1.5;
}

/* Expand icon — center on hover */
.pf-card-expand {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,0.10);
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.pf-card:hover .pf-card-expand {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pf-card-title {
  font-family: var(--pf-font-d);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ── Empty state ── */
.pf-empty {
  padding: 80px 24px;
  text-align: center;
  color: rgba(255,255,255,0.45);
}
.pf-empty svg { margin-bottom: 16px; color: rgba(255,255,255,0.25); }
.pf-empty p { font-size: 1rem; margin: 0; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.pf-lightbox {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pf-lb-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.94);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.pf-lb-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 900px);
  width: 100%;
  gap: 14px;
  animation: pf-lb-in 0.22s ease forwards;
}

@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */

.pf-lb-body {
  max-width: min(120vw, 900px);
} }
@keyframes pf-lb-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.pf-lb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.pf-lb-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--pf-red);
  color: #ffffff;
}
.pf-lb-close {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: background var(--pf-ease), transform var(--pf-ease);
  flex-shrink: 0;
}
.pf-lb-close:hover {
  background: rgba(215,25,32,0.45);
  transform: rotate(90deg) scale(1.05);
}

.pf-lb-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--pf-radius);
  overflow: hidden;
  background: #111;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.05);
  line-height: 0;
}
.pf-lb-img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.20s ease;
}
@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
.pf-lb-img {
  max-height: 96vh;
} }
.pf-lb-img.fading { opacity: 0; }
.pf-lb-img.is-error { opacity: 0.18; }

.pf-lb-prev,
.pf-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  z-index: 2;
  transition: background var(--pf-ease), transform var(--pf-ease), opacity var(--pf-ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.pf-lb-prev { left: 12px; }
.pf-lb-next { right: 12px; }
.pf-lb-prev:hover { background: rgba(215,25,32,0.60); transform: translateY(-50%) scale(1.08); }
.pf-lb-next:hover { background: rgba(215,25,32,0.60); transform: translateY(-50%) scale(1.08); }
/* Disabled state — visually dimmed, cursor blocked */
.pf-lb-prev:disabled,
.pf-lb-next:disabled {
  opacity: 0.20;
  cursor: not-allowed;
  pointer-events: none;
}

.pf-lb-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.pf-lb-title {
  font-family: var(--pf-font-d);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.pf-lb-counter {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.38);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.06em;
}
.pf-lb-hint {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
}
.pf-lb-hint span {
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  gap: 5px;
}
/* Scoped to lightbox only — does not affect other <kbd> elements */
.pf-lb-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--pf-font-b);
  color: rgba(255,255,255,0.35);
}

/* ============================================================
   LOADING
   ============================================================ */
.pf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 80px 24px;
  color: rgba(255,255,255,0.55);
}
.pf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--pf-red);
  border-radius: 50%;
  animation: pf-spin 0.75s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ============================================================
   CTA SECTION
   ============================================================ */
.pf-cta {
  background-color: var(--pf-black);
  background-image:
    linear-gradient(rgba(8,8,8,0.88), rgba(8,8,8,0.88)),
    url('../images/webporavif/bg-1.webp');
  background-size: cover;
  background-position: center;
  padding: 84px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.pf-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--pf-red) 50%, transparent 100%);
}
.pf-cta::after {
  content: '';
  position: absolute;
  bottom: -120px; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(215,25,32,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.pf-cta-inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.pf-cta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pf-red);
  margin-bottom: 14px;
}
.pf-cta-title {
  font-family: var(--pf-font-d);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
@media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
.pf-cta-title {
  font-size: clamp(2rem, 6vw, 3.2rem);
} }
.pf-cta-title em { font-style: normal; color: var(--pf-red); }
.pf-cta-desc {
  font-size: 1rem;
  line-height: 1.72;
  color: rgba(255,255,255,0.50);
  margin: 0 0 38px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.pf-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pf-cta-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pf-red);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: var(--pf-radius-sm);
  font-family: var(--pf-font-b);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background var(--pf-ease), transform var(--pf-ease), box-shadow var(--pf-ease);
  box-shadow: 0 4px 20px rgba(215,25,32,0.38);
}
.pf-cta-btn-primary:hover {
  background: var(--pf-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(215,25,32,0.48);
}
.pf-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: rgba(255,255,255,0.68);
  padding: 14px 28px;
  border-radius: var(--pf-radius-sm);
  border: 1px solid rgba(255,255,255,0.20);
  font-family: var(--pf-font-b);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: border-color var(--pf-ease), color var(--pf-ease);
}
.pf-cta-btn-secondary:hover {
  border-color: rgba(255,255,255,0.50);
  color: #ffffff;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.pf-back-top {
  position: fixed;
  bottom: 30px;
  right: 26px;
  z-index: 500;
  width: 48px;
  height: 48px;
  background: var(--pf-red);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(215,25,32,0.45);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.24s ease, transform 0.24s ease, background 0.18s ease, box-shadow 0.18s ease;
  pointer-events: none;
  will-change: transform, opacity;
}
.pf-back-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.pf-back-top:hover {
  background: var(--pf-red-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(215,25,32,0.55);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.pf-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.40s ease, transform 0.40s ease;
}
.pf-reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ============================================================
   MOBILE FILTER — toggle bar + sheet dropdown
   (hidden on desktop, replaces tab bar on mobile)
   ============================================================ */

/* Base: mobile-only elements hidden on desktop */
.pf-filter-toggle-btn { display: none; }
.pf-filter-sheet      { display: none; } /* [hidden] attr also hides; this covers non-mobile */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .pf-section { padding: 36px 20px 64px; }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .pf-hero { padding-top: 60px; }
  .pf-hero-desc { font-size: 0.95rem; }

  /* Stats: 2×2 grid */
  .pf-hero-stats { flex-wrap: wrap; }
  .pf-stat {
    flex: 0 0 50%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .pf-stat:nth-child(odd)       { border-right: 1px solid rgba(255,255,255,0.08); }
  .pf-stat:nth-last-child(-n+2) { border-bottom: none; }

  /* Hide desktop tabs, hide right-fade, show mobile toggle */
  .pf-filters             { display: none; }
  .pf-filters-wrap::after { display: none; }
  .pf-filter-toggle-btn   { display: flex; }

  /* ── Mobile toggle bar ── */
  .pf-filter-toggle-btn {
    align-items: center;
    width: 100%;
    padding: 0 20px;
    height: 58px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    gap: 14px;
    font-family: var(--pf-font-b);
    transition: border-color var(--pf-ease);
    text-align: left;
  }
  .pf-filter-toggle-btn.is-open {
    border-bottom-color: var(--pf-red);
  }

  .pf-filter-toggle-icon {
    width: 34px;
    height: 34px;
    background: rgba(215,25,32,0.14);
    border: 1px solid rgba(215,25,32,0.30);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pf-red);
    flex-shrink: 0;
    transition: background var(--pf-ease);
  }
  .pf-filter-toggle-btn.is-open .pf-filter-toggle-icon {
    background: rgba(215,25,32,0.24);
  }

  .pf-filter-toggle-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
  }
  .pf-filter-toggle-hint {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255,255,255,0.32);
    line-height: 1;
  }
  .pf-filter-toggle-current {
    font-size: 0.98rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pf-filter-toggle-meta {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.30);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .pf-filter-chevron {
    color: rgba(255,255,255,0.38);
    transition: transform 0.22s ease;
    flex-shrink: 0;
  }
  .pf-filter-toggle-btn.is-open .pf-filter-chevron {
    transform: rotate(180deg);
  }

  /* ── Filter sheet dropdown ── */
  .pf-filter-sheet:not([hidden]) {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background-color: #1c1c1c;
    background-image:
      linear-gradient(rgba(20,20,20,0.97), rgba(20,20,20,0.97)),
      url('../images/webporavif/bg-1.webp');
    background-size: cover;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-bottom: 3px solid rgba(215,25,32,0.40);
    box-shadow: 0 12px 40px rgba(0,0,0,0.60);
    padding: 16px 20px 20px;
    animation: pf-sheet-in 0.18s ease forwards;
  }
  @keyframes pf-sheet-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .pf-filter-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }

  /* ── Sheet filter buttons ── */
  .pf-sheet-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 13px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    color: rgba(255,255,255,0.62);
    font-family: var(--pf-font-b);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    text-align: center;
    min-height: 60px;
  }
  .pf-sheet-btn:hover,
  .pf-sheet-btn:active {
    background: rgba(215,25,32,0.14);
    border-color: rgba(215,25,32,0.35);
    color: #ffffff;
  }
  .pf-sheet-btn.active {
    background: var(--pf-red);
    border-color: var(--pf-red);
    color: #ffffff;
    box-shadow: 0 3px 14px rgba(215,25,32,0.38);
  }
  .pf-sheet-btn-label {
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    display: block;
  }
  .pf-sheet-btn-count {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.60;
    display: block;
    line-height: 1;
  }
  .pf-sheet-btn.active .pf-sheet-btn-count { opacity: 0.80; }

  /* Lightbox controls */
  .pf-lb-prev { left: 6px; width: 38px; height: 38px; }
  .pf-lb-next { right: 6px; width: 38px; height: 38px; }
  .pf-lb-hint { display: none; }
  .pf-lb-body { gap: 10px; }

  .pf-cta { padding: 60px 20px; }
  .pf-back-top { right: 16px; bottom: 20px; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .pf-stat-num   { font-size: 1.8rem; }
  .pf-stat-label { font-size: 9px; }
  .pf-stat       { padding: 18px 0; }
  .pf-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pf-hero-title { font-size: 2.4rem; }
  .pf-lb-body { max-width: 100%; }
  .pf-lb-img { max-height: 56vh; }
  .pf-cta-btn-primary,
  .pf-cta-btn-secondary { width: 100%; justify-content: center; }
}

/* ── Very small (≤ 360px) ── */
@media (max-width: 360px) {
  .pf-filter-btn { padding: 14px 10px; font-size: 0.78rem; }
  .pf-lightbox { padding: 10px; }
  .pf-lb-title { font-size: 1rem; }
  .pf-back-top { width: 42px; height: 42px; }
  .pf-hero-inner { padding: 0 16px 40px; }
  .pf-section { padding: 28px 16px 48px; }
}

/* ── Landscape mobile — lightbox image height fix ── */
@media (orientation: landscape) and (max-height: 500px) {
  .pf-lb-img { max-height: 50vh; }
  @media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
  .pf-lb-img { max-height: 66.6667vh; } }
  .pf-lb-body { gap: 6px; }
  .pf-lb-bottombar { display: none; }
}

/* iOS Safari fixed bg fallback */
@supports (-webkit-touch-callout: none) {
  .pf-filters-wrap { background-attachment: scroll; }
  .pf-cta { background-attachment: scroll; }
}


/* ── Load More button ── */
.pf-load-more-wrap { text-align: center; padding: 2rem 0 1rem; }
.pf-load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgb(255, 0, 0);
  border: 2px solid rgba(0, 0, 0, 0.814);
  color: rgba(0, 0, 0, 0.75);
  font-family: var(--pf-font-b);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: var(--pf-radius-sm);
  cursor: pointer;
  transition: background var(--pf-ease), border-color var(--pf-ease), color var(--pf-ease), transform var(--pf-ease);
}
.pf-load-more:hover {
  background: var(--pf-red);
  border-color: var(--pf-red);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(215,25,32,0.4);
}
.pf-load-more-count {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.65;
  letter-spacing: 0.01em;
}

/* ── 2K / 4K LARGE SCREENS ─────────────────────────────────── */
@media (min-width: 1600px) {
  .pf-hero-inner { padding-bottom: 72px; }
  .pf-section { padding-top: 56px; padding-bottom: 100px; }

  /* ── Hero ── */
  .pf-breadcrumb span { font-size: 1.1rem; }
  .pf-breadcrumb  { font-size: 1rem; }
  .pf-hero-tag    { font-size: 1.2rem; padding: 0.5rem 1.125rem; }
  .pf-hero-title  { font-size: 5.5rem; }
  .pf-hero-desc   { font-size: 1.3rem; max-width: 45rem; }
  .pf-hero-stats  { margin-top: 4rem; }
  .pf-stat        { padding: 2.25rem 0; }
  .pf-stat-num    { font-size: 3rem; }
  .pf-stat-label  { font-size: 1.1rem; margin-top: 0.5rem; }

  /* ── Filter tabs ── */
  .pf-filter-btn   { font-size: 1.15rem; padding: 1.25rem 1.25rem; }
  .pf-filter-count { font-size: 0.8rem; padding: 0.15rem 0.6rem; }

  /* ── Results bar + grid ── */
  .pf-results-count         { font-size: 1.3rem; }
  .pf-results-active-filter { font-size: 0.9rem; }
  /* Wider column floor = bigger cards (auto-fit still fills the row) */
  .pf-grid       { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.75rem; }
  .pf-card-title { font-size: 1.5rem; }
  .pf-card-pill  { font-size: 1.1rem; padding: 0.5rem 1.35rem; top: 1.25rem; left: 1.25rem; letter-spacing: 0.08em; }
  .pf-card-overlay { padding: 1.5rem; }
  .pf-card-expand  { width: 4rem; height: 4rem; }

  /* ── Load more ── */
  .pf-load-more       { font-size: 1.1rem; padding: 1.05rem 2.75rem; }
  .pf-load-more-count { font-size: 0.95rem; }

  /* ── Lightbox ── */
  .pf-lb-body    { max-width: min(90vw, 71.25rem); }
  @media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
  .pf-lb-body    { max-width: min(120vw, 71.25rem); } }   /* 900 → 1140px */
  .pf-lb-img     { max-height: 76vh; }
  @media (min-width: 1600px) {/* DESKTOP-SCALE generated by tools/desktop-scale.mjs */
  .pf-lb-img     { max-height: 101.3333vh; } }
  .pf-lb-title   { font-size: 1.6rem; }
  .pf-lb-counter { font-size: 1rem; }
  .pf-lb-pill    { font-size: 0.85rem; padding: 0.4rem 1.125rem; }
  .pf-lb-close   { width: 3.25rem; height: 3.25rem; }
  .pf-lb-prev,
  .pf-lb-next    { width: 3.5rem; height: 3.5rem; }
  .pf-lb-hint span { font-size: 0.85rem; }

  /* ── CTA ── */
  .pf-cta         { padding: 110px 24px; }
  .pf-cta-inner   { max-width: 50rem; }
  .pf-cta-label   { font-size: 1.2rem; }
  .pf-cta-title   { font-size: 3.6rem; }
  .pf-cta-desc    { font-size: 1.25rem; max-width: 45rem; }
  .pf-cta-btn-primary,
  .pf-cta-btn-secondary { font-size: 1.25rem; padding: 1.125rem 2.25rem; }

  /* ── Back to top ── */
  .pf-back-top { width: 3.5rem; height: 3.5rem; }
  .pf-load-more { font-size: 1.3rem; padding: 1.05rem 2.75rem; }
}
@media (min-width: 2560px) {
  .pf-section { padding-top: 70px; padding-bottom: 120px; }
}
