* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #533483);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  position: relative;
}

/* Noise/grain texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
}

/* Particles canvas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.blue {
  color: #29b6f6;
}

.green {
  color: #9ccc65;
}

.purple {
  color: #ba68c8;
}

.cyan {
  color: #4dd0e1;
}

.red {
  color: #ef5350;
}

.orange {
  color: #ff9800;
}

/* Role Items Styling */
.role-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease;
  opacity: 0;
  animation: roleEnter 0.6s ease-out forwards;
}

.role-item:hover {
  transform: scale(1.05);
}

.role-icon {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
  transition: filter 0.3s ease, transform 0.3s ease;
  animation: iconPulse 0.6s ease-out;
  animation-delay: inherit;
}

.role-item:hover .role-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

@keyframes iconPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 0.9; }
}

.role-text {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)) drop-shadow(0 0 40px var(--glow-color));
}

.role-item:nth-child(1) {
  --gradient-start: #4facfe;
  --gradient-end: #00f2fe;
  --glow-color: rgba(79, 172, 254, 0.4);
}

.role-item:nth-child(2) {
  --gradient-start: #a8ff78;
  --gradient-end: #78ffd6;
  --glow-color: rgba(168, 255, 120, 0.4);
}

.role-item:nth-child(3) {
  --gradient-start: #fa709a;
  --gradient-end: #fee140;
  --glow-color: rgba(250, 112, 154, 0.4);
}

.role-item:nth-child(4) {
  --gradient-start: #00d4ff;
  --gradient-end: #0099cc;
  --glow-color: rgba(0, 212, 255, 0.4);
}

/* Role item stagger animation delays */
.role-item:nth-child(1) {
  animation-delay: 0.5s;
}
.role-item:nth-child(2) {
  animation-delay: 0.7s;
}
.role-item:nth-child(3) {
  animation-delay: 0.9s;
}
.role-item:nth-child(4) {
  animation-delay: 1.1s;
}

@keyframes roleEnter {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Back Card Styling */
.about-header {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  opacity: 0;
  animation: infoEnter 0.5s ease-out forwards;
}

.info-item:nth-child(1) { animation-delay: 0.3s; }
.info-item:nth-child(2) { animation-delay: 0.45s; }
.info-item:nth-child(3) { animation-delay: 0.6s; }
.info-item:nth-child(4) { animation-delay: 0.75s; }

@keyframes infoEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.info-item:hover .info-icon {
  transform: scale(1.15) translateY(-2px);
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1.15) translateY(-2px); }
  50% { transform: scale(1.15) translateY(-4px); }
}

.info-label {
  font-weight: 500;
  min-width: 4.5rem;
}

.content {
  height: 100vh;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.card {
  perspective: 150rem;
  height: 22rem;
  width: 30rem;
  max-width: 90vw;
  position: relative;
  cursor: pointer;
  outline: none;
  animation: cardEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-8px);
    box-shadow:
      0 12px 48px rgba(0, 0, 0, 0.4),
      0 0 60px rgba(77, 208, 225, 0.2);
  }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.card__side {
  height: 22rem;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  margin: auto;
  width: 30rem;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Glassmorphism effect */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.card__side--front {
  /* Additional styling for front */
}
.card__side--back {
  transform: rotateY(180deg);
  /* Additional styling for back */
}
/* Only apply hover flip on devices with hover capability (desktop) */
@media (hover: hover) and (pointer: fine) {
  .card:hover .card__side--front {
    transform: rotateY(-180deg);
  }
  .card:hover .card__side--back {
    transform: rotateY(0deg);
  }
}

/* Flipped state always applies (touch and desktop) */
.card.is-flipped .card__side--front {
  transform: rotateY(-180deg);
}
.card.is-flipped .card__side--back {
  transform: rotateY(0deg);
}

/* Focus indicators for accessibility */
.card:focus {
  outline: 3px solid #4dd0e1;
  outline-offset: 5px;
}

.card:focus:not(:focus-visible) {
  outline: none;
}

.card:focus-visible {
  outline: 3px solid #4dd0e1;
  outline-offset: 5px;
}
.card__cont {
  height: 22rem;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}
.card__cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  color: white;
}
.card__cta p {
  margin-left: 3rem;
}
.card__cta p > .space {
  margin-left: 2rem;
}

/* Link styles with animated underline */
.card__cta a {
  color: inherit;
  position: relative;
  text-decoration: none;
  transition: color 0.3s ease;
}

.card__cta a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4dd0e1, #29b6f6);
  transition: width 0.3s ease;
}

.card__cta a:hover {
  color: #4dd0e1;
  text-shadow: 0 0 10px rgba(77, 208, 225, 0.5);
}

.card__cta a:hover::after {
  width: 100%;
}

.card__cta a:focus {
  outline: 2px solid #4dd0e1;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Responsive breakpoints for mobile */
@media (max-width: 768px) {
  .card {
    width: 85vw;
    height: auto;
    min-height: 24rem;
  }

  .card__side {
    width: 85vw;
    height: 24rem;
  }

  .card__cont {
    height: 24rem;
    padding: 2rem;
    gap: 1rem;
  }

  .role-text {
    font-size: 2rem;
  }

  .role-icon {
    width: 2rem;
    height: 2rem;
  }

  .card__cta {
    padding: 1.5rem;
  }

  .about-header {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .info-item {
    font-size: 0.85rem;
  }

  .info-label {
    min-width: 4rem;
  }
}

@media (max-width: 480px) {
  .card {
    width: 90vw;
    min-height: 26rem;
  }

  .card__side {
    width: 90vw;
    height: 26rem;
  }

  .card__cont {
    height: 26rem;
    padding: 1.5rem;
    gap: 0.8rem;
  }

  .role-text {
    font-size: 1.8rem;
  }

  .role-icon {
    width: 1.8rem;
    height: 1.8rem;
  }

  .card__cta {
    padding: 1.5rem;
  }

  .about-header {
    font-size: 1.1rem;
  }

  .info-item {
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  .info-icon {
    width: 1rem;
    height: 1rem;
  }

  .info-label {
    min-width: 3.5rem;
  }
}

@media (max-width: 360px) {
  .role-text {
    font-size: 1.5rem;
  }

  .role-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .about-header {
    font-size: 1rem;
  }

  .info-item {
    font-size: 0.75rem;
  }

  .info-label {
    min-width: 3rem;
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card {
    animation: none;
  }

  body {
    animation: none;
  }

  .role-item,
  .info-item {
    animation: none;
    opacity: 1;
  }

  .role-icon {
    animation: none;
  }

  .card__cta a::after {
    transition: none;
  }

  .role-item:hover,
  .card:hover {
    transform: none;
  }

  .info-item:hover .info-icon {
    animation: none;
  }
}