/* =======================================
   EPIC PORTFOLIO PAGE - MOTIONTOGRAPHY
   Ultra-Modern Dark Theme with Orange Accents
   ======================================= */

:root {
  --primary-orange: #ed872d;
  --bright-orange: #ffa364;
  --dark-bg: #0a0a0b;
  --card-bg: #151518;
  --text-light: #f2f2f2;
  --text-muted: rgba(242, 242, 242, 0.6);
}

/* =======================================
   ANIMATED PARTICLE BACKGROUND
   ======================================= */
body {
  background: linear-gradient(135deg, #0a0a0b 0%, #1a1a1f 50%, #0f0f12 100%);
  position: relative;
  overflow-x: hidden;
}

.particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* =======================================
   HERO SECTION - EPIC TREATMENT
   ======================================= */
.page-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slowZoom 20s ease-in-out infinite alternate;
  filter: brightness(0.4);
}

@keyframes slowZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(237, 135, 45, 0.2) 0%,
    rgba(10, 10, 11, 0.8) 70%,
    rgba(10, 10, 11, 0.95) 100%
  );
  z-index: 2;
}

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  animation: heroFadeIn 1.5s ease-out;
}

@keyframes heroFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--bright-orange), var(--primary-orange), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  text-shadow: 0 0 80px rgba(237, 135, 45, 0.5);
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(237, 135, 45, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(237, 135, 45, 0.9));
  }
}

.hero__lead {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  animation: heroFadeIn 1.5s ease-out 0.3s both;
}

/* =======================================
   FILTER BUTTONS - FUTURISTIC DESIGN
   ======================================= */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 3rem 1rem;
  position: relative;
  z-index: 10;
  animation: filterSlideIn 1s ease-out 0.5s both;
}

@keyframes filterSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-btn {
  position: relative;
  padding: 0.75rem 1.75rem;
  background: rgba(21, 21, 24, 0.8);
  border: 2px solid rgba(237, 135, 45, 0.3);
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(237, 135, 45, 0.4),
    transparent 70%
  );
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.filter-btn:hover {
  border-color: var(--primary-orange);
  transform: translateY(-2px);
  box-shadow:
    0 0 20px rgba(237, 135, 45, 0.4),
    0 0 40px rgba(237, 135, 45, 0.2),
    inset 0 0 20px rgba(237, 135, 45, 0.1);
}

.filter-btn.is-active {
  background: linear-gradient(
    135deg,
    rgba(237, 135, 45, 0.3),
    rgba(255, 163, 100, 0.2)
  );
  border-color: var(--bright-orange);
  box-shadow:
    0 0 30px rgba(237, 135, 45, 0.6),
    0 0 60px rgba(237, 135, 45, 0.3),
    inset 0 0 30px rgba(237, 135, 45, 0.2);
  transform: scale(1.05);
}

.filter-btn.is-active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    var(--primary-orange),
    var(--bright-orange),
    var(--primary-orange)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 3s linear infinite;
  pointer-events: none;
}

@keyframes borderRotate {
  100% {
    transform: rotate(360deg);
  }
}

/* =======================================
   PORTFOLIO GRID - FULL SCREEN MASONRY
   ======================================= */

/* Override container padding for portfolio section */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 5;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

@media (min-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* =======================================
   SHOWCASE ITEMS - CARD DESIGN
   ======================================= */
.showcase-item.card {
  position: relative;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0 !important;
  transition: opacity 0.3s ease;
  opacity: 0;
  animation: cardReveal 0.6s ease-out forwards;
  aspect-ratio: 1 / 1;
  transform: none !important;
}

.showcase-item.card::before {
  display: none !important;
}

.showcase-item.card:hover,
.showcase-item.card:focus-within {
  transform: none !important;
  box-shadow: none !important;
  border: none !important;
}

@keyframes cardReveal {
  to {
    opacity: 1;
  }
}

.showcase-item:nth-child(1) { animation-delay: 0.05s; }
.showcase-item:nth-child(2) { animation-delay: 0.1s; }
.showcase-item:nth-child(3) { animation-delay: 0.15s; }
.showcase-item:nth-child(4) { animation-delay: 0.2s; }
.showcase-item:nth-child(5) { animation-delay: 0.25s; }
.showcase-item:nth-child(6) { animation-delay: 0.3s; }
.showcase-item:nth-child(n+7) { animation-delay: 0.35s; }

.showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  border: none !important;
  outline: none !important;
  margin: 0;
  padding: 0;
}

