/* ============================================================
   PORTFOLIO — NEW (padreza-inspired, large images, minimal)
   ============================================================ */

.pf2-section {
  padding: 5rem 0 5rem;
  background-color: var(--bg-color, #fff);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 40px 21px;
  border-radius: 40px;
}

@media (max-width: 700px) {
  .pf2-section {
    margin: 20px 12px;
    border-radius: 28px;
  }
}

/* Animated background aurora blobs */
.pf2-section::before,
.pf2-section::after {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
  animation: pf2BlobFloat 22s ease-in-out infinite alternate;
}
.pf2-section::before {
  top: -120px;
  left: -160px;
  background: radial-gradient(circle, hsla(var(--hue-1, 257), 100%, 70%, 0.9), transparent 60%);
}
.pf2-section::after {
  bottom: -160px;
  right: -180px;
  background: radial-gradient(circle, hsla(var(--hue-2, 47), 100%, 60%, 0.8), transparent 60%);
  animation-direction: alternate-reverse;
  animation-duration: 28s;
}
body.dark .pf2-section::before,
body.dark .pf2-section::after {
  opacity: 0.25;
}
@keyframes pf2BlobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 30px) scale(0.95); }
}

.pf2-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* Header */
.pf2-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.pf2-title-wrap {
  flex: 1 1 320px;
}

.pf2-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--main-color-1);
  text-transform: uppercase;
  margin: 0 0 12px 0;
  padding-left: 16px;
  border-left: 4px solid var(--main-color-2);
}

.pf2-heading {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  color: var(--heading-color);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Split-text reveal */
.pf2-heading .pf2-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.08em 0.05em 0.18em;
  margin: -0.08em -0.05em -0.18em;
}
.pf2-heading .pf2-word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.9s ease;
}
.pf2-revealed .pf2-heading .pf2-word > span,
.pf2-heading.revealed .pf2-word > span {
  transform: translateY(0);
  opacity: 1;
}
.pf2-heading .pf2-word:nth-child(1) > span { transition-delay: 0.05s; }
.pf2-heading .pf2-word:nth-child(2) > span { transition-delay: 0.15s; }
.pf2-heading .pf2-word:nth-child(3) > span { transition-delay: 0.25s; }
.pf2-heading .pf2-word:nth-child(4) > span { transition-delay: 0.35s; }
.pf2-heading .pf2-word:nth-child(5) > span { transition-delay: 0.45s; }

/* Gradient accent on last word */
.pf2-heading .pf2-word:last-child > span {
  background: linear-gradient(120deg, var(--main-color-1), hsl(var(--hue-2, 47), 100%, 55%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.pf2-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px;
  background: var(--bg-color-2);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(43, 28, 86, 0.06);
}

.pf2-filter-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-color);
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pf2-filter-btn:hover {
  color: var(--heading-color);
}

.pf2-filter-btn.active {
  background: var(--main-color-1);
  color: #fff;
  box-shadow: 0 4px 14px hsla(var(--hue-1), 100%, 60%, 0.35);
}

/* Grid — 2-column alternating large layout */
.pf2-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 32px;
}

.pf2-card {
  position: relative;
  grid-column: span 6;
  border-radius: 22px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  opacity: 0;
  transform: translateY(60px) scale(0.96);
  transition:
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
  transform-style: preserve-3d;
  perspective: 1200px;
}

.pf2-card.pf2-reveal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Progressive stagger — actual delay applied via JS inline style,
   but provide fallback for no-JS users */
.pf2-card:nth-child(1).pf2-reveal { transition-delay: 0s; }
.pf2-card:nth-child(2).pf2-reveal { transition-delay: 0.08s; }
.pf2-card:nth-child(3).pf2-reveal { transition-delay: 0.16s; }
.pf2-card:nth-child(4).pf2-reveal { transition-delay: 0.24s; }
.pf2-card:nth-child(5).pf2-reveal { transition-delay: 0.32s; }
.pf2-card:nth-child(6).pf2-reveal { transition-delay: 0.40s; }
.pf2-card:nth-child(n+7).pf2-reveal { transition-delay: 0.48s; }

.pf2-card.size-wide { grid-column: span 8; }
.pf2-card.size-small { grid-column: span 4; }
.pf2-card.size-third { grid-column: span 4; }   /* Tretina (1/3 riadku) */
.pf2-card.size-half { grid-column: span 6; }     /* Polovica (1/2 riadku) */
.pf2-card.size-full { grid-column: span 12; }    /* Veľký (celý riadok) */

@media (max-width: 900px) {
  .pf2-card,
  .pf2-card.size-wide,
  .pf2-card.size-small,
  .pf2-card.size-third,
  .pf2-card.size-half,
  .pf2-card.size-full {
    grid-column: span 12;
  }

  .pf2-container { padding: 0 20px; }
  .pf2-header { margin-bottom: 40px; gap: 24px; }
  .pf2-grid { gap: 24px; }
}

