:root {
  --brand: #f6a700;
  --brand-dark: #d48f00;
  --brand-light: #fff7e6;
  --brand-trans: rgba(246, 167, 0, 0.35);
  --black: #0b0b0b;
  --dark: #1a1a1a;
  --white: #ffffff;
  --light: #f8f9fa;
  --muted: #6c757d;
  --glass: rgba(255,255,255,0.06);
  --transition-fast: 220ms cubic-bezier(.2,.8,.2,1);
  --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.15);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.2);
}

/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.preload * {
  transition: none !important;
  animation: none !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }

.display-4 {
  font-weight: 800;
  letter-spacing: -0.5px;
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
}

.text-brand {
  color: var(--brand) !important;
}

.text-glow {
  text-shadow: 0 0 10px rgba(246, 167, 0, 0.3);
}

/* NAVBAR MEJORADO */
.navbar {
  background: transparent;
  padding: 1rem 0;
  transition: all var(--transition-smooth);
  z-index: 1030;
}

.navbar.scrolled {
  background: rgba(11, 11, 11, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-weight: 700;
}

.logo-img {
  height: 40px;
  width: auto;
  transition: transform var(--transition-smooth);
}

.navbar-brand:hover .logo-img {
  transform: rotate(-10deg) scale(1.1);
}

.brand-name {
  font-weight: 800;
  color: var(--white);
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.nav-link {
  font-weight: 600;
  color: var(--white) !important;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: all var(--transition-smooth);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand) !important;
}

/* Botones */
.btn {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--black);
}

.btn-brand:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-light:hover {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--black);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Hero Section Mejorada */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(11, 11, 11, 0.8) 0%,
    rgba(11, 11, 11, 0.6) 50%,
    rgba(246, 167, 0, 0.2) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3rem;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-smooth);
}

.hero-card:hover {
  transform: translateY(-10px);
}

.slogan {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--brand-light);
  margin: 1.5rem 0;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--white);
  border-radius: 20px;
  position: relative;
  margin: 0 auto 10px;
}

.wheel {
  width: 4px;
  height: 10px;
  background: var(--brand);
  border-radius: 2px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Icon Scroller Mejorado */
.tools-section {
  background: linear-gradient(to bottom, var(--dark), var(--black));
  position: relative;
  overflow: hidden;
}

.icon-scroller {
  overflow: hidden;
  position: relative;
  padding: 2rem 0;
}

.icon-track {
  display: flex;
  gap: 4rem;
  animation: scrollLeft 25s linear infinite;
  padding: 0 2rem;
}

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  transition: all var(--transition-smooth);
}

.tool:hover {
  background: rgba(246, 167, 0, 0.1);
  transform: translateY(-5px);
}

.tool i {
  font-size: 3rem;
  color: var(--brand);
  margin-bottom: 1rem;
}

.tool-img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.tool span {
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-120px * 8 - 4rem * 8)); }
}

/* Project Cards Mejoradas */
.project-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all var(--transition-smooth);
  height: 100%;
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 11, 11, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.card-img-wrapper:hover .card-overlay {
  opacity: 1;
}

.card-img-wrapper:hover .card-img-top {
  transform: scale(1.1);
}

