* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
}

/* Colores principales */
:root {
  --primary-blue: #003f72;
  --light-blue: #0066cc;
  --accent-blue: #4a90e2;
  --light-gray: #f8f9fa;
  --white: #ffffff;
  --dark-gray: #2c3e50;
  --bg-color: #ffffff;
  --text-color: #333;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 63, 114, 0.1);
  /* Texto/íconos que van SIEMPRE sobre fondos de color (header, footer,
     hero, botones). No se redefine en modo oscuro a propósito: a
     diferencia de --white, esta variable no representa una superficie
     de tarjeta, sino texto que debe seguir siendo blanco en ambos temas. */
  --text-on-color: #ffffff;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary-blue: #1a6bb5;
  --light-gray: #1a1a2e;
  --white: #16213e;
  --dark-gray: #0f3460;
  --bg-color: #0f0f23;
  --text-color: #e0e0e0;
  --card-bg: #16213e;
  --card-shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
  background: var(--bg-color);
  color: var(--text-color);
}

[data-theme="dark"] .about-text p,
[data-theme="dark"] .service-card p,
[data-theme="dark"] .service-details li,
[data-theme="dark"] .carousel-slide p,
[data-theme="dark"] .mission p,
[data-theme="dark"] .vision p {
  color: #c0c0c0;
}

[data-theme="dark"] .section-title {
  color: #4a90e2;
}

[data-theme="dark"] .about-text h3,
[data-theme="dark"] .service-card h3,
[data-theme="dark"] .carousel-slide h3,
[data-theme="dark"] .mission h4,
[data-theme="dark"] .vision h4 {
  color: #5ba3e6;
}

[data-theme="dark"] .tech-item span {
  color: var(--text-on-color);
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 1001;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Header y navegación */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 63, 114, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-on-color);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-on-color);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.nav-menu a:hover {
  color: var(--accent-blue);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-on-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(0, 63, 114, 0.98);
    padding: 1rem 0;
    gap: 0;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    text-align: center;
  }

  .nav-menu a {
    display: block;
    padding: 1rem 2rem;
  }

  .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Hero Section */
.hero {
  height: 100vh;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--light-blue) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-on-color);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  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.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  animation: float 20s ease-in-out infinite;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
  animation: fadeInUp 1s ease;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Typing effect */
.typing-container {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  min-height: 2em;
}

.typing-text {
  border-right: 2px solid var(--accent-blue);
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  50% { border-color: transparent; }
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-button {
  background: var(--accent-blue);
  color: var(--text-on-color);
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}

.cta-button:hover {
  background: var(--white);
  color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Secciones generales */
.section {
  padding: 5rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-blue);
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent-blue);
  border-radius: 2px;
}

/* About Section */
.about {
  background: var(--light-gray);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h3 {
  color: var(--primary-blue);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.about-text p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.mission-vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.mission,
.vision {
  background: var(--white);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.mission:hover,
.vision:hover {
  transform: translateY(-5px);
}

.mission h4,
.vision h4 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* Tech Stack */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  min-width: 80px;
}

.tech-item:hover {
  transform: translateY(-3px);
}

.tech-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.tech-item span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-blue);
}

/* Process Section */
.process {
  background: var(--light-gray);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
}

.process-grid::before {
  content: "";
  position: absolute;
  top: 45px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--accent-blue);
  opacity: 0.3;
}

.process-step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.process-step:hover .step-number {
  transform: scale(1.15);
}

.process-step h3 {
  color: var(--primary-blue);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.process-step p {
  font-size: 0.95rem;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .process-grid {
    grid-template-columns: 1fr 1fr;
  }

  .process-grid::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .process-grid {
    grid-template-columns: 1fr;
  }
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 63, 114, 0.1);
  transition: all 0.3s ease;
  border-top: 4px solid var(--accent-blue);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 63, 114, 0.2);
}

.service-icon {
  font-size: 3rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.service-card h3 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.service-details {
  list-style: none;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 63, 114, 0.1);
  text-align: left;
}

.service-details li {
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
}

.service-details li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-weight: bold;
}

/* Portfolio Section */
.portfolio {
  background: var(--light-gray);
}

.carousel-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 63, 114, 0.15);
}

