/* TIPOGRAFÍA & VARIABLES */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #050607;
  --bg-alt: #0c0f10;
  --card: #101416;
  --card-soft: #171c1f;
  --accent: #a6ff4d; /* verde oliva neon */
  --accent-soft: rgba(166, 255, 77, 0.16);
  --text: #f4f5f6;
  --muted: #8c9499;
  --border: #222a2f;
  --radius-xl: 1.4rem;
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.2s ease-out;
  --transition-med: 0.28s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #182016 0, #050607 55%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* RUÍDO DE FONDO */
.bg-noise {
  pointer-events: none;
  position: fixed;
  inset: -50px;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: url("https://grainy-gradients.vercel.app/noise.svg");
  background-size: 200px 200px;
  z-index: -1;
}

/* LAYOUT BÁSICO */

.section {
  padding: 6rem 1.5rem;
  position: relative;
}

.section-alt {
  background: radial-gradient(circle at top, #11170f 0, #050607 60%);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
}

/* TOPBAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(5, 6, 7, 0.9),
    rgba(5, 6, 7, 0.65),
    transparent
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1.5rem;
}

.topbar .container,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  background: radial-gradient(circle at top, rgba(166, 255, 77, 0.16), #050607);
}

.logo-text {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
}

/* NAV */

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
  padding-bottom: 0.15rem;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* NAV TOGGLE (MOBILE) */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.22rem;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

/* HERO */

.hero {
  padding-top: 7rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 3.5rem;
  align-items: center;
}

.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero h1 .accent {
  display: block;
  color: var(--accent);
}

.hero-subtitle {
  color: var(--muted);
  max-width: 34rem;
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.7rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn.primary {
  background: radial-gradient(circle at top, #c6ff8f, #7db939);
  color: #050607;
  box-shadow: 0 14px 35px rgba(166, 255, 77, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(166, 255, 77, 0.4);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--accent-soft);
  background: rgba(255, 255, 255, 0.02);
}

.btn.full {
  width: 100%;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-tags span {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

/* TERMINAL */

.hero-terminal {
  background: radial-gradient(circle at top, #172415, #050607);
  border-radius: var(--radius-xl);
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

.hero-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(166, 255, 77, 0.1),
    transparent,
    rgba(0, 0, 0, 0.7)
  );
  opacity: 0.35;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-header .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.terminal-header .dot.red {
  background: #ff5f57;
}

.terminal-header .dot.yellow {
  background: #ffbd2e;
}

.terminal-header .dot.green {
  background: #28c840;
}

.terminal-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 0.35rem;
}

.terminal-body {
  padding: 1rem 1.2rem 1.3rem;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  color: #c2ffb1;
  min-height: 220px;
  position: relative;
}

.terminal-code {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-cursor {
  display: inline-block;
  animation: blink 0.85s steps(1) infinite;
  color: #c2ffb1;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

.hero-scroll-hint {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
}

/* SECTION HEADERS */

.section-header {
  max-width: 600px;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* SERVICES */

.services-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(5, 6, 7, 0.9);
  color: var(--text);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 200px;
  background: #050607;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 0.35rem;
  list-style: none;
  margin: 0;
  box-shadow: var(--shadow-soft);
  display: none;
  z-index: 20;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li {
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.dropdown-menu li:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.dropdown-menu li.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.services-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1.3rem 1.3rem 1.25rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at top left, rgba(166, 255, 77, 0.16), transparent);
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.service-card p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.service-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* TIMELINE */

.timeline {
  position: relative;
  margin-top: 2rem;
  padding-left: 1.3rem;
}

.timeline-line {
  position: absolute;
  left: 0.3rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent),
    rgba(166, 255, 77, 0.1)
  );
  opacity: 0.6;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -0.1rem;
  top: 0.3rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(166, 255, 77, 0.5);
}

.timeline-content {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem 1.1rem;
  margin-left: 1.7rem;
}

.timeline-content h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.timeline-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* SHOWCASE */

.showcase-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.showcase-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}

.showcase-track::-webkit-scrollbar {
  height: 4px;
}

.showcase-track::-webkit-scrollbar-thumb {
  background: var(--accent-soft);
  border-radius: 999px;
}

.showcase-card {
  min-width: 240px;
  max-width: 280px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.1rem 1.1rem 1rem;
}

.showcase-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.showcase-card p {
  margin: 0 0 0.8rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.pill {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.showcase-arrow {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(5, 6, 7, 0.9);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.showcase-arrow:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

/* ABOUT */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr);
  gap: 2.5rem;
  align-items: center;
}

.photo-frame {
  border-radius: var(--radius-xl);
  border: 1px solid var(--accent-soft);
  padding: 0.5rem;
  background: radial-gradient(circle at top, #172415, #050607);
  box-shadow: var(--shadow-soft);
}

.photo-frame img {
  display: block;
  width: 100%;
  border-radius: calc(var(--radius-xl) - 0.4rem);
  object-fit: cover;
}

.about-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.about-tags span {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* CV */

.cv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: start;
}

.cv-list {
  margin: 1rem 0 1.3rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.cv-meta .cv-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.2rem 1.1rem 1.1rem;
}

.cv-card h3 {
  margin: 0 0 0.7rem;
}

.cv-card ul {
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cv-card li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.cv-card span {
  opacity: 0.85;
}

.cv-card strong {
  color: var(--accent);
}

.cv-note {
  font-size: 0.8rem;
  color: var(--muted);
}

/* CONTACTO */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: flex-start;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.contact-link {
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
}

.contact-link:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.contact-form {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.3rem 1.2rem 1.2rem;
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  background: #050607;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(166, 255, 77, 0.2);
}

.field textarea {
  resize: vertical;
}

.form-note {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* FOOTER */

.site-footer {
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: #050607;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ANIMACIÓN REVEAL */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-terminal {
    order: -1;
  }

  .about-grid,
  .cv-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    padding-inline: 1rem;
  }

  .nav-links {
    position: absolute;
    right: 1.5rem;
    top: 3.1rem;
    flex-direction: column;
    background: #050607;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 0.6rem;
    box-shadow: var(--shadow-soft);
    display: none;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 600px) {
  .section {
    padding-inline: 1.1rem;
  }

  .hero {
    padding-top: 6.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .services-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* GRID ANTIGUO DE CLIENTES (no afecta al carrusel nuevo si no se usa) */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.client-card {
  padding: 1.75rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), rgba(10, 12, 14, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   PRELOADER – VERSION FINAL VERDE NEÓN / NEGRO
   ============================================================ */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 999999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body:not(.preloader-done) {
  overflow: hidden;
}

body.preloader-done #preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* NOISE / SCAN ANIMATION */

#preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(74, 222, 128, 0.04) 0px,
    rgba(74, 222, 128, 0.04) 1px,
    transparent 2px
  );
  pointer-events: none;
  animation: scan 4s linear infinite;
  opacity: 0.6;
}

@keyframes scan {
  0% { background-position: 0 -200px; }
  100% { background-position: 0 200px; }
}

/* CONTENIDO INTERNO PRELOADER */

.preloader-inner {
  max-width: 520px;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 10;
}

.preloader-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #4ade80;
}

/* TERMINAL PRELOADER */

.preloader-terminal {
  background: #0a0a0a;
  border-radius: 1rem;
  border: 1px solid rgba(74, 222, 128, 0.3);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
  padding: 0.75rem 0.75rem 1rem;
  position: relative;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}

.terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-header .dot.red {
  background: #4ade80;
}
.terminal-header .dot.yellow {
  background: #22c55e;
}
.terminal-header .dot.green {
  background: #a3e635;
}

.terminal-title {
  margin-left: auto;
  color: #4ade80;
  font-size: 0.75rem;
  opacity: 0.8;
}

.preloader-code {
  margin: 0;
  padding: 0.6rem 0.5rem 0 0.5rem;
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #4ade80;
  max-height: 150px;
  white-space: pre-wrap;
}

/* Cursor */
#preloaderCursor {
  position: absolute;
  bottom: 0.9rem;
  left: 0.9rem;
  font-size: 0.8rem;
  color: #4ade80;
  animation: blink-cursor 0.8s steps(1) infinite;
}

@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* BARRA DE PROGRESO */

.preloader-bar {
  margin-top: 0.5rem;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.15);
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, #22c55e, #a3e635);
  animation: preloader-progress 1.8s ease-out forwards;
}

@keyframes preloader-progress {
  0% { width: 0%; }
  60% { width: 70%; }
  100% { width: 100%; }
}

/* TEXTO PRELOADER */

.preloader-hint {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: #4ade80;
  font-family: "Fira Code", monospace;
  opacity: 0.75;
}

/* RESPONSIVE PRELOADER */

@media (max-width: 640px) {
  .preloader-inner {
    max-width: 100%;
  }
  .preloader-code {
    font-size: 0.75rem;
  }
}

/* Mientras no se marque preloader-done, bloquea el scroll */
body:not(.preloader-done) {
  overflow: hidden;
}

.switch-btn {
  margin-left: 1rem;
  padding: 6px 14px;
  font-size: 0.8rem;
  background: #0f172a;
  color: #4ade80;
  border: 1px solid #4ade80;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

.switch-btn:hover {
  background: #4ade80;
  color: #000;
}

/* Botón de cambio de tema */
.theme-btn {
  padding: 6px 10px;
  font-size: 0.9rem;
  line-height: 1;
  font-family: "Fira Code", monospace;
  background: rgba(148, 163, 184, 0.18);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: 0.2s ease;
}

.theme-btn:hover {
  background: rgba(148, 163, 184, 0.35);
  color: #f9fafb;
}

.theme-btn:active {
  transform: scale(0.95);
}

/* Botón de idioma estilo chip */
.lang-btn {
  padding: 6px 14px;
  font-size: 0.75rem;
  font-family: "Fira Code", monospace;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.6);
  border-radius: 8px;
  cursor: pointer;
  margin-left: 1rem;
  transition: 0.2s ease;
}

.lang-btn:hover {
  background: rgba(74, 222, 128, 0.3);
  color: #a3e635;
  border-color: #a3e635;
}

.lang-btn:active {
  transform: scale(0.96);
}

/* ============================================================
   MODO CLARO (LIMPIO)
   ============================================================ */

/* Cambiamos las VARIABLES cuando el body tiene la clase .light */
body.light {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-soft: #e5e7eb;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;

  background: var(--bg);
  color: var(--text);
}

/* Topbar más clara */
body.light .topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(10px);
}

/* Secciones */
body.light .section {
  background: #f8fafc;
}

body.light .section-alt {
  background: #ffffff;
}

/* Tarjetas / cards usan el nuevo --card y --border */
body.light .service-card,
body.light .showcase-card,
body.light .cv-card,
body.light .client-card,
body.light .contact-form {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Tags y pills */
body.light .hero-tags span,
body.light .about-tags span,
body.light .pill {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

/* Links de contacto */
body.light .contact-link {
  color: var(--text);
  border-color: #cbd5f5;
}

body.light .contact-link:hover {
  background: #0f172a;
  color: #e5e7eb;
}

/* Botones */
body.light .btn.primary {
  background: #16a34a;
  color: #f9fafb;
}

body.light .btn.ghost {
  border-color: #94a3b8;
  color: #0f172a;
}

/* Footer claro */
body.light .site-footer {
  background: #e5e7eb;
  color: #0f172a;
}

/* MODO CLARO: SECCIÓN "CÓMO TRABAJO" */

body.light #process {
  background: #f8fafc;
}

body.light #process .timeline-item {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body.light #process .timeline-content h3,
body.light #process .timeline-content p {
  color: var(--text);
}

body.light #process .timeline-line {
  background: #cbd5e1;
}

body.light #process .timeline-dot {
  background: #16a34a;
  border: 3px solid #bbf7d0;
}

/* ===============================
   CONTACTO CENTRADO
   =============================== */

#contact .contact-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#contact .contact-text {
  max-width: 620px;
}

#contact .contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

#contact .contact-link {
  text-align: center;
}

@media (max-width: 600px) {
  #contact .contact-links {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #contact .contact-link {
    width: 100%;
    max-width: 280px;
  }
}

