/* ===== VARIABLES CSS ===== */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --dark-color: #0f172a;
  --light-color: #f8fafc;
  --text-color: #334155;
  --text-light: #64748b;
  --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --gradient-hover: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== NAVIGATION ===== */
.custom-navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 999;
}

.custom-navbar.scrolled {
  background: rgba(15, 23, 42, 0.98);
  padding: 0.5rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  margin: 0 0.5rem;
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===== HERO SECTION ===== */
.hero-section {
  min-height: 100vh;
  padding-top: 5rem; /* Previene que el navbar tape el contenido */
  position: relative;
  display: flex;
  align-items: center;
  background: var(--dark-color);
  color: white;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  z-index: -2;
}

.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  z-index: -1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-buttons {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  justify-content: center;
}

.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;

  white-space: nowrap; /* evitar salto de línea interno */
  flex-shrink: 1;     /* permite achicar el botón si es necesario */
  min-width: 120px;   /* ancho mínimo para que no se achiquen demasiado */
  max-width: 100%;    /* que no sobresalgan del contenedor */
  box-sizing: border-box;
}

.btn-primary {
  background: var(--gradient);
  color: white;
}

.btn-primary:hover {
  background: var(--gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  transform: translateY(-2px);
}



/* ===== HERO ANIMATION ===== */
.hero-animation {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-card {
  position: absolute;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary-color);
  animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.floating-card:nth-child(2) {
  top: 10%;
  right: 20%;
  animation-delay: 1s;
}

.floating-card:nth-child(3) {
  bottom: 30%;
  left: 20%;
  animation-delay: 2s;
}

.floating-card:nth-child(4) {
  bottom: 20%;
  right: 10%;
  animation-delay: 3s;
}

.floating-card:nth-child(5) {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 4s;
}

.floating-card:nth-child(6) {
  top: 60%;
  right: 40%;
  animation-delay: 5s;
}

.floating-card:nth-child(7) {
  top: 30%;
  left: 5%;
  animation-delay: 1.5s;
}

.floating-card:nth-child(8) {
  bottom: 40%;
  right: 5%;
  animation-delay: 2.5s;
}

.floating-card:nth-child(9) {
  top: 70%;
  left: 60%;
  animation-delay: 3.5s;
}

.floating-card:nth-child(10) {
  top: 40%;
  right: 30%;
  animation-delay: 4.5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 2px;
  height: 30px;
  background: white;
  position: relative;
}

.scroll-arrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -5px;
  width: 12px;
  height: 12px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ===== SERVICE CARDS ===== */
.service-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  height: 100%;
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 70px;
  height: 70px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: white;
}

.service-card h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.service-features {
  list-style: none;
  margin-top: 1.5rem;
}

.service-features li {
  padding: 0.5rem 0;
  color: var(--text-light);
}

.service-features i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

/* ===== ABOUT SECTION ===== */
.stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.code-window {
  background: #1e293b;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.window-header {
  background: #334155;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.window-controls {
  display: flex;
  gap: 0.5rem;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.control.red {
  background: #ef4444;
}
.control.yellow {
  background: #f59e0b;
}
.control.green {
  background: #10b981;
}

.window-title {
  color: #94a3b8;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

.code-content {
  padding: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-line {
  margin-bottom: 0.5rem;
}

.code-keyword {
  color: #c792ea;
}
.code-variable {
  color: #82aaff;
}
.code-property {
  color: #ffcb6b;
}
.code-string {
  color: #c3e88d;
}

/* ===== PORTFOLIO ===== */
.portfolio-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 300px;
  transition: var(--transition);
}

.portfolio-image {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.05);
}

.portfolio-content {
  text-align: center;
  color: white;
  padding: 1.5rem;
  max-width: 100%;
}

.portfolio-content h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.portfolio-content p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.portfolio-tech {
  margin-top: 1rem;
}

.tech-tag {
  display: inline-block;
  background: var(--gradient);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin: 0.25rem;
}

/* ===== PORTFOLIO CARDS ===== */
.portfolio-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  height: 100%;
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.portfolio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

.portfolio-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
}

.portfolio-card h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.portfolio-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ===== TESTIMONIALS ===== */
.testimonial-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: var(--shadow);
}

.testimonial-stars {
  color: #fbbf24;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.testimonial-text {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h5 {
  margin-bottom: 0.25rem;
  color: var(--dark-color);
}

.author-info p {
  color: var(--text-light);
  margin: 0;
}

/* ===== CONTACT ===== */
.contact-form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: var(--border-radius);
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
  color: white;
}

.form-floating label {
  color: rgba(255, 255, 255, 0.7);
}

.contact-info {
  text-align: center;
  padding: 1.5rem;
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.2rem;
  color: white;
}

/* ===== CONTACT CTA ===== */
.contact-cta {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 3rem;
}

.instagram-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 3rem;
  color: white;
  animation: pulse 2s infinite;
}

.btn-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border: none;
  color: white;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  transition: var(--transition);
}

.btn-instagram:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(240, 148, 51, 0.4);
  color: white;
}

/* ===== FOOTER ===== */
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--gradient);
  transform: translateY(-2px);
  color: white;
}

/* ===== PORTFOLIO LINKS ===== */
.portfolio-links .btn {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  transition: var(--transition);
}

.portfolio-links .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .stats-row {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-animation {
    height: 250px;
    margin-top: 2rem;
  }

  .floating-card {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  /* Reposicionar para móviles */
  .floating-card:nth-child(1) {
    top: 10%;
    left: 5%;
  }

  .floating-card:nth-child(2) {
    top: 5%;
    right: 15%;
  }

  .floating-card:nth-child(3) {
    bottom: 40%;
    left: 10%;
  }

  .floating-card:nth-child(4) {
    bottom: 30%;
    right: 5%;
  }

  .floating-card:nth-child(5) {
    top: 45%;
    left: 45%;
  }

  .floating-card:nth-child(6) {
    top: 60%;
    right: 35%;
  }

  .floating-card:nth-child(7) {
    top: 25%;
    left: 25%;
  }

  .floating-card:nth-child(8) {
    bottom: 15%;
    right: 25%;
  }

  .floating-card:nth-child(9) {
    top: 75%;
    left: 55%;
  }

  .floating-card:nth-child(10) {
    top: 35%;
    right: 45%;
  }

  .testimonial-card {
    padding: 2rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-cta {
    padding: 2rem;
  }

  .instagram-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

 .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .floating-card {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .hero-animation {
    height: 200px;
  }

  .portfolio-card {
    padding: 1.5rem;
  }

  .portfolio-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .testimonial-card {
    padding: 2rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-cta {
    padding: 1.5rem;
  }

  .instagram-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(240, 148, 51, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(240, 148, 51, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(240, 148, 51, 0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== UTILITIES ===== */
.bg-gradient {
  background: var(--gradient);
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
}
