/* ===== Variables ===== */
:root {
  --bg-dark: #0c0f14;
  --bg-card: #141922;
  --bg-elevated: #1a1f2a;
  --text: #e8eaef;
  --text-muted: #8b92a3;
  --accent: #00d4aa;
  --accent-hover: #00f0c0;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 72px;
  --container: min(1120px, 100% - 2rem);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: var(--container); margin-inline: auto; padding-inline: 1rem; }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-rm {
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.logo-text { color: var(--text); }

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 212, 170, 0.08), transparent 55%),
    radial-gradient(ellipse 40% 30% at 0% 80%, rgba(0, 212, 170, 0.06), transparent 50%);
  animation: heroGradient 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGradient {
  0% { opacity: 1; }
  100% { opacity: 0.85; }
}

/* Grid de fondo en el hero */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  pointer-events: none;
  animation: heroGridPulse 8s ease-in-out infinite;
}

@keyframes heroGridPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Formas flotantes decorativas */
.hero-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.06);
  border: 1px solid rgba(0, 212, 170, 0.12);
}

.hero-shape-1 {
  width: 320px;
  height: 320px;
  top: 10%;
  right: 5%;
  animation: float1 18s ease-in-out infinite;
}

.hero-shape-2 {
  width: 180px;
  height: 180px;
  bottom: 25%;
  left: 10%;
  animation: float2 14s ease-in-out infinite;
}

.hero-shape-3 {
  width: 100px;
  height: 100px;
  top: 50%;
  right: 25%;
  animation: float3 20s ease-in-out infinite;
}

.hero-shape-4 {
  width: 240px;
  height: 240px;
  bottom: 5%;
  right: 20%;
  border-radius: 30%;
  animation: float2 16s ease-in-out infinite reverse;
}

.hero-shape-5 {
  width: 60px;
  height: 60px;
  top: 30%;
  left: 20%;
  animation: float1 12s ease-in-out infinite 1s;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  33% { transform: translate(20px, -15px) scale(1.05); opacity: 1; }
  66% { transform: translate(-10px, 10px) scale(0.98); opacity: 0.8; }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  50% { transform: translate(-25px, -20px); opacity: 1; }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(15px, 20px) scale(1.1); }
  75% { transform: translate(-20px, -10px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: 4rem 6rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.25rem;
  padding: 0.4em 0.9em;
  background: var(--accent-dim);
  border-radius: 100px;
  border: 1px solid rgba(0, 212, 170, 0.25);
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-title { display: block; color: var(--text); }
.hero-title-accent { display: block; color: var(--accent); }

.hero-desc {
  max-width: 520px;
  margin: 0 0 2rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85em 1.6em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm { padding: 0.6em 1.2em; font-size: 0.9rem; }
.btn-block { width: 100%; }

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 2px;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Section common ===== */
.section-head {
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.section-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-head-light .section-label,
.section-head-light .section-title { color: var(--text); }
.section-head-light .section-desc { color: var(--text-muted); }

/* ===== Services ===== */
.services {
  padding: 5rem 0;
}

.section-head { margin-bottom: 3rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}

.service-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-2px);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.service-icon svg { width: 24px; height: 24px; }

.service-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.service-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.service-card-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
}

.service-cta-text {
  margin: 0 0 1rem !important;
  color: var(--text-muted) !important;
  font-size: 0.95rem !important;
}

/* ===== About ===== */
.about {
  padding: 5rem 0;
  background: var(--bg-elevated);
}

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

.about-content .section-label { margin-bottom: 0.75rem; }
.about-content .section-title { margin-bottom: 1.25rem; text-align: left; }

.about-text {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.about-features {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.about-features li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.about-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.about-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  max-width: 320px;
}

.about-card-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.about-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact {
  padding: 5rem 0;
}

.contact-wrapper {
  max-width: 560px;
  margin-inline: auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.form-feedback {
  display: none;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
}

.form-feedback-success {
  background: rgba(0, 212, 170, 0.12);
  border: 1px solid rgba(0, 212, 170, 0.35);
  color: var(--accent);
}

.form-feedback-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85em 1em;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b92a3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.contact-info {
  padding: 1.5rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius);
}

.contact-info-block {
  margin-bottom: 1rem;
}

.contact-info-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.contact-info-block strong,
.contact-info-block a { color: var(--accent); }
.contact-info-block a:hover { color: var(--accent-hover); text-decoration: underline; }
.contact-info-block span { color: var(--text); }
.contact-note { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

/* ===== Clientes / Carrusel ===== */
.clients {
  padding: 4rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.clients-title {
  text-align: center;
  margin: 0 0 2.5rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text);
}

.clients-carousel-wrap {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.clients-carousel {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: clientsScroll 35s linear infinite;
}

.clients-carousel:hover {
  animation-play-state: paused;
}

.clients-item {
  flex-shrink: 0;
  padding: 0.9rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}

.clients-item:hover {
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--accent);
}

@keyframes clientsScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Footer ===== */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-brand .logo-rm { color: var(--accent); font-family: var(--font-mono); }

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-contact a {
  color: var(--accent);
  transition: color 0.2s;
}

.footer-contact a:hover { color: var(--accent-hover); }

.footer-copy { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-content .section-title { text-align: center; }
  .about-content .section-label { display: block; text-align: center; }
}

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

  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child { border-bottom: none; }

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

  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-contact { justify-content: center; }
}

@media (max-width: 480px) {
  :root { --header-height: 64px; }
  .hero h1 { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
}
