/* ==========================================================================
   ASK Digital Agency - Portfolio Redesign (Reference-Matched Layout)
   Obsidian background, subtle neon-lime glow, cinematic 3D coverflow carousel,
   minimal circular nav buttons, project meta bar, and sleek pill pagination.
   ========================================================================== */

:root {
  --portfolio-neon: #a3e635;
  --portfolio-neon-glow: rgba(163, 230, 53, 0.45);
  --portfolio-card-w: 780px;
}

@media (max-width: 1400px) {
  :root {
    --portfolio-card-w: min(720px, 60vw);
  }
}

@media (max-width: 991px) {
  :root {
    --portfolio-card-w: min(580px, 78vw);
  }
}

@media (max-width: 767px) {
  :root {
    --portfolio-card-w: min(420px, 86vw);
  }
}

/* --------------------------------------------------------------------------
   Section Wrapper & Background Ambience
   -------------------------------------------------------------------------- */
.portfolio-section {
  position: relative;
  background-color: #000000 !important;
  background: #040507 !important;
  padding: 100px 0 105px !important;
  overflow: hidden !important;
  width: 100%;
}

/* Subtle Green Ambient Glow behind active card */
.portfolio-ambient-glow {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1000px, 90vw);
  height: 520px;
  background: radial-gradient(ellipse 65% 55% at 50% 50%, rgba(163, 230, 53, 0.16) 0%, rgba(163, 230, 53, 0.05) 45%, transparent 72%);
  pointer-events: none;
  z-index: 1;
  filter: blur(50px);
}

/* Delicate Green Curved Vector Lines in Corner Margins */
.portfolio-ambient-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.portfolio-container {
  position: relative;
  z-index: 5;
  width: 100% !important;
  max-width: 1720px !important;
  padding-left: clamp(16px, 3.5vw, 48px) !important;
  padding-right: clamp(16px, 3.5vw, 48px) !important;
  margin: 0 auto !important;
}

/* --------------------------------------------------------------------------
   Header / Title Area - Centered Pill Badge & Neon Heading
   -------------------------------------------------------------------------- */
.portfolio-header {
  position: relative;
  z-index: 10;
  margin-bottom: 44px;
}

.portfolio-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(18, 24, 16, 0.85);
  border: 1px solid rgba(163, 230, 53, 0.38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 22px;
  box-shadow: 0 0 16px rgba(163, 230, 53, 0.12);
}

.portfolio-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--portfolio-neon);
  box-shadow: 0 0 8px var(--portfolio-neon);
}

.portfolio-badge-text {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
  font-family: inherit;
}

.portfolio-heading {
  font-family: var(--themeht-typography-secondary-font-family, "DM Sans", "Inter", sans-serif);
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.04;
  margin: 0 auto;
  max-width: 880px;
  letter-spacing: -0.055em;
}

.portfolio-heading-highlight {
  color: var(--portfolio-neon);
  text-shadow: 0 0 28px rgba(163, 230, 53, 0.4);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Cinematic 3D Carousel Stage & Swiper Setup
   -------------------------------------------------------------------------- */
.portfolio-carousel-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
}

/* Preserve the carousel's layout before Swiper measures it, but never expose
   its uninitialized slide positions. The engine removes this gate immediately
   after its first stable frame. */
html.js .portfolio-carousel-wrapper:not(.is-ready) .portfolio-swiper,
html.js .portfolio-carousel-wrapper:not(.is-ready) > .portfolio-arrow,
html.js .portfolio-carousel-wrapper:not(.is-ready) .portfolio-meta-bar,
html.js .portfolio-carousel-wrapper:not(.is-ready) .portfolio-pagination {
  visibility: hidden;
}

.portfolio-stage-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.portfolio-swiper {
  position: relative;
  width: 100%;
  padding: 40px 0 25px !important;
  overflow: visible !important;
}

.portfolio-swiper .swiper-wrapper {
  align-items: center;
  perspective: 1400px;
  transition-timing-function: cubic-bezier(0.25, 1, 0.4, 1) !important;
}

.portfolio-swiper .swiper-slide {
  width: var(--portfolio-card-w) !important;
  display: flex;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Active centered slide prominent stacking */
.portfolio-swiper .swiper-slide-active,
.portfolio-swiper .swiper-slide-prev,
.portfolio-swiper .swiper-slide-next {
  will-change: transform, opacity, filter;
}

.portfolio-swiper .swiper-slide-active {
  cursor: default;
}

/* --------------------------------------------------------------------------
   Card Bezel & High-Precision Preview Viewport
   -------------------------------------------------------------------------- */
.portfolio-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 220px;
}