/* Mobile — filter pills as individual chips that wrap cleanly */
@media (max-width: 700px) {
  .pf2-container { padding: 0 16px; }

  .pf2-header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 32px;
  }
  .pf2-title-wrap { flex: 1 1 auto; }

  /* Remove pill container — each filter is a standalone chip */
  .pf2-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    align-items: center;
    justify-content: flex-start;
  }

  .pf2-filter-btn {
    flex: 0 0 auto;
    font-size: 0.72rem;
    padding: 10px 18px;
    letter-spacing: 1px;
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid rgba(109, 51, 255, 0.12);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(43, 28, 86, 0.04);
  }
  .pf2-filter-btn.active {
    border-color: var(--main-color-1);
  }

  .pf2-grid { gap: 20px; }

  /* Cards — tighter info and smaller typography */
  .pf2-card-info { padding: 14px 4px 4px; gap: 10px; }
  .pf2-card-title { font-size: 1.05rem; }
  .pf2-card-meta { font-size: 0.68rem; letter-spacing: 1.5px; }
  .pf2-card-year { font-size: 0.72rem; }

  /* Hover-only effects disabled on touch */
  .pf2-card-cursor { display: none; }

  .pf2-all-cta { margin-top: 48px; }
  .pf2-all-cta .btn { padding: 14px 28px; }
}

/* Extra-small — phones under 400px */
@media (max-width: 400px) {
  .pf2-section { margin: 20px 10px; border-radius: 24px; padding: 3.5rem 0 3.5rem; }
  .pf2-container { padding: 0 14px; }
  .pf2-filters { margin: 0 -14px; width: calc(100% + 28px); padding-left: 18px; padding-right: 18px; }
  .pf2-filter-btn { font-size: 0.68rem; padding: 8px 14px; }
  .pf2-heading { font-size: clamp(2rem, 9vw, 3rem); }
  .pf2-card-media { border-radius: 16px; }
  .pf2-card { border-radius: 16px; }
}

.pf2-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-color-1);
  box-shadow:
    0 1px 3px rgba(20, 10, 60, 0.06),
    0 12px 32px rgba(20, 10, 60, 0.08);
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.6s ease;
}

.pf2-card.size-small .pf2-card-media,
.pf2-card.size-third .pf2-card-media { aspect-ratio: 1 / 1; }
.pf2-card.size-full .pf2-card-media { aspect-ratio: 21 / 9; }

/* Gradient glow border (revealed on hover) */
.pf2-card-media::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, var(--main-color-1), hsl(var(--hue-2, 47), 100%, 55%));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 2;
}
.pf2-card:hover .pf2-card-media::before { opacity: 1; }

.pf2-card:hover .pf2-card-media {
  box-shadow:
    0 6px 12px rgba(20, 10, 60, 0.08),
    0 30px 60px rgba(20, 10, 60, 0.16);
}

.pf2-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
  filter: saturate(0.95);
  will-change: transform;
}

.pf2-card:hover .pf2-card-media img {
  transform: scale(1.08);
  filter: saturate(1.1);
}

.pf2-card-overlay {
  position: absolute;
  inset: 0;
  padding: 24px;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 5, 30, 0.6) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 1;
}
.pf2-card:hover .pf2-card-overlay { opacity: 1; }

/* Magnetic mouse-follow "VIEW" label */
.pf2-card-cursor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  height: 96px;
  background: var(--main-color-1);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  box-shadow: 0 8px 32px rgba(109, 74, 255, 0.4);
  pointer-events: none;
  z-index: 3;
  will-change: transform, left, top;
}

.pf2-card-cursor i {
  font-size: 1.1rem;
  margin-top: 2px;
}

.pf2-card:hover .pf2-card-cursor {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Hide native cursor while hovering the media area so only the VIEW circle is visible */
@media (hover: hover) and (pointer: fine) {
  .pf2-card .pf2-card-media { cursor: none; }
}

/* Info row below image */
.pf2-card-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 4px 4px;
}

.pf2-card-titlewrap {
  flex: 1;
  min-width: 0;
}

.pf2-card-meta {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--main-color-1);
  margin: 0 0 6px 0;
}

.pf2-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 700;
  color: var(--heading-color);
  margin: 0;
  line-height: 1.15;
  transition: color 0.3s ease;
}

.pf2-card:hover .pf2-card-title {
  color: var(--main-color-1);
}

.pf2-card-year {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 1px;
  white-space: nowrap;
}

.pf2-card-featured {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  background: var(--main-color-2);
  color: #000;
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 16px hsla(var(--hue-2, 47), 100%, 50%, 0.5);
  animation: pf2FeaturedPulse 2.4s ease-in-out infinite;
}
@keyframes pf2FeaturedPulse {
  0%, 100% { box-shadow: 0 4px 16px hsla(var(--hue-2, 47), 100%, 50%, 0.5); }
  50%      { box-shadow: 0 4px 28px hsla(var(--hue-2, 47), 100%, 50%, 0.85); }
}

/* View all button */
.pf2-all-cta {
  text-align: center;
  margin-top: 80px;
}

.pf2-all-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  padding: 16px 40px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pf2-all-cta .btn i {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pf2-all-cta .btn:hover i {
  transform: translateX(6px);
}

.pf2-all-cta .btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}

.pf2-all-cta .btn:hover::before {
  transform: translateX(100%);
}

