/* Tailwind custom configuration */
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  font-family: 'Poppins', sans-serif;
}

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.fade-up.show {
  opacity: 1;
  transform: translateY(0);
}

.scene {
  width: 400px;
  height: 300px;
  perspective: 1000px;
  margin-left: 20%;
}

.cylinder {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateWithPauseReverse 21s infinite ease-in-out;
}

.face {
  position: absolute;
  width: 280px;
  height: 200px;
  top: 50px;
  left: calc(50% - 140px);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}

.face:nth-child(1) { transform: rotateY(0deg) translateZ(300px); }
.face:nth-child(2) { transform: rotateY(60deg) translateZ(300px); }
.face:nth-child(3) { transform: rotateY(120deg) translateZ(300px); }
.face:nth-child(4) { transform: rotateY(180deg) translateZ(300px); }
.face:nth-child(5) { transform: rotateY(240deg) translateZ(300px); }
.face:nth-child(6) { transform: rotateY(300deg) translateZ(300px); }

@keyframes rotateWithPauseReverse {
  0%    { transform: rotateY(0deg); }
  9.5%  { transform: rotateY(0deg); }
  11.9% { transform: rotateY(-60deg); }
  21.4% { transform: rotateY(-60deg); }
  23.8% { transform: rotateY(-120deg); }
  33.3% { transform: rotateY(-120deg); }
  35.7% { transform: rotateY(-180deg); }
  45.2% { transform: rotateY(-180deg); }
  47.6% { transform: rotateY(-240deg); }
  57.1% { transform: rotateY(-240deg); }
  59.5% { transform: rotateY(-300deg); }
  69%   { transform: rotateY(-300deg); }
  71.4% { transform: rotateY(-360deg); }
  100%  { transform: rotateY(-360deg); }
}

/* Responsive for screens below 768px (mobiles/tablets) */
@media (max-width: 768px) {
  .scene {
    width: 90vw;
    height: 230px;
    margin-left: auto;
    margin-right: auto;
  }

  .face {
    width: 220px;
    height: 160px;
    top: 35px;
    left: calc(50% - 110px);
    font-size: 16px;
  }

  .face:nth-child(1),
  .face:nth-child(2),
  .face:nth-child(3),
  .face:nth-child(4),
  .face:nth-child(5),
  .face:nth-child(6) {
    transform: rotateY(calc(var(--i) * 60deg)) translateZ(240px);
  }
}

/* Hide/show based on screen size */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
  }

  .flip-card {
    width: 220px;
    height: 160px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.4s ease-in-out;
  }

  @keyframes flip {
    0%   { transform: rotateY(0deg); }
    50%  { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
  }
}

@media (max-width: 640px) {
  h1#typing-text {
    line-height: 1.2;
    min-height: 5rem;
  }

  section#contact .flex {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  section#services .grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 1536px) {
  .scene {
    margin-left: 25%;
  }
}


.flip-card {
  background: transparent;
  width: 100%;
  max-width: 320px;   /* perfect for mobile */
  height: auto;
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 280px;   /* fixed height for uniform size */
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: .5rem;
  overflow: hidden; /* ensure img doesn’t overflow */
}

.flip-front img,
.flip-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fills the flip card neatly */
  border-radius: .5rem;
}

.flip-back {
  transform: rotateY(180deg);
}


 .section-bg {
      background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    }
    .card {
      background: rgba(30, 41, 59, 0.85);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 1rem;
      padding: 2rem;
      transition: all 0.4s ease;
      backdrop-filter: blur(8px);
    }
    .card:hover {
      transform: translateY(-10px) scale(1.04);
      box-shadow: 0 20px 50px rgba(56,189,248,0.25);
      border-color: rgba(56,189,248, 0.6);
    }
    .card h3 {
      background: linear-gradient(to right, #38BDF8, #60A5FA);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }