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

:root {
  --primary: #00d4ff;
  --secondary: #0a0e27;
  --accent: #ff006e;
  --text: #e0e0e0;
  --bg: #050811;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #141b38 0%, var(--bg) 55%, #05040a 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Animated background elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 110, 0.18) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(0deg, transparent 24%, rgba(0, 212, 255, 0.06) 25%, rgba(0, 212, 255, 0.06) 26%, transparent 27%, transparent 74%, rgba(0, 212, 255, 0.06) 75%, rgba(0, 212, 255, 0.06) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, rgba(0, 212, 255, 0.06) 25%, rgba(0, 212, 255, 0.06) 26%, transparent 27%, transparent 74%, rgba(0, 212, 255, 0.06) 75%, rgba(0, 212, 255, 0.06) 76%, transparent 77%, transparent);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 950px;
  padding: 40px 20px 60px 20px;
  animation: fadeIn 1s ease-in;
}

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

/* ==========================================================================
   Header & Badge
   ========================================================================== */

.badge-row {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 14, 39, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.2);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--primary), var(--accent));
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
  align-self: center;
}

/* ==========================================================================
   Social Links
   ========================================================================== */

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  animation: slideUp 0.8s ease-out 0.1s both;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 14, 39, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.social-link:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  transform: translateY(-3px) scale(1.1);
  color: #fff;
}

.social-link svg {
  transition: transform 0.3s ease;
}

.social-link:hover svg {
  transform: scale(1.1);
}

h1 {
  font-size: 3.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
  animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  font-size: 1.2rem;
  color: rgba(224, 224, 224, 0.9);
  margin-bottom: 10px;
  font-weight: 300;
  letter-spacing: 0.5px;
  animation: slideUp 0.8s ease-out 0.15s both;
}

.tagline {
  font-size: 0.95rem;
  color: rgba(200, 200, 200, 0.85);
  margin-bottom: 55px;
  font-weight: 300;
  animation: slideUp 0.8s ease-out 0.25s both;
}

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

/* ==========================================================================
   Projects Grid
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 10px;
}

.project-card {
  position: relative;
  padding: 40px 28px 32px 28px;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(0, 212, 255, 0.07), transparent 55%),
  rgba(10, 13, 30, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.25);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  overflow: hidden;
  animation: scaleIn 0.8s ease-out;
  animation-fill-mode: both;
  display: flex;
  flex-direction: column;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 110, 0.2)) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:nth-child(1) { animation-delay: 0.25s; }
.project-card:nth-child(2) { animation-delay: 0.35s; }
.project-card:nth-child(3) { animation-delay: 0.45s; }
.project-card:nth-child(4) { animation-delay: 0.55s; }
.project-card:nth-child(5) { animation-delay: 0.65s; }
.project-card:nth-child(6) { animation-delay: 0.75s; }

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow:
    0 0 26px rgba(0, 212, 255, 0.45),
    0 0 50px rgba(255, 0, 110, 0.25);
  transform: translateY(-10px) scale(1.01);
}

.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(224, 224, 224, 0.75);
  background: rgba(5, 10, 24, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.25);
  margin-bottom: 14px;
}

.project-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.9);
}

.project-pill-dot.live {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.9);
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.9);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 255, 136, 1), 0 0 20px rgba(0, 255, 136, 0.6);
    transform: scale(1.2);
  }
}

.project-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--primary);
  position: relative;
  z-index: 1;
  letter-spacing: 0.6px;
}

.project-description {
  font-size: 0.96rem;
  color: rgba(224, 224, 224, 0.88);
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  line-height: 1.7;
  flex-grow: 1;
}

.project-meta {
  font-size: 0.8rem;
  color: rgba(170, 190, 210, 0.9);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 12px 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
  overflow: hidden;
  white-space: nowrap;
  margin-top: auto;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  transition: left 0.5s ease;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(0, 212, 255, 0.6),
    0 0 20px rgba(255, 0, 110, 0.4);
  letter-spacing: 0.18em;
}

.btn:active {
  transform: translateY(-1px);
}

/* Secondary button style */
.btn-secondary {
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
  font-size: 0.85rem;
  padding: 10px 28px;
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

/* ==========================================================================
   Fun link section
   ========================================================================== */

.fun-link {
  margin-top: 60px;
  animation: slideUp 0.8s ease-out 0.6s both;
}

.fun-link-text {
  display: block;
  font-size: 0.85rem;
  color: rgba(200, 200, 200, 0.6);
  margin-bottom: 12px;
  font-style: italic;
}

/* ==========================================================================
   404 Page Styles
   ========================================================================== */

.error-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 650px;
  padding: 40px 20px 60px 20px;
  animation: fadeIn 1s ease-in;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
  line-height: 1;
  margin-bottom: 20px;
}

@keyframes pulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 0, 110, 0.6));
  }
}

.error-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  animation: slideDown 0.8s ease-out 0.2s both;
}

.error-message {
  font-size: 1.1rem;
  color: rgba(224, 224, 224, 0.85);
  margin-bottom: 15px;
  line-height: 1.6;
  animation: slideUp 0.8s ease-out 0.3s both;
}

.error-joke {
  font-size: 0.95rem;
  color: rgba(200, 200, 200, 0.7);
  margin-bottom: 40px;
  font-style: italic;
  animation: slideUp 0.8s ease-out 0.4s both;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: slideUp 0.8s ease-out 0.5s both;
}

.glitch-wrapper {
  position: relative;
  display: inline-block;
}

.glitch-wrapper::before,
.glitch-wrapper::after {
  content: '404';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glitch-wrapper::before {
  animation: glitch-1 0.8s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-wrapper::after {
  animation: glitch-2 0.8s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
  0% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@keyframes glitch-2 {
  0% { transform: translateX(0); }
  20% { transform: translateX(2px); }
  40% { transform: translateX(-2px); }
  60% { transform: translateX(1px); }
  80% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  h1 {
    font-size: 2.6rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }

  .tagline {
    font-size: 0.9rem;
    margin-bottom: 40px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-card {
    padding: 32px 22px 28px 22px;
  }

  .error-code {
    font-size: 5rem;
  }

  .error-title {
    font-size: 1.6rem;
  }

  .glitch-wrapper::before,
  .glitch-wrapper::after {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.1rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .btn {
    padding: 10px 26px;
    font-size: 0.85rem;
  }

  .error-code {
    font-size: 4rem;
  }

  .glitch-wrapper::before,
  .glitch-wrapper::after {
    font-size: 4rem;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Glow effect on hover */
.project-card:hover .project-title {
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.7);
}
