/* AgiCAD.com — Custom Styles */

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #60a5fa;
  --cyan: #06b6d4;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-200);
  background: var(--navy);
  overflow-x: hidden;
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card hover effect */
.card-hover {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.4s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15), 0 0 0 1px rgba(59,130,246,0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Glass morphism card */
.glass {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 1rem;
}

/* Gradient border card — animated border on hover */
.gradient-border {
  position: relative;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.08);
  overflow: hidden;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(59,130,246,0) 0%, rgba(59,130,246,0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.5s ease;
}
.gradient-border:hover::before {
  background: linear-gradient(135deg, rgba(59,130,246,0.5) 0%, rgba(6,182,212,0.5) 50%, rgba(139,92,246,0.5) 100%);
}

/* Scroll reveal animations with stagger support */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Tech badge */
.tech-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-light);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}
.tech-badge:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* Hero gradient overlay — richer */
.hero-gradient {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

/* Animated grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Hero floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}
.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.3), transparent 70%);
  top: -10%; right: -5%;
  animation-delay: 0s;
}
.hero-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.25), transparent 70%);
  bottom: -15%; left: -5%;
  animation-delay: -7s;
}
.hero-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.2), transparent 70%);
  top: 40%; right: 20%;
  animation-delay: -14s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 35px) scale(1.02); }
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--blue);
  margin-left: 4px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Pulse glow for CTA buttons */
.glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
}
.glow-blue:hover {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.5), 0 0 80px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* Animated gradient button */
.btn-gradient {
  background: linear-gradient(135deg, #3b82f6, #06b6d4, #8b5cf6, #3b82f6);
  background-size: 300% 300%;
  animation: gradient-shift 4s ease infinite;
  transition: all 0.3s ease;
}
.btn-gradient:hover {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.4), 0 0 80px rgba(6, 182, 212, 0.2);
  transform: translateY(-2px);
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile nav overlay */
.mobile-nav {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mobile-nav.open {
  transform: translateX(0);
}

/* Portfolio filter buttons */
.filter-btn {
  transition: all 0.25s ease;
}
.filter-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}
.filter-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Project card image placeholder gradient */
.project-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.project-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.project-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.project-gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.project-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.project-gradient-6 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.project-gradient-7 { background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%); }
.project-gradient-8 { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.project-gradient-9 { background: linear-gradient(135deg, #f5576c 0%, #ff9a9e 100%); }
.project-gradient-10 { background: linear-gradient(135deg, #667eea 0%, #43e97b 100%); }

/* Project card gradient overlay on hover */
[class^="project-gradient-"] {
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
[class^="project-gradient-"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  transition: opacity 0.4s ease;
}
.card-hover:hover [class^="project-gradient-"] {
  transform: scale(1.05);
}
.card-hover:hover [class^="project-gradient-"]::after {
  opacity: 0;
}

/* Stat counter */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* Stat card with glow */
.stat-card {
  position: relative;
  padding: 2rem 1rem;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.08);
  transition: all 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(30, 41, 59, 0.5);
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* Process timeline step */
.process-step {
  position: relative;
}
.process-step::before {
  content: '';
  position: absolute;
  left: 1.75rem;
  top: 3.5rem;
  bottom: -1.5rem;
  width: 2px;
  background: linear-gradient(to bottom, rgba(59,130,246,0.3), rgba(59,130,246,0.05));
}
.process-step:last-child::before {
  display: none;
}
.step-number {
  width: 3.5rem; height: 3.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid rgba(59, 130, 246, 0.3);
  color: var(--blue-light);
  font-weight: 700;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.process-step:hover .step-number {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Icon box with glow on hover */
.icon-box {
  transition: all 0.3s ease;
}
.card-hover:hover .icon-box, .glass:hover .icon-box {
  box-shadow: 0 0 20px currentColor;
  transform: scale(1.1);
}

/* Nav link animated underline */
.nav-link-anim {
  position: relative;
}
.nav-link-anim::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 1px;
}
.nav-link-anim:hover::after, .nav-link-anim.active-link::after {
  width: 100%;
}

/* Smooth image/gradient reveal */
.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.img-reveal.visible {
  clip-path: inset(0 0 0 0);
}

/* Marquee for tech stack */
.marquee-track {
  display: flex;
  animation: marquee 40s linear infinite;
  width: max-content;
}
.marquee-track:hover {
  animation-play-state: paused;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--navy);
}
::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.4);
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--blue));
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
  z-index: 9999;
  transform-origin: left;
  transition: transform 0.1s linear;
}

/* Form inputs — glow focus */
input:focus, select:focus, textarea:focus {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.05) !important;
}

/* Card inner subtle glow */
.gradient-border:hover, .glass:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 25px 50px rgba(59, 130, 246, 0.08);
}

/* Smoother link transitions */
a {
  transition: color 0.2s ease;
}

/* Case study back link with arrow animation */
.back-link svg {
  transition: transform 0.2s ease;
}
.back-link:hover svg {
  transform: translateX(-3px);
}

/* Project link arrow animation */
.project-link svg {
  transition: transform 0.2s ease;
}
.project-link:hover svg {
  transform: translateX(3px);
}

/* Fade-up for portfolio filtering */
.project-card {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.project-card.hiding {
  opacity: 0;
  transform: scale(0.95);
}

/* Better gradient text with purple option */
.gradient-text-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtle noise texture overlay */
.noise-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  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)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* Pulsing live dot */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
  display: inline-block;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.4);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Shine sweep on hover for buttons */
.btn-gradient {
  position: relative;
  overflow: hidden;
}
.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}
.btn-gradient:hover::before {
  left: 100%;
}

/* Gradient divider */
.gradient-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(59,130,246,0.4) 50%, transparent 100%);
}

/* Section heading with accent line */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue-light);
}
.section-eyebrow::before {
  content: '';
  width: 2rem;
  height: 2px;
  background: var(--blue);
  border-radius: 1px;
}

/* Floating tag (for live project indicators) */
.tag-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Smooth number morphing */
.stat-number {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* Better focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Service section alternating layout visual hint */
.service-block:nth-child(even) {
  direction: rtl;
}
.service-block:nth-child(even) > * {
  direction: ltr;
}

/* Subtle horizontal rule between services */
.service-block + .service-block {
  border-top: 1px solid rgba(59, 130, 246, 0.06);
  padding-top: 5rem;
}

/* Image/gradient card shine overlay */
.shine-overlay {
  position: relative;
  overflow: hidden;
}
.shine-overlay::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.shine-overlay:hover::after {
  opacity: 1;
}

/* Page transition fade */
main {
  animation: page-fade-in 0.4s ease-out;
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
