/* ==========================================
   style.css — Custom styles for aaryamody.app
   Only what Tailwind CDN can't handle:
   custom animations, scroll keyframes, glass
   utility, gradient backgrounds, and a11y.
   ========================================== */

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Loading Screen ---- */
#loader {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---- Scroll Progress Bar ---- */
#scroll-progress {
  transform-origin: left;
  will-change: width;
}

/* ---- Custom Cursor ---- */
@media (pointer: fine) {
  .custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, opacity 0.15s ease;
    will-change: transform;
  }

  .custom-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.25s ease, width 0.3s ease, height 0.3s ease, opacity 0.15s ease;
    will-change: transform;
  }

  .custom-cursor-dot.hover {
    transform: translate(-50%, -50%) scale(2.5);
  }

  .custom-cursor-ring.hover {
    width: 50px;
    height: 50px;
    border-color: rgba(59, 130, 246, 0.3);
  }

  .custom-cursor-ring.clicking {
    width: 28px;
    height: 28px;
    border-color: rgba(59, 130, 246, 0.8);
  }
}

@media (pointer: coarse) {
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }
}

/* ---- Noise Texture 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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  opacity: 0.4;
}

/* ---- Animated Gradient Mesh ---- */
.animated-gradient {
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* ---- Animated Text Gradient ---- */
.animated-text-gradient {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #06b6d4, #3b82f6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradientFlow 4s ease infinite;
}

@keyframes textGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Text Glow ---- */
.text-glow {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
               0 0 40px rgba(59, 130, 246, 0.1);
}

/* ---- Blob Backgrounds ---- */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -50px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

.animate-blob {
  animation: blob 20s ease-in-out infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

/* ---- Selection Colors ---- */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

:root:not(.dark) ::selection {
  background: rgba(26, 60, 110, 0.2);
  color: #0f172a;
}

/* ---- Section Dividers ---- */
.section-divider {
  line-height: 0;
  margin: -1px 0;
}

/* ---- Elastic Button Press ---- */
.elastic-btn {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.elastic-btn:active {
  transform: scale(0.95) !important;
}

/* ---- Glass morphism utility ---- */
.glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

:root:not(.dark) .glass {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.06);
}

/* ---- Hero gradient mesh background ---- */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(59, 130, 246, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(26, 60, 110, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(96, 165, 250, 0.08) 0%, transparent 60%);
}

:root:not(.dark) .hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(26, 60, 110, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(96, 165, 250, 0.05) 0%, transparent 60%);
}

/* ---- Dot pattern for achievements section ---- */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---- Skill pills ---- */
.skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-card:hover .skill-pill {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

:root:not(.dark) .skill-pill {
  background: rgba(26, 60, 110, 0.08);
  color: #1a3c6e;
}

:root:not(.dark) .skill-card:hover .skill-pill {
  background: rgba(26, 60, 110, 0.15);
}

/* ---- Glass morphism depth hierarchy ---- */
.glass-1 {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-2 {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-3 {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ---- 3D Tilt Card ---- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.1s ease;
}

.tilt-card .tilt-inner {
  transform: translateZ(20px);
}

/* ---- Magnetic Button ---- */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Text Scramble Effect ---- */
.scramble-text {
  display: inline-block;
  cursor: default;
}

/* ---- Staggered Section Reveal ---- */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.4s; }

/* ---- Tech pills (experience/project tags) ---- */
.tech-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

:root:not(.dark) .tech-pill {
  background: rgba(26, 60, 110, 0.06);
  color: #1a3c6e;
}

/* ---- Navigation ---- */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
  border-radius: 1px;
}

.nav-scrolled {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

:root:not(.dark) .nav-scrolled {
  background: rgba(248, 250, 252, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ---- Filter buttons ---- */
.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn:hover {
  color: #e2e8f0;
  border-color: rgba(59, 130, 246, 0.3);
}

.filter-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

:root:not(.dark) .filter-btn {
  background: rgba(0, 0, 0, 0.03);
  color: #64748b;
  border-color: rgba(0, 0, 0, 0.1);
}

:root:not(.dark) .filter-btn:hover {
  color: #1e293b;
  border-color: #1a3c6e;
}

:root:not(.dark) .filter-btn.active {
  background: #1a3c6e;
  color: #fff;
  border-color: #1a3c6e;
}

/* ---- Scroll reveal animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---- Typewriter cursor ---- */
.typewriter-cursor {
  display: inline-block;
  animation: blink 0.8s step-end infinite;
  color: #3b82f6;
  font-weight: 300;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Floating decorative elements ---- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes floatDelayed {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-2deg); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatDelayed 8s ease-in-out infinite;
  animation-delay: 1s;
}

.animate-float-slow {
  animation: floatSlow 10s ease-in-out infinite;
  animation-delay: 2s;
}

/* ---- Timeline dot pulse ---- */
@keyframes timelinePulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.timeline-dot.pulse {
  animation: timelinePulse 1.5s ease-out;
}

/* ---- Counter number stability ---- */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ---- Mobile nav staggered fade-in ---- */
@keyframes mobileNavFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav-item.visible {
  animation: mobileNavFade 0.3s ease-out forwards;
}

/* ---- Focus visible ring ---- */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Back-to-top visible state ---- */
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---- Experience expand arrow rotation ---- */
.experience-toggle[aria-expanded="true"] span {
  transform: rotate(180deg);
}

/* ---- Smooth section offsets for fixed nav ---- */
section[id] {
  scroll-margin-top: 5rem;
}

/* ==========================================
   Print styles
   ========================================== */
@media print {
  header, footer, #back-to-top, .hero-gradient,
  .animate-float, .animate-float-delayed, .animate-float-slow {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .glass {
    background: white !important;
    border: 1px solid #ccc !important;
    backdrop-filter: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  section {
    page-break-inside: avoid;
    padding: 1rem 0 !important;
  }
}

/* ==========================================
   Reduced motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .typewriter-cursor {
    animation: none;
    opacity: 1;
  }

  .animated-gradient {
    animation: none;
  }

  .animated-text-gradient {
    animation: none;
    background: #3b82f6;
    -webkit-text-fill-color: currentColor;
  }

  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }

  .animate-blob {
    animation: none;
  }
}

/* ==========================================
   High contrast mode
   ========================================== */
@media (prefers-contrast: high) {
  .glass,
  .glass-1,
  .glass-2,
  .glass-3 {
    border-width: 2px;
    border-color: currentColor;
    backdrop-filter: none;
    background: Canvas;
  }

  .skill-pill,
  .tech-pill {
    border: 1px solid currentColor;
  }

  .animated-text-gradient {
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  .noise-overlay {
    display: none;
  }
}

/* ==========================================
   Forced colors (Windows High Contrast)
   ========================================== */
@media (forced-colors: active) {
  .glass,
  .glass-1,
  .glass-2,
  .glass-3 {
    border: 1px solid ButtonText;
    background: Canvas;
    backdrop-filter: none;
  }

  .skill-pill,
  .tech-pill,
  .filter-btn {
    border: 1px solid ButtonText;
    forced-color-adjust: auto;
  }

  .nav-link.active::after {
    background: Highlight;
  }

  .animated-text-gradient {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: LinkText;
  }

  #scroll-progress {
    background: Highlight;
  }

  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }
}

/* ==========================================
   FLIP animation for project filter
   ========================================== */
.project-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.project-card.filtering-out {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
}

.project-card.filtering-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ==========================================
   Availability Badge
   ========================================== */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  font-size: 0.8rem;
  font-weight: 500;
  color: #22c55e;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: availabilityPulse 2s ease-in-out infinite;
}

@keyframes availabilityPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ==========================================
   Command Palette
   ========================================== */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.command-palette-overlay.active {
  opacity: 1;
  visibility: visible;
}

.command-palette {
  width: 100%;
  max-width: 520px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.command-palette-overlay.active .command-palette {
  transform: scale(1) translateY(0);
}

:root:not(.dark) .command-palette {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

.command-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-size: 0.95rem;
  outline: none;
}

:root:not(.dark) .command-input {
  color: #0f172a;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.command-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.command-item:hover,
.command-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: #f1f5f9;
}

:root:not(.dark) .command-item:hover,
:root:not(.dark) .command-item.active {
  color: #0f172a;
}

.command-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

/* ==========================================
   Testimonials Section
   ========================================== */
.testimonial-card {
  position: relative;
  padding: 2rem;
  border-radius: 1rem;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 4rem;
  line-height: 1;
  color: rgba(59, 130, 246, 0.15);
  font-family: Georgia, serif;
}

/* ==========================================
   CSS Containment for performance
   ========================================== */
section {
  contain: layout style;
}

.project-card,
.skill-card {
  contain: layout style;
}

/* ==========================================
   aria-live region for form status
   ========================================== */
.form-status {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.75rem;
  transition: opacity 0.3s ease;
}

.form-status.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
