/* ============================================
   ROOT VARIABLES & THEME
   ============================================ */

:root {
  color-scheme: dark;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  --bg-primary: #04050a;
  --bg-secondary: #0d0f1c;
  --text-primary: #f3f4ff;
  --text-muted: #a4a7c7;
  --accent: #7b61ff;
  --accent-strong: #5af0ff;
  --support: #ff9d5a;
}

/* ============================================
   GLOBAL RESET & BASE
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(123, 97, 255, 0.35), transparent 45%),
    radial-gradient(circle at 20% 20%, rgba(90, 240, 255, 0.25), transparent 40%),
    var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  scroll-behavior: smooth;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, rgba(123, 97, 255, 0.12), rgba(90, 240, 255, 0.08));
  pointer-events: none;
  opacity: 0.65;
}

/* ============================================
   BACKDROP & GRADIENT ORBS
   ============================================ */

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.gradient-orb {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite;
}

.orb-one {
  top: -100px;
  left: -120px;
  background: radial-gradient(circle, rgba(123, 97, 255, 0.7), transparent 70%);
}

.orb-two {
  bottom: -140px;
  right: -100px;
  background: radial-gradient(circle, rgba(90, 240, 255, 0.65), transparent 70%);
  animation-delay: 4s;
}

.particle-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
  top: var(--top, 0%);
  left: var(--left, 0%);
  animation: particleFloat var(--duration, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
}

/* ============================================
   PAGE SHELL & LAYOUT
   ============================================ */

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem clamp(1.5rem, 3vw, 3rem);
  text-align: center;
}

/* ============================================
   HERO & HEADER
   ============================================ */

.hero {
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 3vw, 1.25rem);
  animation: fadeUp 1.2s ease forwards;
  margin-bottom: clamp(1.5rem, 5vw, 3rem);
}

.badge {
  align-self: center;
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 0.65rem) clamp(1.5rem, 4vw, 2.4rem);
  border-radius: 999px;
  position: relative;
  display: inline-flex;
  justify-content: center;
  letter-spacing: clamp(0.2em, 1vw, 0.38em);
  font-size: clamp(0.7rem, 1.5vw, 0.82rem);
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  color: #eef8ff;
  background: rgba(4, 5, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 22px rgba(123, 97, 255, 0.35), inset 0 0 6px rgba(90, 240, 255, 0.35),
    0 25px 45px rgba(6, 9, 30, 0.5);
  animation: badgeFloat 5.5s ease-in-out infinite;
}

.badge::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: inherit;
  background: conic-gradient(
      from 0deg,
      rgba(123, 97, 255, 0.4),
      rgba(90, 240, 255, 0.85),
      rgba(255, 214, 165, 0.85),
      rgba(123, 97, 255, 0.4)
    )
    border-box;
  animation: badgeSpin 7s linear infinite;
  filter: blur(4px);
  opacity: 0.9;
  mask: radial-gradient(farthest-side, transparent calc(50% - 3px), #000 calc(50% - 1px), #000 100%);
  z-index: 0;
}

.badge::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: rgba(5, 6, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 25px rgba(123, 97, 255, 0.45), inset 0 0 8px rgba(90, 240, 255, 0.45),
    0 0 25px rgba(90, 240, 255, 0.35);
  z-index: 1;
  pointer-events: none;
}

.badge span {
  position: relative;
  z-index: 2;
  background-image: linear-gradient(120deg, #5af0ff, #7b61ff, #f8d7ff, #5af0ff);
  background-size: 240% 240%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: badgeTextGlow 2.8s linear infinite;
}

.badge span::after {
  content: "";
  position: absolute;
  top: 0;
  left: -25%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(-120%) skewX(-15deg);
  animation: badgeSweep 3.6s ease-in-out infinite;
  opacity: 0.8;
}

.eyebrow {
  display: none;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

h1 .highlight {
  background: linear-gradient(120deg, #5af0ff 0%, #7b61ff 50%, #ff6b6b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.lede {
  margin: 0 auto;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.6;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects-section {
  width: 100%;
  margin-top: clamp(1.5rem, 5vw, 3rem);
}

.projects-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  width: 100%;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  animation: fadeUp 1.4s ease forwards 0.2s;
  animation-fill-mode: both;
}

/* Responsive Grid */
@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   PROJECT CARD
   ============================================ */

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(13, 15, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  animation: fadeUp 0.8s ease forwards;
  transform-style: preserve-3d;
}

.project-card:hover {
  transform: translateY(-12px);
  border-color: rgba(90, 240, 255, 0.6);
  background: rgba(13, 15, 28, 0.95);
  box-shadow: 0 24px 80px rgba(123, 97, 255, 0.25), 0 0 40px rgba(90, 240, 255, 0.2), inset 0 1px 0 rgba(90, 240, 255, 0.1);
}

/* Featured Project */
.project-card.featured {
  border: 1.5px solid rgba(90, 240, 255, 0.6);
  background: linear-gradient(135deg, rgba(13, 15, 28, 0.95), rgba(13, 15, 40, 0.8));
  box-shadow: 0 0 25px rgba(90, 240, 255, 0.15), inset 0 0 20px rgba(90, 240, 255, 0.05);
  position: relative;
}

.project-card.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(90, 240, 255, 0.1), transparent 70%);
  pointer-events: none;
  border-radius: 24px;
}

.project-card.featured:hover {
  transform: translateY(-12px);
  border-color: rgba(90, 240, 255, 0.8);
  background: linear-gradient(135deg, rgba(13, 15, 28, 0.98), rgba(13, 15, 40, 0.9));
  box-shadow: 0 30px 100px rgba(90, 240, 255, 0.3), 0 0 60px rgba(90, 240, 255, 0.25), inset 0 1px 0 rgba(90, 240, 255, 0.15);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, rgba(90, 240, 255, 0.95), rgba(123, 200, 255, 0.85));
  color: #04050a;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 10;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(90, 240, 255, 0.4);
  box-shadow: 0 8px 24px rgba(90, 240, 255, 0.3), 0 0 12px rgba(90, 240, 255, 0.5);
  letter-spacing: 0.5px;
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Project Image */
.project-image {
  width: 100%;
  height: clamp(150px, 30vw, 200px);
  object-fit: cover;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.2), rgba(90, 240, 255, 0.15));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card:hover .project-image {
  transform: scale(1.08);
}