/* Dark mode tweaks */
body.dark .pf2-filters {
  background: var(--bg-color-2);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

body.dark .pf2-card-media { background: var(--bg-color-2); }


/* ============================================================
   PROJECT DETAIL PAGE
   ============================================================ */

.pf2-detail {
  padding-top: 180px;
  padding-bottom: 100px;
  background: transparent;
  /* Accent colors — JS overrides these per-project based on cover image.
     Defaults keep the brand purple palette. */
  --pf2-accent: hsl(var(--hue-1, 257), 100%, 60%);
  --pf2-accent-rgb: 109, 51, 255;
  --pf2-accent-soft: rgba(var(--pf2-accent-rgb), 0.1);
  --pf2-accent-softer: rgba(var(--pf2-accent-rgb), 0.06);
  transition: --pf2-accent 0.6s ease;
}

.pf2-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.pf2-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-color);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.3s ease;
}
.pf2-detail-back:hover { color: var(--pf2-accent); }

.pf2-detail-head {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 80px;
  margin-bottom: 60px;
  align-items: end;
}

@media (max-width: 900px) {
  .pf2-detail-head { grid-template-columns: 1fr; gap: 30px; }
}

.pf2-detail-meta-top {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--pf2-accent);
  transition: color 0.6s ease;
}

.pf2-detail-meta-top span + span {
  padding-left: 24px;
  border-left: 1px solid var(--text-color);
  opacity: 0.9;
}

.pf2-detail-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 800;
  color: var(--heading-color);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}

.pf2-detail-excerpt {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.pf2-detail-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 80px;
  aspect-ratio: 21 / 9;
  background: var(--bg-color-1);
  box-shadow:
    0 2px 8px rgba(20, 10, 60, 0.06),
    0 30px 80px -20px rgba(var(--pf2-accent-rgb), 0.35);
  transition: box-shadow 0.8s ease;
}

/* Soft color-bleed behind hero that matches image accent */
.pf2-detail-hero::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(var(--pf2-accent-rgb), 0.15);
  pointer-events: none;
}

.pf2-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf2-detail-body {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 80px;
  margin-bottom: 80px;
}

@media (max-width: 900px) {
  .pf2-detail-body { grid-template-columns: 1fr; gap: 30px; }
}

.pf2-detail-info h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-color);
  margin: 0 0 12px 0;
}

.pf2-detail-info-block + .pf2-detail-info-block {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--bg-color-3);
}

.pf2-detail-info-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.pf2-detail-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pf2-detail-service {
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pf2-accent);
  padding: 6px 14px;
  background: var(--pf2-accent-soft);
  border: 1px solid rgba(var(--pf2-accent-rgb), 0.18);
  border-radius: 999px;
  transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease, transform 0.3s ease;
}
.pf2-detail-service:hover {
  background: rgba(var(--pf2-accent-rgb), 0.18);
  transform: translateY(-1px);
}

.pf2-detail-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--pf2-accent);
  text-decoration: none;
  margin-top: 8px;
  transition: color 0.5s ease;
}
.pf2-detail-ext-link:hover { text-decoration: underline; }

.pf2-detail-description {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.8;
  color: var(--text-color);
}

.pf2-detail-description p {
  margin: 0 0 1.4em 0;
}

/* Gallery */
.pf2-detail-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}

.pf2-detail-gallery-item {
  grid-column: span 12;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 21 / 10;
  background: var(--bg-color-1);
}

.pf2-detail-gallery-item.full {
  grid-column: span 12;
  aspect-ratio: 21 / 10;
}

.pf2-detail-gallery-item.half {
  grid-column: span 6;
  aspect-ratio: 4 / 3;
}

.pf2-detail-gallery-item.third {
  grid-column: span 4;
  aspect-ratio: 3 / 4;
}

@media (max-width: 900px) {
  .pf2-detail-gallery-item.half { grid-column: span 12; }
  .pf2-detail-gallery-item.third { grid-column: span 6; }
}

@media (max-width: 560px) {
  .pf2-detail-gallery-item.third { grid-column: span 12; }
}

.pf2-detail-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.pf2-detail-gallery-item:hover img {
  transform: scale(1.03);
}

/* Next/prev */
.pf2-detail-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 40px;
  border-top: 1px solid var(--bg-color-3);
}

@media (max-width: 700px) {
  .pf2-detail-nav { grid-template-columns: 1fr; }
}

.pf2-detail-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s ease;
}

.pf2-detail-nav a:hover {
  background: var(--pf2-accent-softer);
}

.pf2-detail-nav-next { justify-content: flex-end; text-align: right; }

.pf2-detail-nav-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-color);
  display: block;
  margin-bottom: 6px;
}

.pf2-detail-nav-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--heading-color);
}

.pf2-detail-nav-arrow {
  font-size: 1.8rem;
  color: var(--pf2-accent);
  transition: color 0.5s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pf2-detail-nav-prev:hover .pf2-detail-nav-arrow { transform: translateX(-4px); }
.pf2-detail-nav-next:hover .pf2-detail-nav-arrow { transform: translateX(4px); }

/* Empty state */
.pf2-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
}
