/* ========================================
   Try2.app - Minimal Black & White Design
   ======================================== */

/* === CSS Variables === */
:root {
  --gradient-mesh: radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 1) 0px, transparent 0%),
                   radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%),
                   radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%),
                   radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
                   radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
                   radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%),
                   radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%);
}

/* === Smooth Scroll === */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* === Selection === */
::selection {
  background-color: white;
  color: black;
}

::-moz-selection {
  background-color: white;
  color: black;
}

/* === Custom Cursor === */
.cursor,
.cursor-follower {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.2s ease-out, opacity 0.3s;
  display: none;
}

.cursor {
  background: white;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.cursor-follower {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: transform 0.4s cubic-bezier(0.75, -0.5, 0.25, 1.5);
}

@media (min-width: 1024px) {
  .cursor,
  .cursor-follower {
    display: block;
  }
}

/* === Glassmorphism === */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.nav-blur {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

/* === Animated Background === */
#gradient-canvas {
  background: #000;
  background-image: var(--gradient-mesh);
  animation: mesh-animation 20s ease infinite;
  opacity: 0.2;
}

@keyframes mesh-animation {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* === Navigation === */
.nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
  font-weight: 500;
}

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

.nav-link:hover {
  color: white;
}

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

/* === Text Reveal Animation === */
.text-reveal {
  opacity: 0;
  transform: translateY(30px);
  animation: reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.text-reveal:nth-child(1) { animation-delay: 0.1s; }
.text-reveal:nth-child(2) { animation-delay: 0.2s; }
.text-reveal:nth-child(3) { animation-delay: 0.3s; }
.text-reveal:nth-child(4) { animation-delay: 0.4s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Fade In Up === */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === Magnetic Button === */
.magnetic-btn {
  position: relative;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.magnetic-btn:hover {
  transform: scale(1.05);
}

.magnetic-btn:active {
  transform: scale(0.95);
}

/* === Service Cards === */
.service-card {
  position: relative;
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  transform-style: preserve-3d;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(255, 255, 255, 0.1);
}

/* === App Cards === */
.app-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(255, 255, 255, 0.1);
}

/* === Testimonial Cards === */
.testimonial-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(255, 255, 255, 0.1);
}

/* === Hero Card === */
.hero-card {
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 80px rgba(255, 255, 255, 0.15);
}

/* === Stat Cards === */
.stat-card {
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: scale(1.1);
}

/* === Tech Badges === */
.tech-badge {
  padding: 1rem 2rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}

.tech-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* === Contact Container === */
.contact-container {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 80px rgba(255, 255, 255, 0.1);
}

/* === Form Inputs === */
.form-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
  border-color: rgba(239, 68, 68, 0.5);
}

.form-input:valid:not(:placeholder-shown) {
  border-color: rgba(34, 197, 94, 0.5);
}

/* === Social Links === */
.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* === Reduce 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;
  }

  .text-reveal,
  .fade-in-up,
  #gradient-canvas {
    animation: none !important;
  }
}

/* === Print Styles === */
@media print {
  nav,
  footer,
  #contact,
  .cursor,
  .cursor-follower,
  #gradient-canvas {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* === Loading State === */
.loading {
  pointer-events: none;
  opacity: 0.6;
  cursor: wait;
}

/* === Message States === */
.message-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.message-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* === Focus Styles for Accessibility === */
*:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

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

*:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* === Mobile Optimizations === */
@media (max-width: 768px) {
  .service-card,
  .app-card,
  .testimonial-card {
    padding: 1.5rem;
  }

  .tech-badge {
    padding: 0.75rem 1.5rem;
  }

  .contact-container {
    padding: 2rem 1.5rem;
  }
}

/* === High Contrast Mode === */
@media (prefers-contrast: high) {
  .glass-effect {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid white;
  }

  .nav-blur {
    background: rgba(0, 0, 0, 0.95);
  }
}
