/* ═══════════════════════════════════════════
   PROJECTS — Technical Intelligence Deck
   Redesigned for a high-end, interactive HUD 
   aesthetic with blueprint details.
   ═══════════════════════════════════════════ */

.deck-section {
  background: transparent;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 2rem;
  overflow: visible !important;
  will-change: auto !important;
  position: relative;
}

.deck-section__header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.deck-section__desc {
  max-width: 600px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ── Deck container ── */
.deck {
  position: relative;
  height: 420px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  z-index: 30; /* Sit above the header */
}

/* ── Individual card ── */
.deck__card {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 100%;
  z-index: var(--i, 1);

  display: grid;
  grid-template-columns: 1fr 1fr; 
  
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 12px 30px rgba(15, 23, 42, 0.08),
    0 30px 60px rgba(15, 23, 42, 0.06);

  will-change: transform;
  transform-origin: center top;
}

/* ── Content side (HUD) ── */
.deck__card-text {
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background-image: radial-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Large Watermark Number */
.deck__card-watermark {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  font-size: 10rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: rgba(15, 23, 42, 0.03);
  -webkit-text-stroke: 1px rgba(15, 23, 42, 0.06);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* HUD System Tag */
.deck__card-hud {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.hud-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 1.5px;
}

.hud-val {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Main Content */
.deck__card-main {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}

.deck__card-main h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.deck__card-main p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 380px;
}

/* Meta Data Box */
.deck__card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
  padding-top: 1rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.meta-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.meta-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

/* card decorative edge */
.card-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--accent-primary), transparent);
  opacity: 0.5;
}

/* ── Image side ── */
.deck__card-img {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-secondary);
}

.deck__card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Industrial HUD Scanning Effect */
.deck__card-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  box-shadow: 0 0 15px var(--accent-primary);
  opacity: 0;
  z-index: 5;
  pointer-events: none;
}

/* Hide mobile-only indicator on desktop */
.deck__tap-indicator {
  display: none;
}

.deck__card:hover .deck__card-scan {
  animation: hudScan 2s linear infinite;
  opacity: 0.6;
}

.deck__card:hover .deck__card-img img {
  transform: scale(1.08);
}

@keyframes hudScan {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ── Status HUD ── */
.deck-status {
  display: none; /* Hidden on Desktop by default */
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  align-items: center;
  gap: 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.deck-status__count {
  color: var(--accent-primary);
  font-size: 1.1rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
}

.deck-status__dots {
  display: flex;
  gap: 8px;
}

.deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
}

.deck-dot.active {
  background: var(--accent-primary);
  transform: scale(1.4);
}

.deck-status__label {
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
}

/* ── RESPONSIVE — Mobile ── */
@media (max-width: 968px) {
  .deck-section {
    height: auto;
    padding-top: 2rem;
    padding-bottom: 8rem;
  }

  .deck-section__header {
    margin-bottom: 2.5rem;
  }

  .deck {
    height: 580px;
    flex: none;
    max-width: 90vw;
    padding: 0;
    clip-path: none; /* Turn off clipping for mobile stack */
  }

  .deck__card {
    position: absolute;
    inset: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
    border-radius: 20px;
  }

  /* Adjust Text for Mobile */
  .deck__card-text {
    padding: 2rem 1.5rem;
    background-size: 20px 20px;
  }

  .deck__card-watermark {
    font-size: 8rem;
    left: 1rem;
    opacity: 0.03;
  }

  .deck__card-hud {
    margin-bottom: 1.25rem;
  }

  .deck__card-main {
    margin-bottom: 1.5rem;
  }

  .deck__card-main h3 {
    font-size: 1.5rem;
  }

  .deck__card-main p {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .deck__card-meta {
    gap: 1rem;
    padding-top: 1rem;
  }

  .meta-val {
    font-size: 0.85rem;
  }

  /* Status Bar Positioning on Mobile */
  .deck-status {
    display: flex; /* Show on Mobile */
    bottom: -5rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90vw;
    justify-content: center;
  }

  .deck-status__label {
    display: none; /* Hide label on mobile to save space */
  }

  /* Animated Tap Indicator for first card */
  .deck__tap-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--text-primary);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    animation: tapBounce 2s infinite ease-in-out;
  }

  .tap-icon {
    width: 14px;
    height: 14px;
    animation: tapPulse 2s infinite;
  }

  @keyframes tapBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }

  @keyframes tapPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.7; }
  }
}

/* ── RTL Support ── */
[dir="rtl"] .deck__card {
  left: 0;
  right: 0;
}

[dir="rtl"] .deck__card-watermark {
  left: auto;
  right: 1.5rem;
}

[dir="rtl"] .deck__card-meta {
  border-left: none;
}

[dir="rtl"] .card-edge {
  left: auto;
  right: 0;
}

[dir="rtl"] .deck-status {
  left: 2rem;
  right: auto;
}

@media (max-width: 968px) {
  [dir="rtl"] .deck {
    padding-right: 0;
  }
  [dir="rtl"] .deck__card {
    right: 0;
  }
  [dir="rtl"] .deck-status {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
