:root {
  --bg-dark: #0f1115;
  --bg-light: #ffffff;
  --accent: #4f7cff;
  --text-dark: #111;
  --text-light: #eaeaea;
  --header-h: 64px;
}

/* Reset mínimo */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html{
  height: 100%;
  overflow: hidden; /* evita scroll del viewport */
  overflow-x: hidden;
  scroll-behavior: auto;
}

body{
  height: 100%;
  margin: 0;
  font-family: system-ui, sans-serif;
  color: var(--text-dark);
  overflow: hidden; /* evita doble scroll */
}

#snap{
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;

  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--header-h);

  -webkit-overflow-scrolling: touch;
}

#snap > section{
  height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 0 10vw;

  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

header.visible {
  transform: translateY(0);
}

.header-title {
  font-weight: 600;
  font-size: 1.1rem;
}

header nav {
  display: flex;
  gap: 24px;
}

header nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

header nav a:hover {
  color: var(--accent);
}


/* Hero */
#hero {
  background: radial-gradient(
    circle at 30% 30%,
    #1a2040,
    #0f1115 75%
  );  
  color: var(--text-light);
  position: relative;
  overflow: hidden;
  padding: 0 10vw;
}

#services,
#services-2,
#contact{
  gap: 32px;
}

#particles-js {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#hero h1,
#hero p {
  position: relative;
  z-index: 1;
  text-align: center;
}

#hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 16px;
  font-weight: 700;
}

#hero p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  opacity: 0.9;
}


.services-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-dark);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-top: 48px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.service-card {
  padding: 32px;
  background: white;
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}

.service-card h3 {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 1.4rem;
}

.service-card p {
  color: #666;
  line-height: 1.6;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(79, 124, 255, 0.15);
  border-color: var(--accent);
}

.parallax{
  background-attachment: scroll; /* compatible con snap */
}

/* Contacto */
#contact {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#contact h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 32px;
  text-align: center;
}

#contact form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

#contact input,
#contact textarea {
  padding: 16px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

#contact input:focus,
#contact textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#contact textarea {
  min-height: 150px;
  resize: vertical;
}

#contact button {
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

#contact button:hover {
  background: #3a64e0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 124, 255, 0.3);
}

#contact button:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  header {
    padding: 0 20px;
  }

  .header-title {
    font-size: 1rem;
  }

  header nav {
    gap: 16px;
  }

  header nav a {
    font-size: 0.9rem;
  }

  #snap > section{
    padding: calc(var(--header-h) + 16px) 6vw 16px;
  }

  #hero {
    padding-top: 0;
  }

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

  .service-card {
    padding: 24px;
  }

  #contact form {
    padding: 30px 24px;
  }
}

@media (max-width: 480px) {
  section {
    padding: 50px 5vw;
  }

  .services-section h2,
  #contact h2 {
    font-size: 1.75rem;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero p {
    font-size: 1rem;
  }

  #contact form {
    padding: 24px 20px;
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

#services{
  background: linear-gradient(135deg, #f5f7fa 0%, #d7e3ff 100%);
}

#services-2{
  background: linear-gradient(225deg, #f7f4ff 0%, #cfe2e8 100%);
}

/* Para que las cards se vean bien sobre fondos claros */
#services .service-card,
#services-2 .service-card{
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
}