.carousel-slide {
  display: none;
  padding: 3rem;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  max-width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.carousel-slide h3 {
  color: var(--primary-blue);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.carousel-slide p {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 63, 114, 0.8);
  color: var(--text-on-color);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-nav:hover {
  background: var(--primary-blue);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

.carousel-dots {
  text-align: center;
  padding: 2rem;
  background: var(--white);
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
  margin: 0 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: var(--accent-blue);
  transform: scale(1.2);
}

/* Case Study Section */
.case-study {
  max-width: 850px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 63, 114, 0.12);
}

.case-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: #fff;
  padding: 2.5rem;
}

.case-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.case-header h3 {
  font-size: 1.5rem;
  line-height: 1.4;
}

.case-body {
  padding: 2.5rem;
}

.case-section {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.case-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 50%;
  background: #fff3cd;
  color: #e67e22;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.case-icon.solution {
  background: #d4edda;
  color: #28a745;
}

.case-section h4 {
  color: var(--primary-blue);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.case-section p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.85;
}

.case-results {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1rem;
}

.case-results h4 {
  color: var(--primary-blue);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.case-results h4 i {
  color: var(--accent-blue);
  margin-right: 0.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.result-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.case-cta {
  text-align: center;
  padding: 2rem 2.5rem 2.5rem;
  border-top: 1px solid rgba(0, 63, 114, 0.08);
}

.case-cta p {
  font-size: 1.15rem;
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .case-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .case-header h3 {
    font-size: 1.2rem;
  }
}

/* Proposal Section */
.proposal-subtitle {
  text-align: center;
  font-size: 1.15rem;
  max-width: 650px;
  margin: -1rem auto 3rem;
  opacity: 0.8;
}

.proposal-timeline {
  max-width: 600px;
  margin: 0 auto 3rem;
}

.timeline-phase {
  background: var(--white);
  border-radius: 12px;
  padding: 1.8rem 2rem;
  box-shadow: 0 5px 20px rgba(0, 63, 114, 0.08);
  transition: transform 0.3s ease;
}

.timeline-phase:hover {
  transform: translateX(8px);
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.phase-icon {
  width: 45px;
  height: 45px;
  min-width: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.phase-icon.active {
  background: linear-gradient(135deg, #0066cc, #4a90e2);
}

.phase-icon.training {
  background: linear-gradient(135deg, #e67e22, #f39c12);
}

.phase-icon.complete {
  background: linear-gradient(135deg, #28a745, #51cf66);
}

.phase-header h3 {
  color: var(--primary-blue);
  font-size: 1.2rem;
}

.timeline-phase p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
  padding-left: 3.5rem;
}

.timeline-connector {
  text-align: center;
  padding: 0.6rem 0;
  color: var(--accent-blue);
  font-size: 1.2rem;
  opacity: 0.5;
}

.proposal-extras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.extra-card {
  background: var(--white);
  padding: 2rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 63, 114, 0.08);
  transition: transform 0.3s ease;
}

.extra-card:hover {
  transform: translateY(-5px);
}

.extra-card i {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.extra-card h4 {
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.extra-card p {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.5;
}

.proposal-cta {
  text-align: center;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .proposal-extras {
    grid-template-columns: 1fr;
  }

  .timeline-phase p {
    padding-left: 0;
  }
}

/* Contact Section */
.contact-icons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

@media (min-width: 600px) {
  .contact-icons {
    flex-direction: row;
    justify-content: center;
  }
}

.contact {
  background: var(--primary-blue);
  color: var(--text-on-color);
  text-align: center;
}

.contact .section-title {
  color: var(--text-on-color);
}

.contact .section-title::after {
  background: var(--accent-blue);
}

.contact-info {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.contact-button {
  display: inline-block;
  background: var(--accent-blue);
  color: var(--text-on-color);
  padding: 1rem 3rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.contact-button:hover {
  background: var(--white);
  color: var(--primary-blue);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .mission-vision {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .carousel-nav {
    display: none;
  }

  .carousel-slide {
    padding: 2rem 1rem;
  }
}

/* Floating CTA buttons */
.floating-cta {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.floating-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.floating-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.floating-btn.whatsapp {
  background: #25d366;
}

.floating-btn.linkedin {
  background: #0077b5;
}

.floating-btn.email {
  background: #ea4335;
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations for cards */
.service-card,
.process-step {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease;
}

.service-card.visible,
.process-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0s; }
.service-card:nth-child(2) { transition-delay: 0.15s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.45s; }

.process-step:nth-child(1) { transition-delay: 0s; }
.process-step:nth-child(2) { transition-delay: 0.15s; }
.process-step:nth-child(3) { transition-delay: 0.3s; }
.process-step:nth-child(4) { transition-delay: 0.45s; }
