/**
 * CSS Custom Properties & Design System
 * Taste-Skill rules: Deep dark, cyan/purple accents, Outfit font.
 */

:root {
  --bg-dark: #050505;
  --bg-card: rgba(15, 15, 20, 0.4);
  --accent-cyan: #00f2fe;
  --accent-purple: #4facfe;
  --text-main: #ffffff;
  --text-muted: #a1a1aa; /* zinc-400 */
  --border-glass: rgba(255, 255, 255, 0.08);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

::selection {
  background: rgba(0, 242, 254, 0.3);
  color: white;
}

.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.font-mono { font-family: 'Courier New', Courier, monospace; }
.text-gray-400 { color: var(--text-muted); }
.text-accent { color: var(--accent-cyan); }
.z-2 { z-index: 2; position: relative; }

/* Background 3D Grid & Blobs */
.grid-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  perspective: 1000px; /* Crucial para o efeito 3D */
  pointer-events: none;
  background-color: var(--bg-dark);
}

.grid-bg {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  transform-style: preserve-3d;
  transform: rotateX(60deg) translateY(-100px) translateZ(-200px);
  /* The JS script will modify the rotation around X and Y axes for parallax */
  transition: transform 0.1s ease-out;
}

/* Gradient Blobs inside the Grid Container */
.gradient-blobs {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  filter: blur(120px);
  opacity: 0.6;
}

.blob {
  position: absolute;
  border-radius: 50%;
  animation: floatBlobs 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  top: -100px;
  right: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-cyan);
  bottom: -200px;
  left: -100px;
  animation-delay: -5s;
}

@keyframes floatBlobs {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, 10%) scale(1.1); }
  100% { transform: translate(10%, -10%) scale(0.9); }
}

.noise-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* --- Navigation & Glassmorphism --- */
.liquid-glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--glass-shadow);
}

.custom-navbar {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-glass);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link-custom {
  color: var(--text-muted) !important;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link-custom:hover, .nav-link-custom.active {
  color: white !important;
}

/* --- Buttons --- */
.btn-accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-accent:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
  color: #000;
}

.btn-accent:active {
  transform: translateY(1px) scale(0.98);
}