.card-body {
  padding: 1.5rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tech-tag {
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========== PARALLAX FIXED ========== */
.parallax-section {
  position: relative;
  min-height: 400px;
  background: linear-gradient(rgba(11, 11, 11, 0.5), rgba(8, 8, 8, 0.4)), 
              url('https://i.pinimg.com/736x/38/f2/e4/38f2e4e6e6529b0943676a50bbc8c3f5.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.parallax-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246, 167, 0, 0.1);
  z-index: 1;
}

.parallax-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
}

.parallax-content {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fallback para dispositivos móviles */
@media (max-width: 768px) {
  .parallax-section {
    background-attachment: scroll;
  }
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, var(--brand-trans) 0%, transparent 70%);
  opacity: 0.3;
}

/* Tech Grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.tech-category {
  background: var(--white);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all var(--transition-smooth);
  border: 2px solid transparent;
}

.tech-category:hover {
  border-color: var(--brand);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tech-icon {
  font-size: 3rem;
  color: var(--brand);
  margin-bottom: 1rem;
}

/* Service Cards */
.service-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.service-features {
  margin: 1.5rem 0;
}

.service-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-feature i {
  margin-top: 0.25rem;
}

/* Diplomas */
.diploma-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.diploma-img-container {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.diploma-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.diploma-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 11, 11, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.diploma-img-container:hover .diploma-overlay {
  opacity: 1;
}

.diploma-img-container:hover .diploma-img {
  transform: scale(1.05);
}

/* Profile */
.profile-img-container {
  position: relative;
  display: inline-block;
}

.profile-img {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
}

.profile-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--brand);
  color: var(--black);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Contact */
.contact-header {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--white) 100%);
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}

/* ========== FIX ICONO INSTAGRAM ========== */
.social-contact-icon.instagram {
  background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

.social-icon[aria-label="Instagram"] {
  transition: all 0.3s ease;
}

.social-icon[aria-label="Instagram"]:hover {
  background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
  transform: scale(1.1) rotate(5deg);
}

.social-contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--light);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-smooth);
}

.social-contact-card:hover {
  background: var(--brand-light);
  transform: translateY(-3px);
}

.social-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.social-contact-icon.instagram { background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D); }
.social-contact-icon.github { background: #181717; }
.social-contact-icon.linkedin { background: #0A66C2; }
.social-contact-icon.whatsapp { background: #25D366; }

.social-contact-text {
  display: flex;
  flex-direction: column;
}

.social-contact-text small {
  font-size: 0.8rem;
  color: var(--muted);
}

.social-contact-text span {
  font-weight: 600;
}

.map-placeholder {
  background: var(--light);
  border-radius: 15px;
  padding: 4rem 2rem;
  text-align: center;
}

/* Footer Mejorado */
.footer {
  background: var(--black);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.social-icon {
  color: var(--white);
  transition: all var(--transition-smooth);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  color: var(--brand);
  background: rgba(246, 167, 0, 0.1);
  transform: translateY(-3px);
}

/* WhatsApp Float Mejorado */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  text-decoration: none;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-smooth);
}

.whatsapp-float:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
}

.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--black);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  right: 75px;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--brand);
  color: var(--black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--brand-dark);
  transform: translateY(-3px);
}

/* Portfolio Header */
.portfolio-header {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--white) 100%);
}

.bg-brand-light {
  background-color: var(--brand-light) !important;
}

/* Data Cards */
.data-card {
  border: none;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  height: 100%;
  transition: all var(--transition-smooth);
}

.data-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.data-card-icon {
  font-size: 3rem;
  color: var(--brand);
  margin-bottom: 1.5rem;
}

/* CTA Portfolio */
.cta-portfolio {
  background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
  color: var(--white);
}

/* Utility Classes */
.pt-7 {
  padding-top: 100px;
}

.py-6 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.bg-light {
  background-color: var(--light) !important;
}

.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 3rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--brand);
  border-radius: 2px;
}

.text-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  .hero-card {
    padding: 2rem 1.5rem;
  }
  
  .display-4 {
    font-size: 2.5rem;
  }
  
  .icon-track {
    gap: 2rem;
    animation-duration: 15s;
  }
  
  .tool {
    min-width: 100px;
    padding: 1rem;
  }
  
  .whatsapp-tooltip {
    display: none;
  }
  
  .back-to-top {
    bottom: 80px;
    right: 20px;
  }
  
  .pt-7 {
    padding-top: 80px;
  }
  
  .parallax-section {
    min-height: 300px;
  }
  
  .parallax-content {
    padding: 2rem 1rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 500px;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-dark);
}

/* Print Styles */
@media print {
  .whatsapp-float,
  .back-to-top,
  .navbar,
  .btn {
    display: none !important;
  }
}