.cv-btn-center {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

/* ============================================================
   CARRUSEL DE CLIENTES – AUTOPLAY
   ============================================================ */

.clients-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;              /* evita desbordes */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

/* La tira que se mueve automáticamente */
.clients-track {
  display: flex;
  align-items: center;
  gap: 2rem;
  will-change: transform;
  transform: translateX(0);
}

/* Tarjeta contenedora de cada logo */
.client-logo-card {
  flex: 0 0 auto;
  width: 140px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* LOGO EN BLANCO — conversión automática */
.client-logo {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;

  /* Convierte cualquier logo a blanco puro */
  filter: brightness(0) invert(1) contrast(1.1);
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Efecto al pasar el mouse */
.client-logo-card:hover .client-logo {
  opacity: 1;
  transform: scale(1.05);
}

/* Ajuste responsive */
@media (max-width: 700px) {
  .client-logo-card {
    width: 120px;
    height: 70px;
  }

  .client-logo {
    max-height: 50px;
  }
}
/* Logos 100% blancos */
.client-logo {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  filter: grayscale(100%) brightness(0) invert(1);
  opacity: 0.85;
  transition: 0.3s ease;
}

.client-logo-card:hover .client-logo {
  opacity: 1;
  transform: scale(1.04);
}
/* Ajuste individual: Bomberos */
.client-logo[src*="bomberos"] {
  filter: grayscale(100%) brightness(0.35) invert(1);
  opacity: 0.9;
}

/* Ajuste individual: Luball */
.client-logo[src*="luball"] {
  filter: grayscale(100%) brightness(0.5) invert(1);
  opacity: 0.95;
}
/* MODO CLARO – logos en gris oscuro para que sí se vean sobre fondo blanco */
body.light .client-logo {
  filter: grayscale(100%) brightness(0.2) invert(0) contrast(1);
  opacity: 0.85;
}

/* ============================
   MODO CLARO – AJUSTE POR LOGO
   ============================ */

/* BBVA */
body.light .client-logo[src*="BBVA"] { filter: brightness(0.25) grayscale(100%); }

/* AE */
body.light .client-logo[src*="ae"] { filter: brightness(0.25) grayscale(100%); }

/* Ayuntamiento */
body.light .client-logo[src*="Logo-09"] { filter: brightness(0.25) grayscale(100%); }

/* Insurgente */
body.light .client-logo[src*="insur"] { filter: brightness(0.30) grayscale(100%); }

/* Bomberos */
body.light .client-logo[src*="bomberos"] { filter: brightness(0.35) grayscale(100%); }

/* Crhonos */
body.light .client-logo[src*="crhonos"] { filter: brightness(0.25) grayscale(100%); }

/* Norms Banquetes */
body.light .client-logo[src*="normsb"] { filter: brightness(0.25) grayscale(100%); }

/* Dlux */
body.light .client-logo[src*="dlux"] { filter: brightness(0.30) grayscale(100%); }

/* Logo Blanco */
body.light .client-logo[src*="LogoBlanco"] { filter: brightness(0.40) grayscale(100%); }

/* Luball */
body.light .client-logo[src*="luball"] { filter: brightness(0.35) grayscale(100%); }

/* Phoenix */
body.light .client-logo[src*="phoenix"] { filter: brightness(0.25) grayscale(100%); }

/* Sebastian Cakes */
body.light .client-logo[src*="sebastiancakes"] { filter: brightness(0.28) grayscale(100%); }

/* Wwave */
body.light .client-logo[src*="wwave"] { filter: brightness(0.28) grayscale(100%); }