.btn-outline-glass {
  background: transparent;
  color: white;
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-outline-glass:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* --- Hero Section --- */
.hero-section {
  padding-top: 80px; /* offset navbar */
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-accent {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 242, 254, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

.max-w-xl { max-width: 36rem; }

/* Hero Visual Card */
.hero-visual-card {
  border-radius: 1.5rem;
  display: inline-block;
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-visual-card:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02);
}

.hero-visual-inner {
  background: rgba(10, 10, 15, 0.6);
  min-width: 280px;
}

.avatar-ring {
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 50%;
}

.avatar-img {
  width: 120px;
  height: 120px;
  border: 4px solid var(--bg-dark);
  object-fit: cover;
  transition: all 0.3s ease;
}

@media (max-width: 991px) {
  .avatar-img {
    width: 64px;
    height: 64px;
    border-width: 2px;
  }
}

.tech-stack-hero .tech-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.tech-stack-hero .tech-icon:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  transform: translateY(-3px);
}

/* --- About & Stats --- */
.leading-relaxed { line-height: 1.7; }
.text-purple { color: var(--accent-purple); }

.badge-tech {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.badge-tech:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.badge-tech.transparent {
  background: transparent;
  padding: 0.3rem 0.8rem;
  border-color: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.bento-card {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.bento-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* --- Projects Bento 2.0 --- */
.project-card {
  transition: all 0.4s ease;
  cursor: pointer;
}

.border-highlight {
  border: 1px solid transparent;
  /* background-clip setup for gradient border illusion */
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, rgba(255,255,255,0.1), transparent 40%, rgba(255,255,255,0.05)) border-box;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.project-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 15rem; height: 15rem;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: blur(50px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-glow-sm {
  position: absolute;
  top: -20px; right: -20px;
  width: 8rem; height: 8rem;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  opacity: 0;
  filter: blur(30px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-card:hover .project-glow, 
.project-card:hover .project-glow-sm {
  opacity: 0.15;
}

.project-link-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

.project-card:hover .project-link-icon {
  transform: translate(3px, -3px);
  color: white !important;
}

/* Abstract Mockup inside Project (Anti-boring screenshot logic) */
.mockup-abstract {
  background: linear-gradient(145deg, rgba(20, 20, 25, 0.8), rgba(10, 10, 15, 0.9));
  min-height: 200px;
}

.placeholder-screenshot {
  opacity: 0.55;
  filter: grayscale(100%) saturate(40%);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.project-card:hover .placeholder-screenshot,
.project-card.is-touch-active .placeholder-screenshot,
.project-card:active .placeholder-screenshot {
  opacity: 1;
  filter: none;
}

.skeleton-bar {
  background: rgba(255, 255, 255, 0.05) !important;
  animation: shimmer 2s infinite linear;
  background-image: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mockup-chart {
  height: 60px;
  width: 100%;
  background: linear-gradient(0deg, var(--accent-cyan) 0%, transparent 100%);
  opacity: 0.2;
  border-radius: 4px;
  clip-path: polygon(0 100%, 0 80%, 20% 60%, 40% 70%, 60% 30%, 80% 50%, 100% 10%, 100% 100%);
  animation: chartRise 2s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}

@keyframes chartRise {
  0% { clip-path: polygon(0 100%, 0 80%, 20% 60%, 40% 70%, 60% 30%, 80% 50%, 100% 10%, 100% 100%); }
  100% { clip-path: polygon(0 100%, 0 90%, 20% 70%, 40% 80%, 60% 40%, 80% 60%, 100% 20%, 100% 100%); }
}

.tilt-element {
  transition: transform 0.2s ease-out;
}

/* --- Native CSS Carousel Track --- */
.projects-track {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
  cursor: grab;
}
.projects-track:active {
  cursor: grabbing;
}
.projects-track.active-drag {
  scroll-behavior: auto; /* Disable smooth snap while dragging to stop stuttering */
  scroll-snap-type: none !important; 
}
.projects-track.active-drag .project-card-wrapper {
  pointer-events: none; /* Prevent accidental clicks while dragging */
}
.projects-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Cards setup for mobile/desktop */
.project-card-wrapper {
  width: 100%;
}
@media (min-width: 992px) {
  .project-card-wrapper {
    /* 75% width permits elegant horizontal internal layout while hinting at the next card */
    width: calc(75% - 12px); 
  }
}
@media (min-width: 1400px) {
  .project-card-wrapper {
    width: calc(65% - 12px); 
  }
}

/* --- Contact Form --- */
.custom-form-group {
  position: relative;
}

.custom-input {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: white !important;
  padding-top: 1.5rem !important;
  padding-bottom: 0.5rem !important;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.custom-input:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--accent) !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 0 15px rgba(0, 230, 118, 0.2) !important;
}

.custom-input::placeholder {
  color: transparent !important;
}

.custom-form-group label {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.custom-input:focus ~ label,
.custom-input:not(:placeholder-shown) ~ label {
  color: var(--accent) !important;
  font-weight: 600;
  opacity: 1;
}

.input-glow {
  position: absolute;
  bottom: 0; left: 50%; width: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-50%);
  transition: width 0.4s ease;
  pointer-events: none;
}

.custom-input:focus ~ .input-glow {
  width: 100%;
}

/* --- WhatsApp Floating Button (Taste-Skill aligned) --- */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25D366;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-size: 32px;
  box-shadow: 0px 4px 20px rgba(37, 211, 102, 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
  background-color: #20BA56;
  color: #fff;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0px 8px 30px rgba(37, 211, 102, 0.6), inset 0 2px 4px rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 26px;
  }
}