/* Project Content */
.project-content {
  padding: clamp(1.25rem, 3vw, 2rem);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.project-description {
  font-size: clamp(0.85rem, 1.5vw, 0.9rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  line-height: 1.5;
}

/* Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  margin-bottom: 1.5rem;
}

.tag {
  display: inline-block;
  background: rgba(123, 97, 255, 0.15);
  color: var(--accent-strong);
  padding: clamp(0.3rem, 0.8vw, 0.4rem) clamp(0.6rem, 1.5vw, 0.8rem);
  border-radius: 20px;
  font-size: clamp(0.7rem, 1vw, 0.75rem);
  font-weight: 600;
  border: 1px solid rgba(123, 97, 255, 0.3);
  transition: all 0.3s ease;
}

.tag:hover {
  background: rgba(123, 97, 255, 0.25);
  border-color: rgba(123, 97, 255, 0.6);
}

/* Live Button */
.live-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 0.65rem);
  padding: clamp(0.8rem, 1.8vw, 1rem) clamp(1.2rem, 3vw, 1.8rem);
  border-radius: 999px;
  text-decoration: none;
  font-size: clamp(0.85rem, 1.3vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #05060a;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease, border-color 0.35s ease;
  box-shadow: 0 15px 40px rgba(90, 240, 255, 0.35);
  overflow: hidden;
}

.live-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.live-button:hover,
.live-button:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 20px 50px rgba(90, 240, 255, 0.45);
}

.live-button:hover::after,
.live-button:focus-visible::after {
  opacity: 1;
}

.live-button i {
  font-size: 1.1rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--text-muted);
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  width: 100%;
  margin-top: 5rem;
}

.contact-container {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: clamp(20px, 3vw, 32px);
  background: rgba(13, 15, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease forwards 0.4s;
}

.contact-container h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.contact-container p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 0.65rem);
  padding: clamp(0.8rem, 1.5vw, 1rem) clamp(1.2rem, 3vw, 1.8rem);
  border-radius: 999px;
  text-decoration: none;
  font-size: clamp(0.85rem, 1.3vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact-link:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(90, 240, 255, 0.4);
  box-shadow: 0 15px 40px rgba(90, 240, 255, 0.25);
}

.contact-link i {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  margin-top: 4rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  animation: fadeUp 1.2s ease forwards 0.6s;
  animation-fill-mode: both;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes badgeSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes badgeTextGlow {
  0% {
    background-position: 0% 50%;
    text-shadow: 0 0 6px rgba(90, 240, 255, 0.35);
  }
  50% {
    background-position: 100% 50%;
    text-shadow: 0 0 12px rgba(123, 97, 255, 0.5);
  }
  100% {
    background-position: 0% 50%;
    text-shadow: 0 0 6px rgba(90, 240, 255, 0.35);
  }
}

@keyframes badgeSweep {
  0% {
    transform: translateX(-150%) skewX(-15deg);
    opacity: 0;
  }
  35% {
    opacity: 0.9;
  }
  60% {
    transform: translateX(120%) skewX(-15deg);
    opacity: 0;
  }
  100% {
    opacity: 0;
    transform: translateX(120%) skewX(-15deg);
  }
}

@keyframes badgeFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes gradientFlow {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(40px, -30px, 0) scale(1.1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes particleFloat {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--dx, 20px), var(--dy, -80px), 0) scale(1.1);
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(255, 157, 90, 0.2);
  }
  50% {
    box-shadow: 0 0 45px rgba(255, 157, 90, 0.45);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gradientBorder {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Staggered Card Animation */
.project-card {
  animation: cardSlideIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}

.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }
.project-card:nth-child(7) { animation-delay: 0.35s; }
.project-card:nth-child(8) { animation-delay: 0.4s; }
.project-card:nth-child(9) { animation-delay: 0.45s; }

/* Enhanced Hover Effects */
.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(90, 240, 255, 0.5);
}

.live-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 0.65rem);
  padding: clamp(0.8rem, 1.8vw, 1rem) clamp(1.2rem, 3vw, 1.8rem);
  border-radius: 999px;
  text-decoration: none;
  font-size: clamp(0.85rem, 1.3vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border: 2px solid transparent;
  background-clip: padding-box;
  color: #05060a;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 15px 40px rgba(90, 240, 255, 0.35);
  overflow: hidden;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 900px) {
  .contact-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-links {
    gap: 1rem;
  }

  .contact-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: 2rem 1rem;
  }

  .projects-grid {
    gap: 1.5rem;
  }

  .contact-container {
    padding: 1.5rem;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-top: 2rem;
  }

  .contact-container {
    padding: 1.5rem;
  }

  .badge {
    font-size: 0.7rem;
  }

  .hero {
    gap: 1rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  body {
    scroll-behavior: auto !important;
  }

  .gradient-orb,
  .particle,
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
