/* ===================================
   BASE & RESET
=================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #050510;
  color: #f1f5f9;
  overflow-x: hidden;
}

::selection {
  background-color: rgba(108, 99, 255, 0.4);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0a0a1f;
}
::-webkit-scrollbar-thumb {
  background: #6c63ff;
  border-radius: 99px;
}

/* ===================================
   NOISE OVERLAY
=================================== */
.noise-overlay {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===================================
   GRADIENT TEXT
=================================== */
.gradient-text {
  background: linear-gradient(135deg, #6c63ff 0%, #ff6ec7 50%, #00f5ff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

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

/* ===================================
   SECTION LABEL
=================================== */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6c63ff;
  position: relative;
  padding-left: 2.5rem;
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.5px;
  background: linear-gradient(90deg, #6c63ff, transparent);
}

/* ===================================
   NAVBAR
=================================== */
#navbar.scrolled {
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #6c63ff;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile Menu Open State */
#mobile-menu.open {
  max-height: 400px;
}

/* Hamburger open state */
.menu-open .menu-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-open .menu-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-open .menu-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===================================
   HERO BACKGROUND
=================================== */
.hero-bg {
  background: radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255, 110, 199, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 60% 80%, rgba(0, 245, 255, 0.04) 0%, transparent 50%);
}

.orb-1 {
  top: 10%;
  left: 5%;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-2 {
  top: 60%;
  right: 10%;
  animation: orbFloat 10s ease-in-out infinite reverse;
}
.orb-3 {
  bottom: 10%;
  left: 40%;
  animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.97); }
}

/* ===================================
   GRID LINES
=================================== */
.grid-lines {
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ===================================
   STARS
=================================== */
.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min-opacity, 0.1); transform: scale(1); }
  50%       { opacity: var(--max-opacity, 0.8); transform: scale(1.3); }
}

/* ===================================
   TECH BADGE (Hero Floating)
=================================== */
.tech-badge {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===================================
   REVEAL ANIMATION (Scroll)
=================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of revealed parents */
.reveal.revealed:nth-child(1) { transition-delay: 0s; }
.reveal.revealed:nth-child(2) { transition-delay: 0.1s; }
.reveal.revealed:nth-child(3) { transition-delay: 0.2s; }
.reveal.revealed:nth-child(4) { transition-delay: 0.3s; }
.reveal.revealed:nth-child(5) { transition-delay: 0.4s; }
.reveal.revealed:nth-child(6) { transition-delay: 0.5s; }

/* ===================================
   SKILL BARS
=================================== */
.skill-bar {
  width: 0;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: visible;
}

.skill-bar.animated {
  width: var(--target-width);
}

.skill-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: inherit;
  box-shadow: 0 0 8px currentColor;
  opacity: 0;
  transition: opacity 0.3s ease 0.8s;
}

.skill-bar.animated::after {
  opacity: 1;
}

/* ===================================
   TECH SCROLL (Infinite Marquee)
=================================== */
.tech-scroll-wrapper {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
}

.tech-scroll {
  animation: marquee 25s linear infinite;
  width: max-content;
}

.tech-scroll:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===================================
   PROJECT CARDS
=================================== */
.project-card {
  transition: all 0.4s ease;
}

.project-card.hidden-card {
  display: none;
}

/* ===================================
   FILTER BUTTONS
=================================== */
.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.filter-btn:hover {
  border-color: rgba(108, 99, 255, 0.4);
  color: #fff;
  background: rgba(108, 99, 255, 0.1);
}

.filter-btn.active {
  background: #6c63ff;
  border-color: #6c63ff;
  color: #fff;
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
}

/* ===================================
   FORM INPUTS
=================================== */
.form-input {
  background: rgba(5, 5, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
  border-color: rgba(108, 99, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
  outline: none;
}

.form-input::placeholder {
  color: #475569;
}

/* ===================================
   BACK TO TOP
=================================== */
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ===================================
   CUSTOM CURSOR
=================================== */
.custom-cursor {
  transform: translate(-50%, -50%);
}

.custom-cursor-follower {
  transform: translate(-50%, -50%);
}

/* ===================================
   AVATAR PLACEHOLDER
=================================== */
.avatar-placeholder {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(255, 110, 199, 0.05) 100%);
}

/* ===================================
   CONTACT INFO CARD HOVER
=================================== */
.contact-info-card {
  transition: all 0.3s ease;
}

.contact-info-card:hover {
  transform: translateX(6px);
}

/* ===================================
   FORM SUCCESS / ERROR
=================================== */
.form-success {
  color: #39ff14;
}

.form-error {
  color: #ff6ec7;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
=================================== */
@media (max-width: 1024px) {
  #hero > .relative.z-10 {
    gap: 2rem;
    padding-top: 3.5rem;
  }

  #hero h1 {
    font-size: 3.75rem;
  }

  #hero p {
    font-size: 1rem;
    max-width: 100%;
  }

  #hero .flex.items-center.gap-10 {
    gap: 1.5rem;
  }

  #hero .relative.w-72.h-72 {
    width: min(24rem, 80vw);
    height: min(24rem, 80vw);
  }

  #hero .tech-badge {
    font-size: 0.78rem;
    padding: 0.5rem 0.85rem;
  }
}

@media (max-width: 768px) {
  .tech-badge {
    display: none;
  }

  .orb {
    opacity: 0.5;
  }

  #hero h1 {
    font-size: 3rem;
    line-height: 1.05;
  }

  #hero p {
    font-size: 0.95rem;
  }

  #hero .flex.flex-col.lg\:flex-row {
    gap: 1.75rem;
  }

  #hero .flex.flex-col.sm\:flex-row {
    width: 100%;
  }

  #hero .flex.flex-col.sm\:flex-row a {
    width: 100%;
    justify-content: center;
  }

  #hero .relative.w-72.h-72 {
    width: min(20rem, 75vw);
    height: min(20rem, 75vw);
  }
}

@media (max-width: 480px) {
  .gradient-text {
    font-size: inherit;
  }

  #hero h1 {
    font-size: 2.2rem;
  }

  #hero p {
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
  }

  #hero .flex.items-center.gap-10 {
    flex-direction: column;
    gap: 0.9rem;
  }

  #hero .flex.items-center.gap-10 .w-px {
    display: none;
  }

  #hero .relative.w-72.h-72 {
    width: min(17rem, 72vw);
    height: min(17rem, 72vw);
  }
}

/* ===================================
   GLOW EFFECTS
=================================== */
.glow-accent {
  box-shadow: 0 0 30px rgba(108, 99, 255, 0.4);
}

.glow-cyan {
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
}

.glow-pink {
  box-shadow: 0 0 30px rgba(255, 110, 199, 0.3);
}

/* ===================================
   LOADING ANIMATION
=================================== */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===================================
   SMOOTH SECTION TRANSITIONS
=================================== */
section {
  position: relative;
}

/* ===================================
   PROJECT THUMBNAIL OVERLAY
=================================== */
.project-thumbnail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(10, 10, 31, 0.8));
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* ===================================
   FOCUS VISIBLE ACCESSIBILITY
=================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6c63ff;
  outline-offset: 3px;
}

/* ===================================
   PRINT STYLES
=================================== */
@media print {
  .noise-overlay,
  #cursor,
  #cursor-follower,
  #back-to-top {
    display: none !important;
  }
}
