/* =========================================================
   CASE-STUDY CARDS — 3D Tilt ID-Card design
   Ported from CodePen "3D ID Card GSAP" (iam-sam), re-themed
   to the Growloop design system (void glass, signal/amber
   accent, lime pulse). Tilt/parallax motion handled by the
   Tilt module in js/main.js (vanilla rAF, no GSAP).
   ========================================================= */

:root {
  --c3d-bg-dark: var(--void, #120B1E);
  --c3d-card-bg: rgba(18, 11, 30, 0.65);
  --c3d-card-border: rgba(255, 255, 255, 0.08);
  --c3d-accent: var(--signal, #FF4D2E);
  --c3d-accent-gradient: linear-gradient(135deg, #FF4D2E 0%, #FF9A3C 100%);
  --c3d-lime: var(--lime, #D4FF3F);
  --c3d-text-main: var(--paper, #F5F2FA);
  --c3d-text-muted: var(--muted, #A29AB8);
}

/* === Scene (perspective wrapper) === */
.card-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

/* === Glass card === */
.id-card {
  position: relative;
  background: var(--c3d-card-bg);
  border: 1px solid var(--c3d-card-border);
  border-radius: 24px;
  padding: 30px 24px 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  display: block;
}
.id-card:hover { border-color: rgba(255, 77, 46, 0.35); }

/* Glow blob — counter-moves on tilt */
.card-bg-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: var(--c3d-accent-gradient);
  filter: blur(60px);
  opacity: 0.25;
  pointer-events: none;
  transform: translateZ(10px);
}

/* === Top strip — brand + status === */
.card-top {
  transform: translateZ(30px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Scoped to .id-card: the global .brand-mark in style.css owns the nav/footer
   GL chip (32px). This 16px icon is only the case-study card's brand glyph. */
.id-card .brand-mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.id-card .brand-mark path { fill: var(--c3d-accent); }
.brand-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--c3d-text-main);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 255, 63, 0.08);
  border: 1px solid rgba(212, 255, 63, 0.25);
  color: var(--c3d-lime);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--c3d-lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--c3d-lime);
  flex-shrink: 0;
  animation: c3d-pulse 2s ease-in-out infinite;
}
@keyframes c3d-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* === Profile ring + creator thumb === */
.profile-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 22px;
  transform: translateZ(50px);
}
.profile-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--c3d-accent-gradient);
  z-index: 1;
  opacity: 0.6;
}
.profile-container img {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  border: 4px solid var(--c3d-bg-dark);
  background: var(--void-3, #1B1233);
  display: block;
}

/* === Details layer (deepest parallax) === */
.card-details {
  transform: translateZ(60px);
}
.project-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .01em;
  color: var(--c3d-text-main);
  margin: 0 0 6px;
  text-wrap: balance;
}
.project-abstract {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--c3d-text-muted);
  margin: 0 0 18px;
}

/* Bullet list — remarkable things done */
.card-points {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.card-points li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(245, 242, 250, 0.82);
}
.card-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 2px;
  background: var(--c3d-accent);
}

/* === Meta box — handle + tier === */
.meta-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.meta-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--c3d-text-muted);
  font-weight: 600;
}
.meta-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c3d-text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.meta-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
}

/* === Footer — top-post signal + barcode + CTA === */
.card-footer-custom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.expire-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c3d-text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barcode-sim {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 16px;
  opacity: 0.4;
  flex-shrink: 0;
}
.barcode-sim span {
  display: block;
  background: var(--c3d-text-main);
  height: 100%;
}
.barcode-sim span:nth-child(1) { width: 3px; }
.barcode-sim span:nth-child(2) { width: 1px; }
.barcode-sim span:nth-child(3) { width: 4px; }
.barcode-sim span:nth-child(4) { width: 2px; }
.barcode-sim span:nth-child(5) { width: 1px; }
.barcode-sim span:nth-child(6) { width: 3px; }
.barcode-sim span:nth-child(7) { width: 2px; }

.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c3d-lime);
}
.card-cta span { transition: transform .2s ease; }
.id-card:hover .card-cta span { transform: translateX(4px); }

/* === Responsive + motion gates === */
@media (max-width: 640px) {
  .card-scene { max-width: none; }
  .id-card { padding: 24px 18px 20px; border-radius: 18px; }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  /* Touch / reduced-motion: no tilt wiring in JS; flatten translateZ layers */
  .card-top, .profile-container, .card-details, .card-bg-glow { transform: none; }
  .id-card { transform-style: flat; }
}