.card-bezel {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0d0f12;
  border: 6px solid #1c1f24;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.95);
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.swiper-slide-active .card-bezel {
  border-color: #242930;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.98),
              0 0 35px -5px rgba(163, 230, 53, 0.18);
}

.card-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 17px;
  overflow: hidden;
  background: #090a0d;
}

/* Screenshot Fallback Stage (Always present as baseline & instant display) */
.screenshot-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background: #0b0c10;
}

.screenshot-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 17px;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Live Interactive Iframe Stage */
.iframe-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.36s;
  z-index: 2;
  background: transparent;
  border-radius: 17px;
  overflow: hidden;
}

.portfolio-card.is-live-ready .iframe-stage {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.iframe-scaler {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 3800px;
  transform-origin: top left;
  will-change: transform;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.iframe-scaler iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #ffffff;
  pointer-events: none;
}

/* Card Click Overlay: lets user click to open real site */
.card-click-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Minimal Circular Previous / Next Arrow Buttons
   Hovering at the left & right seams of the center card
   -------------------------------------------------------------------------- */
.portfolio-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 20, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  padding: 0;
}

.portfolio-arrow:hover {
  background: rgba(163, 230, 53, 0.16);
  border-color: var(--portfolio-neon);
  color: var(--portfolio-neon);
  box-shadow: 0 0 20px rgba(163, 230, 53, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.portfolio-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.portfolio-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.portfolio-arrow-prev {
  left: calc(50% - (var(--portfolio-card-w) / 2) - 24px);
}

.portfolio-arrow-next {
  right: calc(50% - (var(--portfolio-card-w) / 2) - 24px);
}

/* --------------------------------------------------------------------------
   Project Metadata Bar (Directly beneath the active center card)
   -------------------------------------------------------------------------- */
.portfolio-meta-bar {
  position: relative;
  z-index: 10;
  max-width: var(--portfolio-card-w);
  margin: 28px auto 0;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.portfolio-meta-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portfolio-meta-title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.portfolio-meta-desc {
  font-size: clamp(13px, 1.4vw, 14.5px);
  color: #9ca3af;
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
}

.portfolio-meta-right {
  flex-shrink: 0;
}

.portfolio-meta-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--portfolio-neon);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.portfolio-meta-link:hover {
  color: #bef264;
  text-shadow: 0 0 14px rgba(163, 230, 53, 0.55);
}

.portfolio-meta-link svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-meta-link:hover svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Pagination - Centered Horizontal Pill Indicators
   -------------------------------------------------------------------------- */
.portfolio-pagination {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  margin-top: 26px !important;
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  text-align: center;
  z-index: 10;
}

.portfolio-pagination .swiper-pagination-bullet {
  width: 28px !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.22) !important;
  opacity: 1 !important;
  margin: 0 !important;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
  display: inline-block !important;
}

.portfolio-pagination .swiper-pagination-bullet:hover {
  background: rgba(255, 255, 255, 0.45) !important;
}

.portfolio-pagination .swiper-pagination-bullet-active {
  background: var(--portfolio-neon) !important;
  width: 42px !important;
  box-shadow: 0 0 12px var(--portfolio-neon-glow) !important;
}

/* --------------------------------------------------------------------------
   Responsive Adaptations
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .portfolio-section {
    padding: 80px 0 85px !important;
  }

  .portfolio-card {
    aspect-ratio: 16 / 10.2;
  }

  .card-bezel {
    border-width: 5px;
    border-radius: 20px;
  }

  .card-viewport {
    border-radius: 15px;
  }

  .portfolio-arrow {
    width: 42px;
    height: 42px;
  }

  .portfolio-arrow svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 767px) {
  .portfolio-section {
    padding: 65px 0 70px !important;
  }

  .portfolio-arrow-prev {
    left: 4px !important;
  }

  .portfolio-arrow-next {
    right: 4px !important;
  }

  .card-bezel {
    border-width: 4px;
    border-radius: 18px;
  }

  .card-viewport {
    border-radius: 14px;
  }

  .portfolio-meta-bar {
    margin-top: 20px;
  }

  .portfolio-pagination {
    margin-top: 20px !important;
    gap: 6px !important;
  }

  .portfolio-pagination .swiper-pagination-bullet {
    width: 20px !important;
    height: 3.5px !important;
  }

  .portfolio-pagination .swiper-pagination-bullet-active {
    width: 32px !important;
  }
}

@media (max-width: 575px) {
  .portfolio-meta-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 0 8px;
  }
  .portfolio-meta-left {
    align-items: center;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .portfolio-swiper .swiper-slide,
    .portfolio-meta-bar,
    .screenshot-layer,
    .iframe-scaler,
    .iframe-stage,
    .portfolio-arrow,
    .portfolio-pagination .swiper-pagination-bullet {
        transition: none !important;
    }
}