.showcase-item.card:hover {
  opacity: 0.85;
}

/* Hidden content - not visible in grid view */
.showcase-item__content {
  display: none;
}

/* =======================================
   LIGHTBOX - EPIC FULLSCREEN VIEWER
   ======================================= */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: lightboxFadeIn 0.4s ease-out;
}

@keyframes lightboxFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.lightbox.is-active {
  display: flex;
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 70px;
  height: 70px;
  background: rgba(237, 135, 45, 0.3);
  border: 3px solid var(--primary-orange);
  border-radius: 50%;
  color: var(--bright-orange);
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 25px rgba(237, 135, 45, 0.6),
    0 0 50px rgba(237, 135, 45, 0.3);
}

.lightbox__close:hover {
  background: rgba(237, 135, 45, 0.5);
  transform: rotate(90deg) scale(1.15);
  box-shadow:
    0 0 40px rgba(237, 135, 45, 0.8),
    0 0 80px rgba(237, 135, 45, 0.5),
    inset 0 0 25px rgba(237, 135, 45, 0.4);
  border-color: var(--bright-orange);
}

.lightbox__img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow:
    0 0 60px rgba(237, 135, 45, 0.4),
    0 0 120px rgba(237, 135, 45, 0.2);
  animation: imageZoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

@keyframes imageZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Info button in lightbox - TOP LEFT */
.lightbox__info-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(237, 135, 45, 0.3);
  border: 3px solid var(--primary-orange);
  color: var(--bright-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10003;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 25px rgba(237, 135, 45, 0.6),
    0 0 50px rgba(237, 135, 45, 0.3);
}

.lightbox__info-btn:hover {
  background: rgba(237, 135, 45, 0.5);
  transform: scale(1.15);
  box-shadow:
    0 0 40px rgba(237, 135, 45, 0.8),
    0 0 80px rgba(237, 135, 45, 0.5),
    inset 0 0 25px rgba(237, 135, 45, 0.4);
  border-color: var(--bright-orange);
}

.lightbox__info-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* Info panel in lightbox */
.lightbox__info-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  padding-top: 6rem;
  background: linear-gradient(
    to top,
    rgba(10, 10, 11, 0.98) 0%,
    rgba(10, 10, 11, 0.95) 80%,
    transparent 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 10002;
  max-height: 50vh;
  overflow-y: auto;
}

.lightbox__info-panel.is-visible {
  transform: translateY(0);
}

.lightbox__info-panel h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--bright-orange);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.lightbox__info-panel p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
  .lightbox__close {
    width: 60px;
    height: 60px;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }

  .lightbox__info-btn {
    width: 60px;
    height: 60px;
    top: 1rem;
    left: 1rem;
  }

  .lightbox__info-btn svg {
    width: 26px;
    height: 26px;
  }

  .lightbox__info-panel {
    padding: 1.5rem;
    padding-top: 5rem;
  }

  .lightbox__info-panel h3 {
    font-size: 1.4rem;
  }

  .lightbox__info-panel p {
    font-size: 0.95rem;
  }
}

/* =======================================
   SCROLL REVEAL ANIMATIONS
   ======================================= */
.showcase-item.reveal {
  animation: revealOnScroll 0.8s ease-out forwards;
}

@keyframes revealOnScroll {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =======================================
   FILTERING TRANSITIONS
   ======================================= */
.showcase-item.filtered-out {
  animation: fadeOut 0.4s ease-out forwards;
}

.showcase-item.filtered-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =======================================
   RESPONSIVE ADJUSTMENTS
   ======================================= */
@media (max-width: 768px) {
  .hero__title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .filter-buttons {
    gap: 0.75rem;
    padding: 2rem 1rem;
  }

  .filter-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0;
  }

  .showcase-item__content h3 {
    font-size: 1.2rem;
  }

  .lightbox__close {
    width: 50px;
    height: 50px;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
  }
}

/* =======================================
   LOADING SPINNER
   ======================================= */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  z-index: 9999;
}

.loading-spinner::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(237, 135, 45, 0.2);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
